Repository navigation
feat(esp32): measure per-stage disk footprint and publish the measured minimum (#1750 item 1) - #1773
Merged
Merged
Conversation
…d minimum (#1750 item 1) The pre-flight check judged a budget that was a guess: ESP32_CACHE_BYTES was 2 GiB, documented as "platform ~1.3 GB + toolchain ~1.0 GB + framework", while a hydrated pioarduino framework alone measures 2.2-2.8 GB. The check passed hosts that then hit ENOSPC in the linker. - new fbuild_build_engine::disk_footprint: free-space sampling per root at stage boundaries, peak delta per root, one-line summary, optional JSON sink for accumulated measurements (FBUILD_DISK_FOOTPRINT / _JSON), no-op when off - reuses disk_preflight::{FreeSpace, available_on_volume}; generic over the probe so the async build future stays Send - wired into the ESP32 orchestrator at resolve / compile / link boundaries - ESP32_CACHE_BYTES 2 -> 5 GiB with the measured component table in its doc; PROJECT_BUILD_BYTES documented against 15-59 MB of measured build trees Tests: 8 footprint unit tests (scripted volumes) + footprint_roots; the real HostFreeSpace path was verified against the live cache root out of tree. Refs #1750
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
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.
Implements #1750 item 1: "Record the peak disk delta of a cold ESP32 build … and publish a documented minimum per platform. Keep the measured footprint per stage so the estimate tightens as data accumulates."
Why
The pre-flight check (#1767) judges a budget, and that budget was a guess:
ESP32_CACHE_BYTES = 2 GiB, documented as "a platform package (~1.3 GB), a toolchain (~1.0 GB) and the framework install". Measurement says a hydrated pioarduino framework alone is bigger than the whole 2 GiB budget, so the check passed hosts that then hitENOSPCin the linker — the exact failure it exists to prevent.What
1.
fbuild_build_engine::disk_footprint— per-stage measurement. A recorder samples free space per root at stage boundaries and reports the peak delta per root. Free space, not directory size: this counts everything written by subprocesses and by the embedded zccache service, which a walk of the project tree would miss (and a walk of a warm cache costs ~60 s, while the daemon's GC can move it mid-build).perf_log:FBUILD_DISK_FOOTPRINT=1emits one summary line;FBUILD_DISK_FOOTPRINT_JSON=<absolute path>also appends one JSON line per build (implies the flag) so measurements accumulate.sample()returns immediately,dropprints nothing.disk_preflight::{FreeSpace, available_on_volume}(the latter is nowpub(crate)) instead of re-deriving volume probing; generic over the probe so theasync fn buildfuture staysSendand tests can inject a scripted volume.pioarduino-resolve,compile,link-convert; the recorder is created right beside the pre-flight it will one day replace.2. Measured minimum, published in the code.
ESP32_CACHE_BYTESis now 5 GiB, with the measurement in its doc comment:tools/esp32-arduino-libs, 2.7 GB)pioarduino-platform-espressif32)toolchain-xtensa-esp-elf)toolchain-riscv32-esp, C3/C6/H2/P4)→ ~3.9 GiB cold for Xtensa, ~4.9 GiB for RISC-V.
PROJECT_BUILD_BYTESstays 256 MiB, now documented against measurement (15–59 MB across nine ESP32 test projects) rather than a guess.FBUILD_MIN_DISK_BYTESstill lowers the requirement outright for hosts that already hold part of the cache.Verification (real output)
Live probe through the real
HostFreeSpacepath against this host's cache root (throwaway check, not committed):Not done (deliberately)
fbuild cache reclaim(feat(cache): addfbuild cache reclaim— on-demand, ordered cache eviction (#1750 item 3) #1772) still has no trim API to call.Refs #1750.