It is said that "Currently cargo component targets wasm32-wasi by default.".
My question is: (how) can I switch to wasm32-unknown-unknown?
Rationale: My library does not need all the wasi specific imports, i.e. when I python -m wasmtime.bindgen ./component.wasm --out-dir decoder/ for getting Python bindings, I get all the (unneeded) imports. I would like to get rid of them. What is the best way to do so?
wasm32-unknown-unknown is currently ABI incompatible with both clang (all wasm targets) and rustc (wasm32-wasi and wasm32-unknown-emscripten).
Thank you for this clarification.
That said, adding --target wasm32-unknown-unknown to your cargo component build invocation will still produce a component, just not with wasi imports
Christoph Brewing has marked this topic as resolved.
Last updated: Dec 06 2025 at 05:03 UTC