Skip to content

Commit 4461e5e

Browse files
Remove sccache, free disk space on docker runs
1 parent aebaa8b commit 4461e5e

3 files changed

Lines changed: 45 additions & 107 deletions

File tree

.github/workflows/builds.yml

Lines changed: 32 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,10 @@ permissions:
1313

1414
env:
1515
CARGO_TERM_COLOR: always
16-
# sccache caches rustc invocations across runs. RUSTC_WRAPPER is exported
17-
# only after the setup step verifies the GHA cache backend is reachable, so
18-
# transient cache backend failures fall back to uncached rustc instead of
19-
# failing the build.
20-
SCCACHE_GHA_ENABLED: "true"
21-
# sccache cannot cache Cargo incremental artifacts; without this, sccache
22-
# reports ~0% utilization even on cache misses. Disabling incremental lets
23-
# sccache cache per-crate compilations whenever the cargo target cache misses.
16+
# Disable Cargo incremental artifacts. The Rust FFI is built once per
17+
# submodule SHA and cached whole (see the cargo target cache below), so
18+
# incremental dirs add nothing but bloat the cached target/ directory and
19+
# slow the cache upload/download.
2420
CARGO_INCREMENTAL: "0"
2521
# Pinned commit for cpp-example-collection smoke build (https://github.com/livekit-examples/cpp-example-collection)
2622
CPP_EXAMPLE_COLLECTION_REF: bbf0fdf72dac2239117213475449565686f8c58b
@@ -120,30 +116,6 @@ jobs:
120116
if: matrix.name == 'macos-x64'
121117
run: rustup target add x86_64-apple-darwin
122118

123-
# ---------- Setup sccache ----------
124-
- name: Setup sccache
125-
uses: mozilla-actions/sccache-action@054db53350805f83040bf3e6e9b8cf5a139aa7c9 # v0.0.7
126-
127-
- name: Enable sccache wrapping (probe first)
128-
shell: bash
129-
run: |
130-
if sccache --start-server >/dev/null 2>&1; then
131-
echo "RUSTC_WRAPPER=sccache" >> "$GITHUB_ENV"
132-
# Wire sccache into the C++ build too (the dominant build cost),
133-
# but only where the generator honors compiler launchers. The
134-
# Windows preset uses the Visual Studio generator, which ignores
135-
# CMAKE_<LANG>_COMPILER_LAUNCHER, so we skip it there.
136-
if [[ "$RUNNER_OS" != "Windows" ]]; then
137-
echo "CMAKE_C_COMPILER_LAUNCHER=sccache" >> "$GITHUB_ENV"
138-
echo "CMAKE_CXX_COMPILER_LAUNCHER=sccache" >> "$GITHUB_ENV"
139-
echo "::notice::sccache enabled for rustc + C/C++ (RUSTC_WRAPPER + CMAKE_*_COMPILER_LAUNCHER)"
140-
else
141-
echo "::notice::sccache enabled for rustc only (Windows VS generator ignores compiler launchers)"
142-
fi
143-
else
144-
echo "::warning::sccache backend unreachable; building without compile cache this run"
145-
fi
146-
147119
# ---------- Cache Cargo ----------
148120
# The Rust FFI is built from the pinned client-sdk-rust submodule. Its
149121
# compiled output only changes when the submodule commit changes, so we
@@ -202,11 +174,6 @@ jobs:
202174
shell: pwsh
203175
run: ${{ matrix.build_cmd }}
204176

205-
- name: sccache stats
206-
if: always()
207-
shell: bash
208-
run: sccache --show-stats || true
209-
210177
# Save the populated target/ now, while the build output still exists and
211178
# before the "Clean after build" step runs clean-all. Only on a miss --
212179
# an exact-key hit means the cache already holds this submodule's output.
@@ -508,6 +475,20 @@ jobs:
508475
if: github.event_name == 'pull_request'
509476

510477
steps:
478+
# Reclaim ~30GB before loading the multi-GB SDK image and building the
479+
# example collection inside it. Mirrors the docker-build jobs; without it
480+
# the x64 collection build has hit "no space left on device".
481+
- name: Free disk space
482+
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1
483+
with:
484+
tool-cache: false
485+
android: true
486+
dotnet: true
487+
haskell: true
488+
large-packages: true
489+
docker-images: true
490+
swap-storage: true
491+
511492
- name: Download Docker image artifact
512493
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
513494
with:
@@ -535,6 +516,20 @@ jobs:
535516
if: github.event_name == 'pull_request'
536517

537518
steps:
519+
# Reclaim ~30GB before loading the multi-GB SDK image and building the
520+
# example collection inside it. The standard ubuntu-latest runner has hit
521+
# "no space left on device" here without this step.
522+
- name: Free disk space
523+
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1
524+
with:
525+
tool-cache: false
526+
android: true
527+
dotnet: true
528+
haskell: true
529+
large-packages: true
530+
docker-images: true
531+
swap-storage: true
532+
538533
- name: Download Docker image artifact
539534
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
540535
with:

.github/workflows/make-release.yml

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,6 @@ on:
1313

1414
env:
1515
CARGO_TERM_COLOR: always
16-
# sccache caches rustc invocations across runs. RUSTC_WRAPPER is exported
17-
# only after the setup step verifies the GHA cache backend is reachable, so
18-
# transient cache backend failures fall back to uncached rustc instead of
19-
# failing the build.
20-
SCCACHE_GHA_ENABLED: "true"
2116
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
2217
VCPKG_DEFAULT_TRIPLET: x64-windows-static-md
2318
VCPKG_DEFAULT_HOST_TRIPLET: x64-windows-static-md
@@ -140,21 +135,16 @@ jobs:
140135
if: matrix.name == 'macos-x64'
141136
run: rustup target add x86_64-apple-darwin
142137

143-
# ---------- Setup sccache ----------
144-
- name: Setup sccache
145-
uses: mozilla-actions/sccache-action@054db53350805f83040bf3e6e9b8cf5a139aa7c9 # v0.0.7
146-
147-
- name: Enable sccache wrapping (probe first)
138+
# ---------- Cache Cargo ----------
139+
# Key the target cache on the client-sdk-rust submodule SHA (Cargo.lock is
140+
# pinned inside the submodule and froze the old cache). No clean step runs
141+
# in this workflow, so the combined actions/cache post-job save captures
142+
# the populated target/ correctly once the key busts on a submodule bump.
143+
- name: Resolve Rust submodule SHA
144+
id: rust_sha
148145
shell: bash
149-
run: |
150-
if sccache --start-server >/dev/null 2>&1; then
151-
echo "RUSTC_WRAPPER=sccache" >> "$GITHUB_ENV"
152-
echo "::notice::sccache enabled (RUSTC_WRAPPER=sccache)"
153-
else
154-
echo "::warning::sccache backend unreachable; building without compile cache this run"
155-
fi
146+
run: echo "sha=$(git -C client-sdk-rust rev-parse HEAD)" >> "$GITHUB_OUTPUT"
156147

157-
# ---------- Cache Cargo ----------
158148
- name: Cache Cargo registry
159149
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
160150
with:
@@ -170,7 +160,7 @@ jobs:
170160
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
171161
with:
172162
path: client-sdk-rust/target/
173-
key: ${{ runner.os }}-${{ matrix.name }}-cargo-target-${{ hashFiles('client-sdk-rust/Cargo.lock') }}
163+
key: ${{ runner.os }}-${{ matrix.name }}-cargo-target-${{ steps.rust_sha.outputs.sha }}
174164
restore-keys: |
175165
${{ runner.os }}-${{ matrix.name }}-cargo-target-
176166

.github/workflows/tests.yml

Lines changed: 4 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,10 @@ permissions:
1313

1414
env:
1515
CARGO_TERM_COLOR: always
16-
# sccache caches rustc invocations across runs. RUSTC_WRAPPER is exported
17-
# only after the setup step verifies the GHA cache backend is reachable, so
18-
# transient cache backend failures fall back to uncached rustc instead of
19-
# failing the build.
20-
SCCACHE_GHA_ENABLED: "true"
21-
# sccache cannot cache Cargo incremental artifacts; without this, sccache
22-
# reports ~0% utilization even on cache misses. Disabling incremental lets
23-
# sccache cache per-crate compilations whenever the cargo target cache misses.
16+
# Disable Cargo incremental artifacts. The Rust FFI is built once per
17+
# submodule SHA and cached whole (see the cargo target cache below), so
18+
# incremental dirs add nothing but bloat the cached target/ directory and
19+
# slow the cache upload/download.
2420
CARGO_INCREMENTAL: "0"
2521
# vcpkg binary caching for Windows (mirrors builds.yml)
2622
VCPKG_DEFAULT_TRIPLET: x64-windows-static-md
@@ -118,30 +114,6 @@ jobs:
118114
if: matrix.name == 'macos-x64'
119115
run: rustup target add x86_64-apple-darwin
120116

121-
# ---------- Setup sccache ----------
122-
- name: Setup sccache
123-
uses: mozilla-actions/sccache-action@054db53350805f83040bf3e6e9b8cf5a139aa7c9 # v0.0.7
124-
125-
- name: Enable sccache wrapping (probe first)
126-
shell: bash
127-
run: |
128-
if sccache --start-server >/dev/null 2>&1; then
129-
echo "RUSTC_WRAPPER=sccache" >> "$GITHUB_ENV"
130-
# Wire sccache into the C++ build too (the dominant build cost),
131-
# but only where the generator honors compiler launchers. The
132-
# Windows preset uses the Visual Studio generator, which ignores
133-
# CMAKE_<LANG>_COMPILER_LAUNCHER, so we skip it there.
134-
if [[ "$RUNNER_OS" != "Windows" ]]; then
135-
echo "CMAKE_C_COMPILER_LAUNCHER=sccache" >> "$GITHUB_ENV"
136-
echo "CMAKE_CXX_COMPILER_LAUNCHER=sccache" >> "$GITHUB_ENV"
137-
echo "::notice::sccache enabled for rustc + C/C++ (RUSTC_WRAPPER + CMAKE_*_COMPILER_LAUNCHER)"
138-
else
139-
echo "::notice::sccache enabled for rustc only (Windows VS generator ignores compiler launchers)"
140-
fi
141-
else
142-
echo "::warning::sccache backend unreachable; building without compile cache this run"
143-
fi
144-
145117
# ---------- Cache Cargo ----------
146118
# See builds.yml for the rationale: the Rust FFI output only changes with
147119
# the client-sdk-rust submodule commit, so key the target cache on the
@@ -195,11 +167,6 @@ jobs:
195167
shell: pwsh
196168
run: ${{ matrix.build_cmd }}
197169

198-
- name: sccache stats
199-
if: always()
200-
shell: bash
201-
run: sccache --show-stats || true
202-
203170
# Snapshot the populated target/ after a successful build. Placed before
204171
# the test steps so the Rust FFI output is cached regardless of whether
205172
# the unit/integration tests pass. Only on a miss (exact-key hit means the
@@ -374,20 +341,6 @@ jobs:
374341
with:
375342
toolchain: stable
376343

377-
# ---------- Setup sccache ----------
378-
- name: Setup sccache
379-
uses: mozilla-actions/sccache-action@054db53350805f83040bf3e6e9b8cf5a139aa7c9 # v0.0.7
380-
381-
- name: Enable sccache wrapping (probe first)
382-
shell: bash
383-
run: |
384-
if sccache --start-server >/dev/null 2>&1; then
385-
echo "RUSTC_WRAPPER=sccache" >> "$GITHUB_ENV"
386-
echo "::notice::sccache enabled (RUSTC_WRAPPER=sccache)"
387-
else
388-
echo "::warning::sccache backend unreachable; building without compile cache this run"
389-
fi
390-
391344
# ---------- Cache Cargo ----------
392345
# Key the target cache on the client-sdk-rust submodule SHA (see builds.yml
393346
# rationale). Restore/save split so the populated target/ is captured right

0 commit comments

Comments
 (0)