@@ -138,14 +138,22 @@ jobs:
138138 # ---------- sccache experiment for Windows Rust builds ----------
139139 - name : Setup sccache (Windows only)
140140 if : runner.os == 'Windows'
141- uses : mozilla-actions/sccache-action@1583d6b38d7be47f593cb472781bbb21cab4321e # v0.0.10
141+ uses : mozilla-actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # v0.0.10
142142
143- - name : Enable sccache for Rust (Windows only)
143+ - name : Enable sccache wrapping (Windows only)
144+ id : sccache
144145 if : runner.os == 'Windows'
145146 shell : bash
146147 run : |
147148 echo "SCCACHE_GHA_ENABLED=true" >> "$GITHUB_ENV"
148- echo "RUSTC_WRAPPER=sccache" >> "$GITHUB_ENV"
149+ if sccache --start-server >/dev/null 2>&1; then
150+ echo "RUSTC_WRAPPER=sccache" >> "$GITHUB_ENV"
151+ echo "enabled=true" >> "$GITHUB_OUTPUT"
152+ echo "::notice::sccache enabled (RUSTC_WRAPPER=sccache)"
153+ else
154+ echo "enabled=false" >> "$GITHUB_OUTPUT"
155+ echo "::warning::sccache backend unreachable; building without compile cache this run"
156+ fi
149157
150158 # ---------- Cache Cargo ----------
151159 # See builds.yml for the rationale: the Rust FFI output only changes with
@@ -187,7 +195,7 @@ jobs:
187195 echo "LIBCLANG_PATH=/usr/lib/llvm-${LLVM_VERSION}/lib" >> "$GITHUB_ENV"
188196
189197 - name : Reset sccache stats (Windows only)
190- if : runner.os == 'Windows'
198+ if : runner.os == 'Windows' && steps.sccache.outputs.enabled == 'true'
191199 shell : bash
192200 run : sccache --zero-stats
193201
0 commit comments