Request stdlib cache dir in gopackagesdriver#4391
Merged
fmeum merged 1 commit intobazel-contrib:masterfrom Jul 2, 2025
Merged
Conversation
The stdlib_json_file contains paths of compiled cgo files, which are in the stdlib cache_dir. The gopackagesdriver reads those files, but this dependency was not explicitly declared previously. Usually, it works despite the missing dependency. But when you have a Bazel cache configured, and then run `bazel clean` and run the gopackagesdriver again, Bazel will not restore the cache_dir from the Bazel cache. The gopackagesdriver then fails with an error like this: error: unable to load JSON files: unable to resolve imports: open [...]/bin/external/rules_go+/stdlib_/gocache/a4/a4f91e8314b27a4bce0e8fbc01bb9736cb9ed10da747af722c5a4f2fcb1213a3-d: no such file or directory This change adds a new output group containing the stdlib cache_dir, and requests this from the gopackagesdriver, fixing the problem.
|
For what its worth, it appears that once we began using this version of rules_go, all of our builds started failing with this following sort of error: It seemed to taint each of our persistent CI agents where this new version was utilized. To remedy, we had to bounce our CI fleet bc the cache seems to have been corrupted in a way I dont understand yet. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What type of PR is this?
Bug fix
What does this PR do? Why is it needed?
The stdlib_json_file contains paths of compiled cgo files, which are in the stdlib cache_dir. The gopackagesdriver reads those files, but this dependency was not explicitly declared previously.
Usually, it works despite the missing dependency. But when you have a Bazel cache configured, and then run
bazel cleanand run the gopackagesdriver again, Bazel will not restore the cache_dir from the Bazel cache. The gopackagesdriver then fails with an error like this:error: unable to load JSON files: unable to resolve imports: open [...]/bin/external/rules_go+/stdlib_/gocache/a4/a4f91e8314b27a4bce0e8fbc01bb9736cb9ed10da747af722c5a4f2fcb1213a3-d: no such file or directory
This change adds a new output group containing the stdlib cache_dir, and requests this from the gopackagesdriver, fixing the problem.