Skip to content

Commit a0633ed

Browse files
fix(lang/rust): target wasip1 -> wasip2
1 parent c588e4f commit a0633ed

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

component-model/examples/tutorial/README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ Use [`wac`](https://github.com/bytecodealliance/wac) to build and compose the ca
4848
(cd calculator && cargo build --target=wasm32-wasip2 --release)
4949
(cd adder && cargo build --target=wasm32-wasip2 --release)
5050
(cd command && cargo build --target=wasm32-wasip2 --release)
51-
wac plug calculator/target/wasm32-wasip1/release/calculator.wasm --plug adder/target/wasm32-wasip1/release/adder.wasm -o composed.wasm
52-
wac plug command/target/wasm32-wasip1/release/command.wasm --plug composed.wasm -o final.wasm
51+
wac plug calculator/target/wasm32-wasip2/release/calculator.wasm --plug adder/target/wasm32-wasip2/release/adder.wasm -o composed.wasm
52+
wac plug command/target/wasm32-wasip2/release/command.wasm --plug composed.wasm -o final.wasm
5353
```
5454

5555
Now, run the component with Wasmtime:
@@ -67,9 +67,9 @@ wasmtime run final.wasm 1 2 add
6767

6868
```sh
6969
mkdir -p deps/docs
70-
cp adder/target/wasm32-wasip1/release/adder.wasm deps/docs/adder-impl.wasm
71-
cp calculator/target/wasm32-wasip1/release/calculator.wasm deps/docs/calculator-impl.wasm
72-
cp command/target/wasm32-wasip1/release/command.wasm deps/docs/command-impl.wasm
70+
cp adder/target/wasm32-wasip2/release/adder.wasm deps/docs/adder-impl.wasm
71+
cp calculator/target/wasm32-wasip2/release/calculator.wasm deps/docs/calculator-impl.wasm
72+
cp command/target/wasm32-wasip2/release/command.wasm deps/docs/command-impl.wasm
7373
```
7474

7575
Now we are ready to construct a WAC file to define our composition. Ours instantiates our three components, declaring
@@ -84,12 +84,12 @@ package example:composition;
8484
let adder-instance = new docs:adder-impl { };
8585
8686
// Instantiate the calculator-impl component that implements the calculator world.
87-
// In the `new` expression, specify the source of the `add` import to be `adder-instance`'s `add` export.
87+
// In the `new` expression, specify the source of the `add` import to be `adder-instance`'s `add` export.
8888
let calculator-instance = new docs:calculator-impl { add: adder-instance.add };
8989
9090
// Instantiate a command-impl component that implements the app world.
91-
// The command component might import other interfaces, such as WASI interfaces, but we want to leave
92-
// those as imports in the final component, so supply `...` to allow those other imports to remain unresolved.
91+
// The command component might import other interfaces, such as WASI interfaces, but we want to leave
92+
// those as imports in the final component, so supply `...` to allow those other imports to remain unresolved.
9393
// The command's exports (in this case, `wasi:cli/run`) remain unaffected in the resulting instance.
9494
let command-instance = new docs:command-impl { calculate: calculator-instance.calculate,... };
9595
@@ -101,12 +101,12 @@ export command-instance["wasi:cli/run@0.2.0"];
101101
Now, perform your composition by passing the WAC file to `wac compose`.
102102

103103
```sh
104-
wac compose composition.wac -o final.wasm
104+
wac compose composition.wac -o final.wasm
105105
```
106106

107107
> Note, instead of moving all the components to a `deps/docs` directory, you can pass the paths to the components inline
108108
> ```sh
109-
> wac compose --dep docs:adder-impl=./adder/target/wasm32-wasip1/release/adder.wasm --dep docs:calculator-impl=./calculator/target/wasm32-wasip1/release/calculator.wasm --dep docs:command-impl=./command/target/wasm32-wasip1/release/command.wasm -o final.wasm composition.wac
109+
> wac compose --dep docs:adder-impl=./adder/target/wasm32-wasip2/release/adder.wasm --dep docs:calculator-impl=./calculator/target/wasm32-wasip2/release/calculator.wasm --dep docs:command-impl=./command/target/wasm32-wasip2/release/command.wasm -o final.wasm composition.wac
110110
> ```
111111
112112
Run the component with Wasmtime:

0 commit comments

Comments
 (0)