Repository navigation
Windows: one spelling per root module, and a battery that runs no shell (#809) - #2787
Merged
Merged
Conversation
ehartford
force-pushed
the
fix-std-path-windows
branch
from
October 28, 2026 19:01
5da4174 to
d47633f
Compare
added 2 commits
October 28, 2026 15:24
…s registered under (#809) On win10, `tools\battery.w` could not run from the checkout: "'spawn_os' requires an explicit import (§18.1); add: use std.thread.spawn_os" under `use std.thread`. Not Windows-specific: on the Mac, `with check sub/./prog.w` and `sub//prog.w` fail the same way; `sub/prog.w` passes. Root cause (lldb on the installed compiler, `with check out/./th.w`): Sema.update_module_context (SemaCheck.w:2511) sets current_module_path from decl_source_paths, which compile_source seeded with the command line's spelling (`out/./th.w`, Frontend.w seed_decl_source_paths / append_decl_source_paths). Resolve registers the same module under resolve_normalize_path (Resolve.w:315-327, `out/th.w`), so every lookup keyed by the current module path (module_index_by_path, the import walk) missed and the root module had no imports. On Windows the normalizer turns `\` into `/`, so any backslash spelling hit it. The root's declarations now carry resolve_normalize_path(name), the module's one spelling; diagnostics keep the spelling the user gave. `with analyze <file> 'explain:visible:<name>'` reported verdict 1 for the failing spelling: it walks from the registered (normalized) root, not from the path the checker used, so it was silent about this bug. With one spelling the two agree. Evidence: test/behavior/behav_809_root_path_spelling_keeps_imports.w checks one program through three spellings; it fails on the installed compiler (`spawn_os requires an explicit import` for `/./` and `//`).
…ss_alive and current_dir Ruling (Eric, 2026-10-28): the build depends on no Unix or Windows command. tools/battery.w ran every step through `sh -c` (shell syntax, `$PWD`, redirections, `rm -rf`, `kill -0`) and wrapped the build in /usr/bin/caffeinate; on Windows there is no sh, and the seed it looked for was `src/main` where #2759 installs `src/main.exe`. - Every step is an argument vector (run_to_files); `git` is invoked the same way. The build's stdout and stderr land in the step's log (stderr appended after the run; the live RED poll reads both while it runs). - WITH (the pinned seed, absolute), WITH_DRIVER_SHA256 and WITH_SOURCES_COMMIT are set in the process environment the children inherit, instead of a shell prefix. - `rm -rf` is remove_tree; the slot owner's liveness is std.process.process_alive (the runtime's with_process_alive, kill(pid, 0) or OpenProcess); the working directory is std.os.current_dir (the runtime's with_current_dir over rt_getcwd, beside with_process_alive in rt_core: std.os importing rt.platform for it exposed the wasm runtime's names to the c_algorithms bundle), not $PWD, which cmd does not set. - The seed is src/main.exe on Windows. - caffeinate is gone: holding the machine awake and the display lit is the caller's (a host command either way). Until a seed carries process_alive and current_dir, run it with the tree's release compiler: `out/release/bin/with run tools/battery.w`.
ehartford
force-pushed
the
fix-std-path-windows
branch
from
October 28, 2026 19:32
d47633f to
f8ee22e
Compare
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. |
ehartford
marked this pull request as ready for review
October 28, 2026 19:51
This was referenced Oct 28, 2026
Closed
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.
Commits (each message carries its root cause and evidence):
Mac battery GREEN on f8ee22e (379 s), run by the no-shell tools/battery.w with the tree's release compiler.