Repository navigation
Conversation
Normalize guest paths so Windows separators do not break WIT loading. Close the embedded runtime after each load to release directory handles.
This was referenced Oct 22, 2026
kjanat
force-pushed
the
fix/wit-loader-paths
branch
from
October 22, 2026 19:57
31cb497 to
feb121e
Compare
Compare each directory with its parent to detect filesystem roots. The slash-only check looped forever at Windows drive roots when no go.mod existed. Keep nested package suffixes while ascending.
Build fixture paths with filepath.Rel and filepath.Join. Test Windows directory creation permissions with an ACL and compare created permissions with a control directory on the same filesystem. Remove empty test directories before TinyGo cleanup.
Keep WIT path fixtures on the checkout volume and WIT goldens on LF endings. Remove owned temporary files explicitly for TinyGo. Run the existing Go version matrix on Windows as well as Linux.
This branch has not been deployed
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.
LoadWITrejects valid Windows paths when native separators in WASI preopen names do not match guest paths. Successful loads also leave the embedded runtime open, leaking directory handles.Use
/for guest arguments and preopen names, native paths for host mounts, and close the runtime after each load. Stop generator module lookup at drive roots and construct generated fixture paths with filesystem-relative paths.Make tests work with Windows directory permissions and with checkout and temporary directories on different drives. Keep WIT fixtures LF-only and use explicit cleanup where TinyGo cannot recursively remove directories. Add Windows to the existing Go CI matrix.
Verification: full Windows
go test -count=1 ./... ./cm/...; full WIT suite with checkout on V: and temp files on C:; generator and directory-helper packages under TinyGo WASI Preview 1 and 2.