File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -185,11 +185,11 @@ world host {
185
185
186
186
### Guest: Rust
187
187
188
- The Rust compiler supports a native ` wasm32-wasip1 ` target and can be added to
188
+ The Rust compiler since version 1.82 supports a native ` wasm32-wasip2 ` target and can be added to
189
189
any ` rustup ` -based toolchain with:
190
190
191
191
``` sh
192
- rustup target add wasm32-wasip1
192
+ rustup target add wasm32-wasip2
193
193
```
194
194
195
195
In order to compile a wasi dynamic library, the following must be added to the
@@ -244,17 +244,15 @@ generated code (which is probably also a bug in `wit-bindgen`), you can use
244
244
This project can then be built with:
245
245
246
246
``` sh
247
- cargo build --target wasm32-wasip1
248
- wasm-tools component new ./target/wasm32-wasip1/debug/my-project.wasm \
249
- -o my-component.wasm --adapt ./wasi_snapshot_preview1.reactor.wasm
247
+ cargo build --target wasm32-wasip2
250
248
```
251
249
252
- This creates a ` my-component .wasm ` file which is suitable to execute in any
250
+ This creates a ` ./target/wasm32-wasip2/debug/ my-project .wasm` file which is suitable to execute in any
253
251
component runtime. Using ` wasm-tools ` you can inspect the binary as well, for
254
252
example inferring the WIT world that is the component:
255
253
256
254
``` sh
257
- wasm-tools component wit my-component .wasm
255
+ wasm-tools component wit ./target/wasm32-wasip2/debug/ my-project .wasm
258
256
# world my-component {
259
257
# import print: func(msg: string)
260
258
# export run: func()
You can’t perform that action at this time.
0 commit comments