cargo-component icon indicating copy to clipboard operation
cargo-component copied to clipboard

Cargo Component WASI Interfaces

Open JvHKuL opened this issue 7 months ago • 0 comments

The Documentation mentions that

By default, cargo-component imports any required WASI interfaces for us without needing to explicitly declare them.

Is there any documentation when this exactly happens?

I for example noticed that it added a lot of interfaces when I just used list as type in my WIT. My hunch is that it is because it's part of std, but I can't seem to find any information about it.

I know the workaround is to compile with wasm32-unknown-unknown as target. But then I wonder what you need to do if you want to be able only to use println in a component, manually import the stdout WIT interface and compile to wasm32-unknown-unknown? Wasi-Virt could help in that situation if it is your main module, but it's a bit overkill.

JvHKuL avatar Jun 06 '25 08:06 JvHKuL