Skip to content

ci: free runner disk space before heavy cargo builds - #244

Merged
jensholdgaard merged 1 commit into
mainfrom
ci/free-disk-space-heavy-jobs
Jun 17, 2026
Merged

ci: free runner disk space before heavy cargo builds#244
jensholdgaard merged 1 commit into
mainfrom
ci/free-disk-space-heavy-jobs

Conversation

@jensholdgaard

@jensholdgaard jensholdgaard commented Jun 17, 2026

Copy link
Copy Markdown
Owner

Problem

cargo test --all-features on main started failing with disk exhaustion mid-link:

error: failed to write to `.../full.rmeta`: No space left on device (os error 28)
rustc-LLVM ERROR: IO failure on output stream: No space left on device
collect2: fatal error: ld terminated with signal 7 [Bus error], core dumped

The DataFusion-heavy workspace plus a growing set of integration-test binaries — all linked with full debug info — outgrew ubuntu-latest's ~14 GiB root disk. #243 added one more test binary (rfc0014_ingest_write_path) and tipped target/ over the edge. Two consecutive post-merge re-runs hit the identical wall, so this is a capacity problem, not the transient rust-lld bus-error flake (the bus error here is a symptom of the full disk).

The job never reached a single test — it failed while compiling/linking. Locally the suite is green (cargo test -p ourios-ingester --all-features passes; the merged code is correct).

Fix

Reclaim the large preinstalled SDKs this Rust workspace never uses (Android ~9 GiB, dotnet, GHC, CodeQL, boost) via a shared .github/scripts/free-disk-space.sh, run before the build on the two heavy whole-workspace --all-features jobs (test, coverage). This buys ~12 GiB of headroom — also necessary ahead of RFC 0014 part 2, which adds further test binaries.

No third-party action is introduced (just sudo rm + df), so the SHA-pinned-actions / OpenSSF Scorecard posture (#211#213) is unchanged.

Verification

  • ci.yml validates as YAML; free-disk-space.sh passes bash -n and shellcheck.
  • The test job on this PR exercises the fix end-to-end (this is the gate that was failing).

No invariant (§3) or hazard (§4) is touched — CI infrastructure only.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Enhanced CI/build reliability by optimizing disk space usage during automated testing and coverage reporting.

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 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 23d5a93b-1d40-427b-9043-e828c63cc9d5

📥 Commits

Reviewing files that changed from the base of the PR and between 5661984 and 9ff4571.

📒 Files selected for processing (2)
  • .github/scripts/free-disk-space.sh
  • .github/workflows/ci.yml

📝 Walkthrough

Walkthrough

A new bash script .github/scripts/free-disk-space.sh is added that removes several large preinstalled SDK and toolchain directories on Ubuntu runners using best-effort sudo rm -rf. The script is wired as an early step in both the test and coverage CI workflow jobs.

Changes

CI Disk Space Reclamation

Layer / File(s) Summary
Disk space cleanup script
.github/scripts/free-disk-space.sh
New script with set -euo pipefail that reports disk usage, then best-effort removes Android SDK, dotnet, GHC, ghcup, CodeQL, and boost directories via sudo rm -rf ... || true, then re-reports usage.
CI job integration
.github/workflows/ci.yml
Adds a Free runner disk space step after checkout and before Rust toolchain setup in both the test job (line 70) and the coverage job (line 223).

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐇 Hop hop, clear the way!
Android and dotnet, swept away,
GHC and ghcup — gone today,
Cargo needs room to compile and play.
More gigabytes for Rust, hooray! 🦀

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: adding a disk-freeing step before Cargo builds in CI.
Description check ✅ Passed The description provides context (problem statement with error logs), explains the root cause, describes the solution, and mentions verification steps, covering all essential information.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci/free-disk-space-heavy-jobs

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR mitigates GitHub-hosted runner disk exhaustion during heavy Rust builds by reclaiming unused preinstalled SDK space before running workspace-wide --all-features compilation/link steps.

Changes:

  • Add a shared .github/scripts/free-disk-space.sh that removes large, unused SDK/tool directories and prints df before/after.
  • Invoke the script at the start of the test and coverage jobs in CI to increase available disk headroom before cargo test --all-features / cargo llvm-cov.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
.github/workflows/ci.yml Runs the new disk-reclamation script early in the two heaviest jobs (test, coverage) before toolchain install/cache/build.
.github/scripts/free-disk-space.sh Best-effort sudo rm -rf of large unused directories (Android, dotnet, GHC, CodeQL, boost) to recover runner disk space and avoid link-time ENOSPC failures.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@jensholdgaard
jensholdgaard merged commit 39c51c2 into main Jun 17, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants