Conversation
|
Well, to be honest, looks a bit complicated and absolutely "not Bazel" idea to me :) with "store these files for later use" and "strace", but, sure, you can try. Basically that's the third approach :)
|
|
I took a bit closer look and now I think it might be not that bad idea. |
|
Well, as I understand it works something like this: I marked this solution as a proof of concept because of the use of strace. Monitoring syscalls to know which files we accessed feels really wrong; it should be done by CodeChecker. Also, there are a couple of pitfalls with the solution in its current form:
I'm not sure I have answered all your questions, please specify if I have missed some! |
|
Well, yeah, using strace does not look nice.
The same name should not be a problem because, as I can understand, Bazel should not tolerate ambiguity in files.
Well, we better get rid of compile_commands.json :) |
That's a relief.
Sadly even if we add compile_commands.json to the unused_files_list, adding new files would still cause a re-run of the analysis. New files will not be in the unused_files_list, but they will be in the input. |
My idea for caching is to have CodeChecker tell us which files it used during its analysis, then add every other input file to an unused_inputs_list, since this is exactly what it is for (according to the documentation).
This proof of concept proves that this is a possible path forward; however, it mustn't be used in its current state.
How it works now:
This makes it so that Bazel can cache our results and only rerun actions it deems necessary.
This solution also works with the "--ctu" flag (in the zlib project, changing the trees.c file and re-analyzing the project re-analyses inftrees.c too)