Repository navigation
fix(bloat): force ELF delete before each measure-opt-ins compile - #2941
Conversation
Closes #2940. PIO's link step decides whether to relink based on object-file timestamps, NOT on platformio.ini / sdkconfig changes. When the script switched configs that affected only the sdkconfig (e.g. stage3 → baseline), the previous config's ELF stayed on disk and the downstream `bash bloat` step measured it. Smoke test before this fix (after a prior stage3 run left an overlay-built ELF on disk): uv run python tests/measure_esp32s3_opt_ins.py --config baseline → baseline reported 280,738 B # WRONG — that's stage3's number Smoke test after this fix (same starting state): uv run python tests/measure_esp32s3_opt_ins.py --config baseline → baseline reported 339,962 B # CORRECT — matches the pinned tests/data/esp32s3_bloat_baseline.txt The fix: a tiny `_force_relink()` helper deletes `.build/pio/esp32s3/.pio/build/esp32s3/firmware.elf` (if present) before each compile. Object cache stays intact for speed; only the link step is forced. ## Files - tests/measure_esp32s3_opt_ins.py: - New `_ELF_PATH` constant. - New `_force_relink()` helper. - `measure_one()` calls it after patching platformio.ini, before running compile. ## Verification - `bash lint` -> all linters pass (ruff, ty, C++, JS setup). - Smoke test produces 339,962 B for baseline — matching pinned. Refs #2886, #2940, #2939, #2935.
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe PR modifies the ESP32-S3 measurement script to fix a stale-ELF bug: when switching between OptInConfigs that share object files, PlatformIO's link step may skip relinking if timestamps unchanged. The fix adds a constant locating the firmware ELF, a ChangesELF Deletion and Relinking
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related issues
Possibly related PRs
Poem
✨ 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 |
Closes #2940. Forces PIO relink between configs by deleting the prior ELF; the cached objects still make rebuild fast. Smoke test before fix: baseline reported stage3's 280,738 B (stale). After fix: 339,962 B (correct). Refs #2886.
Summary by CodeRabbit