bytecodealliance / bytecodealliance/cargo-component

Cargo Component WASI Interfaces

Open
#404 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
593
Forks
68
PR merge metrics
No merged PRs in 30d

Description

The [Documentation ](https://component-model.bytecodealliance.org/language-support/rust.html#importing-an-interface) mentions that
> By default, cargo-component imports any required [WASI interfaces](https://wasi.dev/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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.