grailbio / bazel-compilation-database

Tool to generate compile_commands.json from the Bazel build system

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Question about compilation_database target config:

mellery451 opened this issue · comments

I'm I bazel newbie, so I apologize in advance if these are trivial questions. Regarding the approach of adding a compilation_database target to the BUILD file:

(1) what does the name property refer to? Does it need to match and existing name in my project?

(2) is there a way to just specify all targets? In my case, I think I care about //src/... and maybe //tests/... (the latter if I want to analyze test sources as well..).

(3) the file also says that exec_root should match bazel info execution_root. In my case, the latter returns a path something like $HOME/.cache/<userid>/<UUID>/execroot/__main__. I wonder if there is way to refer to such a path generically, because this clearly wouldn't be appropriate for other users (it has user id in various parts of the path...).

any advice appreciated.

Hi,

It looks like your use case is better resolved by the "Entire Repo" section of the README. Can you see if it works for you?

Thanks!

ok thanks - I will try the generate script and see if I can make that work.