Skip to content

ci(pacquet): shrink test build debuginfo to avoid ENOSPC on the ubuntu runner - #12665

Merged
zkochan merged 1 commit into
mainfrom
ci/pacquet-test-disk-headroom
Jun 25, 2026
Merged

zkochan merged 1 commit into
mainfrom
ci/pacquet-test-disk-headroom

Conversation

@zkochan

@zkochan zkochan commented Jun 25, 2026 •

Copy link
Copy Markdown
Member

Summary

Follow-up to the pacquet audit signatures PR, where the merge-queue Rust CI / Test / ubuntu job failed with:

rustc-LLVM ERROR: IO failure on output stream: No space left on device
error: linking with `cc` failed: exit status: 1

The failure is disk exhaustion, not a code error — macOS and Windows passed, and it died linking an unrelated crate's test binary. The cargo nextest build holds a full set of --all-targets debug binaries for the whole workspace (~60 crates plus heavy C deps like aws-lc-sys, ring, libsql-ffi, tree-sitter) in target/, which has grown close to the hosted ubuntu runner's free-disk ceiling. The existing Free up runner disk space step frees a fixed ~25 GB, but target/ had crept up to where a run can still cross ENOSPC mid-link.

This builds the test artifacts with line-tables-only debug info (via job-level CARGO_PROFILE_DEV_DEBUG / CARGO_PROFILE_TEST_DEBUG), which drops most of the debuginfo bytes that fill target/ while keeping panic backtraces file:line-accurate. It's set in the workflow rather than Cargo.toml, so local just test keeps full debug info.

Attacking the consumer (target/ size) rather than freeing more host space addresses the growth directly; if headroom gets tight again later, freeing more host space is the next lever.

Squash Commit Body

The Rust CI test job's `cargo nextest` build holds a full set of
`--all-targets` debug binaries for the whole workspace (~60 crates plus
heavy C deps such as aws-lc-sys, ring, libsql-ffi, and tree-sitter) in
target/. That had grown close to the hosted ubuntu runner's free-disk
ceiling even after the fixed `Free up runner disk space` step, and a run
crossed it: the linker died with "No space left on device" while building
an unrelated crate's test binary (macOS and Windows were unaffected).

Build the test artifacts with line-tables-only debug info via job-level
CARGO_PROFILE_DEV_DEBUG / CARGO_PROFILE_TEST_DEBUG env. This drops most of
the debuginfo bytes that fill target/ while keeping panic backtraces
file:line-accurate. Setting it in the workflow rather than Cargo.toml
leaves local `just test` builds with full debug info.

Checklist

  • Added or updated tests.

Written by an agent (Claude Code, claude-opus-4-8).

Summary by CodeRabbit

  • Chores
    • Updated CI test settings to use smaller debug information for Rust builds, helping jobs fit within disk-space limits and run more reliably.

…u runner

The Rust CI test job's `cargo nextest` build holds a full set of
`--all-targets` debug binaries for the whole workspace (~60 crates plus
heavy C deps such as aws-lc-sys, ring, libsql-ffi, and tree-sitter) in
target/. That had grown close to the hosted ubuntu runner's free-disk
ceiling even after the fixed `Free up runner disk space` step, and a run
crossed it: the linker died with "No space left on device" while building
an unrelated crate's test binary (macOS and Windows were unaffected).

Build the test artifacts with line-tables-only debug info via job-level
CARGO_PROFILE_DEV_DEBUG / CARGO_PROFILE_TEST_DEBUG env. This drops most of
the debuginfo bytes that fill target/ while keeping panic backtraces
file:line-accurate. Setting it in the workflow rather than Cargo.toml
leaves local `just test` builds with full debug info.
@coderabbitai

coderabbitai Bot commented Jun 25, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 5d418d3f-44ca-4ce2-8dca-f43f6bde4b8c

📥 Commits

Reviewing files that changed from the base of the PR and between c50c6aa and 682423d.

📒 Files selected for processing (1)
  • .github/workflows/pacquet-ci.yml

📝 Walkthrough

Walkthrough

The Rust CI workflow’s test job now sets Cargo dev and test debug profiles to line-tables-only and updates the related comments.

Changes

CI workflow debug profile settings

Layer / File(s) Summary
Test job debug profile env
.github/workflows/pacquet-ci.yml
The test job defines CARGO_PROFILE_DEV_DEBUG and CARGO_PROFILE_TEST_DEBUG as line-tables-only, with comments updated to match.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Suggested labels

product: pacquet

Suggested reviewers

  • KSXGitHub
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci/pacquet-test-disk-headroom

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.

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Shrink Rust CI test debuginfo to prevent ENOSPC on Ubuntu runners
⚙️ Configuration changes 🕐 10-20 Minutes

Grey Divider

Description

• Reduce cargo nextest build artifact size on Ubuntu by using line-tables-only debuginfo.
• Prevent intermittent CI failures caused by target/ exhausting hosted runner disk during linking.
• Keep full local debuginfo by scoping the setting to the GitHub Actions job env.
Diagram

graph TD
  A["GitHub Actions workflow"] --> B["Rust CI / Test job"] --> C["Env: line-tables-only"] --> D["cargo nextest build"] --> E[("target/ artifacts")] --> F[("Runner disk space")]
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Free additional runner disk space
  • ➕ No change to build/debug configuration
  • ➕ Keeps full debuginfo in CI artifacts
  • ➖ Brittle: depends on runner image/layout and may regress as target/ grows
  • ➖ Treats symptom, not root cause (artifact size)
2. Set debuginfo policy in Cargo.toml (workspace profiles)
  • ➕ Applies consistently across all builds, including local and other CI jobs
  • ➕ Less workflow-specific configuration
  • ➖ Reduces local developer debuginfo unless developers override env/profile
  • ➖ Harder to keep CI-only behavior (goal here is CI-only)
3. Reduce CI build scope (avoid `--all-targets` where possible)
  • ➕ Can drastically cut build outputs and time if feasible
  • ➕ Avoids changing debug settings
  • ➖ May reduce coverage or miss build/test regressions in non-default targets
  • ➖ Often difficult to maintain correctness across a large workspace

Recommendation: Current approach (CI-only CARGO_PROFILE_DEV_DEBUG/CARGO_PROFILE_TEST_DEBUG set to line-tables-only) is the best tradeoff: it directly reduces the dominant disk consumer (target/ debuginfo) while preserving usable backtraces and keeping local just test behavior unchanged. If headroom becomes tight again, the next lever is additional runner cleanup, but shrinking artifacts is the more durable first step.

Files changed (1) +14 / -0

Other (1) +14 / -0
pacquet-ci.ymlSet CI-only Cargo profile debuginfo to line-tables-only for nextest builds +14/-0

Set CI-only Cargo profile debuginfo to line-tables-only for nextest builds

• Adds job-level environment variables to build dev dependencies and test targets with 'line-tables-only' debuginfo. This reduces 'target/' size during 'cargo nextest' on Ubuntu runners to prevent ENOSPC failures while keeping local builds unaffected.

.github/workflows/pacquet-ci.yml

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Jun 25, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (0) 📜 Skill insights (0)

Grey Divider


Action required

1. Stale target cache restored 🐞 Bug ☼ Reliability
Description
jobs.test now changes Cargo artifact fingerprints via
CARGO_PROFILE_{DEV,TEST}_DEBUG=line-tables-only, but the job still restores the existing
Swatinem/rust-cache snapshot while merge_group runs will not save an updated smaller cache
(save-cache is only true on main). This can keep the old large target/ around during
merge-queue runs and force additional rebuild output, undermining the intended disk-space reduction
and risking continued ENOSPC.
Code

.github/workflows/pacquet-ci.yml[R75-88]

+    # Build the nextest artifacts with line-tables-only debug info. The full
+    # `cargo nextest` build holds a complete set of `--all-targets` debug
+    # binaries for the whole workspace (~60 crates plus heavy C deps like
+    # aws-lc-sys, ring, libsql-ffi, and tree-sitter) in target/, which had
+    # grown close to the hosted runner's free-disk ceiling even after the
+    # cleanup step below — a run can cross ENOSPC mid-link (the linker dies
+    # with "No space left on device"). Line tables keep panic backtraces
+    # file:line-accurate while dropping most of the debuginfo bytes. Set here
+    # in CI rather than in Cargo.toml so local `just test` keeps full debug
+    # info. CARGO_PROFILE_DEV_DEBUG covers dependencies (built dev), _TEST_
+    # covers the test targets.
+    env:
+      CARGO_PROFILE_DEV_DEBUG: line-tables-only
+      CARGO_PROFILE_TEST_DEBUG: line-tables-only
Evidence
The test job changes Cargo profile debug settings at the job level, but it still installs Rust via a
composite action that runs Swatinem/rust-cache (which snapshots target/). The job only saves
caches on main, so merge-queue runs restore caches but cannot update them, which can preserve old
large artifacts while building new ones under the changed profile configuration.

.github/workflows/pacquet-ci.yml[71-121]
.github/actions/rustup/action.yml[79-84]
.github/workflows/pacquet-ci.yml[396-400]
.github/workflows/build-pnpr.yml[37-54]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The `test` job changes Cargo profile debug settings (line-tables-only), but still restores an existing workspace `target/` cache. Merge-queue (`merge_group`) runs do not save caches (save is gated to `main`), so they can repeatedly start from an old, large `target/` snapshot and then produce additional artifacts under the new profile settings, defeating the disk-space goal.
## Issue Context
- The `test` job introduces job-level `CARGO_PROFILE_DEV_DEBUG` and `CARGO_PROFILE_TEST_DEBUG`.
- Rust caching is handled by the `./.github/actions/rustup` composite action via `Swatinem/rust-cache`.
- Cache saving is gated by `save-cache: ${{ github.ref_name == 'main' }}` in the test job.
## Fix Focus Areas
- .github/workflows/pacquet-ci.yml[71-121]
- .github/actions/rustup/action.yml[79-84]
## Suggested fix
Pick one (A is preferred):
A) **Change the cache namespace for the test job** so it does not restore the pre-change cache:
- In the test job’s `Install Rust Toolchain` step, pass a distinct `shared-key` to `./.github/actions/rustup` (e.g. `shared-key: warm-line-tables-only`). This forces a clean cache for the new profile settings; after merge, `main` will populate it for future merge-queue runs.
B) **Disable cache restore for merge_group** until main has produced the new cache:
- Set `restore-cache: ${{ github.event_name != 'merge_group' }}` (or just `false` for merge_group) on the rustup action invocation in the test job.
Option A keeps caching benefits while avoiding `target/` bloat from mixing old/new artifacts.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Previous review results

Review updated until commit 682423d

Results up to commit 682423d


🐞 Bugs (1) 📘 Rule violations (0) 📜 Skill insights (0)


Action required
1. Stale target cache restored 🐞 Bug ☼ Reliability
Description
jobs.test now changes Cargo artifact fingerprints via
CARGO_PROFILE_{DEV,TEST}_DEBUG=line-tables-only, but the job still restores the existing
Swatinem/rust-cache snapshot while merge_group runs will not save an updated smaller cache
(save-cache is only true on main). This can keep the old large target/ around during
merge-queue runs and force additional rebuild output, undermining the intended disk-space reduction
and risking continued ENOSPC.
Code

.github/workflows/pacquet-ci.yml[R75-88]

+    # Build the nextest artifacts with line-tables-only debug info. The full
+    # `cargo nextest` build holds a complete set of `--all-targets` debug
+    # binaries for the whole workspace (~60 crates plus heavy C deps like
+    # aws-lc-sys, ring, libsql-ffi, and tree-sitter) in target/, which had
+    # grown close to the hosted runner's free-disk ceiling even after the
+    # cleanup step below — a run can cross ENOSPC mid-link (the linker dies
+    # with "No space left on device"). Line tables keep panic backtraces
+    # file:line-accurate while dropping most of the debuginfo bytes. Set here
+    # in CI rather than in Cargo.toml so local `just test` keeps full debug
+    # info. CARGO_PROFILE_DEV_DEBUG covers dependencies (built dev), _TEST_
+    # covers the test targets.
+    env:
+      CARGO_PROFILE_DEV_DEBUG: line-tables-only
+      CARGO_PROFILE_TEST_DEBUG: line-tables-only
Evidence
The test job changes Cargo profile debug settings at the job level, but it still installs Rust via a
composite action that runs Swatinem/rust-cache (which snapshots target/). The job only saves
caches on main, so merge-queue runs restore caches but cannot update them, which can preserve old
large artifacts while building new ones under the changed profile configuration.

.github/workflows/pacquet-ci.yml[71-121]
.github/actions/rustup/action.yml[79-84]
.github/workflows/pacquet-ci.yml[396-400]
.github/workflows/build-pnpr.yml[37-54]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The `test` job changes Cargo profile debug settings (line-tables-only), but still restores an existing workspace `target/` cache. Merge-queue (`merge_group`) runs do not save caches (save is gated to `main`), so they can repeatedly start from an old, large `target/` snapshot and then produce additional artifacts under the new profile settings, defeating the disk-space goal.

## Issue Context
- The `test` job introduces job-level `CARGO_PROFILE_DEV_DEBUG` and `CARGO_PROFILE_TEST_DEBUG`.
- Rust caching is handled by the `./.github/actions/rustup` composite action via `Swatinem/rust-cache`.
- Cache saving is gated by `save-cache: ${{ github.ref_name == 'main' }}` in the test job.

## Fix Focus Areas
- .github/workflows/pacquet-ci.yml[71-121]
- .github/actions/rustup/action.yml[79-84]

## Suggested fix
Pick one (A is preferred):

A) **Change the cache namespace for the test job** so it does not restore the pre-change cache:
- In the test job’s `Install Rust Toolchain` step, pass a distinct `shared-key` to `./.github/actions/rustup` (e.g. `shared-key: warm-line-tables-only`). This forces a clean cache for the new profile settings; after merge, `main` will populate it for future merge-queue runs.

B) **Disable cache restore for merge_group** until main has produced the new cache:
- Set `restore-cache: ${{ github.event_name != 'merge_group' }}` (or just `false` for merge_group) on the rustup action invocation in the test job.

Option A keeps caching benefits while avoiding `target/` bloat from mixing old/new artifacts.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Qodo Logo

@github-actions github-actions Bot added the reviewed: coderabbit CodeRabbit submitted an approving review label Jun 25, 2026
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 682423d

@zkochan
zkochan enabled auto-merge June 25, 2026 16:43
@zkochan
zkochan added this pull request to the merge queue Jun 25, 2026
@zkochan
zkochan removed this pull request from the merge queue due to a manual request Jun 25, 2026
@zkochan
zkochan merged commit 9f3df6b into main Jun 25, 2026
29 checks passed
@zkochan
zkochan deleted the ci/pacquet-test-disk-headroom branch June 25, 2026 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

product: pacquet reviewed: coderabbit CodeRabbit submitted an approving review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant