Skip to content

ci: gate compile-many opt-in via FASTLED_USE_FBUILD_CI=1 (urgent — unbreaks master) - #2662

Merged
zackees merged 1 commit into
masterfrom
fix/gate-compile-many-opt-in
May 31, 2026
Merged

zackees merged 1 commit into
masterfrom
fix/gate-compile-many-opt-in

Conversation

@zackees

@zackees zackees commented May 31, 2026 •

Copy link
Copy Markdown
Member

Summary

  • fix(ci): probe fbuild compile-many via SUB --help (unbreaks CI fast path) #2661 merged at 14:00 UTC enabled fbuild compile-many for the first time. The subsequent post-merge CI runs immediately showed it as a hard regression on master:
    • uno (small framework): ~3.5 min serial → ~7 min compile-many
    • teensy41 / esp32s3 (large framework): finished serial → 30 min `BUILD FAIL Process timed out`
  • Root cause is upstream FastLED/fbuild#335: each stage-2 sketch lives in its own project dir (`.build/pio//compile_many//`) and therefore gets its own `.fbuild` build dir, so the framework archive stage-1 builds in the root dir is invisible — every stage-2 worker re-builds the framework from scratch. The bigger the framework, the worse the regression.
  • Until fbuild#335 lands a shared framework cache, gate the compile-many dispatch behind `FASTLED_USE_FBUILD_CI=1` so the default behaviour is the known-good legacy serial loop. Everything else from fix(ci): probe fbuild compile-many via SUB --help (unbreaks CI fast path) #2661 (`SUB --help` probe fix, normalized per-sketch output, install-cache wiring, workflow input) stays active and useful — only the dispatch is gated.

Set `FASTLED_USE_FBUILD_CI=1` locally to opt back in (handy for timing experiments against the architectural fix once it lands).

Test plan

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added configurable compilation mode selection through environment variables, enabling use of advanced CI-based build methods with automatic fallback to standard compilation.
  • Tests

    • Enhanced CI build testing to properly exercise and validate CI compilation paths when enabled.

#2661 merged at 14:00 UTC enabled fbuild compile-many for the first
time. The subsequent CI runs immediately showed it as a hard
regression on master:

- uno (small framework): ~3.5 min serial → ~7 min compile-many
- teensy41 / esp32s3 (large framework): finished serial → 30 min
  BUILD FAIL Process timed out

Root cause is upstream FastLED/fbuild#335: each stage-2 sketch lives
in its own project dir (.build/pio/<board>/compile_many/<name>/) and
therefore gets its own .fbuild build dir, so the framework archive
stage-1 builds in the root dir is invisible — every stage-2 worker
re-builds the framework from scratch. The bigger the framework, the
worse the regression.

Until fbuild#335 lands a shared framework cache, gate the compile-many
dispatch behind FASTLED_USE_FBUILD_CI=1 so the default behaviour is
the known-good legacy serial loop. Everything else from #2661 — the
`SUB --help` probe fix, normalized per-sketch output, install-cache
wiring, workflow input — stays active and useful. Only the dispatch
to compile-many is gated.

Set FASTLED_USE_FBUILD_CI=1 locally to opt back in (handy for timing
experiments against the architectural fix once it lands).

Refs FastLED/fbuild#335
@coderabbitai

coderabbitai Bot commented May 31, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

PioCompiler._build_fbuild() now gates fbuild CI and compile-many dispatch behind the FASTLED_USE_FBUILD_CI environment variable, falling back to legacy synchronous fbuild when not opted in. A test is updated to set this variable and exercise the CI code path.

Changes

fbuild CI dispatcher environment-variable gating

Layer / File(s) Summary
fbuild CI dispatcher environment-variable gating
ci/compiler/pio.py, ci/tests/test_fbuild_compile_many.py
_build_fbuild() parses FASTLED_USE_FBUILD_CI for truthy values and conditionally selects _build_fbuild_ci() or _build_fbuild_compile_many() when opted in, otherwise falls back to legacy synchronous fbuild with user-facing fallback messaging. Test sets the environment variable to exercise the mocked CI code path.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related issues

  • FastLED/FastLED#2398: Both changes touch the fbuild vs legacy (PlatformIO) selection logic in the CI compiler dispatcher.
  • FastLED/FastLED#2470: This change implements the env-gated switch to prefer fbuild CI or compile-many in PioCompiler, which directly enables the compile-many CI path.

Possibly related PRs

  • FastLED/FastLED#2476: Adds env-var gate (FASTLED_USE_FBUILD_CI) to PioCompiler._build_fbuild() dispatcher and updates the same test file to exercise the CI path.

Poem

🐰 A rabbit builds bridges with gentle care,
Environment gates let fast paths flare,
CI compiles swiftly through the air,
Fallback whispers: "I'll be there,"
Tests now hop along the legacy stair! 🏃‍♂️✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 75.00% 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
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: gating compile-many opt-in behind an environment variable. It accurately reflects the primary objective of the PR.
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.

✏️ 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 fix/gate-compile-many-opt-in

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 and usage tips.

@zackees

zackees commented May 31, 2026

Copy link
Copy Markdown
Member Author

Urgent: this restores the legacy serial loop as the default so master CI returns to working timings. PR #2661 enabled compile-many but it re-builds the framework per stage-2 sketch (FastLED/fbuild#335) — uno went from ~3.5 min to ~7 min, teensy41 / esp32s3 timed out at 30 min. Until fbuild#335 ships a shared framework cache, this gate is the safest path; set FASTLED_USE_FBUILD_CI=1 to opt back in locally.

(The sync check failure is the existing project-automation GitHub App permissions issue, unrelated to this change.)

@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: 1

🤖 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 `@ci/compiler/pio.py`:
- Line 439: The file contains a local import "import os" inside the function
_build_fbuild; move that import to the module-level import section with the
other standard-library imports, remove the in-function import from
_build_fbuild, and ensure the "os" import is placed in the correct
standard-library ordering (before third-party and local imports); run the
linter/flake8 to confirm import-order compliance after the change.
🪄 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: e4352795-8b50-414b-b2fe-ca1c209a0e5d

📥 Commits

Reviewing files that changed from the base of the PR and between fa147ae and 1a7450d.

📒 Files selected for processing (2)
  • ci/compiler/pio.py
  • ci/tests/test_fbuild_compile_many.py

Comment thread ci/compiler/pio.py
``FASTLED_USE_FBUILD_CI=1`` to opt in (e.g. for local timing
experiments against the architectural fix once it lands).
"""
import os

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win

Move os import to the module import section.

import os was added inside _build_fbuild; this violates the repository import-order rule for system imports.

Proposed diff
@@
 import gc
 import hashlib
+import os
 import platform
@@
-        import os
-
         from ci.util.fbuild_runner import (
             fbuild_supports_ci,
             fbuild_supports_compile_many,
         )

As per coding guidelines, "All system imports must be at the top of the file in proper order: standard library, third-party, local".

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
import os
🤖 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 `@ci/compiler/pio.py` at line 439, The file contains a local import "import os"
inside the function _build_fbuild; move that import to the module-level import
section with the other standard-library imports, remove the in-function import
from _build_fbuild, and ensure the "os" import is placed in the correct
standard-library ordering (before third-party and local imports); run the
linter/flake8 to confirm import-order compliance after the change.

@zackees
zackees merged commit fed6f5f into master May 31, 2026
8 of 9 checks passed
@zackees
zackees deleted the fix/gate-compile-many-opt-in branch May 31, 2026 16:17
zackees added a commit that referenced this pull request Jun 1, 2026
Picks up the compile-many stage-2 framework-archive share
(FastLED/fbuild#337) — the original regression that forced the
FASTLED_USE_FBUILD_CI=1 gate to default-off in #2662 is now fixed
upstream. Also pulls in stage-2 jobs split (#336), the real-toolchain
stage-2 perf regression test (#342), and the #346 hang-debugging
chain: daemon fmt tracing to stderr (#348), bounded zccache start
timeout (#349), project lock acquire instrumentation (#350).

uv.lock is .gitignore'd in this repo so the pin change alone is
enough to nudge consumers to 2.2.13 on next install/lock.

A follow-up will flip FASTLED_USE_FBUILD_CI=1 default-on once a few
CI runs confirm the new pin is healthy.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant