Open andocz opened 2 years ago
Does CodeChecker's logger handle this correctly? If so, can we update CodeCompass' logger with the one in CodeChecker?
CodeChecker's logger keeps the include paths as-is, it never converts a relative path to an absolute one or vice-versa.
I think the proper fix would be to make the C++ parser use the compile command's recorded directory as the working directory when running ClangTool
. We shouldn't rely on compile_commands.json
to only contain absolute paths. Even if CodeCompass_logger
always successfully converted all paths to absolute, other tools may generate compilation databases with relative paths (see CodeChecker).
I think the proper fix would be to make the C++ parser use the compile command's recorded
directory
as the working directory when runningClangTool
.
This does seem like the right call, but let's ask @bruntib to give us a heads-up related to this issue and what steps were taken in CodeChecker. I have vague memories of issues like this constantly looming around us...
When parsing Scintilla 3.10.6, errors like this occur:
This is because Scintilla uses spaces in the include flags, like so (in
gtk/makefile
):This causes an issue due to the combination of the following two things:
CodeCompass_logger
doesn't convert include flags with spaces to absolute paths.CodeCompass_parser
can only handle absolute include paths.Removing the space after every
-I
ingtk/makefile
fixed the issue, confirming this explanation.