Skip to content

ci: disable cache-bin in setup-rust-toolchain#557

Merged
lwshang merged 1 commit into
mainfrom
fix/disable-cargo-bin-cache
May 18, 2026
Merged

ci: disable cache-bin in setup-rust-toolchain#557
lwshang merged 1 commit into
mainfrom
fix/disable-cargo-bin-cache

Conversation

@lwshang
Copy link
Copy Markdown
Contributor

@lwshang lwshang commented May 16, 2026

Summary

  • Add cache-bin: false to every actions-rust-lang/setup-rust-toolchain invocation across checks.yml, test.yml, and validate-examples.yml (8 sites).
  • Stops ~/.cargo/bin/ from round-tripping through the GitHub Actions cache, which was poisoning macOS runs.

Background

A Homebrew rustup formula change on 2026-05-06 (cfffe64f) replaced the multiplexed rustup-init binary with an env_script_all_files wrapper. The wrapper exec's the real binary by filename, dropping argv[0], which breaks rustup's name-based proxy dispatch — cargo test becomes rustup-init test and fails with error: unexpected argument 'test' found. The new macOS runner image 20260511.0048 baked that bottle in, surfacing on jobs that draw the new image.

setup-rust-toolchain caches ~/.cargo/bin/, so once a single run on the broken image saved its ~/.cargo/bin/ into a cache key, every later run hitting that key restored the broken proxy on top of its freshly-installed one. Manually evicting the cache unblocks a job; this change prevents re-poisoning.

This repo doesn't run cargo install anywhere (wasm-tools is installed via taiki-e/install-action, which downloads prebuilt binaries), so the cache had no upside to weigh against this risk.

Related: actions/runner-images #14099, #14097; Swatinem/rust-cache#341.

Test plan

  • CI green on this PR across macOS/ubuntu/windows jobs (poisoned macOS caches were already evicted before this PR was opened, so a fresh ~/.cargo/bin/ is built and not cached)
  • Subsequent re-runs on the same key continue to pass — confirms the cache no longer re-poisons

🤖 Generated with Claude Code

Avoid restoring a stale rustup proxy binary from cache over the freshly
installed one. The new Homebrew rustup formula ships a wrapper that drops
argv[0], breaking cargo/rustc multiplex dispatch; once a poisoned
~/.cargo/bin/ lands in the GHA cache it re-poisons every later run on
that key. We don't cargo-install any tools, so the cache is pure risk.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@lwshang lwshang marked this pull request as ready for review May 16, 2026 00:29
@lwshang lwshang requested a review from a team as a code owner May 16, 2026 00:29
@lwshang lwshang enabled auto-merge (squash) May 16, 2026 00:29
@lwshang lwshang merged commit 4db6a23 into main May 18, 2026
218 of 220 checks passed
@lwshang lwshang deleted the fix/disable-cargo-bin-cache branch May 18, 2026 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants