Repository navigation
feat(disk): translate a mid-build ENOSPC into the pre-flight disk message (#1750 item 4) - #1768
Merged
Merged
Conversation
…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.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
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").
This was referenced Oct 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.lnkblob. That failure used to reach the user as a rawENOSPCfrom 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_fullrecognises the condition from either anio::Error(errno 28 on POSIX,ERROR_DISK_FULL/ERROR_HANDLE_DISK_FULLon Windows, with a text fallback) or a tool's stderr (No space left on device,ENOSPC, the Win32 message,EDQUOT— matched case-insensitively).insufficient disk space:/ what was being written / the underlying cause / the same closing hint (DISK_FULL_HINT, now shared withPreflightReport::failure_messageso the two cannot drift apart).disk_preflight::enospc_failureadditionally appends the depth-one reclaimable caches, exactly as the pre-flight failure does.platform::host::current()— the workspace's single OS-selection point — so no newcfg!(unix)host mechanic appears (the platform-boundary scanner stays at its baseline).Wired at every boundary the issue names:
build-engine/src/parallel.rscompile loopar)fbuild-core/src/archive.rs::createld)esp32_linker::linkesp32_linker::convert_firmware(esptool elf2image)esp32_linker::linkcreating the output dirdownloader::DownloadAttemptError::PartFileA 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::Errortranslation, non-ENOSPCio::Errorleft alone. With the signature table disabled, 2 of the 6 fail.build-engine::disk_preflight(10, +2): a translatedENOSPClists reclaimable caches largest-first and ends onDISK_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-fileENOSPCbecomes the disk message;EACCESkeeps the download error.Verification (this host)
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.