ci: disable rust-cache cache-bin to fix macOS build#312
Merged
Conversation
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
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.
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'scache-bin: truedefault. 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: falseis 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:
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