MCPcopy Create free account
hub / github.com/FastLED/FastLED / build_meson_setup_cmd

Function build_meson_setup_cmd

ci/meson/meson_setup_execute.py:459–545  ·  view source on GitHub ↗

Build the ``meson setup [--reconfigure] ...`` command list. When the venv ships a zccache (>= 1.11.13) that supports the ``meson configure`` wrapper (zackees/zccache#649) plus ``--input-file`` (zackees/zccache#655, closes zackees/zccache#654), route the invocation through that wrapp

(
    *,
    native_file_path: Path,
    build_dir: Path,
    build_mode: str,
    enable_examples: bool,
    enable_unit_tests: bool,
    reconfigure: bool,
    source_hashes: Optional["SourceHashes"] = None,
)

Source from the content-addressed store, hash-verified

457
458
459def build_meson_setup_cmd(
460 *,
461 native_file_path: Path,
462 build_dir: Path,
463 build_mode: str,
464 enable_examples: bool,
465 enable_unit_tests: bool,
466 reconfigure: bool,
467 source_hashes: Optional["SourceHashes"] = None,
468) -> list[str]:
469 """Build the ``meson setup [--reconfigure] ...`` command list.
470
471 When the venv ships a zccache (>= 1.11.13) that supports the
472 ``meson configure`` wrapper (zackees/zccache#649) plus ``--input-file``
473 (zackees/zccache#655, closes zackees/zccache#654), route the
474 invocation through that wrapper AND extend the cache key with a
475 sidecar file containing FastLED's source/test/example hashes. The
476 sidecar lets the wrapper correctly invalidate the cached configure
477 tree when those globs change — so the reconfigure path also benefits
478 from cache restoration instead of having to bypass the wrapper.
479
480 When the wrapper is 1.11.14+ (zackees/zccache#660), pass ``--no-walk``
481 plus an explicit ``--input-file`` for each of FastLED's known
482 meson.build paths (see ``FASTLED_MESON_BUILD_FILES``). This skips
483 the wrapper's recursive ``--source-dir`` walk entirely — that walk
484 was dominated by ``.venv/`` traversal (~100k Python files, ~5s on
485 cold-with-cache) and is pure overhead given we already enumerate
486 the input set.
487
488 When ``source_hashes`` is unavailable (caller didn't supply, or
489 sidecar write failed), the reconfigure path falls back to a direct
490 ``meson setup --reconfigure`` invocation. The non-reconfigure path
491 still uses the wrapper without the sidecar (the wrapper hashes
492 meson.build either way, which is stable for non-source-trigger
493 configures).
494 """
495 meson_exe = get_meson_executable()
496 meson_args: list[str] = [
497 "--native-file",
498 str(native_file_path),
499 f"-Dbuild_mode={build_mode}",
500 f"-Denable_examples={str(enable_examples).lower()}",
501 f"-Denable_unit_tests={str(enable_unit_tests).lower()}",
502 ]
503
504 capability = _get_zccache_meson_configure_path()
505 sidecar: Optional[Path] = None
506 if capability is not None and source_hashes is not None:
507 sidecar = _write_zccache_input_sidecar(
508 build_dir=build_dir,
509 build_mode=build_mode,
510 source_hashes=source_hashes,
511 )
512
513 # Wrapper path: requires zccache+wrapper. The sidecar is OPTIONAL —
514 # without it, the wrapper still works but only invalidates on
515 # meson.build changes, so we keep the old reconfigure-bypass guard
516 # to avoid stale-tree hits on source-trigger reconfigures.

Callers 1

setup_meson_buildFunction · 0.90

Calls 4

get_meson_executableFunction · 0.90
appendMethod · 0.45

Tested by

no test coverage detected