Skip to content

fix(ci): disable cargo-bin cache on kpm-build to stop stale rustup-init shim (#134)#220

Merged
kalwalt merged 1 commit into
devfrom
fix/macos-cache-stale-shim-134
Jun 26, 2026
Merged

fix(ci): disable cargo-bin cache on kpm-build to stop stale rustup-init shim (#134)#220
kalwalt merged 1 commit into
devfrom
fix/macos-cache-stale-shim-134

Conversation

@kalwalt

@kalwalt kalwalt commented Jun 26, 2026

Copy link
Copy Markdown
Member

Disable ~/.cargo/bin caching on the kpm-build job so a stale cargo
shim can no longer be restored on the macOS runner.

The kpm-build (macos-latest) job flaked intermittently with
rustup-init: unexpected argument 'build' found: Swatinem/rust-cache@v2
(with the default cache-bin: true) restored a cached ~/.cargo/bin
containing a cargo shim that resolved to rustup-init, overwriting the
fresh binary just installed by dtolnay/rust-toolchain@stable. Subsequent
cargo build invocations were then parsed as rustup-init build and the
job failed. Linux and Windows were unaffected; the failure was
non-deterministic (depended on which cache the runner restored).

Setting cache-bin: false on this job's cache step stops the binaries
(including the rustup proxy shim) from being cached at all. kpm-build
installs no cargo-managed tools, so this removes the flake at no cost to
cache effectiveness — only the registry/build caches matter here.

Verification happens in CI itself: the macOS leg of this PR's kpm-build
matrix exercises the changed step.

Refs #134

🤖 Generated with Claude Code

…it shim (#134)

Swatinem/rust-cache@v2 intermittently restored a stale `cargo` shim into
~/.cargo/bin on the macOS kpm-build runner. The cached shim resolved to
`rustup-init`, so `cargo build` was parsed as `rustup-init build` and the
job failed non-deterministically. Linux and Windows were unaffected.

Set `cache-bin: false` on this job's cache step. kpm-build installs no
cargo-managed binaries, so disabling bin caching removes the flake at no
cost to cache effectiveness.

Refs #134

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@codecov

codecov Bot commented Jun 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@kalwalt kalwalt self-assigned this Jun 26, 2026
@kalwalt kalwalt added bug Something isn't working enhancement New feature or request ci/cd labels Jun 26, 2026
@kalwalt kalwalt merged commit 63bda44 into dev Jun 26, 2026
21 checks passed
@kalwalt kalwalt deleted the fix/macos-cache-stale-shim-134 branch June 28, 2026 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working ci/cd enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(ci): macOS kpm-build flake — Swatinem/rust-cache restores stale cargo shim pointing to rustup-init

1 participant