-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
failed to find a pre-opened file descriptor from WASM WASI module with standalone wastime #2902
Comments
Does it work if you specify |
Unfortunately not.. Same error:
|
Oh, I think I now what is going on. By using |
Hmm, this project was meant for another use-case, where it is used as a lib. I was hoping to quickly test it with wasmtime. Is this on purpose that invoked functions skip other necessary entry points? |
Wasi has two execution models:
To compile a reactor with rustc you need to use the unstable |
Thanks for your valuable input! That was new to me and actually solved the problem! Compiling the project with |
I'm also getting a very similar error. I'm building a very simple Rust WASI binary not in reactor mode, that tries to opens a file. I start it in command mode via Node - see code below. I get the same (Sorry to slightly hijack this issue, but there's not much on the internet about this.)
|
Oh wait... you just need to do this:
Sorry for the noise! |
For Windows you need this nonsense:
(Or I guess narrow it down to a specific directory if your application allows that.) |
Test Case
smartcore_wasi_lib.wasm - https://easyupload.io/7l8u6z
test1.txt
Steps to Reproduce
Just run the wasm file in the same folder as
test1.txt
.wasmtime run --dir=. smartcore_wasi_lib.wasm --invoke load_model test1.txt test2.txt
Expected Results
A new file inside
./
with the nametest2.txt
and the same contents astest1.txt
.Actual Results
Versions and Environment
Wasmtime version or commit: 0.26.0
Operating system: Ubuntu 20.04
Architecture: x86_64
Extra Info
This is the example for WASI from https://github.com/bytecodealliance/wasmtime/blob/main/docs/WASI-tutorial.md
Here's the code:
And compiled via
cargo build --target=wasm32-wasi --release
The text was updated successfully, but these errors were encountered: