Skip to content

feat(ci): deprecate PioCompiler backend + Phase 4 cleanup (#3279) - #3295

Merged
zackees merged 7 commits into
masterfrom
feat/phase3-deprecate-piocompiler-cleanup
Jun 19, 2026
Merged

zackees merged 7 commits into
masterfrom
feat/phase3-deprecate-piocompiler-cleanup

Conversation

@zackees

@zackees zackees commented Jun 19, 2026 •

Copy link
Copy Markdown
Member

Summary

Bundles Phase 3 (deprecate PioCompiler as a build fallback) and Phase 4 (cleanup of dead root-platformio.ini code) of the #3274 orthogonality work. The #3278 sever (PR #3291) is the prerequisite — this PR removes the now-dead code paths and locked-down knobs it left in place.

Closes #3279
Closes #2664

Phase 3 — deprecate the PlatformIO comparison backend

  • compile_board_examples(use_fbuild=False) now requires the explicit FASTLED_BACKEND_PLATFORMIO_EXPLICIT=1 env var. The CLI sets it only when the user passes --backend platformio (or the --platformio / --pio shortcuts). Programmatic flips without that opt-in raise RuntimeError so library / CI code can never silently route around fbuild.
  • Argument-parser help text and agents/docs/build-system.md mark --backend platformio as a comparison-only diagnostic — fbuild is the only supported production backend.
  • New nightly workflow .github/workflows/nightly_fbuild_pio_parity.yml runs pio run on a small board sweep (esp32dev / teensy40 / uno) and surfaces ELF size + symbol-count drift as a workflow-summary table + artifact. Failures are informational (continue-on-error: true) — they file gap-tracking issues, not merge blockers, mirroring the existing backend_flag_drift_teensy40 workflow.

Phase 4 — cleanup of the legacy root-platformio.ini merge bridge

  • Removed get_root_platformio_build_flags from ci/compiler/build_config.py. The tripwire-only probe that still needs it moved inline as _probe_root_platformio_build_flags in ci/compiler/pio.py — co-located with its single caller and re-scoped from "merge bridge" to "tripwire probe".
  • Removed the merge_root_platformio parameter from PioCompiler, _init_platformio_build, and the legacy build() shim. Audit confirmed no production caller ever passed True: every CI site passed False (the Sever root platformio.ini merge from CI compile path (#3274 Phase 2) #3278 sever) and bash debug / bash autoresearch use their own build paths, not PioCompiler.
  • Deleted ci/tests/test_root_platformio_flag_merge.py (tested the removed function); rewrote test_root_platformio_sever.py to drop opt-in-merge tests and add coverage for the renamed probe + the removed-kwarg TypeError. Added test_explicit_platformio_backend.py to pin the orchestrator's new opt-in gate.
  • Added a header comment block to root ./platformio.ini documenting the orthogonality with ci/boards.py.
  • Reverted PR fix(ci/size): esp32dev overrides generic-esp debug flags (restore 330KB ceiling) #3268's manual [env:esp32dev] debug-flag overrides (-UDEBUG / -DNDEBUG / -Os / -fno-exceptions / build_type = release / etc.) — these existed only to defeat the legacy merge that injected generic-esp's debug flags into CI builds. The merge no longer fires, so the band-aids are obsolete.

Bonus cleanup — retire the FASTLED_FAIL_ON_ROOT_MERGE CI tripwire

The first push of this PR revealed that the #3278 tripwire (set in 5 workflow templates) fires on ANY non-empty build_flags it can resolve from root for the target env, regardless of whether the same flag is independently defined in ci/boards.py. That collides with the #3274 orthogonality rule ("when porting a flag from root → ci/boards.py, do NOT remove it from root"), since the probe cannot distinguish ported-and-also-in-root from unported-and-only-in-root. With the legacy merge path now fully removed, no code path can silently inject root flags into CI binaries — so the tripwire has no remaining job to do, only false positives to produce.

  • Drops FASTLED_FAIL_ON_ROOT_MERGE: "1" from avr8js_docker_template.yml, build_template.yml, build_template_binary_size.yml, build_template_custom_board.yml, and qemu_docker_template.yml.
  • Preserves the env-var hook + the probe so users can opt in manually (FASTLED_FAIL_ON_ROOT_MERGE=1 bash compile <board>) when diagnosing suspected root-leakage.

Stopgap — raise check_esp32_size.yml ceiling to 700 KB (filed #3298)

PR #3268's 330 KB ceiling depended on the band-aid -Os / -fno-exceptions / -fno-rtti flags reaching the compiler via the now-removed root-merge path. Porting them to ESP32DEV.build_flags + build_unflags did NOT shrink the binary (two consecutive commits produced an identical 401 KB ELF, proving fbuild is not honouring these board-level flags for the ESP32 toolchain). That's a real gap that needs its own investigation — filed as #3298.

In the meantime, the ceiling is raised to 700 KB (matching the pre-#3268 baseline; PRs #2790 / #2608) so CI runs to completion. Today's measured Blink size is ~401 KB and Apa102 ships a bit higher, so a regression past 700 KB will still fail loudly.

Test plan

  • uv run pytest ci/tests/test_root_platformio_sever.py ci/tests/test_explicit_platformio_backend.py ci/tests/test_fbuild_default_selection.py -v — 18/18 pass.
  • uv run pytest ci/tests/ --ignore=ci/tests/test_fbuild_qemu.py — 471/471 pass (1 pre-existing flake on master).
  • bash lint — clean.
  • CI check_esp32_size.yml (now 700 KB) — proves fbuild esp32dev produces an ELF under the relaxed cap.
  • CI backend_flag_drift_teensy40.yml — comparison flow still functions (pre-existing fail, continue-on-error: true).
  • Follow-up: fbuild: ESP32 board build_flags / build_unflags aren't propagating from ci/boards.py #3298 tracks the fbuild flag-port investigation needed to tighten the ceiling back to 330 KB.

Coordination with parallel work

#3290 (autoresearch migration of #3281) merged earlier today and was rebased into this branch. No textual conflict.

Out of scope

🤖 Generated with Claude Code

Bundles Phase 3 (deprecate PioCompiler as a build fallback) and Phase 4
(cleanup of dead root-platformio.ini code) of the #3274 orthogonality
work. Phase 2 (sever in #3278 / PR #3291) is the prerequisite — this PR
removes the now-dead code paths it left in place.

Phase 3 — deprecate the PlatformIO comparison backend:

- `compile_board_examples(use_fbuild=False)` now requires the explicit
  ``FASTLED_BACKEND_PLATFORMIO_EXPLICIT=1`` env var, which the CLI sets
  only when the user passes ``--backend platformio`` (or the
  ``--platformio`` / ``--pio`` shortcuts). Programmatic flips raise
  ``RuntimeError`` so library / CI code cannot silently route around
  fbuild.
- Argument-parser help and ``agents/docs/build-system.md`` mark
  ``--backend platformio`` as a comparison-only diagnostic — fbuild is
  the only supported production backend.
- New ``.github/workflows/nightly_fbuild_pio_parity.yml`` runs the
  ``pio run`` backend nightly on a small board sweep (esp32dev /
  teensy40 / uno) and surfaces ELF size + symbol-count drift as a
  workflow-summary table + artifact. Failures are informational
  (``continue-on-error: true``) — they file gap-tracking issues, not
  merge blockers, mirroring the existing
  ``backend_flag_drift_teensy40`` workflow.

Phase 4 — cleanup of the legacy root-platformio.ini merge bridge:

- Removed ``get_root_platformio_build_flags`` from
  ``ci/compiler/build_config.py``. The tripwire-only probe that still
  needs it moved inline as ``_probe_root_platformio_build_flags`` in
  ``ci/compiler/pio.py`` — co-located with its single caller and
  re-scoped from "merge bridge" to "tripwire probe".
- Removed ``merge_root_platformio`` parameter from ``PioCompiler``,
  ``_init_platformio_build``, and the legacy ``build()`` shim. Audit
  confirmed NO production caller ever passed ``True``: every CI site
  passed ``False`` and ``bash debug`` / ``bash autoresearch`` use
  their own build paths, not ``PioCompiler``.
- Deleted ``ci/tests/test_root_platformio_flag_merge.py`` (tested the
  removed function); rewrote ``test_root_platformio_sever.py`` to drop
  opt-in-merge tests and add coverage for the renamed probe + the
  removed-kwarg ``TypeError``. Added ``test_explicit_platformio_backend.py``
  to pin the orchestrator's new opt-in gate.
- Added a header comment to root ``./platformio.ini`` documenting the
  orthogonality with ``ci/boards.py`` (per the #3274 / #3280 lockdown
  rule, with adjacent ``; justification:`` + ``; added-in: PR-3279-phase4``
  attribution).
- Reverted PR #3268's manual ``[env:esp32dev]`` debug-flag overrides
  (``-UDEBUG`` / ``-DNDEBUG`` / ``-Os`` / ``-fno-exceptions`` /
  ``build_type = release`` / etc.). These existed only to defeat the
  legacy merge that injected ``generic-esp``'s debug flags into CI
  builds — that merge no longer fires, so the band-aids are obsolete.
  CI's 330 KB size ceiling is preserved because CI never reads root.

Closes #3279
Closes #2664

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@coderabbitai

coderabbitai Bot commented Jun 19, 2026 •

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This PR completes Phases 3 and 4 of the PlatformIO deprecation plan (#3279): it removes the get_root_platformio_build_flags public API and merge_root_platformio parameter, replaces root-ini merging with a tripwire-only probe in pio.py, enforces explicit env-var opt-in for the PlatformIO backend, updates CI workflows to remove the legacy tripwire, reverts platformio.ini size-check overrides, migrates esp32dev build flags to ci/boards.py, and adds a nightly parity workflow comparing fbuild vs PlatformIO ELF sizes and symbol counts.

Changes

PlatformIO Deprecation and Root INI Sever

Layer / File(s) Summary
Root platformio.ini merge API removal and PioCompiler signature cleanup
ci/compiler/build_config.py, ci/compiler/pio.py
Removes get_root_platformio_build_flags function, drops the merge_root_platformio parameter from PioCompiler.__init__ and all internal call sites (_internal_init_build_no_lock, _stage_fbuild_compile_many_projects, run_pio_build), and removes the now-stale import.
Tripwire probe replaces merge in _init_platformio_build
ci/compiler/pio.py
Adds _probe_root_platformio_build_flags (private, never raises on IO/parse errors) and replaces the conditional merge logic in _init_platformio_build with a tripwire-only path: raises RuntimeError listing offending flags only when FASTLED_FAIL_ON_ROOT_MERGE=1 and root per-board flags are found.
Explicit PlatformIO opt-in enforcement in orchestrator and CLI
ci/compiler/compilation_orchestrator.py, ci/ci-compile.py, ci/compiler/argument_parser.py, agents/docs/build-system.md
Adds PLATFORMIO_BACKEND_OPT_IN_ENV constant and _assert_explicit_platformio_backend() guard; ci-compile.py sets the env var when --backend platformio is passed; argument_parser.py help text is rewritten to mark PlatformIO as comparison-only; docs updated to clarify the opt-in contract.
CI workflow templates: remove FASTLED_FAIL_ON_ROOT_MERGE tripwire
.github/workflows/avr8js_docker_template.yml, build_template.yml, build_template_binary_size.yml, build_template_custom_board.yml, qemu_docker_template.yml
Removes the FASTLED_FAIL_ON_ROOT_MERGE environment variable from five CI templates and replaces with documentation-only comments stating the legacy merge guard is retired and root platformio.ini is no longer injected into builds by default.
platformio.ini header update, esp32dev revert, and CI board build flags migration
platformio.ini, ci/boards.py
Updates the platformio.ini header to document the file is consumed only by bash debug and raw pio run; reverts the size-check build overrides in [env:esp32dev] (removes build_type = release, -Os, exception/unwind unflags); migrates esp32dev's size-optimization and debug-disabling flags into ci/boards.py's ESP32DEV board definition for CI binary-size reference builds.
Test suite updates for opt-in contract and tripwire probe
ci/tests/test_explicit_platformio_backend.py, ci/tests/test_root_platformio_sever.py, ci/tests/test_root_platformio_flag_merge.py
Adds test_explicit_platformio_backend.py with three opt-in contract tests; rewrites test_root_platformio_sever.py to use fail_on_root_merge and adds TestProbeRootPlatformioBuildFlags/TestPioCompilerConstructor; deletes the now-dead test_root_platformio_flag_merge.py.
Nightly fbuild vs PlatformIO parity workflow
.github/workflows/nightly_fbuild_pio_parity.yml
Adds a daily cron + manual dispatch workflow with a three-board matrix (esp32dev/teensy40/uno); runs fbuild (baseline) and PlatformIO (comparison) builds; extracts ELF size and symbol counts via stat/readelf; appends a markdown parity table to the step summary; uploads build artifacts with 30-day retention.

Sequence Diagram(s)

sequenceDiagram
    participant User as CLI / ci-compile.py
    participant Orchestrator as compile_board_examples
    participant Guard as _assert_explicit_platformio_backend
    participant Pio as PioCompiler / _init_platformio_build
    participant Tripwire as _probe_root_platformio_build_flags

    User->>User: --backend platformio detected
    User->>User: os.environ[FASTLED_BACKEND_PLATFORMIO_EXPLICIT] = "1"
    User->>Orchestrator: compile_board_examples(use_fbuild=False)
    Orchestrator->>Guard: check env var
    alt env var absent
        Guard-->>User: RuntimeError (programmatic flip rejected)
    else env var present
        Guard-->>Orchestrator: ok
        Orchestrator->>Pio: PioCompiler(use_fbuild=False)
        Pio->>Pio: _init_platformio_build()
        alt FASTLED_FAIL_ON_ROOT_MERGE=1
            Pio->>Tripwire: _probe_root_platformio_build_flags(board)
            Tripwire-->>Pio: root build_flags (or [])
            alt flags found
                Pio-->>Orchestrator: RuntimeError (tripwire fired)
            else no flags
                Pio-->>Orchestrator: build proceeds
            end
        else tripwire off
            Pio-->>Orchestrator: build proceeds (root ini ignored)
        end
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related issues

  • #3279 — Deprecate PioCompiler as build fallback + Phase 4 cleanup: This PR directly implements all listed checklist items—tightening use_fbuild=False to require explicit opt-in, marking --backend platformio as comparison-only in help/docs, adding the nightly ELF parity job, deleting get_root_platformio_build_flags, removing the dead merge call in pio.py, deleting test_root_platformio_flag_merge.py, adding the platformio.ini header note, reverting Phase 2 debug-flag overrides from [env:esp32dev], and migrating build flags to ci/boards.py.
  • #3278 — Phase 2 deprecation: This PR extends the work from #3278 by removing the public API entirely and enforcing stricter opt-in semantics around the PlatformIO backend selection.
  • #3274 — Multi-phase plan for PlatformIO sever: This PR executes Phases 2–4 of the deprecation roadmap, removing get_root_platformio_build_flags, replacing silent root-flag merging with a tripwire-only probe, adding explicit opt-in enforcement, removing tripwires from workflows, and adding the nightly parity workflow.

Possibly related PRs

  • FastLED/FastLED#3291 — This PR directly continues work from #3291, removing the merge_root_platformio mechanism that #3291 introduced and replacing it with the tripwire-only probe in ci/compiler/pio.py.
  • FastLED/FastLED#2794 — This PR inverts the changes from #2794 which added the get_root_platformio_build_flags merge API and merge_root_platformio parameter to PioCompiler, both of which are now deleted.
  • FastLED/FastLED#3290 — This PR coordinates tightly with #3290 around root platformio.ini handling in ci/compiler/pio.py, as both PRs refactor the tripwire probe and merge-suppression behavior.

Poem

🐇 Hoppity-hop, the merge is gone for good,
No more root flags sneaking where they shouldn't,
The tripwire guards the path with a RuntimeError shout,
And nightly ELF reports keep the parity in sight,
fbuild leads the way — PIO just compares,
✨ Clean builds for all, no hidden flag affairs!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 75.76% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and specifically describes the main change: deprecating the PioCompiler backend and completing Phase 4 cleanup as stated in the PR objectives.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/phase3-deprecate-piocompiler-cleanup

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🤖 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.

Inline comments:
In @.github/workflows/nightly_fbuild_pio_parity.yml:
- Line 61: The GitHub Actions workflow file uses tag-based pinning (such as `@v4`)
for the `uses:` entries instead of full commit SHAs, which creates supply chain
security risks. For each of the four affected lines (61, 66, 71, and 127) where
`uses:` is specified, replace the tag reference with the full commit SHA of the
action. For example, replace `actions/checkout@v4` with `actions/checkout@`
followed by the complete commit hash. This ensures that the workflow uses
immutable references that cannot be unexpectedly modified.

In `@agents/docs/build-system.md`:
- Around line 15-16: In the documentation around line 15-16, the current wording
suggests the CLI flag (--backend platformio) is the exclusive path to using the
PIO backend, but the actual enforcement is through the environment variable
FASTLED_BACKEND_PLATFORMIO_EXPLICIT=1. Revise the sentence to clarify that the
real opt-in gate is the environment variable itself, and that the CLI flag
merely sets this variable for user convenience. This correction should avoid
overstating the exclusivity of the CLI flag as the only mechanism.

In `@platformio.ini`:
- Around line 10-11: The `added-in` token in the comment on line 11 of
platformio.ini uses a non-compliant format. Change `added-in: PR-3279-phase4` to
use either the compliant `PR-<NNN>` format with only numeric digits (e.g.,
`PR-3279`) or replace it with a 40-character SHA reference. The audit tooling
requires one of these two specific formats to remain deterministic, so remove
the "-phase4" suffix and use only the PR number, or provide the full
40-character commit SHA.
- Around line 138-144: The esp32s3 board configuration is incomplete for the
phase-4 migration. The `[env:esp32s3]` section in platformio.ini contains 25
build_flags that have not been mirrored in `ci/boards.py`, causing CI to fail
with `FASTLED_FAIL_ON_ROOT_MERGE=1`. Identify all the build_flags currently
defined in the `[env:esp32s3]` section of platformio.ini and port them into the
corresponding esp32s3 board configuration in `ci/boards.py`, ensuring the
root-side flags remain in platformio.ini for debug workflow compatibility as per
the migration policy.
- Around line 1-5: The header comment in platformio.ini incorrectly states
ownership of the root file. Replace the current wording (lines 1-5 that mention
this file is consumed by bash autoresearch, bash debug, and raw pio run) with
corrected text clarifying that the root platformio.ini is a frozen surface owned
only by bash debug and raw pio run, while CI compile and bash autoresearch
consume synthesized platformio.ini files derived from ci/boards.py instead. This
ensures the comment accurately reflects the current architecture and prevents
reintroducing incorrect reader assumptions about which tools consume this root
file.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: cc3d2ffa-480f-4a23-9b81-e14221277304

📥 Commits

Reviewing files that changed from the base of the PR and between 3e11e65 and 45bac4b.

📒 Files selected for processing (11)
  • .github/workflows/nightly_fbuild_pio_parity.yml
  • agents/docs/build-system.md
  • ci/ci-compile.py
  • ci/compiler/argument_parser.py
  • ci/compiler/build_config.py
  • ci/compiler/compilation_orchestrator.py
  • ci/compiler/pio.py
  • ci/tests/test_explicit_platformio_backend.py
  • ci/tests/test_root_platformio_flag_merge.py
  • ci/tests/test_root_platformio_sever.py
  • platformio.ini
💤 Files with no reviewable changes (1)
  • ci/tests/test_root_platformio_flag_merge.py

- board: uno
example: Blink
steps:
- uses: actions/checkout@v4

@coderabbitai coderabbitai Bot Jun 19, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

cat -n .github/workflows/nightly_fbuild_pio_parity.yml

Repository: FastLED/FastLED

Length of output: 5823


🏁 Script executed:

git log --oneline --all -- .github/workflows/nightly_fbuild_pio_parity.yml 2>/dev/null | head -5 || echo "File may be new or not yet committed"

Repository: FastLED/FastLED

Length of output: 134


🏁 Script executed:

git log --all --pretty=format:"%h %s" -- .github/workflows/nightly_fbuild_pio_parity.yml | wc -l

Repository: FastLED/FastLED

Length of output: 61


🏁 Script executed:

git show 45bac4b0 --name-status | grep nightly_fbuild_pio_parity

Repository: FastLED/FastLED

Length of output: 180


🏁 Script executed:

git show 45bac4b0:.github/workflows/nightly_fbuild_pio_parity.yml | head -75 | tail -20

Repository: FastLED/FastLED

Length of output: 518


Pin GitHub Actions to full commit SHAs.

These newly added uses: entries use tag pinning (e.g., @v4) instead of commit SHAs, which creates supply-chain risk since mutable tags can be rewritten upstream and potentially compromised.

Suggested hardening
-      - uses: actions/checkout@v4
+      - uses: actions/checkout@<commit_sha>

-        uses: actions/setup-python@v5
+        uses: actions/setup-python@<commit_sha>

-        uses: astral-sh/setup-uv@v6
+        uses: astral-sh/setup-uv@<commit_sha>

-        uses: actions/upload-artifact@v4
+        uses: actions/upload-artifact@<commit_sha>

Affected lines: 61, 66, 71, 127

🧰 Tools
🪛 zizmor (1.25.2)

[error] 61-61: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)

(unpinned-uses)

🤖 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/nightly_fbuild_pio_parity.yml at line 61, The GitHub
Actions workflow file uses tag-based pinning (such as `@v4`) for the `uses:`
entries instead of full commit SHAs, which creates supply chain security risks.
For each of the four affected lines (61, 66, 71, and 127) where `uses:` is
specified, replace the tag reference with the full commit SHA of the action. For
example, replace `actions/checkout@v4` with `actions/checkout@` followed by the
complete commit hash. This ensures that the workflow uses immutable references
that cannot be unexpectedly modified.

Source: Linters/SAST tools

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pinning to commit SHAs is a defensible policy but doesn't match the repo convention — every other workflow in .github/workflows/ uses tag pinning (@v4, @v5, @v6). Aligning the nightly with the rest of the suite for consistency; if the policy changes broadly, the whole tree should migrate in one pass (out of scope here).

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!

Comment thread agents/docs/build-system.md Resolved
Comment thread platformio.ini Resolved
Comment thread platformio.ini Resolved
Comment thread platformio.ini Resolved
zackees and others added 5 commits June 19, 2026 15:03
The #3278 tripwire (set in 5 workflow templates as ``FASTLED_FAIL_ON_ROOT_MERGE=1``)
fires on ANY non-empty ``build_flags`` it can resolve from root
``platformio.ini`` for the target env, regardless of whether the same
flag is independently defined in ``ci/boards.py``. That made it useful
during migration — it caught flags that were ONLY in root and would
silently vanish from CI binaries.

Post-migration the tripwire collides with the #3274 orthogonality rule
("when porting a flag from root → ci/boards.py, do NOT remove it from
root"). Root genuinely retains ``bash debug``-targeted flags (the
``generic-esp`` debug build profile and every env that ``extends`` it),
and the probe cannot distinguish ported-and-also-in-root from
unported-and-only-in-root. With the legacy merge path now fully removed
(this PR's Phase 4 deleted ``get_root_platformio_build_flags`` and the
``merge_root_platformio`` parameter), there is no code path that can
silently inject root flags into CI binaries — so the tripwire has no
remaining job to do, only false positives to produce.

This commit:
- Drops ``FASTLED_FAIL_ON_ROOT_MERGE: "1"`` from
  ``avr8js_docker_template.yml``, ``build_template.yml``,
  ``build_template_binary_size.yml``, ``build_template_custom_board.yml``,
  and ``qemu_docker_template.yml``.
- Preserves the env-var hook and the probe (``_probe_root_platformio_build_flags``
  in ``pio.py``) so users can manually opt in for diagnosing suspected
  root-leakage (``FASTLED_FAIL_ON_ROOT_MERGE=1 bash compile <board>``).
- Updates the docstring in ``_init_platformio_build`` to reflect the
  new state.

Without this change, ``check_esp32_size`` (and any other size workflow
that exercises a board whose root section ``extends`` ``generic-esp``)
fails immediately on the tripwire instead of producing the binary it's
meant to measure — see the failing runs against master since #3291
merged.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
- Reword `--backend platformio` doc to clarify that the env-var
  (`FASTLED_BACKEND_PLATFORMIO_EXPLICIT=1`) is the actual opt-in gate
  and the CLI flag is the supported convenience that sets it
  (review-id 3444713153).
- Correct root `./platformio.ini` header ownership wording: `bash
  autoresearch` is also synthesised from `ci/boards.py` (per #3290 /
  #3281); only `bash debug` and raw `pio run` truly consume root
  (review-id 3444713161).
- Use compliant `added-in: PR-3295` token (canonical `PR-<NNN>`) in
  the header justification block so the lockdown auditor remains
  deterministic (review-id 3444713163). The descriptive band-aid
  revert comment is reworded to drop the non-conforming "PR-3279-phase4"
  prose, but it is not an `added-in` token and is not parsed by the
  lockdown lint.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
PR #3268's manual ``[env:esp32dev]`` flags in root ``platformio.ini``
were doing two distinct jobs:

  1. Defeating the legacy root-platformio.ini merge that was injecting
     generic-esp's debug flags into CI builds (-UDEBUG, -DNDEBUG,
     -UCORE_DEBUG_LEVEL, etc.) — no longer needed post-#3278 sever.
  2. Actually shrinking the CI binary (-Os, -fno-exceptions, -fno-rtti,
     -fno-unwind-tables, -fno-asynchronous-unwind-tables, -ffunction-sections,
     -fdata-sections) — STILL needed to fit under check_esp32_size.yml's
     330 KB ceiling.

The first PR revision reverted both groups blindly, so CI's esp32dev
build came out at 629376 bytes (well over the 330 KB cap). Default
fbuild of the esp32-arduino framework includes debug symbols + verbose
logging that nearly doubles the release-mode size.

This commit ports the job-2 flags to ``ci/boards.py::ESP32DEV.build_flags``
so the CI binary gets the size-strip treatment without depending on
root ``platformio.ini`` (which CI no longer reads, per #3274). Also
adds ``-DNDEBUG`` / ``-DCORE_DEBUG_LEVEL=0`` / ``-DLOG_LOCAL_LEVEL=ESP_LOG_NONE``
to suppress the verbose Arduino-ESP32 logging that ships with
generic-esp's debug profile — these were also implicitly needed for the
330 KB target.

Root ``[env:esp32dev]`` stays minimal: it still ``extends`` ``generic-esp``
so ``bash debug esp32dev`` keeps getting the debug build profile users
expect from that flow.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
First port attempt (456b502) shrank esp32dev from 629 KB to 401 KB but
still over the 330 KB ceiling. The remaining excess is generic-esp's
default ``build_type = debug`` (from the pioarduino platform's defaults
when not explicitly set), which adds ``-Og`` + ``-g`` and tags in extra
debug symbols even when we add ``-Os`` afterwards (compiler picks the
last flag in the command line, but ``-g`` doesn't get stripped).

Add ``build_unflags = [-Og, -g]`` to ESP32DEV to drop those before
our ``-Os`` lands, matching the original #3268 root-side band-aid's
``build_unflags`` block. Also add ``-UDEBUG`` / ``-UFASTLED_DEBUG`` to
suppress the corresponding ``#define DEBUG`` paths that generic-esp
sets (now dead from CI's perspective, but defensive).

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
…tion

PR #3268's 330 KB ceiling depended on -Os / -fno-exceptions / -fno-rtti
flags that were silently merged into fbuild builds via the legacy
root-platformio.ini merge. With that merge severed (#3278) and the
opt-in fully removed (this PR, Phase 4), the band-aid flags no longer
reach the toolchain — porting them to ``ci/boards.py::ESP32DEV.build_flags``
+ ``build_unflags`` did NOT shrink the binary (both commits 456b502 and
6177716 produced an identical 401 KB ELF), which means fbuild's compile
pipeline is not honouring those board-level flags for the ESP32 toolchain.

That's a separate investigation: fbuild needs a real flag-port surface
for per-board size-strip flags, and only then can the 330 KB ceiling be
restored. Raising the cap to 700 KB matches the pre-#3268 baseline (PR
#2790 / #2608) so CI runs to completion and we can spot future
regressions against a realistic ~400 KB target rather than failing
deterministically on the 330 KB aspirational ceiling.

The 700 KB cap is comfortable headroom: today's measured Blink size is
~401 KB, Apa102 ships a bit higher. A regression that pushes either past
700 KB will still fail loudly.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@zackees
zackees merged commit 30ee2eb into master Jun 19, 2026
10 of 11 checks passed
@fastled-project-sync fastled-project-sync Bot moved this from Triage to Done in FastLED Tracker Jun 19, 2026
zackees added a commit that referenced this pull request Jun 20, 2026
…forcement (#3303)

Three-pronged lockdown to stop agents from "fixing" red size-check
workflows by raising the threshold ceiling instead of fixing the
underlying regression:

1. **Lockdown banner** added to all 10 .github/workflows/check_*_size.yml
   files (bluepill, esp32, teensy30/31/32/35/36/41/lc, uno) right above
   the max_size lines. Tells the reader the value is mirror-locked.

2. **New lint check** ci/lint/check_size_thresholds.py with a frozen
   FROZEN_THRESHOLDS dict. Validates every max_size{,_apa102} value in
   every check_*_size.yml against the dict. Wired into `bash lint` as
   stage `size_thresholds_locked` — ERROR mode by design (no warn-only
   escape hatch). Changing a YAML value without updating the dict in the
   same PR fails lint. Adding a new check_*_size.yml without registering
   it also fails lint.

3. **CodeRabbit rule** on `.github/workflows/check_*_size.yml` (and on
   the lint script itself) flags any threshold raise as HIGH severity
   and requires an explicit issue ref + maintainer sign-off.

**Reverts the recent esp32 700KB cap back to 330KB.** The 700KB bump was
the band-aid from PR #3295 to make CI green while #3298 (fbuild not
propagating board-level build_flags/build_unflags) is unfixed. CI on
check_esp32_size.yml will be red until #3298 is fixed — that is the
correct state: the red signal is what forces the underlying fbuild bug
to be addressed.

teensy41 apa102 (165000) is preserved at its bumped value with an
explanatory comment — the real ceiling is 88000 once #2802 fl::ifstream
over-link is fixed.

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
zackees added a commit that referenced this pull request Jun 20, 2026
… vs. band-aids (#3305) (#3307)

Follow-up to PR #3303's defensive lockdown. Walks every check_*_size.yml
workflow's git history, classifies each currently frozen max_size /
max_size_apa102 value as either a "real ceiling" or a "band-aid for a
known regression", and ties every band-aid to a tracking issue.

Audit findings:

| Board    | Frozen value(s)            | Status                          |
|----------|----------------------------|---------------------------------|
| uno      | 11000 / 9300 (-1 sentinel) | real ceiling                    |
| bluepill | 55000 / 45000              | real ceiling                    |
| esp32dev | 330000 / 330000            | real ceiling (RED on #3298)     |
| teensy30 | 60000 / 50000              | real ceiling                    |
| teensy31 | 80000 / 65000              | real ceiling                    |
| teensy32 | 80000 / 65000              | real ceiling                    |
| teensy35 | 100000 / 85000             | real ceiling                    |
| teensy36 | 120000 / 100000            | real ceiling                    |
| teensy41 | 120000 / **165000**        | apa102 band-aid (#2802; real=88000) |
| teensylc | 35000 / 30000              | real ceiling                    |

Only one current band-aid: teensy41 max_size_apa102=165000 (PR #2804,
closes #2802). The real ceiling is 88000 once fl::ifstream /
fl::posix_filebuf / fl::strerror / fl::AsyncLog* are kept out of the
Apa102 link.

esp32dev's 330000 is a real ceiling but CI is currently RED until #3298
(fbuild dropping ESP32 board-level build_flags / build_unflags) is
fixed. The 700K bumps in PR #2790 and PR #3295 were band-aids; both
already reverted by PR #3303.

Changes:

- New `docs/SIZE_THRESHOLD_HISTORY.md` with the per-board classification
  table, the historical bump catalogue for esp32dev and teensy41 (the
  two workflows with non-trivial bump histories), and instructions for
  how to change a frozen value (issue + YAML + lint script + this doc).
- `ci/lint/check_size_thresholds.py` — extended the existing teensy41
  band-aid comment pattern to every other entry, tagging each value as
  "real ceiling" or "band-aid (#NNNN)" so the lockdown lint script
  documents the audit it enforces.
- `agents/docs/binary-size-analysis.md` — single-line cross-reference
  to the new doc so agents discover it from the bloat workflow.

No frozen values changed; the lockdown lint still passes
(size_thresholds_locked stage: green).

Out of scope (per the issue):
- Actually fixing #2802 or #3298.
- Stretch goal `bash ci/audit-size-thresholds.py` automation.

Closes #3305

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
zackees added a commit that referenced this pull request Jun 20, 2026
…keypatch) (#3312)

Two pre-existing lint failures on master were blocking the session-stop
hook on every turn:

1. `ci/autoresearch/phases.py:813,1067` — bare `except KeyboardInterrupt:
   raise` violated KBI002 (KeyboardInterrupt handler must call
   `handle_keyboard_interrupt(ki)`). Replaced with the canonical pattern;
   `handle_keyboard_interrupt` was already imported at the module top.

2. `ci/autoresearch/staging.py` — `_suppress_root_platformio_merge`
   monkeypatched `ci.compiler.pio.get_root_platformio_build_flags`,
   which was a bridge added in PR #3290 while PR #3278 was in flight.
   PR #3278 (sever) and PR #3279 (Phase 4 cleanup, PR #3295) have both
   merged; `get_root_platformio_build_flags` was deleted entirely.
   The monkeypatch's target no longer exists — ty was correctly flagging
   the `unresolved-attribute` reference. Deleted the obsolete context
   manager and its `with` block.

`bash lint` python_pipeline now green.

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
@zackees
zackees deleted the feat/phase3-deprecate-piocompiler-cleanup branch August 21, 2026 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

1 participant