Repository navigation
#801: resolve embed_file on native Windows + un-skip its 3 tests - #813
Merged
Merged
Conversation
ropoctl
force-pushed
the
windows-embed-path-801
branch
from
August 17, 2026 06:37
06394bd to
10ac08f
Compare
…#801) tracked_dirname and tracked_normalize_path split path segments on '/' (byte 47) only. On native Windows a source path spelled with backslashes (`with build src\app.w`) therefore yields an empty dirname, so a bare or subdirectory embed_file target resolves against the process cwd instead of the source file's directory and fails with "could not read". Make both helpers separator-agnostic (split on '/' and '\'), matching the sibling helpers tracked_path_is_absolute / tracked_path_has_parent_segment, which already treat '\' as a separator on every platform. This is the existing design decision made consistent, not a new one. Verified on the Windows x86_64 VM with a 2x2 matrix (bare-filename and computed-subpath embeds x forward-slash / backslash source paths): before, backslash source paths fail "could not read"; after, all four cells build and print "ok". The test harness always feeds forward-slash-terminated paths (rt_list_files joins with '/'), so this specific regression is only reachable from a hand-typed backslash CLI path and is verified manually rather than by a harness fixture.
const_str_embed_file_const, embed_file_computed_path, and embed_file_relative_module were gated skip-windows on #801. The green battery feeds the compiler forward-slash-terminated source paths, which embed_file already resolves correctly, so all three build and print "ok" on native Windows. Verified on the Windows x86_64 VM through the real `test` subcommand (build + run + stdout check) with battery-form relative paths: all three pass on both the current compiler and the #801-fixed compiler, including the imported-module embed (relative_module).
… break asserts (#801) embed_file embeds a fixture's bytes verbatim and the behavior tests assert the result exactly (e.g. `DATA == "embedded const data\n"`). GitHub's Windows runners set core.autocrlf=true, so a native checkout rewrites the .txt fixtures to CRLF; embed_file then reads "...\r\n" and every assertion fails at runtime (clean panic, exit 134) even though compilation succeeds. Reproduced natively on the Windows VM: an LF copy of the fixture prints "ok" (rc 0); a byte-identical CRLF copy panics 'assertion failed' (rc 134). Pin the embed_file test fixtures to LF via .gitattributes so their bytes are identical on every platform.
ropoctl
force-pushed
the
windows-embed-path-801
branch
from
August 17, 2026 06:39
10ac08f to
9a92001
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.
Stacked on #812 (windows-regex-fnarg-abi-798).
What
tracked_dirname/tracked_normalize_pathinsrc/compiler/TrackedInputs.wsplit path segments on/only. A native-Windows source path spelled with backslashes (with build src\app.w) then produces an empty dirname, soembed_fileresolves its target against the process cwd instead of the source directory and fails "could not read". Both helpers are now separator-agnostic (/and\), matching the sibling helperstracked_path_is_absolute/tracked_path_has_parent_segment, which already treat\as a separator on every platform.const_str_embed_file_const,embed_file_computed_path,embed_file_relative_modulewere gatedskip-windowson Windows: embed_file behavior tests fail #801. They build and printokon native Windows.Why the tests already pass (and the fix is still real)
The green battery feeds the compiler forward-slash-terminated source paths (
rt_list_filesjoins with/viawin_path_join), so the harness never hits the backslash regression — the three tests resolve correctly through it. The fix targets the remaining hand-typed-backslash CLI path, which a Windows dev will use; it is not exercised by a harness fixture but is verified manually on the VM.Verification (Windows x86_64 VM, native)
embed_file: could not read; after, all four build and runok.testsubcommand (build + run + stdout check) with battery-form relative paths: all three tests pass on both the current compiler and the Windows: embed_file behavior tests fail #801-fixed compiler, including the imported-module embed (relative_module).