Skip to content

driver: a build.w build names its own compiler; the Windows seed is src/main.exe (#2759, #2637) - #2783

Merged
ehartford merged 5 commits into
mainfrom
fix-2759
Oct 28, 2026
Merged

ehartford merged 5 commits into
mainfrom
fix-2759

Conversation

@ehartford

@ehartford ehartford commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Commits (each message carries its root cause and evidence):

Restacked 2026-10-28 from the handoff's branches onto main 455ff0b; the wip commits are grouped by issue.

Eric Hartford added 4 commits October 28, 2026 14:14
Root cause, observed on win10: comp_resolve_seed_compiler
(build/compiler.w) resolves a target's "seed" compiler as WITH, then
with on PATH, then src/main. A plain-shell src\main.exe build :dev
therefore handed the bootstrap bridge compiles to an older PATH
with.exe (v0.15.2.1), whose embedded runtime predates use rt.rt_core
in src/compiler/LlvmBridge.w: import module not found. The same
compile by hand with the seed succeeds; with WITH pinned to the seed
the action succeeds.

The driver owns its identity: in build.w tool mode, when WITH is
unset the driver sets it to its own executable before the graph
loads, so every resolution downstream names the compiler that was
invoked. An explicit WITH still wins (the battery pins the seed that
way, and seed-driver still refuses a mismatch). with_self_exe now
returns an absolute path — a child action runs in the project root,
where a relative argv[0] spelling names nothing.

Regression: test/behavior/behav_2759_driver_names_itself_with.w — an
action records env WITH under a driver run with WITH unset; before,
it read empty.
Observed on win10: :seed installed the pinned seed as extensionless
src/main beside a stale src/main.exe; cmd resolves the .exe first, so
the tree kept driving with the old seed (undefined variable
with_system_info at stage1). The seed target's output and the
src/main fallback in comp_resolve_seed_compiler now carry the host
exe suffix, as every other tool path in the build layer does.
On win10 the regression test's runner spawns the compiler by a
repo-relative argv[0] with the child cwd in the case directory;
joining that cwd named a file that does not exist. Existence decides:
the cwd join when it names this executable, the raw spelling
otherwise (the build layer absolutizes a relative compiler against
the project root it runs the child in).
On win10 the test runner named itself by bare argv[0]; a test child
in a case directory could not resolve it, and the child compiler
then could not name itself in WITH either. with_self_exe already
owns this answer for every other self-invocation.
@ehartford
ehartford added this pull request to stack #2786 October 28, 2026 18:16
@ehartford ehartford changed the title fix 2759 driver: a build.w build names its own compiler; the Windows seed is src/main.exe (#2759, #2637) Oct 28, 2026
ea914ac installs the fetched seed at src/main.exe on Windows, which
.gitignore did not cover: every Windows tree read as dirty to the
battery's clean-tree check and to the green lookup (D49).
@ehartford

Copy link
Copy Markdown
Contributor Author

Seed-driven Mac battery GREEN on the stack top f8ee22e (379 s, run by this stack's no-shell tools/battery.w with the tree's release compiler). The first full Windows battery on win10 (same top, 696 s) ran end to end and is RED on targets outside #809's list; inventory in the tracking issue filed with this merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant