Open roubert opened 7 months ago
Hey @roubert , thanks for the report.
Clang has a "driver" which implements the GCC command line, and it calls itself with the more verbose command line flags. Is this the issue? (It means the second entry is not the linking, but the same compiling pass.)
Could you send me the output?
Have you had the chance to look into this and can you confirm that it's an issue with Bear (that would be useful to fix)?
Create any trivial Hello, World! style program and combine compile & link on the command line like this:
That's a perfectly normal thing to do and should work perfectly fine.
Then do that through Bear:
That works fine and generates a
compile_commands.json
file with a single entry, which contains exactly that one single command line, just as expected.Then do that with Clang instead:
That generates a
compile_commands.json
file with two different entries, one with that one single command line plus one for the underlying execution of the compile step, with a very longarguments
list.This is a problem because that internal command line for the internal compile step can't be executed directly from the command line and trying to use this compilation database with Clang-Tidy will therefore result in a compilation error:
That
pic
comes from the internal command line, which shouldn't have been included in thecompile_commands.json
file.This happens both with the Bear 3.1.3 release and with Bear built from source at current
HEAD
.