Skip to content

ci: log the build's disk use in the ubuntu-latest job - #486

Merged
giswqs merged 2 commits into
mainfrom
ci/test-line-tables-only
Nov 2, 2026
Merged

giswqs merged 2 commits into
mainfrom
ci/test-line-tables-only

Conversation

@giswqs

@giswqs giswqs commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

The ubuntu-latest job now logs df -h . and the size of target at its end, even when an earlier step fails. On #484 the runner died with No space left on device during cargo test --workspace, and the job's log was lost, so the cause could not be established. The rerun passed.

Correction. This PR first set CARGO_PROFILE_DEV_DEBUG=line-tables-only, on my mistaken claim that CI builds with full debug info. [profile.dev] already sets debug = 0, so that setting added disk use, and it has been removed. No debug or build settings change here.

Measured on this PR's ubuntu-latest job. The current build ends at 22 GB of target, with 81 GB used and 64 GB free out of 145 GB. With line tables it was 46 GB of target and 40 GB free.

Limitations. This does not fix the failure, whose cause is still unknown. With 64 GB free at the end of a normal run, a build filling the disk 1m43s into the step is hard to explain, so it may have been specific to that runner. No test is implicated: a local run's largest temp file seen was 128 MB, sampled once a second. If the failure recurs, this log shows the margin.

The ubuntu-latest job ran out of disk during cargo test --workspace on
PR 484. There are about 170 test binaries, each linking all of terrio.
Tests themselves use little disk.

Keep file and line in backtraces, and log the build's disk use so the
margin can be seen.
@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 02e2c6df-ac39-4899-92a0-69a013ee0c02
Commits

Reviewing files that changed from the base of the PR and between efe8884 and 6ed2c4e.

Files selected for processing: 1
  • .github/workflows/ci.yml

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.

Walkthrough

The check job adds an always-run step that reports filesystem usage and the size of target. If du fails, the step prints no target directory.

Changes: CI workflow updates

Layer / File(s) Summary
Check job disk reporting
.github/workflows/ci.yml
The check job adds an always-run step to report filesystem usage and the size of target. If du fails, the step prints no target directory.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Other

Suggested reviewers: rvalavi

Merge Risk: Low · up to 6ed2c

The logging-only change is mergeable with a small diagnostic caveat: a disk-usage measurement error can incorrectly report that target is missing.

Pre-merge checks: Passed 4
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "ci: log the build's disk use in the ubuntu-latest job" matches the changeset. The raw summary says the check job adds an always() step that prints filesystem usage and reports the size of t…
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.
Full details: Title check

Explanation

The title "ci: log the build's disk use in the ubuntu-latest job" matches the changeset. The raw summary says the check job adds an always() step that prints filesystem usage and reports the size of target. The PR objectives describe the same end-of-job logging of df -h . and the size of target, including when an earlier step fails. The title is specific and uses a conventional commit prefix. It names the main change and the job it affects. The summary also mentions a fallback message when target is absent, which the title does not need to cover.

Finishing Touches
Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

A rabbit checks the disk by moon,
And sees the target’s measured room.
If du cannot report the way,
“no target directory” it will say.
Then hops along beneath the stars.

Comment thread .github/workflows/ci.yml Resolved
Comment thread .github/workflows/ci.yml Resolved
@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Code review

Bugs

  • The change likely increases disk use instead of reducing it (confidence: medium-high). Cargo.toml:130-131 already sets [profile.dev] debug = 0, and docs/testing.md:455 says dev and test builds omit debug symbols by default. CI therefore already built without debug info, which is also the baseline behind the PR's own 19.5 GB measurement. CARGO_PROFILE_DEV_DEBUG: line-tables-only adds line tables on top of that, rather than removing full debug info as the PR body and the comment at ci.yml:19-20 claim. The file:line backtrace benefit is real, but the disk goal isn't served by it. Inline comment posted at .github/workflows/ci.yml:21.

Security

  • None found. The new env var and the df/du step take no untrusted input.

Performance

  • The workflow-level env var applies to every job in ci.yml, including features, wasm, msrv and api-docs, not only the check job. It also changes the cache-relevant build settings for all of them. The PR body acknowledges the cold-cache rebuild, but not the wider scope. Confidence: medium.

Quality

  • du -sh target fails when target/ does not exist, for example when cargo fmt --check fails first, which adds a misleading second error to the log. Confidence: high, but low impact. Inline suggestion posted at .github/workflows/ci.yml:103-104.

CLAUDE.md

  • AGENTS.md asks for measured evidence when build settings change. The PR's evidence (local, no baseline CI disk usage) does not show the change saves space, and it is contradicted by the repo's existing debug = 0 default. Confidence: medium.

Checked: .github/workflows/ci.yml (full file), Cargo.toml profile settings, docs/testing.md build-size section, the claude-autofix.yml env overrides, and the PR metadata and diff. The diff is one file and 8 added lines. I did not run the build. Whether CARGO_PROFILE_TEST_DEBUG is needed is unverified, since test profiles inherit from dev.

Change size

Compared with the base branch (main, merge base 9f4ab10 to PR head efe8884).

Measure Value
Files changed 1 (added 0, modified 1, removed 0, renamed 0)
Size before 17.5 KB
Size after 17.9 KB
Total size change +328 B
Path Before After Change
.github/workflows/ci.yml 17.5 KB 17.9 KB +328 B

- Drop CARGO_PROFILE_DEV_DEBUG: the dev profile already sets debug = 0,
  so line tables added to the build instead of saving disk.
- Do not report a second error when target does not exist.
@giswqs giswqs changed the title ci: keep only line tables in debug builds to save runner disk ci: log the build's disk use in the ubuntu-latest job Nov 2, 2026
Comment thread .github/workflows/ci.yml
if: always()
run: |
df -h .
du -sh target 2>/dev/null || echo "no target directory"

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.

Confidence: medium. 2>/dev/null || echo "no target directory" treats every du failure as a missing directory. A permission error or a tree that disappears mid-walk would print the wrong message with no hint. Testing for the directory first keeps the two cases apart:

Suggested change
du -sh target 2>/dev/null || echo "no target directory"
if [ -d target ]; then du -sh target; else echo "no target directory"; fi

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Leaving as is: this is a best-effort log line, and a permission error on the runner's own checkout is not a realistic case. Not worth another CI cycle; leaving this open for the maintainer.

Comment thread .github/workflows/ci.yml
- run: cargo clippy -p terrio --features ndarray --lib --test ndarray --test float_reads -- -D warnings
- run: cargo test -p terrio --features ndarray --test ndarray --test float_reads
- name: Disk use of the build
if: always()

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.

Confidence: low-medium. always() also runs when the job is cancelled. Pull requests have cancel-in-progress: true (line 10), so every superseded run would first spend time running du over a tree the PR says can reach 46 GB. The step's purpose is to record a failed build, so !cancelled() runs it on failure but not on cancellation:

Suggested change
if: always()
if: ${{ !cancelled() }}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fair, but the cost is small: du over 22 GB is seconds, on a run being cancelled. Not worth another CI cycle; leaving this open for the maintainer.

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Code review

Bugs

  • None that would break CI. The step runs on failure (if: always()), df is harmless, and the du fallback is not hazardous. The two inline comments below are about diagnostic accuracy and cost.
  • Limitation, not a defect (medium confidence): the step samples disk use once, after the job ends. The PR body says the failure came 1m43s into the test step, and the 128 MB peak seen locally was transient, so an end-of-job df may miss the peak that caused the failure. A background sampler (for example, df every few seconds into a log file during the test steps) would show the margin at the moment that matters.

Security

  • None found. The step interpolates no ${{ github.event.* }} values and handles no untrusted input.

Performance

  • du -sh target over a large tree adds time to every run, including ones cancelled by cancel-in-progress (confidence low-medium). Inline comment on line 98.

Quality

  • du … 2>/dev/null || echo conflates a missing directory with a du error (confidence medium). Inline comment on line 101 with a suggestion.
  • Nit (high confidence): the step has no comment, though the file comments the rationale of non-obvious steps (lines 17, 93–94, 124–125). A two-line comment pointing to the disk-exhaustion diagnosis would match that convention.

CLAUDE.md (AGENTS.md)

  • No conflicts. The change touches only .github/workflows/ci.yml, with no build-setting changes and no artifacts committed.

Verified claims

  • The PR body says [profile.dev] already sets debug = 0. Cargo.toml:130-131 confirms it.
  • No CARGO_TARGET_DIR or target-dir override exists in Cargo.toml or .cargo/config*, so target is the right path.

Change size

Compared: the whole PR against main (merge base 9f4ab10 to PR head 6ed2c4e).

Measure Value
Files changed 1 (added 0, modified 1, removed 0, renamed 0)
Size before 17.5 KB
Size after 17.7 KB
Total size change +156 B
Path Before After Change
.github/workflows/ci.yml 17.5 KB 17.7 KB +156 B

@giswqs
giswqs merged commit e8412b1 into main Nov 2, 2026
19 checks passed
@giswqs
giswqs deleted the ci/test-line-tables-only branch November 2, 2026 02:43
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.

1 participant