Skip to content

bash test --cpp --clean leaves runner executables non-executable, faking a 372-test red #4168

Closed

Description

@zackees

Summary

bash test --cpp --clean leaves the quick build tree unusable: both runner executables are produced without their executable bit, so every subsequent test fails to spawn. The harness then reports a full-suite failure that is indistinguishable from a catastrophic regression.

Hit while validating an unrelated change; I initially misread it as my own breakage.

Evidence

After bash test --cpp --clean:

File Mode
.build/meson-quick/tests/runner -rw-r--r-- ❌
.build/meson-quick/examples/example_runner -rw-r--r-- ❌
.build/meson-debug/tests/runner -rwxr-xr-x ✅

Tests are built as .so DLLs loaded by runner (tests/meson.build:85). With runner non-executable, every one of the 372 tests fails:

[1/372] x example-AdafruitBridge FAILED
[MESON] Test execution error: failed to spawn process: Permission denied
(os error 13)

Why this is worse than a one-off

  1. The bad state persists. Every later bash test --cpp inherits it and dies at ~4s with [MESON] Tests failed with return code -9, plus Could not find detailed error information in testlog.txt. Nothing points at file permissions.
  2. The harness advice hides it. On failure it prints AGENT ACTION REQUIRED: RE-RUN FAILED TESTS IN DEBUG. Debug mode uses .build/meson-debug, whose runner kept its bit, so the debug re-run passes — which reads as flakiness rather than a broken tree.
  3. -9 looks like an OOM kill. It is not: 97 GiB free and no kernel OOM record.

Repro

bash test --cpp --clean     # 372 failures, "Permission denied (os error 13)"
bash test --cpp             # now fails at ~4s with return code -9

Workaround

chmod +x .build/meson-quick/tests/runner .build/meson-quick/examples/example_runner
bash test --cpp             # 372/372 pass

Confirmed: immediately after the chmod the suite reported All tests passed (372/372 unit + examples in 18.39s) with no other change.

Suspected cause

Likely the link/cache path rather than the build generator itself, which normally sets the mode on link. zccache warned throughout these runs:

WARNING: 100.0% of lookups returned cold_skip despite a populated depgraph on disk;
the warm-cache classifier may be regressed (see #320 / #796 SI-2)

A cache restore that writes the artifact without preserving file mode would produce exactly this. Worth checking whether zccache serves the runner link output and, if so, whether it round-trips mode bits.

Suggested fixes

  • Preserve/restore the executable bit wherever the runner link output is cached or copied.
  • Assert the runner mode (or apply chmod +x) after build, so a bad cache entry cannot poison the tree.
  • Have the test harness detect a non-executable runner and say so, instead of surfacing 372 spawn failures and pointing at debug mode.

Environment

NixOS, Linux 6.18.48, x86_64. FastLED master @ 9de01d3547.

Found during work on #3713.

Generated with Claude Code

https://claude.ai/code/session_01KkufoNxfnNRU9psT3R9F51

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