You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
error: failed to resolve directory while parsing WIT for path [/home/hone/Projects/rust/wasm/wasmtime_component_hello/wit]
Caused by:
package not found
--> /home/hone/Projects/rust/wasm/wasmtime_component_hello/wit/hello.wit:4:10
|
4 | import wasi:cli/environment@0.2.0;
| ^-------
The text was updated successfully, but these errors were encountered:
hone
changed the title
Using satisfying imports for wasmtime::component::bindgen!
Satisfying imports for wasmtime::component::bindgen!Apr 21, 2024
Hello and thanks for the report! One issue here is that the WIT tooling isn't in a great place to give a good error message about this. Right now WIT directories need to be "self contained" meaning that if they refer to something, like wasi:cli/environment, then that needs to be in the WIT directory. For that you'll need to copy WASI WITs locally to work with them.
You can copy the WITs from the upstream repositories or from Wasmtime itself for now. In the future we hope to improve the copy-things-around situation but we're not quite there yet.
Right now WIT directories need to be "self contained" meaning that if they refer to something, like wasi:cli/environment, then that needs to be in the WIT directory
Because it wasn't clear to me, and this issue came up in my search: put the additional .wit files in deps, e.g. I made wit/deps/network.wit to re-use types from wasi:sockets/network.
Hi, I'm fairly new to all of this. If there's someplace else I should be going, please let me know. Thanks!
I'm trying to use
bindgen!
with a simple hello world WASM Component Model. I've built a simple one using:The generated wit looks like the following:
When I manually use
add_to_linker
I can get it to work:I'm trying to follow the documentation on using
wasmtime::components::bindgen!
:I can't seem to get around this error:
The text was updated successfully, but these errors were encountered: