Repository navigation
fix(ci,channels): restore fbuild + 330KB esp32 size budget (refs #2773) - #2821
Conversation
…2773) The esp32dev_binary_size workflow had been pinned to --backend platformio (PR #2605) and the budget bumped 330000 -> 700000 (PR #2790) to dodge two fbuild deficiencies — fbuild#297 (no build_info.json emitter) and fbuild#304 (framework objects not archived). Both upstream issues are fixed in fbuild 2.2.10+ (we pin 2.2.17), so restore both: - build_template_binary_size.yml: drop the three --backend platformio flags so ci.ci-compile defaults to fbuild and we get .eh_frame stripping back on every size workflow (~169KB on esp32dev). - check_esp32_size.yml: revert max_size/max_size_apa102 to the historical 330000 high-water mark. The test will fail at this ceiling — that is the regression signal the user asked for ("minimal memory size... goal is complete when the esp size test is failing again with its historical high water mark"). Also fix a master-blocking compile error introduced by #2795: the new enum class DriverStatus { DISABLED, ENABLED } in fl/channels/manager.h is textually rewritten by Arduino-ESP32's `#define DISABLED 0x00` (esp32-hal-gpio.h:59) at every site that includes Arduino.h before manager.h — which is every esp32 sketch. The platformio-backend CI is failing for the same reason (`esp32dev_binary_size` red on every push). Rename to STATUS_DISABLED/STATUS_ENABLED and update the four callers in channel.cpp.hpp, manager.cpp.hpp, and tests/fl/channels/channel.cpp. Local verification: fbuild build of examples/Blink on esp32dev succeeds, emits build_info_Blink.json (with tool aliases the symbol_analysis pipeline needs), and ci-check-compiled-size.py reports "esp32dev size 640228 is greater than max size 330000" — the expected regression signal. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
📝 WalkthroughWalkthroughThis PR renames ChangesEnum rename and codebase propagation
CI workflow updates
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 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)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 Infer (1.2.0)tests/fl/channels/channel.cpptests/fl/channels/channel.cpp:5:10: fatal error: 'FastLED.h' file not found ... [truncated 1058 characters] ... stall/lib/clang/18/include" 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 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.github/workflows/build_template_binary_size.yml (1)
44-44: ⚖️ Poor tradeoffMitigate template injection risk in workflow inputs.
Static analysis (zizmor) flags potential code injection via template expansion of
${{ inputs.board }}and${{ inputs.extra_args }}directly inrun:commands. While the current caller (check_esp32_size.yml) uses hardcoded values, the pattern is vulnerable if a future workflow passes user-controlled input (e.g., from PR metadata).🔒 Recommended mitigation using intermediate environment variables
- name: Check Compiled Program Size for ${{ inputs.board }} - run: uv run ci/ci-check-compiled-size.py ${{ inputs.board }} --max-size ${{ inputs.max_size }} --example Blink ${{ inputs.extra_args }} + env: + BOARD: ${{ inputs.board }} + MAX_SIZE: ${{ inputs.max_size }} + EXTRA_ARGS: ${{ inputs.extra_args }} + run: uv run ci/ci-check-compiled-size.py "$BOARD" --max-size "$MAX_SIZE" --example Blink $EXTRA_ARGSApply the same pattern to lines 65 and 87.
Also applies to: 65-65, 87-87
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/build_template_binary_size.yml at line 44, The run step currently expands `${{ inputs.board }}` and `${{ inputs.extra_args }}` directly into the `run:` command which is flagged for template-injection risk; change the step to pass those inputs into environment variables (e.g., BOARD and EXTRA_ARGS) via an `env:` block and reference them in the `run:` command as shell env vars (e.g., `$BOARD` and `$EXTRA_ARGS`) when invoking `ci/ci-check-compiled-size.py`, applying the same env-variable pattern to the other instances mentioned (the steps controlling lines 65 and 87); keep the script name `ci/ci-check-compiled-size.py` and flags (`--max-size`, `--example Blink`) the same but substitute template inputs with the new env vars.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In @.github/workflows/build_template_binary_size.yml:
- Line 44: The run step currently expands `${{ inputs.board }}` and `${{
inputs.extra_args }}` directly into the `run:` command which is flagged for
template-injection risk; change the step to pass those inputs into environment
variables (e.g., BOARD and EXTRA_ARGS) via an `env:` block and reference them in
the `run:` command as shell env vars (e.g., `$BOARD` and `$EXTRA_ARGS`) when
invoking `ci/ci-check-compiled-size.py`, applying the same env-variable pattern
to the other instances mentioned (the steps controlling lines 65 and 87); keep
the script name `ci/ci-check-compiled-size.py` and flags (`--max-size`,
`--example Blink`) the same but substitute template inputs with the new env
vars.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 86139952-cf87-4ae7-9dab-b2a964c6176d
📒 Files selected for processing (6)
.github/workflows/build_template_binary_size.yml.github/workflows/check_esp32_size.ymlsrc/fl/channels/channel.cpp.hppsrc/fl/channels/manager.cpp.hppsrc/fl/channels/manager.htests/fl/channels/channel.cpp
Summary
Per #2773: continue memory hunting / reduction. This restores the two CI changes that were workarounds for now-fixed fbuild issues, so the eh_frame stripping + 330 KB historical high-water mark are both back in force.
--backend platformioflags pinned by ci(size): pin binary-size checks to --backend platformio (unblock master) #2605 (fbuild defaults again, restoring the ~169 KB.eh_framestrip) and revert ci(esp32dev_size): bump max_size 330000 → 700000 to unblock master (Closes #2608) #2790'smax_size 330000 → 700000bump. The size test will now fail at the historical ceiling — which is the regression signal Meta: ESP32-S3 binary-size reduction — Batch 1 (~26 KB) + Batch 2 (~26–50 KB) (supersedes #2771) #2773 wants visible again.enum class DriverStatus { DISABLED, ENABLED }infl/channels/manager.his textually rewritten by Arduino-ESP32's#define DISABLED 0x00(esp32-hal-gpio.h:59) on every sketch that pulls in Arduino.h beforemanager.h— which is every esp32 sketch. Rename toSTATUS_DISABLED/STATUS_ENABLEDand update the 4 callers (channel.cpp.hpp,manager.cpp.hpp,tests/fl/channels/channel.cpp). Master'sesp32dev_binary_sizeis currently red on this on every push.Why fbuild is safe again
build_info_<env>.jsonemitter).o's not archived → ISR pull-in)We pin
fbuild==2.2.17inpyproject.toml, so both fixes ship.Local verification
The fbuild backend emits
build_info_Blink.jsonwith the fullaliasesblock (nm, c++filt, objdump, addr2line, …) thatsymbol_analysis_runner.pyconsumes, so the downstream symbolizer/symbol-analysis steps in the workflow keep working.Test plan
build_info_Blink.jsonlands at the expected path withaliasespopulated.ci-check-compiled-size.py --max-size 330000exits non-zero at 640228 > 330000 (expected red — drives further memory-reduction work in Meta: ESP32-S3 binary-size reduction — Batch 1 (~26 KB) + Batch 2 (~26–50 KB) (supersedes #2771) #2773).bash test channel --cpppasses after the enum rename.esp32dev_binary_sizeCI run on this PR (this PR's own workflow run is the authoritative check that the symbolizer pipeline is intact end-to-end on Ubuntu).*_binary_sizeworkflows (attiny85, teensy*, bluepill) still pass under fbuild + their historical max_size.Refs #2773 (memory hunting / minimal-size invariant), supersedes the platformio-backend pin (#2605) and the 700 KB ceiling bump (#2790) now that the upstream fbuild blockers are closed.
🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
Chores