feat(build): report flash and RAM footprint after a build - #71
Open
srpatcha wants to merge 1 commit into
Open
Conversation
| """ | ||
|
|
||
| import subprocess | ||
| from pathlib import Path |
This was referenced Aug 29, 2026
The MLP developer walk in the platform design document ends with a build that
says how much of the board it used:
Flash: 384 KB
RAM: 72 KB
Ready to flash.
Nothing produced those numbers. A developer had to run `size` themselves and
remember which columns to add, which is not being told — it is being left to
find out.
$ ebuild build
[ok] Build completed successfully.
Flash: 1.9 KB of 1.00 MB (0.2%)
RAM : 300.6 KB of 192.0 KB (156.6%)
[warn] RAM usage 300.6 KB exceeds the board's 192.0 KB -- this image
will not fit.
The accounting matches scripts/measure_footprint.py in the eos repo so the two
tools cannot disagree about what a number means:
flash = text + data
ram = data + bss
`data` is charged to both because it is stored in flash and copied to RAM at
startup; reading `size`'s "dec" column instead understates RAM.
Capacity comes from the project's own board.yaml `memory.flash_size` /
`ram_size` when it ships one — the convention the descriptions under
hardware/board/ already use — and otherwise from a table of the reference part
for each board family. Boards that boot from removable storage, and
Linux-class parts with no fixed budget, are deliberately absent: a percentage
against a guessed ceiling reads as authoritative, so those report absolute
sizes only.
An over-budget image is a warning, not a build failure. It linked; it will not
fit. The developer needs to hear that now rather than from a board that will
not boot.
A cross build is measured with its own `size` and never falls back to the host
one — host `size` on an ARM ELF reports numbers for a different target and
nothing in the output would say so. Where no suitable tool exists the report
is skipped rather than guessed, and never fails the build.
Also fixes .gitignore, found while committing this: line 8 was a bare `build/`
from the Python-packaging block, which also matched `ebuild/build/` — the
source package holding dispatch.py, ninja_backend.py and toolchain.py. Those
four files predate the rule and stayed tracked, but every new module added
there was silently ignored, including this one. Anchored to `/build/`, which
keeps the setuptools artifact directory ignored and stops the pattern reaching
nested source.
235 tests pass, up from 202; 32 are new here.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
srpatcha
force-pushed
the
feat/build-footprint-report
branch
from
August 29, 2026 22:42
cfc3698 to
dc9d0df
Compare
This was referenced Aug 29, 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.
The MLP developer walk in the platform design document ends with a build that says how much of the board it used:
Nothing produced those numbers. A developer had to run
sizethemselves and remember which columns to add — that is not being told, it is being left to find out.Accounting
Matches
scripts/measure_footprint.pyin the eos repo, so the two tools cannot disagree about what a number means:datais charged to both — it is stored in flash and copied to RAM at startup. Readingsize'sdeccolumn instead understates RAM.Where capacity comes from
The project's own
board.yamlmemory.flash_size/ram_sizewhen it ships one — the convention the descriptions underhardware/board/already use — otherwise a table of the reference part per board family.Boards that boot from removable storage, and Linux-class parts with no fixed budget, are deliberately absent. A percentage against a guessed ceiling reads as authoritative; those report absolute sizes only.
Decisions worth reviewing
size. Hostsizeon an ARM ELF reports numbers for a different target and nothing in the output would say so. No tool → no report, rather than a wrong one.Also fixes
.gitignore— found while committing thisLine 8 was a bare
build/from the Python-packaging block. It also matchedebuild/build/, the source package holdingdispatch.py,ninja_backend.pyandtoolchain.py:Those four files predate the rule and stayed tracked, but every new module added there was silently ignored — including this one. Anchored to
/build/, which keeps the setuptools artifact directory ignored and stops the pattern reaching nested source.Verification
pytest: 235 passed, up from 202; 32 are new here. Built and measured three real projects — within budget, over budget, and a board with no known capacity — plus agcc-compiled binary with a known 4 KBbssarray to confirm the section accounting.Branches off the
masterrepair in #70, sincemastercannot currently run its own test suite.🤖 Generated with Claude Code