-
Notifications
You must be signed in to change notification settings - Fork 398
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does Codechecker Supports hooking MSBuild like it does for the Makefile? #3846
Comments
The command |
Hi, CodeChecker does some transformation of (mainly) gcc build commands: https://github.com/Ericsson/codechecker/blob/master/analyzer/codechecker_analyzer/buildlog/log_parser.py Thanks! |
Hi, Clang also doesn't provide full support for MSVC. llvm/llvm-project#59997
That's good to know. 🤞 |
@VenoVeno If you can craft a compilation database without using our logger, either by using and emitting it from CMake or looking how MSBuild can generate a compilation database, CodeChecker might be capable of running the analysis, see #555. If you gather some experience here we would be happy to hear — as far as I understand, none of us in the team use Windows for development, so Windows support has not been in scope for us for quite a while. Whether Clang itself can consume some specific Windows or 3rd-party library on Windows is not solvable from CodeChecker's side; unless there is some magic flag that we need to inject to Clang that's not present in the original compilation database — that's all we can do… |
Hi, @whisperity
Though MSBuild emits compilation database, it will invoke the Visual Studio as it is a compiler.
If so, does Codechecker supports the compiler argument parsing? I don't have any idea about how the arguments are parsed. Some arguments like /GS /I /W3 /D. Codechecker won't parse these arguments right? The arguments are required for MSVC Project to build.
The AST is generated by the Clang Compiler, forwarding all the (GCC, G++) arguments in the format of Clang compiler understanding. Correct me if i'm wrong about it. If that's the case though i manage to get the compilation database, still the AST generation requires compilation Ref here. The MSVC Code should be able to parse by the Clang Compiler, whereas Clang doesn't have full support for the MSVC Source 😞
If Clang have a fault tolerant parser using any flags to generate AST it would be better but it doesn't have one llvm/llvm-project#59700. |
Okay, that's a game-breaking thing on our end. And I have no idea what those flags mean, so it would definitely require non-trivial effort to rewrite an MSVC compile command onto a GCC (or Clang) compile command.
This is unfortunately out of our hands (at least in the CodeChecker project). The best we could do (but do not do right now) is to craft the compile command necessary to at least call Clang with some sensible input parameters. If despite this effort Clang can't parse the input and start the analysis, then what CodeChecker will do (and actually does if the original project is working on Linux but somehow fail the analysis) is to report which source files could not be analysed. And if some parts of the project do analyse, we can show results from that part at least. |
(I close this question purely to ensure we have the meta-discussion about Windows continuously in #555 instead.) |
Yes. That needs lot of effort in implementing all possibles.
I agree.
As most of the files are Visual C++ implementation with windows Windows SDK and API dependency, all the source parsing failed. Anyways. Thanks for the awesome tool. 👏 |
Codecheckers takes all the GCC Commands and forwards to Clang Compiler.
Can it be done for the same way for MSBuild?
The text was updated successfully, but these errors were encountered: