hedronvision / bazel-compile-commands-extractor

Goal: Enable awesome tooling for Bazel users of the C language family.
Other
696 stars 112 forks source link

Provide more specifics about headers in compile_commands.json #213

Open keith opened 2 months ago

keith commented 2 months ago

While debugging the perf of this tool in our project I discovered this:

https://github.com/hedronvision/bazel-compile-commands-extractor/blob/1e08f8e0507b6b6b1f4416a9a22cf5c28beaba93/refresh.template.py#L665-L667

It sounds like there might be some poor devx cases being solved here, but it's not entirely clear to me if it's something we will be affected by or not. Do you remember some more specifics I could test on our project to determine if this time is worth spending? For reference >75% of the generating time is eliminated if we don't generate commands for headers, which is pretty tempting for us. Also we're migrating from cmake and the cmake generated file doesn't include headers either, so I'm definitely interested in the bazel specifics that cause this.

rockwotj commented 2 months ago

https://github.com/clangd/clangd/issues/123

https://github.com/hedronvision/bazel-compile-commands-extractor/blob/1e08f8e0507b6b6b1f4416a9a22cf5c28beaba93/refresh_compile_commands.bzl#L34-L37