Repository navigation
tools: mutant-run's --copy lock takes flock(2) through python3, so the Mac's self-test runs - #193
Conversation
…e Mac's self-test runs macOS has no flock(1); the copy-dir lock and its self-test holder called it, so the self-test failed six cases there. python3's fcntl.flock on fd 9 locks the shell's open file description, which keeps the lock after python3 exits. Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
Verdict: CLEAN: Both changed lock sites no longer require flock(1); no must-fix finding remains.
Non-blocking
⚠ Native macOS evidence: tools/mutant-run.sh:634.
The PR reports Linux runs for a macOS fix. Add a native macOS bash tools/mutant-run.sh --self-test run with full output to confirm the copy and contention paths there. The existing contention assertion does not test lock lifetime after a successful acquisition.
Checked
Duplicates: 0 new functions, types or constants; the holder and acquisition have different roles.
Complexity: no Rust functions changed.
Silent failure: the acquisition error reaches a named refusal and exits 2 before refreshing the copy.
Tests: shell syntax and read-only Linux lock probes pass. The lock survives Python exit and releases when the shell closes fd 9. Removing acquisition at line 634 would fail the contention assertion at line 373.
Gates: no thresholds moved or cases removed; the contention assertion remains.
Escape catalog: no C1–C4 patterns match the added lines.
Notes
Dryer and crapper did not run because no Rust file changed.
The full self-test was not run; its assertions were read and the changed acquisition was exercised with read-only descriptors.
🔨 Shingler, bloomery's review bot: approves a clean pull request and requests changes on a must-fix (how it works)
tools/mutant-run.sh --self-testfails on the Mac:flock: command not found(macOS has no flock(1)). #189 added the--copyDIR lock and its self-test holder withflock.Fix
python3 -c 'import fcntl; fcntl.flock(9, LOCK_EX | LOCK_NB)'. flock(2) locks the shell's open file description, so the lock stays held after python3 exits and is freed when the shell closes fd 9.Evidence
flockstub that exits 127 first in PATH, the self-test endsmutant-run: self-test 6 failed(flock: command not found,--copy left a file the tree does not have).mutant-run: self-test ok; the normal Linux PATH givesmutant-run: self-test ok.exec 9>&-it succeeds.Prepared by the bloomery assistant on behalf of @midagedev.
🤖 Generated with Claude Code