From 9ff4571ea8a2adff8a9b1e78835b1a7f086b96fe Mon Sep 17 00:00:00 2001 From: Jens Holdgaard Pedersen Date: Wed, 17 Jun 2026 21:40:49 +0200 Subject: [PATCH] ci: free runner disk space before heavy cargo builds The `cargo test --all-features` job started failing on main with `No space left on device (os error 28)` mid-link (compounded by the recurrent rust-lld bus-error). The DataFusion-heavy workspace plus a growing set of integration-test binaries, linked with debug info, outgrew ubuntu-latest's ~14 GiB root disk; #243 added one more test binary and tipped it over. Two post-merge re-runs hit the same wall, so this is capacity, not a flake. Reclaim the large unused preinstalled SDKs (Android ~9 GiB, dotnet, GHC, CodeQL, boost) via a shared script before building, on the two heavy whole-workspace `--all-features` jobs (`test`, `coverage`). No third-party action is added, so the SHA-pinned-actions / Scorecard posture is unchanged. Co-Authored-By: Claude Opus 4.8 --- .github/scripts/free-disk-space.sh | 27 +++++++++++++++++++++++++++ .github/workflows/ci.yml | 4 ++++ 2 files changed, 31 insertions(+) create mode 100755 .github/scripts/free-disk-space.sh diff --git a/.github/scripts/free-disk-space.sh b/.github/scripts/free-disk-space.sh new file mode 100755 index 000000000..2368e432b --- /dev/null +++ b/.github/scripts/free-disk-space.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash +# Reclaim disk on GitHub-hosted ubuntu runners before a heavy Cargo build. +# +# `cargo test --all-features` (and `cargo llvm-cov`) link the full +# DataFusion-heavy workspace plus every integration-test binary with debug +# info; the resulting target/ outgrew ubuntu-latest's ~14 GiB root disk and +# failed mid-link with "No space left on device (os error 28)". The big +# preinstalled SDKs below (Android alone is ~9 GiB) are unused by this Rust +# workspace, so removing them buys ample headroom without a third-party +# action (keeping the SHA-pinned-actions / Scorecard posture intact). +set -euo pipefail + +echo "Disk before:" +df -h / + +# `|| true`: the set is best-effort — a missing dir on a future image must +# not fail the build (the goal is headroom, not a specific layout). +sudo rm -rf \ + /usr/local/lib/android \ + /usr/share/dotnet \ + /opt/ghc \ + /usr/local/.ghcup \ + /opt/hostedtoolcache/CodeQL \ + /usr/local/share/boost || true + +echo "Disk after:" +df -h / diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 91fb4e05b..db3de768a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -67,6 +67,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 + - name: Free runner disk space + run: .github/scripts/free-disk-space.sh - uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9 # master (pinned); channel via toolchain input with: toolchain: stable @@ -218,6 +220,8 @@ jobs: contents: write steps: - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 + - name: Free runner disk space + run: .github/scripts/free-disk-space.sh - uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9 # master (pinned); channel via toolchain input with: toolchain: stable