Skip to content

perf(m e s o n): minimal skip-list expansion + --no-walk for explicit input control (closes #659) - #660

Merged
zackees merged 1 commit into
mainfrom
perf/meson-discovery-skip-list-659
Jun 4, 2026
Merged

zackees merged 1 commit into
mainfrom
perf/meson-discovery-skip-list-659

Conversation

@zackees

@zackees zackees commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator

Closes #659. Two complementary changes to discover_meson_inputs:

  1. Add .venv, venv, .cargo to the default skip list alongside existing entries (universally never-meson; on FastLED these were the dominant ~5s cost walking ~100k site-packages files).

  2. Add --no-walk flag. When set, the wrapper skips the implicit walk entirely and keys only on the explicitly-named --input-file set. Whitelisting at the caller's choice. Failed if no --input-file supplied (foot-gun prevention).

Deliberately refused to ship an exhaustive blacklist (.pio, .cached, .fbuild, .clang-tool-chain, .claude, .idea, .vscode, ...) because every entry is a heuristic and the list grows forever. Whitelisting via --no-walk is the cleaner long-term API.

Three new integration tests: no_walk_requires_at_least_one_input_file; no_walk_hits_on_unchanged_input_files; no_walk_is_keyed_distinctly_from_walked. All 9 tests pass on Windows.

Generated with Claude Code.

… input control (closes #659)

Two complementary changes to discover_meson_inputs in the m e s o n configure cache wrapper:

1. Add .venv, venv, .cargo to the default skip list alongside the existing build / .build / target / node_modules / .git. These are universally never-meson dirs that show up in nearly every Python or Rust project and were the dominant cost in the FastLED reproduction (~5s of wrapper overhead spent walking ~100k Python site-packages files in .venv).

2. Add --no-walk flag. When set, the wrapper skips the implicit recursive walk of --source-dir entirely and keys only on the explicitly-named --input-file set. This is the principled whitelist option for monorepos whose scratch dirs aren't on the default skip list, or callers who maintain the exact input set themselves.

Refused to ship an exhaustive blacklist (.pio, .cached, .fbuild, .clang-tool-chain, .claude, .idea, .vscode, etc.) because every entry is a heuristic and the list grows forever. Whitelisting at the caller's choice via --no-walk is the cleaner long-term API: callers who care about walk cost specify their input set, callers who don't care pay for the conservative default.

Three new integration tests pin the contract: --no-walk without --input-file is a hard error; --no-walk hits when supplied --input-file content is unchanged; --no-walk and walked-mode produce DIFFERENT cache keys for the same logical input (no cross-pollution between modes).

All 9 cli_meson_configure_cache tests pass on Windows.
@zackees
zackees merged commit 4546954 into main Jun 4, 2026
30 checks passed
zackees added a commit that referenced this pull request Jun 4, 2026
Ships #660 (m e s o n configure cache: minimal skip-list expansion + --no-walk flag, closes #659) and #658 (release-auto verify step now finds wheels post-checkout, closes #657). The headline payload is #660 for downstream callers like FastLED: with --no-walk they can take full responsibility for naming each input file via --input-file, skipping the implicit walk entirely and paying zero cost for traversing in-tree .venv / .pio / .cached / .fbuild scratch dirs not on the default skip list.
zackees added a commit to FastLED/FastLED that referenced this pull request Jun 4, 2026
….build inputs (#2761)

Pulls zccache 1.11.14 (forge-ci/zccache#660, closes forge-ci/zccache#659)
into the meson-configure wrapper path. The 1.11.14 wrapper exposes a
`--no-walk` flag that disables the recursive `--source-dir` traversal —
that traversal was dominated by `.venv/` (~100k Python files, ~5s on
cold-with-cache reconfigures) on FastLED's tree.

Changes:
- `pyproject.toml`: bump `zccache>=1.11.13` -> `zccache>=1.11.14` and
  refresh the comment block to record the 1.11.14 rationale alongside
  the prior 1.11.11 / 1.11.12 / 1.11.13 history.
- `ci/meson/meson_setup_execute.py`:
  - Introduce `FASTLED_MESON_BUILD_FILES`, the canonical 7-entry tuple
    naming every meson.build in the FastLED tree (top level + tests/ +
    tests/profile/ + examples/ + ci/meson/{native,shared,wasm}/).
  - Replace `_get_zccache_meson_configure_path() -> Optional[Path]`
    with `_get_zccache_meson_configure_path() -> Optional[ZccacheCapability]`
    (path + supports_no_walk flag, detected by checking `--no-walk`
    appears in the wrapper's `--help` text). Older wrappers
    (1.11.12 / 1.11.13) keep the old behaviour.
  - In `build_meson_setup_cmd`, when the wrapper supports `--no-walk`,
    add `--no-walk` and one `--input-file <path>` per entry in
    `FASTLED_MESON_BUILD_FILES`. The existing sidecar `--input-file`
    (FastLED's src/test/source hash digest) still rides alongside.

Cache key behaviour: `--no-walk` produces an empty `input_files` map
inside the wrapper, distinct from the walked-mode map, so cache keys
between the two modes never collide. This is pinned by the upstream
test `no_walk_is_keyed_distinctly_from_walked` in
forge-ci/zccache#660.

Co-authored-by: Claude Opus 4.7 <[email protected]>
zackees added a commit to FastLED/fbuild that referenced this pull request Jun 5, 2026
zccache 1.11.14 ships the `meson configure --no-walk` flag
(forge-ci/zccache#660, closes forge-ci/zccache#659), eliminating the
recursive `--source-dir` walk that dominated the configure-cache
hit path on trees with large scratch dirs.

FastLED measured this end-to-end (FastLED/FastLED#2761): cold-with-
cache reconfigure went from ~5.6s (1.11.13, walked hit) to 0.62s
(1.11.14, no-walk hit). Bringing fbuild's published floor in line
keeps both projects on a consistent wrapper feature set.

The intermediate 1.11.11 / 1.11.12 / 1.11.13 picks (depfile-on-
cache-hit fix, the wrapper itself, `--input-file`) are also worth
floor-pinning at once rather than staircasing.

Tracker: forge-ci/zccache#662

Co-authored-by: Claude Opus 4.7 <[email protected]>
zackees added a commit to zackees/clang-tool-chain that referenced this pull request Jun 5, 2026
The existing `zccache>=1.3.0` floor pre-dated a long string of
behavior fixes that clang-tool-chain's zccache_shim entry-points
silently depend on:

- 1.11.11 — depfile-on-cache-hit fix (forge-ci/zccache#643).
  Without this, `deps = gcc` records `#deps 0` for every cached
  object and incremental builds produce stale `.obj` files after a
  git pull that changes transitive headers (symptom: `undefined
  symbol: ...` link errors hours after the header actually
  changed).
- 1.11.12 — `meson configure` wrapper itself (forge-ci/zccache#649)
- 1.11.13 — `--input-file` for the wrapper (forge-ci/zccache#655)
- 1.11.14 — `--no-walk` for the wrapper (forge-ci/zccache#660)

clang-tool-chain's `zccache_shim` entry-points (-clang, -clang-cpp,
-emcc, -em-cpp, -wasm-ld, -clang-tidy, -iwyu) just exec into the
installed zccache binary, so this bump affects only the
installation-time floor — no shim code change is required.

Tracker: forge-ci/zccache#662

Co-authored-by: Claude Opus 4.7 <[email protected]>
zackees added a commit to forge-ci/soldr that referenced this pull request Jun 5, 2026
) (#678)

Bumps every codified mention of the managed zccache version from 1.11.8
to 1.11.14, picking up six zccache CLI releases worth of fixes plus the
new `meson configure --no-walk` wrapper (forge-ci/zccache#660, closes
forge-ci/zccache#659). Also bumps the soldr workspace version 0.7.51 ->
0.7.52 so release-auto cuts a new soldr ship; setup-soldr's downstream
issue (forge-ci/setup-soldr#379) can then pick up the new default
`soldr-version`.

Notable zccache pickups since 1.11.8:

- 1.11.11 — depfile-on-cache-hit fix (forge-ci/zccache#643). Without
  this, `deps = gcc` records `#deps 0` for every cached object and
  incremental builds produce stale `.obj` files after a git pull that
  changes transitive headers.
- 1.11.12 — `meson configure` wrapper itself (forge-ci/zccache#649).
- 1.11.13 — `--input-file` for the wrapper (forge-ci/zccache#655).
- 1.11.14 — `--no-walk` for the wrapper (forge-ci/zccache#660). On
  FastLED's tree this took cold-with-cache reconfigure from ~5.6s
  (walked hit) to 0.62s (no-walk hit) — see FastLED/FastLED#2761.

Files touched (mechanical version-string replacements only):

- `Cargo.toml` — workspace version 0.7.51 -> 0.7.52
- `Cargo.lock` — regenerated via `cargo update --workspace`
- `contracts/zccache-runtime.v1.json` — `zccache.managed_version`
- `crates/soldr-cli/src/fetch/mod.rs` — `MANAGED_ZCCACHE_VERSION` const
- `crates/soldr-cli/src/zccache.rs` — 2x test-fixture path strings
- `crates/soldr-cli/tests/cli_cache.rs` — 3x assert_eq strings
- `crates/soldr-cli/tests/cli_install_zccache.rs` — 2x assert_eq strings

Tracker: forge-ci/zccache#662

Co-authored-by: Claude Opus 4.7 <[email protected]>
zackees added a commit to forge-ci/setup-soldr that referenced this pull request Jun 5, 2026
soldr 0.7.52 is now published (forge-ci/soldr#678 + #679) and bundles
zccache 1.11.14, which ships the `meson configure --no-walk` flag
(forge-ci/zccache#660, closes forge-ci/zccache#659).

Bumps:
- `action.yml`: input `version` default 0.7.51 -> 0.7.52 + description
- `README.md`: 3x description strings naming the default
- `CHANGELOG.md`: new entry under `## Unreleased`

Transitive consumers (zackees/clud and similar) automatically pick
the new managed zccache version up via `setup-soldr@latest`. No
per-consumer follow-up required, which is why zackees/clud is
not part of the rollout tracker (forge-ci/zccache#662).

Co-authored-by: Claude Opus 4.7 <[email protected]>
@zackees
zackees deleted the perf/meson-discovery-skip-list-659 branch November 5, 2026 05:56
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.

perf(meson): expand discovery skip-list (.venv, .cached, .cargo, .pio, .fbuild, etc.)

1 participant