Repository navigation
with run: each invocation builds in a directory of its own (#1374) - #1511
Merged
ehartford merged 1 commit intoSep 23, 2026
Merged
Conversation
Contributor
Author
|
Stack #1516 battery (seed-driven, new seed, cold c_import cache, with :drop-audit/:move-audit) on main + #1509 → … → #1515 (head 63e8340): build ok, :fixpoint ok (stage2 == stage3 with DWARF variables), :drop-audit ok, :move-audit ok, :test ok (no reds), :test-green ok, :last-green ok. Merge the stack: |
ehartford
marked this pull request as ready for review
September 23, 2026 16:30
The shared runtime objects are not the race: their extraction to
out/tmp/with_runtime is already a unique temp file renamed into place, and
eight concurrent `with run` of eight differently named copies of one program
in one fresh directory pass (3 rounds, 24/24). Eight concurrent runs of the
SAME program fail (3 rounds: 19 rc=1 link failures, 5 rc=127).
`with run prog.w` built to link_stage_output_path_for_source: out/prog, its
object out/prog.o and the object's nm report out/prog.o.undef
(link_stage_undefined_symbols_for_object), all named by the source alone.
Proven by interleaving under lldb (installed v0.15.2.1): run A stopped at
runtime_read_file called from link_stage_undefined_symbols_for_object, with
out/p1.o and out/p1.o.undef (363 bytes) on disk; run B of the same file ran
to completion (`1 0`, rc=0) and left neither file; A continued and failed
with `clang: error: no such file or directory: 'out/p1.o'`. Unpaused, the
same overlap reads another run's truncated or deleted report: undef is
empty, link_stage_undefined_symbols_need_helpers_runtime says no runtime,
and the link lacks rt_core ("_with_vec_push" undefined, the issue's
symptom); a run whose binary another run's cleanup deleted exits 127.
run_run_command now builds into <out>/<dir>/run.<pid>.<nanos>/<stem> and
removes that directory after the program exits (or after a failed build).
test/behavior/behav_run_concurrent_same_program.w runs eight `with run` of
one program from eight threads in one case directory; with the installed
compiler as the p7 compiler, runs fail with `_with_vec_push` undefined and
rc=127.
ehartford
force-pushed
the
fix-1374-run-private-artifacts
branch
from
September 23, 2026 19:37
a9da74f to
8589e3d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1374.
Root cause (not the runtime objects). The extraction to
out/tmp/with_runtimeis already a unique temp file renamed into place. Eight concurrentwith runof eight differently named copies of one program in one fresh directory pass (3 rounds, 24/24); eight concurrent runs of the same program fail (3 rounds: 19 rc=1 link failures, 5 rc=127).with run prog.wbuilt tolink_stage_output_path_for_source:out/prog, its objectout/prog.o, and the object's nm reportout/prog.o.undef(link_stage_undefined_symbols_for_object), all named by the source alone.Proof (installed v0.15.2.1, lldb): run A stopped at
runtime_read_filecalled fromlink_stage_undefined_symbols_for_object, without/p1.oandout/p1.o.undef(363 bytes) on disk; run B of the same file ran to completion (1 0, rc=0) and left neither file; A continued and failed withclang: error: no such file or directory: 'out/p1.o'. Unpaused, the same overlap reads another run's truncated or deleted report:undefis empty,link_stage_undefined_symbols_need_helpers_runtimesays no runtime, and the link lacks rt_core ("_with_vec_push"undefined — the issue's symptom); a run whose binary another run's cleanup deleted exits 127.Fix.
run_run_commandbuilds into<out>/<dir>/run.<pid>.<nanos>/<stem>and removes that directory after the program exits (or after a failed build). The binary keeps the source's stem, so argv[0]'s basename is unchanged.Test.
test/behavior/behav_run_concurrent_same_program.wruns eightwith runof one program from eight threads in one case directory; with the installed compiler runs fail with_with_vec_pushundefined and rc=127; with the tree's stage2 all eight printran 7and no per-run file remains.Found on the way: #1471 (closures made in a loop capture a Copy local by place; the fixture spells one closure site per thread).