-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Open
Labels
arch-wasmWebAssembly architectureWebAssembly architecturearea-Build-monoos-wasiRelated to WASI variant of arch-wasmRelated to WASI variant of arch-wasm
Milestone
Description
problem statement
When building a component for wasi:http when running in wasmtime I get the following error:
wasmtime serve .\bin\Debug\net8.0\wasi-wasm\native\MyApp.wasm --addr 127.0.0.1:3000
Error: component imports instance `wasi:cli/[email protected]`, but a matching implementation was not found in the linker
Caused by:
0: instance export `get-environment` has the wrong type
1: function implementation is missing
When inspecting the component built I see imports for wasi:cli/environemnt and wasi:cli/exit, even though I only built against the wasi:http world:
wasm-tools.exe component wit .\bin\Debug\net8.0\wasi-wasm\native\MyApp.wasm
package root:component;
world root {
import wasi:cli/[email protected];
import wasi:cli/[email protected];
....
I was able to work around it by telling wasmtime to provide the cli imports:
wasmtime serve -S cli ...
question
Should these imports be included in the component? Is there a way to detect during compilation if the env/exit are being used and not include them?
Discussion in Bytecode Alliance Zulip: https://bytecodealliance.zulipchat.com/#narrow/stream/407028-C.23.2F.2Enet-collaboration/topic/missing.20implementation.20was.20not.20found.20in.20linker
example
https://github.com/jsturtevant/wasi-http-oci
Metadata
Metadata
Assignees
Labels
arch-wasmWebAssembly architectureWebAssembly architecturearea-Build-monoos-wasiRelated to WASI variant of arch-wasmRelated to WASI variant of arch-wasm