Repository navigation
feat(bloat): delegate nm + ELF path resolution to fbuild symbols (arm support) - #3225
Conversation
… support) Rewrites ci/bloat.py to drop the hardcoded ESP32-only BOARD_CHIP_MAP gate when an fbuild-native ELF is available. Three concrete changes: 1. **fbuild-native path added**: `.fbuild/build/<board>/release/firmware.elf` is now the first candidate searched (FastLED/fbuild#594 gap 3). The legacy PIO path and the pre-#487 fbuild path remain as fallbacks. 2. **nm auto-resolved via build_info.json**: when the ELF was found in the fbuild-native path, we omit `--nm` and let `fbuild symbols` read `nm_path` from the sibling `build_info_<board>.json` (FastLED/fbuild #428 + #594 gap 1). This makes the shim arch-agnostic — any board fbuild can build (Xtensa, RISC-V, ARM Cortex-M) gets bloat analysis with zero board-specific configuration in this file. 3. **Over-budget retry hook**: a new `--allow-overflow` flag retries the build via `fbuild build --bloat-analysis` (FastLED/fbuild#594 gap 2, pending fbuild PR), so over-budget builds still emit `firmware.elf` for nm-based analysis. Reproduction case from the issue: Before: $ bash bloat lpc845brk Bloat: board 'lpc845brk' has no nm mapping. Add it to BOARD_CHIP_MAP... After (no ELF on disk): $ bash bloat lpc845brk Bloat: no firmware.elf found. Looked at: .fbuild/build/lpc845brk/release/firmware.elf .build/pio/lpc845brk/.pio/build/lpc845brk/firmware.elf .build/lpc845brk/firmware.elf After (ELF on disk, in-budget): emits a per-symbol top-N table. Closes FastLED/fbuild#594 gaps 1 + 3. Gap 2 (over-budget ELF emission) requires the companion fbuild PR adding `fbuild build --bloat-analysis`; this commit's `--allow-overflow` flag invokes it. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthrough
Changesfbuild-native ELF support and overflow retry
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related issues
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
Summary
Rewrites
ci/bloat.pysobash bloat <board>works on ARM Cortex-M (the original gating use case is LPC845, but the change is arch-agnostic). Closes FastLED/fbuild#594 gaps 1 + 3; gap 2 is the companion fbuild PR.Three concrete changes
fbuild-native ELF path added.
.fbuild/build/<board>/release/firmware.elfis now the first candidate searched. The legacy PIO path and the pre-fbuild#487 layout remain as fallbacks.nm auto-resolved via
build_info_<board>.json. When the ELF was found in the fbuild-native path we omit `--nm` and let `fbuild symbols` read `nm_path` from the sibling build_info JSON (fbuild#428). This makes the shim arch-agnostic — any board fbuild can build (Xtensa, RISC-V, ARM) gets bloat analysis with zero board-specific configuration in this file. The hardcoded `BOARD_CHIP_MAP` survives as a legacy-PIO fallback only.Over-budget retry hook. New `--allow-overflow` flag retries the build via `fbuild build --bloat-analysis` (bash bloat / fbuild symbols: no arm-none-eabi path; can't measure LPC845 bloat from FastLED's wrapper fbuild#594 gap 2, pending fbuild PR), so over-budget builds still emit `firmware.elf` for nm-based analysis.
Reproduction from the issue
Before:
```
$ bash bloat lpc845brk
Bloat: board 'lpc845brk' has no nm mapping. Add it to BOARD_CHIP_MAP in
ci/bloat.py — entries are mechanical (arch + chip prefix). Supported
boards today: esp32, esp32c3, esp32c6, esp32h2, esp32s2, esp32s3.
```
After (no ELF on disk):
```
$ bash bloat lpc845brk
Bloat: no firmware.elf found. Looked at:
.fbuild/build/lpc845brk/release/firmware.elf
.build/pio/lpc845brk/.pio/build/lpc845brk/firmware.elf
.build/lpc845brk/firmware.elf
Run `bash compile lpc845brk --examples Blink` first, or pass --build.
```
After (ELF on disk, in-budget): emits a per-symbol top-N table with no further config.
Test plan
🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Chores