Skip to content

Cargo Component WASI Interfaces #404

@JvHKuL

Description

@JvHKuL

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions