I'm currently trying to build a rather large project for the wasm32-wasip2 target in Rust - it is not written as a WebAssembly specific target and therefore does not depend on either wasmtime or any other wasm-related crate. Everything compiles, however, linking fails. I use the wasi-sdk toolchain with clang & wasm-component-ld, which results in the following error:
= note: error: failed to parse core wasm for componentization
Caused by:
0: updating metadata for section component-type:wit-bindgen:0.33.0:rust:wasi:bindings:encoded worldrust-wasi-from-crates-io
1: failed to merge WIT package sets together
2: failed to merge package `rust:wasi` into existing copy
3: failed to merge world `bindings`
4: import `wasi:io/poll@0.2.2` not found in target world
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I'm not sure what this error means, who should provide this world?
as far as I'm aware, wasi-sdk still produces wasip1 modules which wasm-tools can adapt into wasip2 components, ie. tell your rust to compile as wasip1 and then use wasm-tools component adapt
Thank you very much! That's what I thought, but some dependencies need socket support, so I depend on wasip2 - have you any idea how I could get around that?
If you tell rustc to compile for wasip2 it will already use the wasip1->wasip2 adapter.
Meaning that the wasi-sdk should not be the issue here?
Last updated: Dec 06 2025 at 06:05 UTC