-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Be resilient to outdated exec paths in action cache entries #23227
Conversation
60924fd changed the canonical repo name separator from `~` to `+`. Older repo names containing `~` now trigger a syntax error. If an action cache entry refers to an exec path from a previous version of Bazel that used `~`, we need to be resilient and treat the cache entry as corrupted, rather than just crash. Fixes #23180.
Tested with: cd github/bazel
USE_BAZEL_VERSION=7.2.1 bazelisk build src:bazel # succeeds
cp bazel-bin/src/bazel /tmp/bazel
USE_BAZEL_VERSION=last_green bazelisk build src:bazel # crashes
/tmp/bazel build src:bazel # succeeds I'm still looking for a place to add tests. Any hints would be welcome :) |
After digging around the code base a bit, it's still unclear where I should add tests for this. The only thing I can think of is to have an integration test that builds with |
The issue is action cache sharing across bazel versions? Would it be easier to increment https://cs.opensource.google/bazel/bazel/+/master:src/main/java/com/google/devtools/build/lib/actions/cache/CompactPersistentActionCache.java;l=81;drc=f806a2ac39d1cf073207b8ecd5cb5cbcb8c4337b as a fix (#23224 is already going to do this)? |
That would work, except that entries could be "poisoned" in the same version due to a flag flip. So unless we can "flip" the action cache version between two numbers (which is actually what we're doing with the MODULE.bazel.lock file version), this PR is still necessary. |
I'm not very familiar with the callers of |
Yes (see #23227 (comment)).
The caller of |
Thanks, that explanation is very helpful. |
60924fd changed the canonical repo name separator from `~` to `+`. Older repo names containing `~` now trigger a syntax error. If an action cache entry refers to an exec path from a previous version of Bazel that used `~`, we need to be resilient and treat the cache entry as corrupted, rather than just crash. Fixes #23180. Closes #23227. PiperOrigin-RevId: 660105601 Change-Id: Iea5d86c635056d12ba20598383da463bdde03ab0
…23230) 60924fd changed the canonical repo name separator from `~` to `+`. Older repo names containing `~` now trigger a syntax error. If an action cache entry refers to an exec path from a previous version of Bazel that used `~`, we need to be resilient and treat the cache entry as corrupted, rather than just crash. Fixes #23180. Closes #23227. PiperOrigin-RevId: 660105601 Change-Id: Iea5d86c635056d12ba20598383da463bdde03ab0
60924fd changed the canonical repo name separator from `~` to `+`. Older repo names containing `~` now trigger a syntax error. If an action cache entry refers to an exec path from a previous version of Bazel that used `~`, we need to be resilient and treat the cache entry as corrupted, rather than just crash. Fixes #23180. Closes #23227. PiperOrigin-RevId: 660105601 Change-Id: Iea5d86c635056d12ba20598383da463bdde03ab0 Co-authored-by: Xdng Yng <[email protected]>
60924fd changed the canonical repo name separator from
~
to+
. Older repo names containing~
now trigger a syntax error. If an action cache entry refers to an exec path from a previous version of Bazel that used~
, we need to be resilient and treat the cache entry as corrupted, rather than just crash.Fixes #23180.