You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In command, the path to the cc file is a relative one (main.cc in this case). This path, however, expands to <project_dir>/plz-out/gen/main.cc, which does not exist. If you run Clang tools such as clang-tidy against the source file, you'll get an error like:
clang-tidy main.cc
Error while processing <project_dir>/main.cc.
error: no input files [clang-diagnostic-error]
error: no such file or directory: 'main.cc' [clang-diagnostic-error]
error: unable to handle compilation, expected exactly one compiler job in '' [clang-diagnostic-error]
Found compiler error(s).
IIUC this is due to please by design compiling each translation unit in a temporary directory plz-out/tmp/... using the source file copied into it, instead of the one in the source tree.
Issue 2
This command string is missing include paths. I would expect it to contain -isystem lib/include. Without it Clang tools won't work.
What I also noticed was that the query result from plz query graph (see attached file) is already missing include paths. plz_query_graph.json
Is there already any workaround to mitigate this issue? If not, I would be happy to contribute.
The text was updated successfully, but these errors were encountered:
WeiHe1991
changed the title
compile_commands.json generated by compdb contains stale paths. compile_commands.json generated by compdb has wrong command.
Jun 13, 2024
Hey! Here is a minimal reproducible example, where the
compile_commands.json
file generated by the toolcompdb
looks like:There are currently two issues:
Issue 1
In
command
, the path to the cc file is a relative one (main.cc
in this case). This path, however, expands to<project_dir>/plz-out/gen/main.cc
, which does not exist. If you run Clang tools such asclang-tidy
against the source file, you'll get an error like:IIUC this is due to
please
by design compiling each translation unit in a temporary directoryplz-out/tmp/...
using the source file copied into it, instead of the one in the source tree.Issue 2
This
command
string is missing include paths. I would expect it to contain-isystem lib/include
. Without it Clang tools won't work.What I also noticed was that the query result from
plz query graph
(see attached file) is already missing include paths.plz_query_graph.json
Is there already any workaround to mitigate this issue? If not, I would be happy to contribute.
The text was updated successfully, but these errors were encountered: