Skip to content

Windows battery fixes; the root module keeps its spelling (#2788, #809, #1953) - #2793

Merged
ehartford merged 6 commits into
mainfrom
fix-809-root-spelling
Oct 29, 2026
Merged

ehartford merged 6 commits into
mainfrom
fix-809-root-spelling

Conversation

@ehartford

@ehartford ehartford commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Six commits, each its own fix (see each message):

Gate green. Draft until the stack's battery is green.

Eric Hartford added 6 commits October 28, 2026 18:20
…kips Windows (#2788)

On win10 the test failed: 'probe_key.h' file not found. It set only
WITH_SDKROOT, which host_c_sysroot reads on macOS alone; Linux reads
WITH_LINUX_SYSROOT, and on Windows host_c_sysroot is empty, so there is
no second sysroot for the cache key to tell apart. The test sets both
variables and skips Windows with that reason.
…ble suffix (#2788)

On win10 the battery stopped drop-audit and move-audit before they ran:
"missing declared input: C:/Users/Eric/wtr/src/main". The seed there is
src/main.exe (#2759); build.w declared and ran "src/main" in five
places (the audits' input and baseline, the issue61 fixture's copy).
Each now says "src/main" ++ host_exe_suffix(), as the seed target does.
…tions keep it too (#809, #1953)

8f105fe seeded the root's declarations with resolve_normalize_path(name)
so they would match the module Resolve registered. That restored the
root's imports and broke every consumer that needs the spelling, on
every host (TMPDIR ends in '/', so any $TMPDIR program is one):

- `with build $TMPDIR/x.w --emit-obj` wrote an object with no main:
  Codegen.path_is_imported_module_symbol (CodegenTraits.w) compares a
  declaration's path with source_file, the given spelling, so every
  root function read as imported and was only declared (macOS 336 B
  against 2152 B; win10 behav_panic_path_is_canonical, empty .text).
- `__FILE__` and panic sites printed the normalized path, not the
  file byte for byte (win10 behav_1953: `C:/…/t/r/b/boom.w` for
  `C:\…\t\r\b\boom.w`).

The declarations carry the spelling again, and Resolve stores the root
module under that same spelling (resolve_from_root_pool_with_prefix);
identity stays resolve_canonical_module_key (#592). Sema's lookups by
the current module path (module_index_by_path, built from module_paths
by Frontend and by every Sema copy) find the root under the one
spelling everything carries.

Evidence: behav_809_root_path_spelling_keeps_imports now runs each
spelling (stdout must be the spelling, then 7) and emits an object
that must define main; it fails on the installed compiler (all three
spellings: normalized __FILE__, no main) and passes on stage1.
…old (#2788, #2176)

On win10 every f64 parse died with an access violation before printing
(behav_959, behav_750: "1.5".parse() into f64; a direct std.libc
strtold call too, while strtod passed). The PE imports no strtold: the
mingw ucrt.lib exports none, so the link took mingwex.lib's
gdtoa_strtopx.o strtold (llvm-nm), whose long double is the 80-bit x87
type returned through a hidden pointer. Called as f64 strtold(nptr,
endptr), the text was the result slot and the null endptr was read as
the text.

std.libc's strtold is the correctly rounded double (#2176). The UCRT's
own strtold is its strtod (its long double is a double), so both
Windows runtimes bind strtod, as the Linux runtimes already do.
behav_1915 refused every program on win10: "imports a DLL Windows does
not ship: crypt32.dll". The runtime reads the ROOT system trust store
through crypt32 since #1061 (#2762); crypt32.dll is a System32 DLL on
every Windows, so the test's in-box list names it.
…deadline (#2788, #2412)

On win10 source-cache-tests failed: a source down at 127.0.0.1:1 was
reported as "no complete response within 20 s", not "no connection to
127.0.0.1:1". A refused connect takes 2077 ms there (Windows retries the
SYN; measured with tcp_connect_timeout), so five probes and their 1+2+3+4 s
pauses outlived the 20 s deadline fetch_url runs the helper under, and the
kill replaced the helper's reason with the deadline's. The probe schedule
assumed a refused connect is instant ("ten seconds in all"); a host that
drops SYNs breaks it on every OS.

fetch_url passes its deadline; the helper stops probing when the pause and
one more probe like the last would reach it, and says how many it made.
The test asks for more than one probe, not five.
@ehartford
ehartford added this pull request to stack #2797 October 28, 2026 23:18
@ehartford ehartford changed the title fix 809 root spelling Windows battery fixes; the root module keeps its spelling (#2788, #809, #1953) Oct 28, 2026
@ehartford

Copy link
Copy Markdown
Contributor Author

Seed-driven battery GREEN on the stack top ba1cf73 (with run tools/battery.w: gate, uat, battery-checks).

@ehartford
ehartford marked this pull request as ready for review October 29, 2026 00:53
@ehartford
ehartford merged commit 698a33c into main Oct 29, 2026
@ehartford
ehartford deleted the fix-809-root-spelling branch October 29, 2026 00:53
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