Skip to content

bash test --cpp fails with 'Stale test artifact' on a healthy tree; --clean and zccache stop do not clear it #4212

Closed

Description

@zackees

Symptom

bash test --cpp fails all tests without running any:

[1/383] x cled_controller FAILED
[MESON] Stale test artifact: .build/meson-quick/tests/cled_controller.so
  DLL mtime (1788816732.21) predates this build's start (1788837138.54).
  The current link likely failed and left a previous build's DLL behind --
  running it would produce misleading results (see FastLED #3011).
  Resolve the underlying link failure (`zccache stop` + retry usually clears
  the daemon-crash variant) and re-run.

Ten such failures, then the runner halts early. This is #3011's guard firing. The guard is working as designed; the question is why it fires on a tree with no link failure.

What I verified

There is no link failure. The build log contains no FAILED:, link failed, lost connection, or ninja: build stopped. The only match for those patterns is the runner's own Failed: 10 summary. Linking progressed normally ([586/824] Linking target ...).

Not caused by any local change. Reproduced identically with my working changes stashed (clean tree, git status empty) -- same tests, same message.

The suggested remedies do not clear it.

  • zccache stop -> daemon stopped, then the identical failure on retry.
  • bash test --clean --cpp -> the failure moved from unit tests to examples (example-AdafruitBridge, example-ParallelSPI, example-MoodRing, ...), still 10 x "Stale test artifact".
  • Across all three runs the reported DLL mtime was unchanged (1788816732.21), i.e. the artifacts are not being relinked.

The artifacts really are old. cled_controller.so and fastled_core.so both carry mtime 1788813865 (13:44), while the failing build started at 1788837394 (20:16) -- about 6.5 hours earlier.

But an earlier run passed with those same artifacts. A bash test --cpp at 14:33 reported 385/385 unit + examples passed with Compilation | 0.34s, i.e. mostly up-to-date, against artifacts already carrying the 13:44 mtime. So "artifact older than build start" is not by itself sufficient to trigger this.

One possibly relevant log line, offered as an observation and not a diagnosis:

[BUILD] Stabilized 2 output mtimes (zccache mtime fix)

zccache deliberately normalises some output mtimes, which is the kind of thing that could interact with an mtime-vs-build-start check. I did not establish that it is the cause and am not claiming it.

What I am not claiming

I could not identify the trigger. The difference between the 14:33 pass and the 20:16 failure is not accounted for by anything I measured, and I would rather leave that open than guess at it.

Why it matters

bash test is unusable on this bench, and the failure presents as "your change broke 10 tests". It cost a stash/restore cycle and a full --clean rebuild to establish that a src/fl/channels/bus_info.h change was unrelated -- the first plausible reading of the output is that the change is at fault. A message distinguishing "artifact older than build start" from "link demonstrably failed during this run" would make that call much cheaper; only the second warrants suspecting the current build.

Environment

NixOS, zccache 1.13.22, quick mode, .build/meson-quick. Same bench as #4205 (link wrapper stripping exec bits from test executables), which is a separate fault that also presents as broken tests.

Activity

  1. zackees commented on Sep 8, 2026

    @zackees
    MemberAuthor

    Sharper diagnosis, and it reproduces on a clean tree at merged master. Updating my original report, which said I could not identify a trigger.

    Now reproduces without any local change

    Clean checkout of 3ee4009a83 (merge of #4208), git status empty. bash test --cpp still fails with 10 x "Stale test artifact".

    --clean does not produce fresh artifacts

    ci/meson/meson_setup_execute.py:523 documents the intent:

    The sidecar lives in build_dir.parent (typically .build/) so it survives bash test --clean (which wipes the inner build dir but leaves .build/ intact).

    But after two separate bash test --clean --cpp runs, every artifact still carries its original mtime:

    tests/cled_controller.so         2026-09-07 13:42:17
    tests/fastled_core.so            2026-09-07 13:42:18
    tests/fl_stl_vector.so           2026-09-07 13:43:52
    examples/example-Animartrix.so   2026-09-07 13:44:35
    examples/example-Blink.so        2026-09-07 13:44:41
    now                              2026-09-07 20:41:41
    

    Roughly 7 hours old, unchanged across every run. Unit tests and examples alike.

    Likely mechanism (evidence-backed, but see the caveat)

    If --clean really wipes the inner build dir, these files cannot have been preserved -- they must have been restored. That points at zccache returning cached link outputs together with their original mtimes. The build log states it does manipulate output mtimes:

    [BUILD] Stabilized 2 output mtimes (zccache mtime fix)
    

    which would produce exactly this: a successful build whose outputs legitimately predate the build's start, and a #3011 guard that reads "mtime older than build start" as "the link failed and left an old DLL behind". Both components are individually correct; the interaction is what fails.

    One thing this still does not explain

    A run at 14:33 today reported 385/385 unit + examples passed with Compilation | 0.34s against artifacts already carrying the 13:44 mtime. If "mtime predates build start" were sufficient on its own, that run should have failed too. Something else gates whether the guard fires, and I have not identified it. Flagging the gap rather than papering over it.

    A second, different failure from the same build state

    Before the clean, the same tree produced compile errors instead:

    src/fl/channels/bus_info.h:12:8: error: redefinition of 'DeviceRuntime'
    src/fl/channels/bus_info.h:31:8: error: redefinition of 'DeviceInfo'
    

    bus_info.h has #pragma once and the test includes it normally (directly, and transitively via bus_info.json.h). #pragma once dedupes by file identity, so a redefinition here suggests the same header resolving under two different paths -- possibly related to the Normalized private include paths for zccache strict mode step. bash test --clean cleared this one (0 occurrences afterwards) while leaving the stale-artifact failure intact.

    Suggested handling

    • Have the guard distinguish "artifact older than build start" from "the link for this target demonstrably failed during this run". Only the latter justifies blaming the current build; the former is expected whenever a link is a cache hit.
    • Or have the zccache mtime restore bump restored outputs to the current build's start time, so cache hits stop looking like failed links.

    Either way the current behaviour makes bash test unusable here and presents as "your change broke 10 tests", which is what cost me a stash/restore cycle and two full clean rebuilds to disprove.

  2. zackees commented on Sep 8, 2026

    @zackees
    MemberAuthor

    Correction to my previous comment, plus a confirmed sibling bug.

    I said above that the stale-artifact failures were explained by zccache restoring outputs with their original mtimes. That mechanism is real, but I overstated how much it explains — I found and fixed a concrete bug in the stabilizer and the failures still recurred. Correcting that here rather than leaving it standing.

    Confirmed bug (fixed in #4213)

    ci/meson/mtime_stabilizer.py, the module whose entire purpose is repairing this, globbed only:

    _DLL_PATTERNS = ["tests/*.dll", "examples/*.dll"]

    Linux emits .so, macOS .dylib. Measured against the live build dir: 0 of 383 outputs matched. The module was a silent no-op on two of three hosts.

    _KEY_INPUTS had the same flaw — it looked for fastled.dll.p/fastled.dll.symbols when the file is fastled.so.p/fastled.so.symbols, so the only input mtime it ever found was libcrash_handler.a.

    Fixed by deriving both from ("dll", "so", "dylib"). Verified: 0 → 383 matched, symbols file resolves.

    Why that does not close this issue

    The two components test different things:

    compares output mtime against
    stabilizer the input files (symbols, libcrash_handler.a)
    #3011 guard this build's start time

    A cache-restored output can satisfy the first and still fail the second. So fixing the stabilizer's glob was necessary but not sufficient, and I have not established that the mtime path is the whole story for the guard failures. Flagging the gap rather than declaring victory.

    Confirmed sibling: the same restore also drops the executable bit (#4205)

    Chasing a different failure on the same tree — ERROR: Unhandled python OSError ... return code 13 — turned up:

    PermissionError: [Errno 13] Permission denied:
      .build/meson-quick/tests/color_profile_tiny_runtime
    

    A build-dir survey found 4 ELF executables, 4 without +x, 0 with it. So a zccache-served link loses both the mtime and the mode. That makes the underlying defect a good deal more concrete than "something restores old mtimes": cached link results come back without the attributes the linker sets, and each lost attribute fails the build in its own way.

    Suggested handling (unchanged)

    🤖 Generated with Claude Code

    https://claude.ai/code/session_01KkufoNxfnNRU9psT3R9F51

  3. moved this from Triage to Done in FastLED Trackeron Sep 9, 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

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions