-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
External execroot cache invalidated when generating compile commands #201
Comments
I found a work-around and a clue! Workaround: After running It appears running refresh_compile_commands causes some symlinks in the bazel cache to be invalidated somehow. Some more detail on what I'm seeing: The printed error is caused because the file The correct include path for that porf_def.inc file is: The port_defs.inc file is part of a cc_library which has a That is why the include path is a generated _virtual_includes directory with a bunch of symlinks under it. The symlinks for the _virtual_includes directory are valid after I run
After I run Now I run So it appears |
I dug a bit deeper and found that almost all of the symlinks in the external execroot cache directory are deleted after running
Here is what the output looks like before running the hedron command:
And here is the output after:
I tried this on a larger repository, and sure enough there were hundreds of external dependencies that were missing symlinks after running refresh_compile_commands. It is all fixed by rebuilding. |
This issue looks related: bazelbuild/bazel#10680 |
I confirmed that if I don't invoke the refresh_compile_commands script with I.E. I do this:
|
Thank you, you saved my day! |
I think this is a dupe of #140? My understanding is that when you And this is supposed to be fixed in Bazel 7.1, unfortunately my project is stuck on 7.0 for now... |
edit: See below comments where I dug in a bit deeper and found a potentially broader issue.
Hi! I love this project and have been using it successfully for many years.
Recently I upgrade protobuf and now I am running into the following issue.
Whenever there is a protobuf c++ target, hedron_compile_commands cannot build the compile_commands.json successfully. It seems to be using the wrong version of probotuf somehow. This is weird because the bazel build succeeds. It's only the hedron refresh_compile_commands target that fails.
I created a minimal example repo with instructions to reproduce the issue here:
https://github.com/kgreenek/hedron_pb_bug_repro
I verified that when running the example binary, the protobuf version found at compile time is the expected newer version. So I believe somehow hedron is finding some older headers.
I tried removing all protobuf headers from my system to see if those were being found somehow. However, hedron still found the wrong version of protobuf somehow and I saw the same errors.
The text was updated successfully, but these errors were encountered: