Skip to content

Commit 7749434

Browse files
authored
Update the README to discuss the wasm32-wasip2 feature. (#359)
Update the documentation talking about Rust's wasm32-wasip2 feature. We do hope to make use of it in `cargo component`, though it's not a trivial change. This is inspired by #355.
1 parent 7e766b0 commit 7749434

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

README.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,8 @@ Until that time, there's `cargo component`!
142142

143143
## WASI Support
144144

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

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

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

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

189186
## Relationship with wasm32-wasip2
190187

0 commit comments

Comments
 (0)