Skip to content

Commit 0b8b8d4

Browse files
committed
fix(ci): isolate Windows Rust toolchains for stable caches
Signed-off-by: Piotr Mlocek <[email protected]>
1 parent 206e6ce commit 0b8b8d4

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

‎.github/workflows/windows-msvc.yml‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ concurrency:
1818

1919
env:
2020
CARGO_INCREMENTAL: "0"
21+
# Log cache write failures without dumping compiler arguments or environments.
22+
SCCACHE_LOG: "debug/Error executing cache write"
2123

2224
jobs:
2325
pr_metadata:
@@ -54,6 +56,8 @@ jobs:
5456
rust_target: aarch64-pc-windows-msvc
5557
runs-on: ${{ matrix.runner }}
5658
env:
59+
# rust-cache hashes every installed toolchain, including unused runner defaults.
60+
RUSTUP_HOME: ${{ runner.temp }}/openshell-rustup
5761
READ_ONLY_GITHUB_TOKEN: ${{ github.token }}
5862
SCCACHE_GHA_ENABLED: "true"
5963
SCCACHE_GHA_VERSION: windows-msvc-${{ matrix.arch }}
@@ -111,6 +115,7 @@ jobs:
111115
rust_target: aarch64-pc-windows-msvc
112116
runs-on: ${{ matrix.runner }}
113117
env:
118+
RUSTUP_HOME: ${{ runner.temp }}/openshell-rustup
114119
READ_ONLY_GITHUB_TOKEN: ${{ github.token }}
115120
SCCACHE_GHA_ENABLED: "true"
116121
SCCACHE_GHA_VERSION: windows-msvc-${{ matrix.arch }}
@@ -165,6 +170,7 @@ jobs:
165170
rust_target: aarch64-pc-windows-msvc
166171
runs-on: ${{ matrix.runner }}
167172
env:
173+
RUSTUP_HOME: ${{ runner.temp }}/openshell-rustup
168174
READ_ONLY_GITHUB_TOKEN: ${{ github.token }}
169175
SCCACHE_GHA_ENABLED: "true"
170176
SCCACHE_GHA_VERSION: windows-msvc-${{ matrix.arch }}

‎architecture/windows-msvc-build.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,10 @@ recovers cacheable Rust compiler outputs when source changes invalidate part of
118118
that target tree. CI enables client-side mode and normalizes the checkout root
119119
for stable compiler cache keys. The target-cache action runs its metadata step
120120
with `RUSTC_WRAPPER` cleared so cache maintenance does not depend on sccache.
121+
Hosted jobs use an isolated `RUSTUP_HOME` containing the pinned toolchain so
122+
unused toolchains in runner images cannot change the target-cache restore key.
123+
CI logs sccache write failures alongside its hit/miss statistics to distinguish
124+
backend failures from ordinary cache misses.
121125

122126
The lane uses `mise run --skip-tools windows:*` because Windows Rust comes from
123127
rustup and linking comes from Visual Studio Build Tools. Mise orchestrates the

0 commit comments

Comments
 (0)