Skip to content

Fix zccache strict paths for Linux Meson private includes - #2389

Merged
zackees merged 5 commits into
masterfrom
fix-meson-linux-strict-private-includes
Apr 22, 2026
Merged

zackees merged 5 commits into
masterfrom
fix-meson-linux-strict-private-includes

Conversation

@zackees

@zackees zackees commented Apr 22, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Fix Meson private include normalization for Linux/Ninja command lines where Meson emits unquoted -I*.p flags.
  • Keep the existing quoted Windows form supported.
  • Add a focused regression test covering both quoted and unquoted private include forms in build.ninja and compile_commands.json.

Why

PR #2386 failed in Linux unit tests because zccache strict mode rejected:

-Ici/meson/native/fastled.so.p

The strict-path normalizer from #2385 handled quoted forms such as -Itests/test.dll.p, but Linux emits the private Meson include as an unquoted token.

This needs to land on master because the PR unit-test workflow checks out trusted master CI scripts and only overlays source/test/example files from the PR.

Related failure: https://github.com/FastLED/FastLED/actions/runs/24801132063/job/72583717422?pr=2386

Testing

  • ZCCACHE_STRICT_PATHS=absolute bash test --cpp --force --no-parallel -> passed 302/302
  • uv run pytest ci/tests/test_meson_private_include_normalization.py ci/tests/test_meson_include_paths.py -v -> passed 3/3
  • git diff --check -> clean

Summary by CodeRabbit

  • Chores
    • CI now uses repository-local Meson build configuration for same-repo PRs, improving consistency for builds and checks; private Meson include paths are normalized more robustly to produce correct absolute include entries.
  • Tests
    • Added a regression test that verifies normalization of both quoted and unquoted private include arguments, ensuring originals are replaced by normalized absolute paths.

@coderabbitai

coderabbitai Bot commented Apr 22, 2026 •

Copy link
Copy Markdown

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: a74996a0-6c77-41a8-ad78-1c0ba60ee9a6

📥 Commits

Reviewing files that changed from the base of the PR and between 0cf2ce5 and 791cf85.

📒 Files selected for processing (7)
  • .github/workflows/build_linux.yml
  • .github/workflows/build_template.yml
  • .github/workflows/build_template_binary_size.yml
  • .github/workflows/build_template_custom_board.yml
  • .github/workflows/build_wasm.yml
  • .github/workflows/build_wasm_compilers.yml
  • .github/workflows/template_example_test.yml

📝 Walkthrough

Walkthrough

Replaces the Meson private-include path regex to correctly match quoted and unquoted -I*.p tokens and preserve surrounding quotes when rewriting to absolute paths; adds a regression test for both forms; updates CI workflow templates to copy PR Meson helper code for same-repo PRs.

Changes

Cohort / File(s) Summary
Meson build config
ci/meson/build_config.py
Rewrote the _MESON_PRIVATE_INCLUDE_RE to use named capture groups to detect -I tokens with optional quotes, capture .p private-include paths excluding internal quotes/whitespace, and preserve original quote prefix/suffix when normalizing to absolute paths.
Tests
ci/tests/test_meson_private_include_normalization.py
Added TestMesonPrivateIncludeNormalization.test_normalizes_quoted_and_unquoted_private_includes that creates minimal build.ninja and compile_commands.json fixtures with quoted/unquoted -I*.p entries, runs normalization, and asserts normalized absolute paths replace the originals.
CI workflows (same-repo PR safe-file merge)
.github/workflows/.../template_unit_test.yml, .github/workflows/.../build_linux.yml, .github/workflows/.../build_template.yml, .github/workflows/.../build_template_binary_size.yml, .github/workflows/.../build_template_custom_board.yml, .github/workflows/.../build_wasm.yml, .github/workflows/.../build_wasm_compilers.yml, .github/workflows/.../template_example_test.yml
Each workflow's “merge safe source files from PR” step now conditionally copies pr-code/ci/meson/build_config.py into the trusted workspace when the PR head repo matches the workflow repo, enabling same-repo PRs to exercise PR-provided Meson helper code; behavior unchanged for forks/cross-repo PRs.

Sequence Diagram(s)

(omitted)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related issues

Possibly related PRs

Poem

🐰 A regex hop, a subtle trace,
Quotes held gently in their place,
Tests nibble errors, paths made nice,
CI copies code to roll the dice,
A rabbit nods: the build runs ace.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: fixing Meson private include path handling for Linux in the zccache strict-paths normalization logic.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-meson-linux-strict-private-includes

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@ci/tests/test_meson_private_include_normalization.py`:
- Around line 40-41: The test constructs expected path strings using .as_posix()
but the code under test (normalize_meson_private_include_paths) uses
.resolve().as_posix(), causing mismatches on symlinked temp dirs; update the
expected values native_private and test_private in the test to use
.resolve().as_posix() (i.e., call resolve() on build_dir /
"ci/meson/native/fastled.so.p" and build_dir / "tests/test.dll.p") so the test
mirrors the function behavior and avoids symlink-dependent failures.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f6a663c5-0033-4ce6-826b-df3a897a9cfb

📥 Commits

Reviewing files that changed from the base of the PR and between 6d84315 and 18bc7ed.

📒 Files selected for processing (2)
  • ci/meson/build_config.py
  • ci/tests/test_meson_private_include_normalization.py

@zackees

zackees commented Apr 22, 2026

Copy link
Copy Markdown
Member Author

Addressed CodeRabbit's path-resolution test feedback in 0cf2ce5 and resolved the review thread. @coderabbitai review

@coderabbitai

coderabbitai Bot commented Apr 22, 2026

Copy link
Copy Markdown

@zackees: Thank you for addressing the feedback and sharing the commit reference. I'll kick off a new review of the PR now!

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@zackees
zackees merged commit f104eb8 into master Apr 22, 2026
64 of 77 checks passed
@zackees
zackees deleted the fix-meson-linux-strict-private-includes 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

None yet

Development

Successfully merging this pull request may close these issues.

1 participant