Hi all!
I've been looking for the best way to link worlds dynamically, for example I have two wit worlds:
world runner {
import runner-impl;
export runner-interface;
}
world impl {
export runner-impl;
}
I want to be able in my host (wasmtime) to dynamically select the world impl wasm (i can have a few of wasm files with different impls) every time the runner uses it. I've looked at all tests and example, but I couldn't figure what it the best way to do it.
Thank you
There isn't a great solution for this yet, but you have a couple of options:
wit_component::decode
wasmparser
to inspect the component import/export sectionsa 3rd option that _might_ work in your case would be to create a world that includes all the import
s that might be used by a component, actually instantiate your component linked against that world, then inspect the Instance::exports
Last updated: Nov 22 2024 at 16:03 UTC