Skip to content

Meson in-place reconfigure fails C++11 probe after test-discovery cache invalidation #2714

Closed

Description

@zackees

Symptom

Running bash test --cpp (non-clean) after adding new test files triggered a Meson reconfigure that aborted during the compiler probe phase with:

WARNING: No include directory found parsing "...\zccache.exe ...\ctc-clang++.exe -xc++ -E -v -" output
ERROR: C++ Compiler does not support -std=c++11
A full log can be found at C:\Users\niteris\dev\fastled\.build\meson-quick\meson-logs\meson-log.txt

bash test --cpp --clean immediately afterwards completed successfully (308/308 tests passing in ~265s).

Repro context

  • Platform: Windows 10 Pro 19045, PowerShell
  • Branch: fix/native-input-gamut-default-2710 (PR fix(rgbw): default source = native LED gamut + D65; named-gamut opt-in #2711)
  • Files touched in the session before failure: src/fl/gfx/rgbw.{h,cpp.hpp}, tests/fl/gfx/rgbww.cpp (extended with a new test case)
  • Meson reported Detected test file changes: Added: 225 test files before the failure — that's the trigger that kicked off the auto-reconfigure

The trigger pattern appears to be: test-discovery cache invalidation → in-place Meson reconfigure → compiler probe failure.

Hypothesis

The recent fast-native-file optimization (memory note 2026-03-07, ci/meson/build_config.py:_resolve_fast_native_entries) replaced the clang-tool-chain-sccache-cpp.EXE Python wrapper with [sccache, ctc-clang++.exe, --target=..., flags...]. On a fresh --clean setup this probes cleanly, but on an in-place reconfigure the zccache-wrapped probe ... -xc++ -E -v - apparently returns output Meson can't parse for include directories. After the include-dir parse fails, the -std=c++11 capability probe also fails (likely because Meson now has no -isystem paths to use).

Possible interactions to investigate:

  1. Stale meson-private/sanitycheck/* or compiler-cache entries left over from the prior session interact badly with the new native-file shape.
  2. zccache wraps the -v -E probe in a way that suppresses or reorders the include-directory output Meson scans.
  3. The 225-test-file mass reconfigure hits a different probe path than incremental reconfigure does.

Workaround

bash test --cpp --clean works around it but throws away the incremental-build advantage. Adding new tests shouldn't force a full clean rebuild.

Suggested investigation

  • Inspect .build/meson-quick/meson-logs/meson-log.txt immediately after the failure (the successful clean rebuild overwrote it in my repro — needs to be reproduced and captured before retry).
  • Compare zccache-wrapped vs. raw-binary output of clang++ -xc++ -E -v - to see whether the wrapper drops the #include <...> search starts here: block that Meson parses.
  • Check whether meson reconfigure (as opposed to first-time setup) calls into _resolve_fast_native_entries() cleanly, or whether it reuses the prior native-file content.

Defaults used while filing this issue

I picked these defaults — edit on GitHub if any are wrong:

  • Title focused on the user-visible C++11 symptom rather than the suspected zccache parse failure root cause.
  • Labels: type: bug, area: ci, priority: low (low-frequency dev-loop annoyance, no CI impact since CI uses fresh clones), status: triage.
  • No reproducer steps beyond what's above — the failure log was overwritten by the successful --clean retry.

🤖 Filed via Claude Code during PR #2711 follow-up work.

Activity

  1. added
    status: triage
    type: bug
    priority: low
    area: ci
    on Jun 3, 2026
  2. zackees commented on Jun 5, 2026

    @zackees
    MemberAuthor

    Investigation report

    Reproduced the warning string on this Windows 10 box and traced the full code path. Root cause is zccache wrapping the meson include-dir probe, not a stale-cache issue. The "No include directory found" warning is benign in isolation but cascades when zccache adds enough latency / pipe weirdness that subsequent capability probes time out on the daemon and return non-zero — at which point -std=c++11: NO and meson aborts.

    Code path

    1. ci/meson/build_config.py:setup_meson_build -> write_meson_native_file -> _resolve_fast_native_entries (in ci/meson/native_launchers.py:296) emits the cpp entry as [<zccache path>, <ctc-clang++ path>] whenever a cache_binary is resolved. The resulting meson_native.txt line:

      cpp = ['C:\Users\niteris\dev\fastled5\.venv\Scripts\zccache.exe', 'C:\Users\niteris\dev\fastled5\.cached\clang-native\ctc-clang++.exe']
      
    2. Meson reads this in mesonbuild/envconfig.py:BinaryTable.parse_entry (lines 462-477). It only strips a leading element from the compiler list when that element is the literal string 'ccache' or 'sccache'. Any other prefix (full path, 'zccache', etc.) is treated as the actual compiler, and the rest of the list is passed as arguments. So meson never knows zccache is a wrapper.

    3. Meson then runs the include-dir probe via mesonbuild/compilers/mixins/gnu.py:gnulike_default_include_dirs (line 319):

      cmd = list(compiler) + [f'-x{lang}', '-E', '-v', '-']

      That becomes zccache.exe ctc-clang++.exe -xc++ -E -v -, reading from stdin.

    4. The probe is called from GnuLikeCompiler.get_default_include_dirs (line 401) with get_exelist(ccache=False) — meson DOES try to exclude ccache from the probe (see compilers.py:601-602), but only the prefixes meson recognizes get stripped. Since meson didn't recognize zccache, the full wrapped command runs anyway.

    Live reproduction of the wrapped probe (this Windows 10 + zccache 1.11.14)

    Bare compiler (works perfectly, returns in <1s):

    $ ctc-clang++.exe -xc++ -E -v - < /dev/null
    clang version 21.1.5
    Target: x86_64-w64-windows-gnu
    ...
    #include "..." search starts here:
    #include <...> search starts here:
     C:/Users/niteris/.clang-tool-chain/clang/win/x86_64/include/c++/v1
     C:/Users/niteris/.clang-tool-chain/clang/win/x86_64/include
     C:\Users\niteris\.clang-tool-chain\clang\win\x86_64\lib\clang\21\include
    End of search list.
    

    Zccache-wrapped probe (hangs indefinitely on this box, killed at 90s):

    $ zccache.exe ctc-clang++.exe -xc++ -E -v - < /dev/null   # times out (SIGTERM after 90s)
    $ zccache.exe wrap ctc-clang++.exe -E <empty.cpp>          # hangs >2min
    

    Existing .build/meson-quick/meson-logs/meson-log.txt from a prior session captures the warning at line 1346 followed by three failed compile probes returning -> 1 with zccache[err][R]: broken connection to daemon: recv timed out after 300s. The -std=c++11 probe at line 1397 happened to succeed in that pass, but on the reconfigure-during-225-file-discovery pass it didn't, hence the original report.

    Proposed fix (single-PR-sized)

    Move zccache out of the meson native file. Wrap compile/link commands at the ninja level instead. Concretely:

    1. ci/meson/native_launchers.py:_resolve_fast_native_entries — drop the cache_binary parameter from the cc/cxx entries. Emit:

      cpp = ['C:\...\ctc-clang++.exe']
      c   = ['C:\...\ctc-clang.exe']
      

      Meson now sees the bare compiler. The -xc++ -E -v - probe runs natively against ctc-clang++.exe and parses cleanly. C++11 capability probe and every other meson probe also runs against the bare compiler.

    2. New helper in ci/meson/meson_markers.py — inject_zccache_wrapper_patch(build_dir, zccache_path). Sibling to the existing inject_ar_optimization_patches (same file, same read-once/write-once pattern, line 181). After meson generates build.ninja, rewrite the two relevant rules in-place:

      rule cpp_COMPILER
       command = <ctc-clang++> $ARGS ...      ->   command = <zccache> <ctc-clang++> $ARGS ...
      rule cpp_LINKER
       command = <ctc-clang++> $ARGS ...      ->   command = <zccache> <ctc-clang++> $ARGS ...
      

      (Same for c_COMPILER/c_LINKER if C is enabled.) These are the only two rules that should be cached. STATIC_LINKER (ar) is already wrapped by ar_content_preserving.py and should stay that way.

    3. Wire the patch call wherever inject_ar_optimization_patches is already called: meson_setup_execute.py:run_meson_setup_command (line 630) and meson_setup_execute.py:handle_skip_meson_setup (line 319).

    4. zccache-version invalidation — the existing markers.zccache_version check in build_config.py:279-299 still works. When zccache changes, force_reconfigure fires, build.ninja gets regenerated, and the patch re-wraps with the new path.

    Why this is the right shape

    • Meson native-file API can't represent compiler launchers for tools it doesn't natively recognize. Patching meson upstream to add zccache to parse_entry is the "correct" long-term fix but requires upstream review.
    • The existing ar-patching helper proves this in-place build.ninja rewrite is already an accepted pattern in this codebase.
    • The probe phase runs ~10x and is exactly the workload that doesn't benefit from caching (one-off temp files, never repeated). Building runs thousands of times against stable sources — that's where caching pays off. The split is natural.
    • Behavioral change is contained: same cache invalidation policy, same cache root, same --strict-paths mode, just applied to the build-only command lines.

    Risk / test plan if implemented

    • Validate that build.ninja rule lines remain editable across meson versions (already pinned to 1.10.x in pyproject, and inject_ar_optimization_patches already depends on this exact line shape).
    • Run bash test --cpp --clean then bash test --cpp twice (warm reconfigure path) and confirm the original symptom doesn't reproduce.
    • Watch zccache status cache hits before/after — incremental rebuilds should still cache.

    Why not implemented in this iteration

    The fix touches the recently-merged zccache+meson-configure pipeline (#2754, #2758, #2761) and changes the long-standing assumption that the native file is the single source of truth for the compile command line. Worth a dedicated PR with a clean diff and the test plan above, not bundled into other work. Filing this report so the next session has the full trace.

    Filed via Claude Code while iterating on #2714.

  3. moved this from Triage to Done in FastLED Trackeron Jun 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: cipriority: lowstatus: triagetype: bug

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions