Closed shjunma closed 3 years ago
Thanks for this report. lucet-runtime-example
is incorrect here, and this never got caught because it is not tested in CI. Since https://github.com/bytecodealliance/lucet/pull/655, any use of lucet-wasi
requires instances be run as async
inside the tokio runtime.
We realize this restriction is pretty heavy, but lucet is approaching its EOL and lucet isn't structured to make supporting both sync and async versions of wasi easy. We recommend users transition to our sister project, wasmtime, which at this point supports everything lucet does, as well as many new wasm features which lucet does not. Wasmtime supports wasi both on sync rust and on top of tokio.
I got it, thanks very much for your reply.
thread 'main' panicked at 'called
Result::unwrap()
on anErr
value: RuntimeTerminated(TerminationDetails::BlockOnNeedsAsync)'lucet version is latest master branch git clone https://github.com/bytecodealliance/lucet.git
Follow is my steps:
cd ~/workplace mkdir hello cd hello vim hello.c
wasm32-wasi-clang -Ofast -o hello.wasm hello.c lucetc-wasi -o hello.so hello.wasm lucet-wasi hello.so
output: Hello world
cd lucet/docs/lucet-runtime-example cp hello.so into docs/lucet-runtime-example/
src/main.rs content:
project files:
cargo run
Result: Compiling lucet-runtime-example v0.1.0 (/home/ubuntu/workplace/lucet/docs/lucet-runtime-example) Finished dev [unoptimized + debuginfo] target(s) in 10.30s Running
/home/ubuntu/workplace/lucet/target/debug/lucet-runtime-example
thread 'main' panicked at 'calledResult::unwrap()
on anErr
value: RuntimeTerminated(TerminationDetails::BlockOnNeedsAsync)', docs/lucet-runtime-example/src/main.rs:17:33Who can tell me why? thanks a lot