-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
WASI std lib tests fail when the host is Windows (mostly fs
-related)
#13157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Most of the bugs in the test file are caused by testing for the removal of files that are actually a directory. when wasmtime is called by calls remove_file from cap-std [Note: I might be slightly off with the trace, but I believe the final function call is correct] this ends up calling rust's Now, because One way to fix this is probably by calling Since this is caused by an "intended" behavior from the Windows API, I am not sure whether this should Similarly, the open and create functions also acts the same way because they call Another thing I found during debugging this issue is that there are some tests that are marked to not execute on windows. Since wasmtime will eventually call windows functions, they will eventually fail for the same reason. I added a fix on my fork here and will comment for clarity, but I am not sure if I should submit a PR since the fix includes adding wasmtime is treating functions called in windows environment as windows functions rather than a POSIX functions. (side note for people who wants to debug and trace unreported errors: I added a skip on every test and when error went down by one, it meant that I was in the test that caused it, then added print statement in random places to see where it's exactly located. Not sure if there is a better way since try calls would fail with no proper trace) |
Thanks for the detailed writeup! It seems like wasmtime and Zig are running into similar problems with regard to a single cross-platform API for filesystem stuff. This is an unresolved problem with the Zig standard library (see #6364 for the rename issue you're talking about, and #6600 for a broader perspective), and it sounds like this might be the case with WASI/wasmtime as well. The extra Still unsure how to proceed, since I'm unclear on exactly what wasmtime (or the WASI spec) has to say about these sorts of differences or if there's a plan to address them in the future. |
Zig Version
0.10.0-dev.4281+ebeadf9d9
Steps to Reproduce
These tests pass when the host is Linux, but fail when the host is Windows. 6 tests are failing within
std/fs/test.zig
and 10 are failing across the entire std lib test suite. Not sure exactly what the other 4 are. I'm testing withwasmtime-v1.0.1-x86_64-windows
.Worth noting especially that
Dir.deleteTree
andDir.deleteTreeMinStackSize
are consistently failing witherror.AccessDenied
, so all the fs tests that usetesting.TmpDir
are failing to clean up their directories too.It's unclear to me exactly where solutions should happen here: are these Zig bugs, wasmtime bugs, or problems with the WASI spec?
Expected Behavior
All tests pass
Actual Behavior
When running just
std/fs/test.zig
:When running all std lib tests:
The text was updated successfully, but these errors were encountered: