Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the README to discuss the wasm32-wasip2 feature. #359

Merged
merged 1 commit into from
Dec 3, 2024
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
13 changes: 5 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,8 @@ Until that time, there's `cargo component`!

## WASI Support

Currently `cargo component` targets `wasm32-wasip1` by default.

As this target is for a _preview1_ release of WASI, the WebAssembly module
produced by the Rust compiler must be adapted to the _preview2_ version of WASI
supported by the component model.
Currently `cargo component` uses the `wasm32-wasip1` target to produce core
Wasm modules, and then adapts them into WASIp2 aka "preview2" components.

The adaptation is automatically performed when `wasm32-wasip1` is targeted using
a built-in WASI adapter snapshotted out of the Wasmtime repository.
Expand Down Expand Up @@ -181,10 +178,10 @@ Next, edit `Cargo.toml` to point at the adapter:
adapter = "wasi_snapshot_preview1.wasm"
```

When the Rust compiler supports a [_preview2_ version of the WASI target][1],
support in `cargo component` for adapting a _preview1_ module will be removed.
The Rust compiler now has an [upstream Rust wasm32-wasip2] target that produces
components. In the future, we hope to update `cargo component` to use it directly.

[1]: https://github.com/rust-lang/compiler-team/issues/594
[upstream Rust wasm32-wasip2 target]: https://blog.rust-lang.org/2024/11/26/wasip2-tier-2.html

## Relationship with wasm32-wasip2

Expand Down