Skip to content

Commit cc2761d

Browse files
authored
Rename wasm32-wasi usage to wasm32-wasip1 (#984)
Handle the rename of the Rust target happening throughout the release channels now.
1 parent f5f91c7 commit cc2761d

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

.github/workflows/main.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666
submodules: true
6767
- name: Install Rust
6868
run: rustup update stable --no-self-update && rustup default stable
69-
- run: rustup target add wasm32-wasi
69+
- run: rustup target add wasm32-wasip1
7070

7171
- run: rustup target add wasm32-unknown-unknown
7272
if: matrix.lang == 'rust'
@@ -117,7 +117,7 @@ jobs:
117117
submodules: true
118118
- name: Install Rust
119119
run: rustup update stable --no-self-update && rustup default stable
120-
- run: rustup target add wasm32-wasi
120+
- run: rustup target add wasm32-wasip1
121121
- run: cargo test -p wit-bindgen-core
122122
- run: cargo test -p wit-bindgen
123123
- run: cargo test --workspace --exclude 'wit-bindgen*'
@@ -131,8 +131,8 @@ jobs:
131131
run: rustup update stable --no-self-update && rustup default stable
132132
- name: Install wasm32-unknown-unknown target
133133
run: rustup target add wasm32-unknown-unknown
134-
- name: Install wasm32-wasi target
135-
run: rustup target add wasm32-wasi
134+
- name: Install wasm32-wasip1 target
135+
run: rustup target add wasm32-wasip1
136136

137137
# Verify the output of the `./ci/rebuild-libcabi-realloc.sh` script is
138138
# up-to-date.
@@ -151,10 +151,10 @@ jobs:
151151
- run: cargo build --no-default-features --features markdown
152152

153153
# Feature combos of the `wit-bindgen` crate
154-
- run: cargo build --target wasm32-wasi -p wit-bindgen --no-default-features
155-
- run: cargo build --target wasm32-wasi -p wit-bindgen --no-default-features --features realloc
156-
- run: cargo build --target wasm32-wasi -p wit-bindgen --no-default-features --features macros
157-
- run: cargo build --target wasm32-wasi -p wit-bindgen --no-default-features --features macros,realloc
154+
- run: cargo build --target wasm32-wasip1 -p wit-bindgen --no-default-features
155+
- run: cargo build --target wasm32-wasip1 -p wit-bindgen --no-default-features --features realloc
156+
- run: cargo build --target wasm32-wasip1 -p wit-bindgen --no-default-features --features macros
157+
- run: cargo build --target wasm32-wasip1 -p wit-bindgen --no-default-features --features macros,realloc
158158

159159
# Verity that documentation can be generated for the rust bindings crate.
160160
- run: cargo doc -p wit-bindgen --no-deps

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ is:
115115
2. The native language toolchain is used to emit a core WebAssembly module. This
116116
core wasm module is the "meat" of a component and contains all user-defined
117117
code compiled to WebAssembly. The most common native target to use for
118-
compilation today is the `wasm32-wasi` target.
118+
compilation today is the `wasm32-wasip1` target.
119119
3. The output core wasm module is transformed into a component using the
120120
[`wasm-tools`] project, notably the `wasm-tools component new` subcommand.
121121
This will ingest the native core wasm output and wrap the output into the
@@ -185,11 +185,11 @@ world host {
185185

186186
### Guest: Rust
187187

188-
The Rust compiler supports a native `wasm32-wasi` target and can be added to
188+
The Rust compiler supports a native `wasm32-wasip1` target and can be added to
189189
any `rustup`-based toolchain with:
190190

191191
```sh
192-
rustup target add wasm32-wasi
192+
rustup target add wasm32-wasip1
193193
```
194194

195195
In order to compile a wasi dynamic library, the following must be added to the
@@ -244,8 +244,8 @@ generated code (which is probably also a bug in `wit-bindgen`), you can use
244244
This project can then be built with:
245245

246246
```sh
247-
cargo build --target wasm32-wasi
248-
wasm-tools component new ./target/wasm32-wasi/debug/my-project.wasm \
247+
cargo build --target wasm32-wasip1
248+
wasm-tools component new ./target/wasm32-wasip1/debug/my-project.wasm \
249249
-o my-component.wasm --adapt ./wasi_snapshot_preview1.reactor.wasm
250250
```
251251

@@ -265,7 +265,7 @@ which in this case, as expected, is the same as the input world.
265265

266266
### Guest: C/C++
267267

268-
C and C++ code can be compiled for the `wasm32-wasi` target using the [WASI
268+
C and C++ code can be compiled for the `wasm32-wasip1` target using the [WASI
269269
SDK] project. The releases on that repository have precompiled `clang` binaries
270270
which are pre-configured to compile for WebAssembly.
271271

crates/test-rust-wasm/artifacts/build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ fn main() {
1212

1313
let target_to_test = match std::env::var("WIT_BINDGEN_WASI_TEST_TARGET") {
1414
Ok(s) => s,
15-
Err(_) => "wasm32-wasi".to_string(),
15+
Err(_) => "wasm32-wasip1".to_string(),
1616
};
1717

1818
let mut cmd = Command::new("cargo");

tests/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ There are a few pre-requisites to testing the project. You only need the languag
88
- Create an environment variable called `WASI_SDK_PATH`` giving the path where you extracted the WASI SDK download, i.e., the directory containing `bin`/`lib`/`share`` folders.
99
- Compilers for the target language:
1010
- Go + TinyGo - https://tinygo.org/ (v0.27.0+)
11-
- Rust - wasi target: `rustup target add wasm32-wasi`
11+
- Rust - wasi target: `rustup target add wasm32-wasip1`
1212
- Java - TeaVM-WASI `ci/download-teamvm.sh`
1313
- C - [Clang](https://clang.llvm.org/)
1414
- C# - [Dotnet 8](https://dotnet.microsoft.com/en-us/download/dotnet/8.0)

0 commit comments

Comments
 (0)