Skip to content

Commit dbee04b

Browse files
Timo StarkTimo Stark
authored andcommitted
Update Wasi is now available on crates.io - No more git clone needed
1 parent 9f59a48 commit dbee04b

File tree

1 file changed

+5
-15
lines changed

1 file changed

+5
-15
lines changed

source/news/2024/wasm-component-model-part-2.rst

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -80,25 +80,15 @@ Start by creating a new Wasm Component using **cargo component**:
8080
8181
$ cargo component new --lib test-wasi-component
8282
83-
At the time of writing, the wasi crate (Version 0.12.1) available on `crates.io <https://crates.io/crates/wasi>`__ didn't include the latest version available on GitHub. As we are making use of a Macro in Rust, we will have to clone the `repository <https://github.com/bytecodealliance/wasi>`__ and reference it from our new Wasm Component project.
83+
Navigate into the **test-wasi-component** directory.
8484

85-
Clone the bytecodealliances wasi repository
85+
Add the **wasi** crate:
8686

8787
.. code-block:: bash
8888
89-
$ git clone https://github.com/bytecodealliance/wasi
89+
$ cargo add wasi
9090
91-
You should now have a directory structure like this:
92-
93-
.. code-block:: bash
94-
95-
$ ls -lah
96-
../
97-
./
98-
wasi
99-
test-wasi-component
100-
101-
Navigate into the **test-wasi-component** directory and modify the **Cargo.toml** file with the text editor of your choice. Add the wasi crate to the dependencies section and the **proxy = true** configuration to the **[package.metadata.component]** section. After saving the changes, your **Cargo.toml** file should look like this:
91+
Next, modify the **Cargo.toml** file with the text editor of your choice. Add the **proxy = true** configuration to the **[package.metadata.component]** section. After saving the changes, your **Cargo.toml** file should look like this:
10292

10393
.. code-block:: toml
10494
@@ -110,7 +100,7 @@ Navigate into the **test-wasi-component** directory and modify the **Cargo.toml*
110100
[dependencies]
111101
bitflags = "2.4.2"
112102
wit-bindgen-rt = "0.21.0"
113-
wasi = { path = "../wasi" }
103+
wasi = "0.13.0"
114104
115105
[lib]
116106
crate-type = ["cdylib"]

0 commit comments

Comments
 (0)