I'm trying to use the macro wit_bindgen::generate!
and need to use the with
field to add some existing bindings. This is what I tried:
wit_bindgen::generate!({
world: "example",
with: {
"lyra:api/ecs": common_api::bindings::lyra::api::ecs,
},
});
but I get an error:
error: failed to resolve directory while parsing WIT for path [/media/data_drive/Development/Rust/lyra-wasm-scripting-test/witguest/wit]
Caused by:
package not found
--> /media/data_drive/Development/Rust/lyra-wasm-scripting-test/witguest/wit/world.wit:14:9
|
14 | use lyra:api/ecs.{ecs-world};
| ^-------
I tried to change the with to "lyra:api": common_api::bindings::lyra::api
and I also got the same error. I'm not sure how I can fix it.
The lyra:api package needs to be found in a subdue of your wit/deps directory
So mkdir deps/lyraapi and stick it in there
Ahh that was it! The only issue is that now I have duplicates of .wit
files in my repo. I guess I could create symlinks though
Thanks!
Last updated: Dec 23 2024 at 12:05 UTC