Skip to content

Commit 94e5000

Browse files
authored
Rename wasm32-wasi to wasm32-wasip1 (#93)
Update CI and a few strings of documentation here and there.
1 parent 922a5a1 commit 94e5000

File tree

3 files changed

+26
-29
lines changed

3 files changed

+26
-29
lines changed

.github/workflows/main.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ jobs:
1212
- uses: actions/checkout@v4
1313
- name: Install Rust
1414
run: rustup update ${{ matrix.rust }} && rustup default ${{ matrix.rust }} && rustup component add rustfmt
15-
- run: rustup target add wasm32-wasi wasm32-unknown-unknown
15+
- run: rustup target add wasm32-wasip1 wasm32-unknown-unknown
1616
- run: cargo build --workspace
1717
- run: cargo build --workspace --no-default-features
18-
- run: cargo build --workspace --target wasm32-wasi
19-
- run: cargo build --workspace --target wasm32-wasi --no-default-features
18+
- run: cargo build --workspace --target wasm32-wasip1
19+
- run: cargo build --workspace --target wasm32-wasip1 --no-default-features
2020
- run: cargo test --workspace --doc
2121
- name: Install Wasmtime
2222
uses: bytecodealliance/actions/wasmtime/setup@v1
@@ -28,9 +28,9 @@ jobs:
2828
version: "1.202.0"
2929
- run: curl -LO https://github.com/bytecodealliance/wasmtime/releases/download/v19.0.0/wasi_snapshot_preview1.command.wasm
3030

31-
- run: cargo build --examples --target wasm32-wasi --no-default-features
31+
- run: cargo build --examples --target wasm32-wasip1 --no-default-features
3232

33-
- run: wasm-tools component new ./target/wasm32-wasi/debug/examples/hello-world-no_std.wasm --adapt ./wasi_snapshot_preview1.command.wasm -o component.wasm
33+
- run: wasm-tools component new ./target/wasm32-wasip1/debug/examples/hello-world-no_std.wasm --adapt ./wasi_snapshot_preview1.command.wasm -o component.wasm
3434
- run: wasmtime run component.wasm
3535

3636
- run: cargo build --examples --target wasm32-unknown-unknown --no-default-features
@@ -41,9 +41,9 @@ jobs:
4141
- run: wasm-tools component new ./target/wasm32-unknown-unknown/debug/examples/http_proxy_no_std.wasm -o component.wasm
4242
- run: wasm-tools component targets wit component.wasm -w wasi:http/proxy
4343

44-
- run: cargo build --examples --target wasm32-wasi
44+
- run: cargo build --examples --target wasm32-wasip1
4545

46-
- run: wasm-tools component new ./target/wasm32-wasi/debug/examples/hello-world.wasm --adapt ./wasi_snapshot_preview1.command.wasm -o component.wasm
46+
- run: wasm-tools component new ./target/wasm32-wasip1/debug/examples/hello-world.wasm --adapt ./wasi_snapshot_preview1.command.wasm -o component.wasm
4747
- run: wasmtime run component.wasm
4848

4949
- run: cargo build --examples --target wasm32-unknown-unknown
@@ -54,9 +54,9 @@ jobs:
5454
- run: wasm-tools component new ./target/wasm32-unknown-unknown/debug/examples/http_proxy.wasm -o component.wasm
5555
- run: wasm-tools component targets wit component.wasm -w wasi:http/proxy
5656

57-
- run: cargo build --examples --workspace --target wasm32-wasi --features rand
57+
- run: cargo build --examples --workspace --target wasm32-wasip1 --features rand
5858

59-
- run: wasm-tools component new ./target/wasm32-wasi/debug/examples/rand.wasm --adapt ./wasi_snapshot_preview1.command.wasm -o component.wasm
59+
- run: wasm-tools component new ./target/wasm32-wasip1/debug/examples/rand.wasm --adapt ./wasi_snapshot_preview1.command.wasm -o component.wasm
6060
- run: wasmtime run component.wasm
6161

6262
rustfmt:

README.md

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ fn main() {
4747
```
4848

4949
This crate is intended to target [components] but today you need to go through
50-
the intermediate build step of a core WebAssembly module using the `wasm32-wasi`
50+
the intermediate build step of a core WebAssembly module using the `wasm32-wasip1`
5151
target:
5252

5353
```
54-
$ cargo build --target wasm32-wasi
54+
$ cargo build --target wasm32-wasip1
5555
```
5656

5757
Next you'll want an "adapter" to convert the Rust standard library's usage of
@@ -67,7 +67,7 @@ component:
6767

6868
```
6969
$ cargo install wasm-tools
70-
$ wasm-tools component new target/wasm32-wasi/debug/foo.wasm \
70+
$ wasm-tools component new target/wasm32-wasip1/debug/foo.wasm \
7171
--adapt ./wasi_snapshot_preview1.command.wasm \
7272
-o component.wasm
7373
```
@@ -109,19 +109,17 @@ want to support. Rust WebAssembly targets include:
109109

110110
* `wasm32-unknown-unknown` - do not use this crate because this target indicates
111111
that WASI is not desired.
112-
* `wasm32-wasi` or `wasm32-wasip1` - this target has been present in Rust for
113-
quite some time and is recently being renamed from `wasm32-wasi` to
114-
`wasm32-wasip1`. The two targets have the same definition, it's just the name
115-
that's changing. For this target you probably want the 0.11.0 track of this
116-
crate.
112+
* `wasm32-wasip1` - this target has been present in Rust for quite some time and
113+
was previously known as `wasm32-wasi`. For this target you probably want the
114+
0.11.0 track of this crate.
117115
* `wasm32-wasip2` - this target is a recent addition to rustc (as of the time of
118116
this writing it's not merged yet into rustc). This is what the 0.12.0 version
119117
of the crate is intended for.
120118

121-
Note that if you use `wasm32-wasi` or `wasm32-wasip1` it's not necessarily
122-
guaranteed you want 0.11.0 of this crate. If your users are producing components
123-
then you probably want 0.12.0 instead. If you don't know what your users are
124-
producing then you should probably stick with 0.11.0.
119+
Note that if you use `wasm32-wasip1` it's not necessarily guaranteed you want
120+
0.11.0 of this crate. If your users are producing components then you probably
121+
want 0.12.0 instead. If you don't know what your users are producing then you
122+
should probably stick with 0.11.0.
125123

126124
Long story short, it's a bit complicated. We're in a transition period from
127125
WASIp1 to WASIp2 and things aren't going to be perfect every step of the way, so

src/lib.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -127,22 +127,21 @@
127127
//!
128128
//! This crate is intended to be easiest to use with a future
129129
//! `wasm32-wasip2` target added to the Rust compiler. In the meantime
130-
//! it's recommended to use the `wasm32-wasi` target (soon to be renamed to
131-
//! `wasm32-wasip1`) instead:
130+
//! it's recommended to use the `wasm32-wasip1` target instead:
132131
//!
133132
//! ```sh
134-
//! $ cargo build --target wasm32-wasi
133+
//! $ cargo build --target wasm32-wasip1
135134
//! ```
136135
//!
137-
//! Note that the output of the `wasm32-wasi` target is a core wasm module, not
136+
//! Note that the output of the `wasm32-wasip1` target is a core wasm module, not
138137
//! a component, so to turn it into a component you can use the [`wasm-tools`]
139138
//! CLI in combination with an "adapter module" for the `wasi_snapshot_preview1`
140139
//! APIs that the Rust standard library uses (example adapters can be found on
141140
//! [Wasmtime's release page][adapters] as
142141
//! [`wasi_snapshot_preview1.command.wasm`] for example)
143142
//!
144143
//! ```sh
145-
//! $ wasm-tools component new ./target/wasm32-wasi/debug/my-app.wasm \
144+
//! $ wasm-tools component new ./target/wasm32-wasip1/debug/my-app.wasm \
146145
//! --adapt ./wasi_snapshot_preview1.command.wasm \
147146
//! -o my-component.wasm
148147
//! ```
@@ -221,10 +220,10 @@ pub mod cli {
221220
/// wasi::cli::command::export!(MyCliRunner);
222221
/// ```
223222
///
224-
/// ## Compatibility with `wasm32-wasi` targets
223+
/// ## Compatibility with `wasm32-wasip1` targets
225224
///
226-
/// This macro is not compatible with `wasm32-wasi` `bin` targets which
227-
/// instead use a `fn main()` with the
225+
/// This macro is not compatible with `wasm32-wasip1` `bin` targets
226+
/// which instead use a `fn main()` with the
228227
/// `wasi_snapshot_preview1.command.wasm` adapter. This macro _can_ be
229228
/// used with the `reactor` or `proxy` adapters.
230229
///

0 commit comments

Comments
 (0)