akeles85 opened issue #5639:
When I try to run fib debug example in the repository, it gives an an error like below. I tried in two different machines with different operating systems and got the same result.
➜ wasmtime git:(main) ✗ cargo run --example fib-debug
Compiling wasmtime-cli v6.0.0 (/Users/akeles/workspace/wasm/wasmtime)
Finished dev [unoptimized + debuginfo] target(s) in 0.77s
Runningtarget/debug/examples/fib-debug
Error: expected 4 imports, found 0I have also checked the wasm file from command line and it seems working correctly. I also can run "cargo run --example wasi" without any errors.
➜ wasmtime git:(main) ✗ wasmtime target/wasm32-wasi/debug/fib.wasm --invoke fib 2
warning: using--invoke
with a function that takes arguments is experimental and may break in the future
warning: using--invoke
with a function that returns values is experimental and may break in the future
3
alexcrichton commented on issue #5639:
Thanks for the report, but it looks like you updated the example to use the
wasm32-wasi
target rather than thewasm32-unknown-unknown
target. When doing that the module may import WASI functions which means you'd need to use aLinker
andwasmtime_wasi::add_to_linker
to set up the WASI context.If you use the example as-is, with the
wasm32-unknown-unknown
target, then it should work.
alexcrichton closed issue #5639:
When I try to run fib debug example in the repository, it gives an an error like below. I tried in two different machines with different operating systems and got the same result.
➜ wasmtime git:(main) ✗ cargo run --example fib-debug
Compiling wasmtime-cli v6.0.0 (/Users/akeles/workspace/wasm/wasmtime)
Finished dev [unoptimized + debuginfo] target(s) in 0.77s
Runningtarget/debug/examples/fib-debug
Error: expected 4 imports, found 0I have also checked the wasm file from command line and it seems working correctly. I also can run "cargo run --example wasi" without any errors.
➜ wasmtime git:(main) ✗ wasmtime target/wasm32-wasi/debug/fib.wasm --invoke fib 2
warning: using--invoke
with a function that takes arguments is experimental and may break in the future
warning: using--invoke
with a function that returns values is experimental and may break in the future
3
Last updated: Dec 23 2024 at 12:05 UTC