Repository navigation
fix(ci/cppcheck): recognize fbuild's collapsed-env release-dir layout (closes #3264) - #3265
Conversation
`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]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe Changesfbuild compile_commands.json path detection
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
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:
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
🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
Documentation
fbuildoutput directory structures.