From a80ff9aeef0979f4d6d8777a20b33bceec9fb3ff Mon Sep 17 00:00:00 2001 From: xdustinface Date: Fri, 15 May 2026 08:03:07 +1000 Subject: [PATCH] ci: stop caching `~/.cargo/bin` `Swatinem/rust-cache@v2` defaults to `cache-bin: true`, which caches `~/.cargo/bin`. On macOS aarch64 the rustup proxies are hardlinks to a single binary, and after a partial (prefix-match) cache restore `cargo` can end up pointing to the `rustup-init` installer instead of the rustup proxy, making every `cargo test` invocation fail with `error: unexpected argument 'test' found`. Disable bin caching so the toolchain is always reinstalled by `dtolnay/rust-toolchain@stable`. Bump `prefix-key` to `v1-rust` to invalidate the existing poisoned caches, since GitHub Actions cache rejects saves to an existing key and prefix-match restore would otherwise keep pulling the bad tar. --- .github/workflows/build-and-test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index d890f6ad1..0422965cd 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -38,6 +38,8 @@ jobs: - uses: Swatinem/rust-cache@v2 with: shared-key: "test-${{ inputs.os }}-${{ matrix.group }}" + prefix-key: "v1-rust" + cache-bin: false - name: Install cargo-llvm-cov if: inputs.coverage