You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Windows: a bare argv[0] resolves through PATH, so the compiler re-invokes a different with.exe (unknown command '__ld') #2647
Found while verifying #1145 on the Windows VM (win10).
Repro: put the published with-windows-x86_64.exe (nightly-20261025-local-1-c88f3eeff0bc) in an empty directory as with.exe, with an older with.exe (v0.15.2.1) on PATH, and from cmd in that directory:
C:\t> with.exe run hello.w
...usage...
error: unknown command '__ld'
error: run failed
C:\t> C:\t\with.exe run hello.w
hi
Root cause: with_self_exe (src/compiler/LldDriver.w, "argv[0] when it names a path, else argv[0] found on PATH") resolves a bare with.exe through PATH. cmd ran the copy in the current directory, but the link spawned the older one on PATH as with.exe __ld -flavor link …, and that copy has no __ld. Every self-invocation reads the same function: __ld, __ar, with cc, link_stage_compiler_dir, the runtime root, and install-user's source.
Expected: the compiler re-invokes the executable that is running. That is the OS's own answer (GetModuleFileNameW; _NSGetExecutablePath; /proc/self/exe), not a PATH guess. The runtime exposes none today, so this needs a runtime function, which is seed-gated for src/. Until then, a bare argv[0] on Windows should be looked up in the current directory before PATH, as cmd does.
Activity
Driver: a bare argv[0] on Windows is the current directory's executab…
ehartford commentedon Oct 26, 2026
Fixed on main by 27092dc (stack #2743, battery GREEN on its top ddb68e8: behavior-tests 1949/1949, gate, uat and battery-checks green).