Repository navigation
fix(cli): reject overlapping output paths before writing - #1975
EpsilonPhoenix wants to merge 2 commits into
Conversation
|
Thanks for digging into this. We're closing this one, though: the fix costs more than the problem is worth. Most of these collisions come from the user asking for two outputs at the same file (a symlink between two The one case worth guarding is the one a user can hit without meaning to. We'd take a new PR with just two checks, run before anything is written:
That should be a few dozen ttok, with no changes to |
A build with multiple
-opaths can exit successfully while one output silently overwrites another. For example, ifresult.mjslinks toresult.js, requesting both replaces the runnable JS with the module output.Preflight all requested outputs before writing, resolving symlinks (including dangling links and linked parent directories) and comparing hard-link identities. Include GPU sidecars only when the generated program and platform/toolkit detection select a GPU build; CPU-only
-o program -o program.gpuremains valid. Reuse generated C when preflight needs it.Validation on Linux:
output_input_linksregression fails on upstream main and passes interpreted and as emitted JavaScript.!fallback. The native CPU binaries print42.42.git diff --checkpasses.review-agent: no findings after correcting its initial CPU-sidecar finding.Actual Metal/CUDA execution and the mini-cluster gates were not run. The collision guard is a preflight; it does not protect against concurrent filesystem changes after the check.