Skip to content

fix(ci/cppcheck): recognize fbuild's collapsed-env release-dir layout (closes #3264) - #3265

Merged
zackees merged 1 commit into
masterfrom
fix/3264-fbuild-cppcheck-fastled-ci-layout
Jun 19, 2026
Merged

zackees merged 1 commit into
masterfrom
fix/3264-fbuild-cppcheck-fastled-ci-layout

Conversation

@zackees

@zackees zackees commented Jun 19, 2026 •

Copy link
Copy Markdown
Member

Summary

`ci/util/fbuild_compiledb.py::_candidate_fbuild_release_dirs` knew about three layouts for where fbuild writes its release artifacts, but missed the one the FastLED CI orchestrator actually produces: when fbuild's env name matches the build-dir's board name, fbuild collapses the `` segment and emits to `.build/pio//.fbuild/build/release/` (no env in the path).

The bug

`was_compiled_with_fbuild` returned `False` for every LPC8xx board, so `ci/ci-cppcheck.py` fell through to `pio check` for all of them. The platformio-side platform `zackees/platform-nxplpc-arduino` happens to register lpc845/lpc845brk/lpcxpresso804/lpcxpresso845max but not `lpc804`, so on that one board `pio check` raised:

```
Checking lpc804 > cppcheck (board: lpc804; platform: ...; framework: arduino)
UnknownBoard: Unknown board ID 'lpc804'
##[error]Process completed with exit code 123.
```

The bug is invisible on the boards PIO knows about — they pass `pio check` even though they were never supposed to be on that path; they should have routed through the fbuild fast-path that uses the emitted `compile_commands.json`.

Evidence

From the lpc804 failure (run 27811322117):

```
Artifact: .../.build/pio/lpc804/.fbuild/build/release/firmware.elf (30.68KB)
```

— path uses `.fbuild/build/release/`, not `.fbuild/build/lpc804/release/` like the candidate list expected.

Fix

Add the collapsed-env path `build_root / "pio" / board_name / ".fbuild" / "build" / "release"` as the second candidate (right after the env-named path), so:

  1. Standalone `fbuild --target compiledb` invocations still match the env-named path (highest priority).
  2. FastLED-CI builds (the common case today) match the new no-env path.
  3. The legacy `.build/.fbuild/...` fallback stays at the tail.

Docstring updated to explain the collapsing behavior.

Side effect

After this lands, lpcxpresso804/lpcxpresso845max/lpc845brk also flip from `pio check` → `clang-tool-chain-tidy` (the intended fbuild path). That's a behavior change but is the original design intent per the existing code path's docstring. If clang-tidy surfaces real findings on those boards, they need addressing separately; the fix here is correct independent of that.

Closes

Closes #3264

Test plan

  • `ruff check` and `ty check` clean on `ci/util/fbuild_compiledb.py`
  • Validate post-merge: `build_lpc804.yml` flips green on master
  • Validate post-merge: the 3 currently-green LPC variants stay green (they shouldn't regress — clang-tidy via fbuild path is gentler than `pio check`)

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes

    • Improved detection of compiler output files by adding support for additional build directory layouts, particularly for builds orchestrated without explicit environment configuration.
  • Documentation

    • Updated documentation to clarify supported fbuild output directory structures.

`ci/util/fbuild_compiledb.py::_candidate_fbuild_release_dirs` listed
three candidate locations for fbuild artifacts, but missed the layout
the FastLED CI orchestrator actually produces: fbuild collapses the
`<env>` segment when its env name matches the build_dir's board, and
writes to `.build/pio/<board>/.fbuild/build/release/` (no env name in
the path).

Effect of the bug: `was_compiled_with_fbuild` returned False for every
LPC8xx board (and any other board built via the FastLED orchestrator),
so `ci/ci-cppcheck.py` fell through to `pio check` — which then failed
for boards the platformio-side platform doesn't register, namely
`lpc804`. The lpcxpresso804/845max/lpc845brk variants happened to be
registered with the `zackees/platform-nxplpc-arduino` platform and so
were green; `lpc804` was not, and `build_lpc804.yml` had been red since
the LPC8xx canary CI was wired up in #3080.

CI artifact path from a failing run:

```
Artifact: /home/runner/work/.../.build/pio/lpc804/.fbuild/build/release/firmware.elf
```

— note `.fbuild/build/release/`, not `.fbuild/build/lpc804/release/`.

After this change, `was_compiled_with_fbuild` finds the build via the
new candidate path, `ensure_compile_commands` locates the
sibling `compile_commands.json`, and `run_static_analysis_against_compile_db`
runs `clang-tool-chain-tidy` against the fbuild-emitted DB instead of
shelling out to `pio check`. lpc804 (and any other fbuild-only board)
should go green.

Closes #3264

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

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 4a1da5e7-b992-493e-a1fe-9c691c0171d4

📥 Commits

Reviewing files that changed from the base of the PR and between d2566be and e1bcfce.

📒 Files selected for processing (1)
  • ci/util/fbuild_compiledb.py

📝 Walkthrough

Walkthrough

The ci/util/fbuild_compiledb.py script's _candidate_fbuild_release_dirs function receives an updated docstring describing all known fbuild output layouts and a new candidate release directory path that matches the collapsed <env> segment layout used when fbuild is invoked by FastLED orchestration without an explicit -e <env> argument.

Changes

fbuild compile_commands.json path detection

Layer / File(s) Summary
Docstring and candidate path list update
ci/util/fbuild_compiledb.py
Docstring for _candidate_fbuild_release_dirs rewritten to document the collapsed <env> layout, standalone CLI layout, and .build/.fbuild/... tail fallback. A new candidate path for FastLED-orchestrated runs (collapsed <env> segment, per issue #3264) is prepended to the candidate list with explanatory inline comments.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • FastLED/FastLED#2307: Directly relates to the same ci/util/fbuild_compiledb.py compile-DB helper whose release/ path detection is being refined in this PR.

Poem

A path was collapsed, the env segment gone,
My compile_commands.json nowhere to be drawn!
But now a new candidate hops to the fore,
#3264's fix lands on the right door.
🐇 fbuild and I shall compile evermore!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: fixing the fbuild compile database script to recognize the collapsed-env release directory layout, which directly addresses issue #3264.
Linked Issues check ✅ Passed The PR directly addresses issue #3264 by adding recognition of the collapsed-env fbuild path layout, enabling proper detection of fbuild-only boards like lpc804 and routing them through the correct code path.
Out of Scope Changes check ✅ Passed All changes are scoped to _candidate_fbuild_release_dirs function—docstring updates and path addition—directly addressing the fbuild path detection issue in #3264.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ 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/3264-fbuild-cppcheck-fastled-ci-layout

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 merged commit 9358275 into master Jun 19, 2026
11 of 12 checks passed
@fastled-project-sync fastled-project-sync Bot moved this from Triage to Done in FastLED Tracker Jun 19, 2026
@zackees
zackees deleted the fix/3264-fbuild-cppcheck-fastled-ci-layout 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

Development

Successfully merging this pull request may close these issues.

ci(build_lpc804): UnknownBoard 'lpc804' from ci/ci-cppcheck.py (PIO platform missing variant)

1 participant