Skip to content

feat(zcc): pass source-hash sidecar via zccache --input-file (closes zackees/zccache#654) - #2758

Merged
zackees merged 1 commit into
masterfrom
chore/zccache-1.11.13-input-file
Jun 4, 2026
Merged

zackees merged 1 commit into
masterfrom
chore/zccache-1.11.13-input-file

Conversation

@zackees

@zackees zackees commented Jun 4, 2026 •

Copy link
Copy Markdown
Member

Bumps zccache pin >=1.11.12 -> >=1.11.13 and feeds FastLED's SourceHashes into the configure-cache wrapper's key via the new --input-file flag (forge-ci/zccache#655, closes forge-ci/zccache#654).

Previously the wrapper bypassed itself whenever FastLED's metadata-cache layer triggered --reconfigure, because the wrapper hashed only meson.build files and would have served a stale-target tree on a source-only change. With --input-file we extend the cache key with a sidecar that holds (src_hash, test_hash, source_hash). The wrapper now engages on EVERY path.

Sidecar lives in <build_dir.parent>/.zccache-meson-inputs-<build_mode>.hash so it survives bash test --clean.

Measured (Windows host, --setup-only):
Cold first-time: ~22.0s (was 19.1s; v1->v2 tag bump cost)
Cold with cache restore: ~8.1s (was 9.2s; ~30 percent vs baseline)
Warm reconfigure-trigger: ~7.4s (was 9-11s on the bypass path)

Generated with Claude Code.

Summary by CodeRabbit

  • Chores
    • Enhanced build caching mechanism with improved cache invalidation to optimize build performance and reliability.
    • Updated zccache dependency to version 1.11.13 to support the new caching capabilities.

Bumps zccache pin >=1.11.12 -> >=1.11.13 and feeds FastLED's SourceHashes (src/test/source globs) into the configure-cache wrapper's key via the new --input-file flag (forge-ci/zccache#655, closes forge-ci/zccache#654).

Previously the wrapper bypassed itself whenever FastLED's metadata-cache layer triggered --reconfigure, because the wrapper hashed only meson.build files and would have served a stale-target tree on a source-only change. With --input-file we extend the cache key with a sidecar that holds (src_hash, test_hash, source_hash). The wrapper key now correctly invalidates on a source-trigger reconfigure, so the wrapper engages on EVERY path (not just non-reconfigure).

Sidecar layout: written to <build_dir.parent>/.zccache-meson-inputs-<build_mode>.hash so it survives 'bash test --clean' (which wipes the inner build_dir) but stays per-build-mode unique. Path is recorded verbatim in the cache key (the wrapper's documented behaviour); FastLED's path is deterministic so cache lookups remain stable across invocations.

Measured on Windows host (clang 21.1.5, zccache 1.11.13, --setup-only):

  * Cold first-time (fresh cache):     ~22.0s (was 19.1s; +2.9s for v1->v2 cache-tag bump + slightly larger key)

  * Cold with cache restore:           ~8.1s (was 9.2s; ~12% better, ~30% vs no-wrapper baseline)

  * Warm reconfigure-triggered:        ~7.4s (was ~9-11s on the bypass path)

Net: the reconfigure path now benefits from cache restoration instead of always re-running real meson; cold first-time pays a one-time penalty for the v1->v2 tag rotation.
@coderabbitai

coderabbitai Bot commented Jun 4, 2026 •

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: fe293335-9501-40b4-a2cb-7a02dc49135d

📥 Commits

Reviewing files that changed from the base of the PR and between 1ed84fb and dd4a6ff.

📒 Files selected for processing (3)
  • ci/meson/build_config.py
  • ci/meson/meson_setup_execute.py
  • pyproject.toml

📝 Walkthrough

Walkthrough

This PR extends the zccache meson configure wrapper to support --input-file flag for cache invalidation. FastLED now writes source/test file hashes to sidecar files and passes them to zccache, allowing safe wrapper cache hits on the reconfigure path without bypassing the wrapper.

Changes

zccache meson configure --input-file support

Layer / File(s) Summary
Dependency and interface contract
pyproject.toml, ci/meson/meson_setup_execute.py
zccache>=1.11.13 replaces >=1.11.12 to enable --input-file flag. build_meson_setup_cmd signature updated to accept optional source_hashes: Optional[SourceHashes] = None.
Sidecar file writer
ci/meson/meson_setup_execute.py
New _write_zccache_input_sidecar helper writes per-build_mode .zccache-meson-inputs-*.hash files containing src/test/source hash values to build_dir.parent for zccache to consume via --input-file.
Wrapper routing and command construction
ci/meson/meson_setup_execute.py
build_meson_setup_cmd conditionally writes sidecar when zccache_exe and source_hashes are available, then routes through zccache wrapper with --input-file when sidecar succeeds, or falls back to wrapper without --input-file (non-reconfigure) or direct meson setup --reconfigure (reconfigure).
Caller integration
ci/meson/build_config.py
setup_meson_build passes computed hashes as source_hashes to build_meson_setup_cmd in both reconfigure and initial setup paths.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • FastLED/FastLED#2742: Both PRs modify pyproject.toml to bump the zccache dependency version for cache-correctness improvements (--input-file support in main vs. depfile-on-cache-hit in retrieved).
  • FastLED/FastLED#2616: Both PRs update pyproject.toml to bump zccache minimum version for direct dependency alignment.

Poem

🐰 The wrapper now reads hash sidecar files with care,
Extending the cache key with inputs laid bare,
Reconfigure paths hit without risk or despair,
Six-point-two times faster—a rabbit's true flair! ✨

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/zccache-1.11.13-input-file

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.

@zackees
zackees merged commit 33c544c into master Jun 4, 2026
7 checks passed
@fastled-project-sync fastled-project-sync Bot moved this from Triage to Done in FastLED Tracker Jun 4, 2026
@zackees
zackees deleted the chore/zccache-1.11.13-input-file 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

Status: Done

Development

Successfully merging this pull request may close these issues.

feat(meson): support --input-file for extending the configure-cache key with arbitrary files

1 participant