Repository navigation
fix: lpc lint compliance + purge stale PCH after zccache meson snapshot restore - #2995
Conversation
io_lpc.cpp.hpp and runtime_lpc.cpp.hpp use FL_IS_ARM_LPC in preprocessor conditionals without including is_arm.h; runtime_lpc also holds global operator delete overrides that cannot live in namespace fl, so mark it with the no-namespace opt-out comment. Co-Authored-By: Claude Opus 4.7 <[email protected]>
zccache meson configure snapshots capture the entire build dir (forge-ci/zccache#710), so a restore can resurrect a stale clang PCH whose embedded file identities silently defeat #pragma once dedup, producing redefinition errors in every PCH-consuming test TU. The restored .input_hash/.d.cache sidecars also make compile_pch.py skip rebuilding it forever. Delete *.pch and its sidecars whenever the setup output reports a [zccache-meson] hit so ninja recompiles the PCH against the live tree. Co-Authored-By: Claude Opus 4.7 <[email protected]>
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThis PR adds zccache PCH artifact cleanup logic to the Meson setup pipeline and adds a platform detection header include to LPC platform code. The build system now detects when zccache restores a meson snapshot and purges stale precompiled headers, forcing recompilation. Separately, ARM LPC platform code includes a header for ARM detection support. ChangesPCH Artifact Purge on zccache Hit
ARM Platform Header Includes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 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 |
* docs(skills): add /pch-debug skill and pch_probe.py
A skill that auto-activates on PCH failures ('redefinition of',
'redefines default argument', 'modified since the precompiled header',
tests that pass only after --clean). It explains the identity model
(#pragma once fails early; include guards hide the double read), the two
mechanisms in FastLED's history (path-spelling drift: #2685/zccache#619,
#3813; stale PCH accepted: #4839, #4437, #2995/zccache#710), and a
probe-before-clean procedure.
pch_probe.py: 'inputs' dumps what the PCH recorded (falls back to scanning
the PCH bytes when clang refuses a stale PCH) and flags odd spellings,
duplicate spellings and stale inputs; 'tu' runs a real compile_commands
entry with -H (optionally through zccache) and lists project headers
re-opened from disk next to their PCH spelling.
* pch_probe: llvm-bcanalyzer input records; repo-root-based project-header check (#4860 review)
- inputs: read the PCH with llvm-bcanalyzer -dump when available (PATH or
LLVM_BCANALYZER): exact recorded spelling, size and mtime per input,
without clang's stale-PCH validation; stale = size/mtime differ from the
record (clang's own check). Falls back to -module-file-info / byte scan.
- Project headers are now classified by resolving under the repo root
(derived from the script location), not by matching /src/ or /tests/ in
the raw spelling: relative recorded entries like tests/... count, and any
--build-dir location works.
* pch_probe: resolve relative recorded inputs against the build dir (#4860 review)
Summary
io_lpc.cpp.hpp/runtime_lpc.cpp.hppusedFL_IS_ARM_LPCin preprocessor conditionals without includingplatforms/arm/is_arm.h(IsHeaderIncludeChecker);runtime_lpc.cpp.hppalso gets the// ok no namespace flopt-out since globaloperator deleteoverrides andextern "C"runtime symbols cannot live in a namespace (PlatformsFlNamespaceChecker).zccache meson configuresnapshots capture the entire build dir — including compiled clang PCHs and thecompile_pch.pyskip-cache sidecars (meson configure: snapshot captures build outputs from already-built dirs; restored stale clang PCH silently defeats #pragma once forge-ci/zccache#710). Restoring such a snapshot into a clean build dir resurrects a stale PCH whose embedded file identities silently defeat#pragma oncededup, producingredefinition of 'IChannelDriver'-style errors in every PCH-consuming test TU, and the restored.input_hash/.d.cachesidecars prevent the PCH from ever rebuilding.run_meson_setup_command()now purges*.pch/*.pch.input_hash/*.d.cachefrom the build dir whenever the setup output reports a[zccache-meson] hit, forcing a fresh PCH compile against the live tree. Belt-and-suspenders until zccache#710 lands.Test plan
bash lintclean (previously failed on the two lpc files)bash test --cpp— 310/310 tests pass*.pch/*.pch.input_hash/*.d.cache, leaves.obj,build.ninja, andtest_pch.hsources untouched[zccache-meson] hiton a fresh build dir should log[MESON] Purged N PCH artifact(s)...and rebuild the PCH🤖 Generated with Claude Code
Summary by CodeRabbit