-
Notifications
You must be signed in to change notification settings - Fork 824
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
__wasi_path_open incompatible with wasmtime #434
Comments
Thanks for reporting this! As far as I'm aware, opening directories this way is undefined by the current WASI spec; I'll verify this and then bring it up there and see what we can do about it! For context on why Wasmer behaves this way: Wasmer is trying to stay portable and support things like Windows, and Windows (or NTFS or something) doesn't allow directories to be opened like files (we had a bug with this in the past that we fixed). So we'll have to define what the correct behavior is in regards to WASI and then emulate that on Windows and possibly Unix if it differs from the native behavior! edit: so the docs on So the next step for us here is to expose native functionality on Unix systems and emulate the behavior on Windows for now |
Okay! So I just started to investigate it and I think my initial diagnosis is incorrect! I'll post here as I know more |
So it seems that there were just a number of logic errors that compounded to cause this! I fixed |
Thank you for reporting this, it should be working on master now! |
Reading the dirs is now fixed, but reading the file |
Okay, good catch! I'll look in to it! |
Thanks! |
Okay! I have a fix and the output between wasmtime and wasmer is the same modulo differences in the order of files printed! We're going to start focusing on regression tests for our WASI implementation soon. Thanks for helping us get this right! |
446: apply base path update to wasi::path_filestat_get r=MarkMcCaskey a=MarkMcCaskey resolves #434 (again) causes `path_filestat_get` to start at the base path calculated from the fd passed in. This technique was applied to `path_open` but didn't make it to `path_filestat_get`, this fixes that Co-authored-by: Mark McCaskey <mark@wasmer.io>
Thanks, will try once my wasi application is recompiled (made some changes in a very very very big crate (librustc)). This will take >5min. |
@MarkMcCaskey your fix works! |
446: apply base path update to wasi::path_filestat_get r=MarkMcCaskey a=MarkMcCaskey resolves #434 (again) causes `path_filestat_get` to start at the base path calculated from the fd passed in. This technique was applied to `path_open` but didn't make it to `path_filestat_get`, this fixes that Co-authored-by: Mark McCaskey <mark@wasmer.io>
Thanks for the bug report!
Describe the bug
When running the reproduction in wasmer, it gives an
EINVAL
error while opening a directory, but when running using wasmtime, it succeeds.Steps to reproduce
Unpack rustc_binary.wasm, then run the following commands:
Expected behavior
Wasmer doesn't return
EINVAL
from__wasi_path_open
, like wasmtime.Actual behavior
Wasmer returns
EINVAL
from__wasi_path_open
.Additional context
The text was updated successfully, but these errors were encountered: