Skip to content

feat(disk): translate a mid-build ENOSPC into the pre-flight disk message (#1750 item 4) - #1768

Merged
zackees merged 2 commits into
mainfrom
agent/esp32-enospc-translation
Oct 28, 2026
Merged

zackees merged 2 commits into
mainfrom
agent/esp32-enospc-translation

Conversation

@zackees

@zackees zackees commented Oct 28, 2026

Copy link
Copy Markdown
Member

Why

fbuild's pre-flight check (#1767) catches a volume that is already too full, but it cannot see a volume that fills up during a build — a 40 MB LTO temporary, a framework install, a .lnk blob. That failure used to reach the user as a raw ENOSPC from whichever tool wrote last, naming neither the path nor a way out. This is #1750 item 4.

What

One recogniser, one message family.

  • fbuild-core::disk_full recognises the condition from either an io::Error (errno 28 on POSIX, ERROR_DISK_FULL/ERROR_HANDLE_DISK_FULL on Windows, with a text fallback) or a tool's stderr (No space left on device, ENOSPC, the Win32 message, EDQUOT — matched case-insensitively).
  • The text it produces is the pre-flight text: insufficient disk space: / what was being written / the underlying cause / the same closing hint (DISK_FULL_HINT, now shared with PreflightReport::failure_message so the two cannot drift apart). disk_preflight::enospc_failure additionally appends the depth-one reclaimable caches, exactly as the pre-flight failure does.
  • Host selection goes through platform::host::current() — the workspace's single OS-selection point — so no new cfg!(unix) host mechanic appears (the platform-boundary scanner stays at its baseline).

Wired at every boundary the issue names:

boundary site
subprocess / compile build-engine/src/parallel.rs compile loop
linker (ar) fbuild-core/src/archive.rs::create
linker (ld) esp32_linker::link
image conversion esp32_linker::convert_firmware (esptool elf2image)
fbuild's own write esp32_linker::link creating the output dir
downloader downloader::DownloadAttemptError::PartFile

A failure that is not a full volume keeps its original text verbatim — an undefined-reference link error is never relabelled a disk failure.

Tests (RED-first)

Every branch has a positive and a negative case:

  • fbuild-core::disk_full (6): POSIX/Windows/quota signatures, errno recognition, ordinary tool errors not mistaken for a full disk, message shape (context + cause + hint), io::Error translation, non-ENOSPC io::Error left alone. With the signature table disabled, 2 of the 6 fail.
  • build-engine::disk_preflight (10, +2): a translated ENOSPC lists reclaimable caches largest-first and ends on DISK_FULL_HINT; ordinary compile errors are never relabelled.
  • build-esp::esp32_linker (182, +4): link and elf2image, both directions. The cache root is injected (link_failure_in/convert_failure_in) so the tests do not walk the host's real cache.
  • fbuild-packages-fetch::downloader (186, +2): part-file ENOSPC becomes the disk message; EACCES keeps the download error.

Verification (this host)

fbuild-core lib        disk_full 6 passed / 0 failed
build-engine lib       disk_preflight 10 passed / 0 failed
build-esp lib          182 passed / 0 failed / 1 ignored
packages-fetch lib     186 passed / 0 failed
bash test              EXIT 0 — 47 suites, 3878 passed, 0 failed
clippy --workspace --all-targets -D warnings   EXIT 0
cargo fmt --all -- --check                     clean
ci/enforce_platform_boundary.py --print-totals rows=44 (baseline)
ci/check_dylint_allowlists.py                  current
run_dylint fbuild-core / fbuild-build-esp      EXIT 0 (fbuild-packages-fetch run separately)

Not in this PR

Items 3 (budgeted on-demand reclaim, never mid-build) and 5 (fbuild doctor --check-disk) of #1750 remain; #1750 stays open.

Part of #1750.

…sage

A pre-flight check cannot see a volume that fills up *during* a build, and
that failure used to reach the user as a raw ENOSPC from whichever tool wrote
last - naming no path, no shortfall and no way out. #1750 item 4.

- fbuild-core::disk_full recognises the condition (POSIX ENOSPC via errno or
  the strerror text, Win32 ERROR_DISK_FULL/ERROR_HANDLE_DISK_FULL, EDQUOT) and
  builds the same actionable text the pre-flight failure uses, sharing
  DISK_FULL_HINT so the two cannot drift apart.
- Wired at every boundary the issue names: the compile loop, ar (core archive),
  the ESP32 link, esptool elf2image, fbuild's own link-dir write, and the
  downloader's part-file write.
- A tool failure that is not a full volume keeps its original text verbatim.
@coderabbitai

coderabbitai Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • 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

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

downloader_tests.rs was already at 991 LOC; the two new tests pushed it to
1022, over the workspace's 1000-LOC limit (CI "Reject .rs files over 1000 LOC").
@zackees
zackees added this pull request to the merge queue Oct 28, 2026
Merged via the queue into main with commit 5fca4d4 Oct 28, 2026
35 checks passed
@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Oct 29, 2026
@zackees
zackees deleted the agent/esp32-enospc-translation branch November 5, 2026 05:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

1 participant