Skip to content

ci: disable rust-cache cache-bin to fix macOS build#312

Merged
francisdb merged 1 commit into
mainfrom
ci/disable-cache-bin
May 14, 2026
Merged

ci: disable rust-cache cache-bin to fix macOS build#312
francisdb merged 1 commit into
mainfrom
ci/disable-cache-bin

Conversation

@francisdb
Copy link
Copy Markdown
Owner

Summary

Build matrix's macOS job is failing because the new GitHub macOS runner image (actions/runner-images#14037) interacts badly with Swatinem/rust-cache's cache-bin: true default. After cache restore, `$CARGO_HOME/bin/cargo` ends up resolving to `rustup-init`, so `cargo build` dispatches as the installer:

```
error: unexpected argument 'build' found
Usage: rustup-init[EXE] [OPTIONS]
```

This is tracked upstream: Swatinem/rust-cache#341. Reporter confirms cache-bin: false is the workaround.

What this does

Adds `cache-bin: false` to the `Swatinem/rust-cache` step in the build matrix. The toolchain proxies installed by `dtolnay/rust-toolchain` then survive the cache round-trip.

The two wasm jobs are left alone:

  • They run on `ubuntu-latest`, not affected by the macOS image change.
  • They legitimately benefit from `cache-bin: true` because they run `cargo install wasmtime-cli` / `cargo install wasm-bindgen-cli`. Caching those bins saves real time.

Cache eviction note

The already-poisoned macOS cache (key prefix `v0-rust-build-Darwin-x64-...`) will linger until evicted or aged out (7-day GH Actions cache TTL). With `cache-bin: false` the new restore won't try to bring back `$CARGO_HOME/bin` (rust-cache narrows both save and restore paths based on the flag), so the next run should be clean. If anything still misbehaves, manually delete the macOS cache entry via Settings -> Actions -> Caches.

Test plan

  • CI passes on this PR (all three platforms reach `cargo build` and `cargo test`).

The new GitHub macOS runner image (actions/runner-images#14037) ships a
rustup layout where $CARGO_HOME/bin contains proxies that, once round-
tripped through rust-cache's bin scanner (introduced in v2.9.0 by
Swatinem/rust-cache#325), restore as aliases to `rustup-init`. After
cache restore, `cargo build` then dispatches as `rustup-init` and dies
with "unexpected argument 'build'".

Setting cache-bin: false on the build matrix step keeps the toolchain
proxies installed by dtolnay/rust-toolchain intact across runs. Only
applied to the build matrix; the wasm jobs legitimately want bin caching
for their `cargo install wasmtime-cli` / `cargo install wasm-bindgen-cli`
steps and aren't affected (they run on ubuntu-latest).

See Swatinem/rust-cache#341
@francisdb francisdb merged commit 7767fea into main May 14, 2026
9 checks passed
@francisdb francisdb deleted the ci/disable-cache-bin branch May 14, 2026 08:32
@francisdb francisdb mentioned this pull request May 14, 2026
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.

1 participant