ci: disable cache-bin to fix flaky macOS builds#411
Merged
Conversation
Swatinem/rust-cache with cache-bin: true (the default) caches ~/.cargo/bin, which contains rustup proxy binaries. On macOS, rustup uses RUSTUP_PERMIT_COPY_RENAME=1, so these proxies are copies of the rustup binary. When the cache restores stale copies, they can resolve to rustup-init instead of the proper cargo proxy, causing: error: unexpected argument 'test' found Usage: rustup-init[EXE] [OPTIONS] Setting cache-bin: false prevents caching the bin directory, letting rustup manage its own proxy binaries correctly.
jlizen
approved these changes
May 15, 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.
Problem
The macOS CI job flakes with:
This happens because
Swatinem/rust-cache@v2withcache-bin: true(the default) caches~/.cargo/bin. On macOS,dtolnay/rust-toolchainsetsRUSTUP_PERMIT_COPY_RENAME=1, so rustup proxy binaries (cargo,rustc, etc.) are copies of the rustup binary rather than hardlinks.When the cache restores these stale copies after a rustup version change on the runner image, the
cargobinary resolves torustup-initinstead of the proper proxy, breaking all cargo commands.Fix
Set
cache-bin: "false"soSwatinem/rust-cacheno longer caches~/.cargo/bin. Rustup manages its own proxy binaries; they should not be cached.This is a documented known issue in rust-cache.
Impact