Repository navigation
fix(ci): harden PCH staleness (real-clang e2e test, WASM reuse fixes, stale-PCH fail-safe) - #4843
Conversation
… stale-PCH fail-safe - ci/tests/test_pch_e2e.py drives ci/compile_pch.py with FastLED's real clang driver: touched header, content change, no change (no rebuild loop), flag change, .o through the wrapper, plus the real clang redefinition output for the fail-safe. Added to the routine Python smoke list. - WASM: check_dependencies_changed ignored the depfile whenever it was older than the PCH (always), so transitive header changes never rebuilt the PCH; compute_flags_hash sorted flags and ignored the checkout root; sketch objects did not recompile after a PCH rebuild. - compile_pch.py: hash-match skip applies to .pch outputs only. - Fail-safe in compile_meson and the streaming runner: on a redefinition error in a header that is in a PCH, purge only the PCHs, retry once, warn loudly. - agents/docs/testing-commands.md: Precompiled Header Invariant + clang repro.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
Follow-up to #4839: hardens every place that reuses a precompiled header (PCH) so the stale-PCH
#pragma oncebug cannot come back.Changes
ci/tests/test_pch_e2e.py(added to the routineci/native_ci.pyPython smoke list; the size guard goes from 8 to 9). It uses FastLED's real clang driver (.cached/clang-native/ctc-clang++, falling back toclang-tool-chain-cpp). It skips only when that driver is missing, and underCIit fails instead of skipping. It builds a PCH from a#pragma onceheader with the same flags as the meson PCH target, runsci/compile_pch.pyandinvalidate_stale_pch, then compiles a consumer TU. Cases covered:.ocompiles routed through the wrapperci/wasm_compile_pch.pycheck_dependencies_changed: it returned "unchanged" whenever the depfile was older than the PCH. The depfile is always older than the PCH, so the check never ran, and touched or edited transitive headers never rebuilt the WASM PCH. Fixed.compute_flags_hash: it sorted the flags, so an order change was invisible, and it ignored the checkout root. Fixed.ci/wasm_compile_native.pyneeds_compilation: the sketch object was not recompiled after a PCH rebuild. Fixed.ci/compile_pch.py: skipping on a hash match now applies only to.pchoutputs. This is defensive;.ocompiles were not observed being skipped in practice.meson_setup_execute._PCH_ARTIFACT_SUFFIXES: now includes.pch.flags_hash.build_config.pywipes the build when the version changes, including*.pch.compile_meson(used for single-test runs) and the streaming runner check for aredefinition oforredefines default argumenterror in a header that is listed in a PCH depfile. When they see one, they purge only the PCHs and their sidecar files, retry once, and printSTALE PCH DETECTED ... please report it. They rebuild the PCH rather than "compile without PCH", because-include-pchis baked into the meson cpp_args.agents/docs/testing-commands.mdgains a "Precompiled Header Invariant" section explaining the rule and the clang bug, with a minimal repro.Evidence
pytest ci/tests/test_pch_e2e.pygives 6 failed, 7 passed. The failures:bash lintis clean.bash test adl_barrierprints:Summary by CodeRabbit