-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
std::fs::hard_link doesn't work on WASI #82277
Comments
Generated code for C and Rust versions of this program are wildly different, so I think C version running fine does not rule out the possibility that this could be a wasmtime bug. I'm unable to build WASI-enabled stage1 compiler so I tried with If I run with wasmer ( If I run with my own interpreter the process exits with 0 and I see the linked file. |
It's probably worth comparing the arguments and the result of |
Ah, forgot to mention - I also tried to execute with Wasmer, but it silently doesn't do anything on both outputs, so I think that's a separate issue. |
Hmm, okay, I tried to execute both with Node.js WASI support, and it does work. So perhaps it is a Wasmtime issue after all. |
Oh... and it doesn't fail on Wasmtime 0.22, but fails on 0.23. Closing here. |
UPD: as mentioned on the linked Wasmtime issue, turns out this is partially a Rust issue after all and it already has a pending fix in #81984. |
I tried this code:
I compiled it with
--target wasm32-wasi
and executed with latest Wasmtime 0.23.0 withwasmtime --mapdir=/::.
where the current directory contains valid filea
.I expected to see this happen:
A hard link
b
is created that points toa
.Instead, this happened:
It fails with an error:
Meta
rustc --version --verbose
:wasmtime --version
:Equivalent C code
I've also tried to compile an equivalent C code to exclude possibility of a bug in Wasmtime itself:
When this is compiled with WASI SDK
clang --target=wasm32-wasi
and executed with the same command in Wasmtime, it successfully creates the hardlink.The text was updated successfully, but these errors were encountered: