Repository navigation
Description
Meta issue
This issue is a tracker — the real fixes are upstream. Linking them so FastLED's side of the fix lands in lockstep.
Symptom on FastLED
Under parallel quick-mode test runs on Windows, a small subset of test DLLs intermittently fail to load with:
Error: Failed to load C:\...\fl_math_lut.dll (error code: 126)
Error: Failed to load C:\...\fl_math_filter_filter.dll (error code: 32)
Error: Failed to load C:\...\fl_math_simd.dll (error code: 126)
Error: Failed to load C:\...\fl_math_screenmap.dll (error code: 126)
Error: Failed to load C:\...\fl_stl_fstream.dll (error code: 126)
- Error 126 =
STATUS_DLL_NOT_FOUND— a runtime dependency DLL was not on the search path when the loader resolved imports. - Error 32 =
ERROR_SHARING_VIOLATION— file-lock contention, usually from another worker still holding the DLL.
All five pass when re-run individually in --debug mode. They are real tests with real logic; the failure is a load-time flake, not a test-logic bug.
Root cause
Two pieces interact:
-
clang-tool-chainships a MinGW/clang toolchain with runtime DLLs (libwinpthread-1.dll,libstdc++-6.dll,libclang_rt.asan_dynamic-x86_64.dll, …). Thectc-clang++driver has a post-link deployment step that copies these DLLs next to the binary it just linked, so the binary loads on any machine withoutPATHgymnastics. -
zccacheis a compile/link cache that wrapsctc-clang++. When a link is a cache hit, zccache writes the cached binary directly — the driver is bypassed. The deployment step never runs. The cached binary lands next to an empty directory.
FastLED's existing mitigation lives in ci/meson/native/meson.build (see the comment around runtime_dll_paths): we query clang-tool-chain for its runtime directories and prepend them to PATH before running tests. This works most of the time. Under 16-worker parallel load, the loader occasionally can't resolve a runtime DLL before another worker's test locks / releases it, producing intermittent 126/32 errors on the heaviest tests (fl_math_simd's AVX-512 runtime, fl_stl_fstream's libstdc++ chain).
Why it's a two-sided fix
The gap isn't fixable cleanly in FastLED alone:
- zccache has no post-link hook — grep confirms no
post_link/link_hook/after_linkplumbing in the package. When a link cache hit serves, nothing runs against the output file. clang-tool-chain-libdeployexists and is exactly the tool we'd want to invoke — but it has no documented argv contract or--jsonmanifest mode that a wrapper like zccache can lean on. Each wrapper would have to reverse-engineer the invocation.
Both sides need a small, well-scoped change:
| Side | Repo | Issue | Summary |
|---|---|---|---|
| Deployment tool | zackees/clang-tool-chain |
#7 | Make libdeploy wrapper-friendly: stable argv, --json / --dry-run / --if-missing |
| Cache wrapper | zackees/zccache |
#33 | Add post-link hook so cached link outputs invoke libdeploy |
Both land → the integration wires through automatically: when zccache serves a cached link, its post-link hook calls clang-tool-chain-libdeploy <output>, and the runtime DLLs materialize in the output dir the way they would have on a fresh build. Flake disappears.
FastLED-side work (once upstream lands)
Minimal — this is a tracker, not an implementation issue:
- Bump pinned versions of
zccacheandclang-tool-chaininpyproject.toml/ install scripts once both issues land. - Opt into the hook — register
clang-tool-chain-libdeployas zccache's post-link command via whatever surface the fix exposes (CLI flag, config file, env var). - Remove the PATH workaround in
ci/meson/native/meson.build(runtime_dll_paths+test_env.prepend('PATH', ...)) — it becomes unnecessary once DLLs are co-located with binaries. Keep it as a belt-and-suspenders measure if review prefers. - Delete the known-flake retry logic (if any exists for these five tests) — the flake should be gone.
- Lint: add a CI check that runs
clang-tool-chain-libdeploy --jsonafter the test build and fails if any test DLL has unresolved runtime deps in its sibling dir. Turns a silent regression into a build error.
Why keep this as a meta issue
- Pinning the two upstream issues together so both teams can see the integration picture.
- FastLED reviewers / future-agents seeing error 126 in CI can land here, see the two upstream links, and know exactly what's blocking vs what's fixed.
- When both upstream issues close, this one closes with the version bump + workaround removal PR.
Repro
bash test --cpp --clean
under parallel load. Hits the flake roughly 1 in 3 runs on my box (Windows 10, 16 cores, zccache 1.2.11, clang-tool-chain 1.2.6). Re-running each failed test individually (bash test <name> --debug) always passes — confirms the issue is load-time, not logic.
Related
- Build: normalize all Meson -I paths to forward-slash absolute form #2328 — separate Meson
-Ipath normalization issue (different root cause, same class of "wrapper contract not enforced") - fix(audio): add #ifndef guards to vibe.h for PCH-safe inclusion #2325 — merged defensive
#ifndefguard that handles a different but adjacent symptom (#pragma once+ PCH)
Activity
zackees commentedon Apr 18, 2026
Refined design: one fix, in zccache only
Pivot on the upstream approach. The original plan paired a zccache post-link hook with a clang-tool-chain
libdeploy --jsoncontract, but the simpler and better design lives entirely in zccache:zccache caches the full artifact set (the
-ooutput plus every sibling file the driver produced in the output directory), not just the named output.See zccache#33 refined proposal: forge-ci/zccache#33 (comment).
Why this is better than the original pairing
.pdbdebug files, WASM sidecars, future driver outputs we don't know about yet.Updated status
zackees/zccachezackees/clang-tool-chainFastLED-side close-out (revised)
zccacheversion once the artifact-bundling fix lands.runtime_dll_paths/test_env.prepend('PATH', ...)workaround inci/meson/native/meson.build— runtime DLLs will be co-located with every cached test DLL.clang-tool-chain-libdeploy --json(blocked on #7) to catch silent regressions — not required for the core fix.Close this meta when step 1–3 are done and CI is stable over ~10 consecutive full test runs.
feat(daemon): invoke ZCCACHE_LINK_DEPLOY_CMD after cache-miss links
fix(ci): activate zccache ZCCACHE_LINK_DEPLOY_CMD to cure DLL-126 fla…