Repository navigation
Description
Background
PR #2395 made fbuild the default for board builds. While unifying on one backend is the goal, fbuild has been silently drifting from PlatformIO in ways that have already broken at least one platform (Teensy 4.x) and likely affect others we haven't caught yet.
Concrete example: Teensy 4.x drift discovered 2026-04-25
After commit cafcfb3493 ("chore(ci): add teensy40/41 to fbuild") landed on 2026-04-18, every single teensy41 master CI run has failed (50+ consecutive failures). The teensy30/31/LC builds — which kept using PlatformIO — continued going green throughout the same window.
The actual error from the latest run (24914626788):
colorpalettes.h:23:35: error: 'RainbowColors_p' causes a section type
conflict with 'fl::sinCosPairedLut'
This is a real GCC .progmem section-attribute conflict (mismatched alignment between two PROGMEM tables). It only surfaced under fbuild, never under PlatformIO, despite identical source, identical unity-build entry files, and the same arm-none-eabi-gcc toolchain.
Flag drift comparison (Teensy 4.x)
Comparing PlatformIO's actual build_info_Blink.json for teensy41 vs fbuild's reference config for teensy4x:
| Flag/Define | PlatformIO | fbuild |
|---|---|---|
-fpermissive |
yes | no |
-Wno-error=narrowing |
yes | no |
-flto=auto -fno-fat-lto-objects |
no | yes |
-Os (release) |
no (uses -O2) |
yes |
-Wextra |
no | yes |
Define CORE_TEENSY |
yes | no |
Define F_CPU=600000000 |
yes | no |
Define PLATFORMIO=60118 |
yes | no |
Define ARDUINO_ARCH_TEENSY |
no | yes |
ARDUINO= value |
10805 |
10819 |
-flto=auto -fno-fat-lto-objects is the most likely culprit for the Teensy 4.x section-conflict: with fat-LTO disabled, code generation defers to link time and section-attribute consolidation runs through a different GCC code path.
Open question
How much drift exists for every other platform we ship? We don't know — there is no programmatic check.
Proposal
Add a workflow that, for every supported board, compares the actual compile command line fbuild uses against the compile command line PlatformIO would use for the same translation unit, and fails CI if the two diverge (or at least posts a diff on the PR for visual review).
Approach sketch:
- For each board in
boards.py, produce twocompile_commands.jsonfiles:- One from a real PlatformIO
pio run -t compiledbinvocation - One from fbuild's existing
compile_commands.jsonemission
- One from a real PlatformIO
- Normalize both (sort flags, strip absolute paths, strip cache-key salts).
- Diff per-source-file. Allow an explicit allowlist of intentional differences.
- Run nightly (or on-PR for
ci/**andboards.pychanges) and post the diff as a workflow summary.
This should be doable for all build types since both backends end up invoking the same toolchain — the difference is purely in the argv they pass.
Acceptance criteria
- CI job that emits a per-board flag-drift report
- Configurable allowlist for intentional fbuild-only / PlatformIO-only flags
- Drift report attached as workflow artifact + posted to PR if changed
- Initial run audits all boards currently in
FBUILD_BOARDSand produces a baseline
Related
- Discovered while investigating uncommitted Teensy 4.x PROGMEM workaround on branch
pr-2395 - Sibling issue: standardized cross-backend smoke tests (filing separately)
- Sibling issue: extend comparison to arduino-cli for three-way drift detection (filing separately)
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsTriage
Activity
feat(ci): backend flag-drift detector for fbuild <-> PlatformIO (refs #…
ci: wire backend flag-drift detector into teensy40 (refs #3122 B4 / #…
zackees commentedon Aug 20, 2026
Deferred after a current-master audit. PRs #2801 and #3155 provide a useful Teensy 4.0 detector, but the issue still requires all-board coverage, an intentional-drift allowlist, PR-facing changed-result reporting, and an all-board baseline. This is a cross-platform CI program rather than a bounded bug fix. Resume when an owner can supply/maintain backend snapshots across the supported board matrix.