Hey there,
I am thinking about a host feature where it automatically determines if a wasm component targets a wasi:cli/command
world or a wasi:http/proxy
world, which I believe will be the most popular worlds that most components target to. Has anyone done similar work in wasmtime before?
I know wasm-tools component wit
will output the WIT from a wasm component and it makes it really easy to compare if its wasi-http or wasi-cli or neither. But this approach does not extend to a component that targets wasi-http + some other imports (e.g. wasi-keyvalue), because it's not a match to wasi-http. Perhaps we should only check the exports of the components?
You might be interested to explore wasm-tools component targets
Oh cool didn't know this exists!
I conjecture that in order for the host to execute a component , the following should satisify
The first rule makes sure the component at least targets a known world to the host. It allows the host to select an export function (e.g. run
for wasi-cli and handler
for wasi-http) to execute.
The second rule allows the host to satisify all the imports of the component so it can instantiate the component and execute.
Last updated: Nov 22 2024 at 16:03 UTC