ci: fix macOS rustup cache corruption in install-rust action#357
Open
GuillaumeLagrange wants to merge 1 commit into
Open
ci: fix macOS rustup cache corruption in install-rust action#357GuillaumeLagrange wants to merge 1 commit into
GuillaumeLagrange wants to merge 1 commit into
Conversation
Merging this PR will not alter performance
|
SuperMuel
approved these changes
May 16, 2026
Switch back to `rustup toolchain install` (the rustup-documented way to install the toolchain pinned by rust-toolchain.toml across rustup 1.28+ versions) and disable `cache-bin` on macOS. Caching ~/.cargo/bin caused macOS jobs to fail with `error: unexpected argument 'fmt' found / Usage: rustup-init[EXE]`: rust-cache was restoring a stale cargo proxy from a runner with a different rustup version, overwriting the proxy installed in this run and leaving cargo behaving like rustup-init. Co-Authored-By: Claude <noreply@anthropic.com>
c47530a to
0d87670
Compare
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.
Switch the install-rust composite action back to
rustup toolchain installand disablecache-binon the rust-cache step for macOS.macOS lint jobs were failing with:
Two compounding causes:
rustup showwas used to materialize the toolchain pinned inrust-toolchain.toml. Per the rustup 1.28 release notes,rustup showno longer auto-installs the active toolchain — the documented replacement isrustup toolchain install(with no arguments). Behavior was partially restored in 1.28.1 behindRUSTUP_AUTO_INSTALL, so relying onrustup showis fragile across runner image updates.Swatinem/rust-cachecaches~/.cargo/binby default. On macOS, the cache had been saved on a runner with a different rustup version; on restore it overwrote the freshly-installed cargo proxy with a stalerustup-initbinary, which is whycargo fmt/cargo clippyreportedUsage: rustup-init[EXE].This matches the pattern tokio uses (tokio-rs/tokio CI): install the toolchain first, then run rust-cache with
cache-bin: falseon macOS only.Tested with 10 runs of just the macos lint