Repository navigation
ci: enforce zccache strict path validation (closes #2378) - #2504
Conversation
Extend the Meson compile-flag normalizer beyond ``-I*.p`` to cover every path-bearing flag enforced by ``ZCCACHE_STRICT_PATHS=absolute`` (``-I``, ``-isystem``, ``-iquote``, ``-iframework``, ``-idirafter``, ``-imsvc``, ``-include``, ``-include-pch``, ``-imacros``, ``-F``, ``/I``), strip ``/.`` and ``/..`` components, and add a pre-compile gate in ``setup_meson_build`` / ``_normalize_meson_private_paths`` that raises before the build scheduler picks up work when ``compile_commands.json`` still has strict-path offenders. Path char class excludes a leading ``-`` so the longer-prefix-first alternation doesn't fall back from ``-include-pch`` to ``-include`` + ``-pch`` on bare two-token PCH flag pairs. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThis PR strengthens Meson compile-command validation by expanding path normalization from private includes to all path-bearing compiler flags, adding runtime violation detection, and integrating fail-fast enforcement into both normal and alternative build workflows, with comprehensive test coverage. ChangesMeson Strict Path Validation and Enforcement
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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
-I*.pto every strict-path-bearing flag (-I,-isystem,-iquote,-iframework,-idirafter,-imsvc,-include,-include-pch,-imacros,-F,/I), and strip/.//..components.find_strict_path_violations/_enforce_strict_path_violations) called fromsetup_meson_build()and the WASM_normalize_meson_private_pathsshim — raises before any compile work is scheduled ifcompile_commands.jsonstill has offenders."-include-pch"token to"-includeC:/.../-pch"by falling back from the-include-pchalternative to-includeand consuming-pchas the path.Context
ZCCACHE_STRICT_PATHS=absoluteend-to-end.ZCCACHE_STRICT_PATHSenv var is already set in bothci/meson/runner.pyandci/meson/build_config.py(left in place).zccache>=1.9.0is already pinned inpyproject.toml(well above the 1.3.7 baseline that introduced--strict-paths).ci/tests/test_meson_include_paths.pycontinues to gate CI via the existing pytest run.Test plan
uv run pytest ci/tests/test_meson_include_paths.py ci/tests/test_meson_private_include_normalization.py -v— 8 passeduv run pytest ci/tests/(excluding pre-existing unrelated failures) — 313 passed, 39 skippedbash lint ci/meson/build_config.py ci/tests/test_meson_private_include_normalization.py ci/wasm_build.py— no new violationsSummary by CodeRabbit