Avoid Cargo cache cleanup races on macOS - #1777
Merged
Merged
Conversation
Signed-off-by: Ludvig Liljenberg <4257730+ludfjig@users.noreply.github.com>
ludfjig
requested review from
andreiltd,
danbugs,
dblnz,
devigned,
jprendes,
jsturtevant,
simongdavies,
squillace and
syntactically
as code owners
August 27, 2026 16:34
Contributor
There was a problem hiding this comment.
Pull request overview
This PR mitigates race conditions on self-hosted macOS runners where concurrent jobs can interfere with each other via ~/.cargo/bin cleanup performed by Swatinem/rust-cache, potentially removing Cargo for another job. It applies the upstream-recommended workaround by disabling caching (and thus cleanup) of ~/.cargo/bin on macOS while retaining caching elsewhere.
Changes:
- Disable
Swatinem/rust-cachecache-binon macOS to prevent cross-job removal of~/.cargo/bin. - Add an inline comment documenting why macOS is treated differently.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
jprendes
approved these changes
Aug 27, 2026
danbugs
approved these changes
Aug 27, 2026
jsturtevant
approved these changes
Aug 27, 2026
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.
We have mutliple macos runners running concurrently on the same machine. https://github.com/swatinem/rust-cache has a known issue where ~/.cargo/bin gets cleared, which can interfere with concurrent jobs. This fix applies the recommended workaround which is to not cache (and therefore not clean) ~/.cargo/bin
This fix covers DailyArm64.yml and ValidatePullRequest.yml, which are the only jobs running macos concurrently with caching enabled.
closes #1744