Repository navigation
fix(tools): the flash budget gate fails when it cannot see the firmware.bin - #290
Merged
Merged
Conversation
…re.bin
tools/check_flash_budget.py <env> <log> holds the image's firmware.bin,
signed, to the OTA ceiling and to the size recorded for it ("bin"). When
.pio/build/<env>/firmware.bin was not there, it printed a NOTE and exited
0, so a run in a tree whose .pio/build had been cleaned passed without
reading any .bin. Found in the review of S10c D5 (2026-10-23, on the
UI-drivers branch). It did the same when OTA_APP_SAFE_MAX_SIZE could not
be read out of src/ota/ota_layout.h, a condition --table already fails on.
Both are failures now, and the message names what was not checked. An
image under "ota_exempt" (pico_w_test_https) still needs no .bin. CI is
unaffected: its firmware job builds the image and runs the gate in the
same tree. The NOTE said "no firmware.bin next to the log" while the gate
looks under .pio/build/<env>/; the message names that path now.
Reproduction, on pico_w_release's log and .bin built from main at a8ccf4c
(#288, the one PR since, changed only pico_w_test_https):
- with .pio/build/pico_w_release/firmware.bin in place, main's gate and
this one both pass ("firmware.bin signed 1035181 B, 5203 B under the
OTA ceiling");
- with .pio/build cleaned, main's gate prints the NOTE and exits 0; this
one fails and exits 1.
tools/test_flash_budget.py gains five cases that run a copy of the gate
the way CI does, in a temporary tree: no .pio/build fails (A), a .bin of
its recorded size passes (B), one 1 B over its record fails (C), an
exempt image needs no .bin (D), and an ota_layout.h the gate cannot read
fails (E). Against main's gate, A and E fail and B, C and D pass (22 ok,
2 failed); with the fix, 24 ok. The CI gates, run locally in a depth-1
clone (static analysis included; native suites, sanitizers and fuzz
skipped): 36 of 36 steps pass. Host only: nothing here runs on a board.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LyLm7Q1o7kCHngE63BnoTx
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.
What
tools/check_flash_budget.py <env> <log>holds each image'sfirmware.bin, signed, to the OTA ceiling and to the size recorded for it ("bin"). When.pio/build/<env>/firmware.binwas not there, it printed a NOTE and exited 0: a run in a tree whose.pio/buildhad been cleaned passed without reading any.bin. Found in the review of S10c D5 (2026-10-23, on the UI-drivers branch). The same happened whenOTA_APP_SAFE_MAX_SIZEcould not be read out ofsrc/ota/ota_layout.h, which--tablealready treats as a failure.Both are failures now, and the message names what was not checked. An image under
ota_exempt(pico_w_test_https) still needs no.bin. CI is unaffected: its firmware job builds the image and runs the gate in the same tree (.github/workflows/build.yml, "Build" then "Check flash budget"). The old NOTE said "no firmware.bin next to the log", while the gate looks under.pio/build/<env>/; the message names that path now.Proof
Reproduction on real data:
pico_w_release's build log and.binfrom main at a8ccf4c (#288, the one PR since, changed onlypico_w_test_https)..pio/build/pico_w_release/firmware.binNew cases in
tools/test_flash_budget.py. They run a copy of the gate the way CI does (the env and its log), in a temporary tree:.pio/build.binof its recorded size.bin1 B over its record.binota_layout.hthe gate cannot readAgainst main's gate the suite gives 22 ok and 2 failed (A and E); with the fix, 24 ok.
CI gates run locally in a depth-1 clone, the way CI checks out: 36 of 36 steps pass, static analysis included (quick mode: native suites, sanitizers and fuzz skipped).
check_flash_budget.py --tablepasses (9 images, 1 exempt).Host only: no image changes, nothing here runs on a board.
🤖 Generated with Claude Code
https://claude.ai/code/session_01LyLm7Q1o7kCHngE63BnoTx