Conversation
|
Do I understand correctly that in this case if a header changes, still all TUs are reanalized, considering that each .cpp file is dependent on all headers? Or the idea is that the patch demonstrates that we are making bazel think of the analysis rules on a per-TU basis, where we can still refine the header set later down the line? |
e682e70 to
43ee354
Compare
Well, yes, at least per target. We can say for one target each src depends on all headers within this target.
Sure, it is per-TU basis, that's how we run |
There was a problem hiding this comment.
In terms of the high level stuff, this looks like a great step forward. Nice!
I see a few obstacles/future steps:
- We need some tests where we demonstate that changing a cpp file only triggers its own reanalysis, and one where changing a header (as of now) triggers a whole reanalysis
- I'd be happy to see the CI patches land (#37 or #28 at the very least) before this,
- We discussed in the related issue (#21) that in time, we should retrieve the true header dependency set. It sure sounds plausible (it really must be the case) that bazel knows the true header dependencies, even if the
hdrsandsrcsfields aren't the way to get them. Tibor mentioned some .d files that bazel generates but seem hard to access -- in loose, informal terms, how would you approach this problem? Make bazel list the header dependencies, should we have a compiler call, or ask the CodeChecker folks (which we will need to do for CTU anyways later on) to create a dry-run option?
Totally agree with those.
Well, these discussions are valid and we should continue experimenting with different approaches and ideas.
Bazel does not generate anything except artifacts described as Action output (clang |
|
This patch is indeed an improvement! I'm perfectly okay refining the later steps in subsequent patches, I don't see anything inherent that would make it more difficult.
Do you have plans to work on that yourself or would you prefer if @furtib and I took a crack at it?
And what a wrapper it is! :) But yes, you are correct, we should probably patch clang (likely clang-extdef-mapping) directly instead of CodeChecker. We can consider later on whether it'd be good design to consult with clang through CodeChecker regardless, but thats a discussion for another day. |
a7664db to
56d4070
Compare
e2cf129 to
91b6e68
Compare
|
As there are no objections so far, lets land this. If the you-know-what hits the fan, we can still change course after the fact. |
Why: Incremental analysis doesn't work with the per-file rule
What: Make inputs dependent on headers only
Note: depending on headers only may mean that CTU wont work!
Test:
Addresses: #21