Skip to content

Commit 36cc1c6

Browse files
Try sccache again
1 parent bbdfe5f commit 36cc1c6

2 files changed

Lines changed: 24 additions & 8 deletions

File tree

.github/workflows/builds.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,14 +137,22 @@ jobs:
137137
# ---------- sccache experiment for Windows Rust builds ----------
138138
- name: Setup sccache (Windows only)
139139
if: runner.os == 'Windows'
140-
uses: mozilla-actions/sccache-action@1583d6b38d7be47f593cb472781bbb21cab4321e # v0.0.10
140+
uses: mozilla-actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # v0.0.10
141141

142-
- name: Enable sccache for Rust (Windows only)
142+
- name: Enable sccache wrapping (Windows only)
143+
id: sccache
143144
if: runner.os == 'Windows'
144145
shell: bash
145146
run: |
146147
echo "SCCACHE_GHA_ENABLED=true" >> "$GITHUB_ENV"
147-
echo "RUSTC_WRAPPER=sccache" >> "$GITHUB_ENV"
148+
if sccache --start-server >/dev/null 2>&1; then
149+
echo "RUSTC_WRAPPER=sccache" >> "$GITHUB_ENV"
150+
echo "enabled=true" >> "$GITHUB_OUTPUT"
151+
echo "::notice::sccache enabled (RUSTC_WRAPPER=sccache)"
152+
else
153+
echo "enabled=false" >> "$GITHUB_OUTPUT"
154+
echo "::warning::sccache backend unreachable; building without compile cache this run"
155+
fi
148156
149157
# ---------- Cache Cargo ----------
150158
# The Rust FFI is built from the pinned client-sdk-rust submodule. Its
@@ -192,7 +200,7 @@ jobs:
192200
echo "LIBCLANG_PATH=/usr/lib/llvm-${LLVM_VERSION}/lib" >> "$GITHUB_ENV"
193201
194202
- name: Reset sccache stats (Windows only)
195-
if: runner.os == 'Windows'
203+
if: runner.os == 'Windows' && steps.sccache.outputs.enabled == 'true'
196204
shell: bash
197205
run: sccache --zero-stats
198206

.github/workflows/tests.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)