Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 4 additions & 12 deletions crates/wasip2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,30 +46,22 @@ fn main() {
}
```

This crate can currently be used in three main ways.
This crate can currently be used in two main ways.

- One is to use it and compile for the [`wasm32-wasip2` target] in Rust 1.82 and later.
this is the simplest approach, as all the tools needed are included in the
Rust tooling, however it doesn't yet support some of the features of the
other approaches.

- Another is to use it and compile using [`cargo component`]. This is essentially
the same as the next option, except that `cargo component` handles most of the
steps for you. `cargo component` also has a number of additional features for
working with dependencies and custom WIT interfaces.

- And the third is to compile for the `wasm32-wasip1` target, and then adapt
- And the other way is to compile for the `wasm32-wasip1` target, and then adapt
the resulting modules into component using `wasm-tools component new`; see
the next section here for details.

[`wasm32-wasip2` target]: https://blog.rust-lang.org/2024/11/26/wasip2-tier-2.html
[`cargo component`]: https://github.com/bytecodealliance/cargo-component

## Building with wasm32-wasip1 and `cargo component new`.
## Building with wasm32-wasip1

The `wasm32-wasip2` target works with a simple `cargo build --target wasm32-wasip2`
and doesn't need a lot of documentation here, and `cargo component` has its own
documentation, so here we have some documentation for the `wasm32-wasip1` way.
Steps to target `wasm32-wasip1` and then adapt to a component.

```
$ cargo build --target wasm32-wasip1
Expand Down