Skip to content

Commit abba523

Browse files
authored
Merge pull request #2948 from vdice/ref/wasm32-wasip1-updates
ref(*): replace wasm32-wasi with wasm32-wasip1
2 parents cda78d0 + 9ece312 commit abba523

File tree

31 files changed

+534
-87
lines changed

31 files changed

+534
-87
lines changed

.devcontainer/bootstrap.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
rustup update stable && rustup default stable && rustup component add clippy rustfmt
33

44
# Installs wasm32 compiler targets
5-
rustup target add wasm32-wasi wasm32-unknown-unknown
5+
rustup target add wasm32-wasip1 wasm32-unknown-unknown

.github/actions/spin-ci-dependencies/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ runs:
9595
rustup default ${{ inputs.rust-version }}
9696
9797
- name: "Install Wasm Rust target"
98-
run: rustup target add wasm32-wasi wasm32-wasip1 wasm32-unknown-unknown
98+
run: rustup target add wasm32-wasip1 wasm32-unknown-unknown
9999
if: ${{ inputs.rust-wasm == 'true' }}
100100
shell: bash
101101

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ jobs:
196196

197197
# Install all the toolchain dependencies
198198
- name: Install Rust wasm target
199-
run: rustup target add wasm32-wasi wasm32-wasip1 wasm32-unknown-unknown
199+
run: rustup target add wasm32-wasip1 wasm32-unknown-unknown
200200
- uses: goto-bus-stop/setup-zig@v2
201201
- uses: actions/setup-go@v4
202202
with:
@@ -281,7 +281,7 @@ jobs:
281281
run: rustup target add --toolchain ${{ env.RUST_VERSION }} ${{ matrix.config.target }}
282282

283283
- name: "Install Wasm Rust target"
284-
run: rustup target add wasm32-wasi wasm32-wasip1 wasm32-unknown-unknown --toolchain ${{ env.RUST_VERSION }}
284+
run: rustup target add wasm32-wasip1 wasm32-unknown-unknown --toolchain ${{ env.RUST_VERSION }}
285285

286286
- name: setup for cross-compiled linux aarch64 build
287287
if: matrix.config.target == 'aarch64-unknown-linux-gnu'

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ jobs:
103103
run: rustup target add --toolchain ${{ env.RUST_VERSION }} ${{ matrix.config.target }}
104104

105105
- name: "Install Wasm Rust target"
106-
run: rustup target add wasm32-wasi wasm32-wasip1 wasm32-unknown-unknown --toolchain ${{ env.RUST_VERSION }}
106+
run: rustup target add wasm32-wasip1 wasm32-unknown-unknown --toolchain ${{ env.RUST_VERSION }}
107107

108108
- name: setup for cross-compiled linux aarch64 build
109109
if: matrix.config.target == 'aarch64-unknown-linux-gnu'

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ and then follow the
3939
language guides, and the [guide on writing Spin applications](https://developer.fermyon.com/spin/configuration/).
4040

4141
## Usage
42-
Below is an example of using the `spin` CLI to create a new Spin application. To run the example you will need to install the `wasm32-wasi` target for Rust.
42+
Below is an example of using the `spin` CLI to create a new Spin application. To run the example you will need to install the `wasm32-wasip1` target for Rust.
4343

4444
```bash
45-
$ rustup target add wasm32-wasi
45+
$ rustup target add wasm32-wasip1
4646
```
4747

4848
First, run the `spin new` command to create a Spin application from a template.
@@ -55,7 +55,7 @@ Running the `spin new` command created a `hello-rust` directory with all the nec
5555
```bash
5656
# Compile to Wasm by executing the `build` command.
5757
$ spin build
58-
Executing the build command for component hello-rust: cargo build --target wasm32-wasi --release
58+
Executing the build command for component hello-rust: cargo build --target wasm32-wasip1 --release
5959
Finished release [optimized] target(s) in 0.03s
6060
Successfully ran the build command for the Spin components.
6161

build.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ fn main() {
5858

5959
println!(
6060
r#"
61-
error: the `wasm32-wasi` target is not installed
62-
= help: consider downloading the target with `rustup{} target add wasm32-wasi`"#,
61+
error: the `wasm32-wasip1` target is not installed
62+
= help: consider downloading the target with `rustup{} target add wasm32-wasip1`"#,
6363
toolchain_override
6464
);
6565
process::exit(1);
@@ -75,7 +75,7 @@ error: the `wasm32-wasi` target is not installed
7575
fn build_wasm_test_program(name: &'static str, root: &'static str) {
7676
build_target_dep(root, Path::new("target/test-programs").join(name))
7777
.release()
78-
.target("wasm32-wasi")
78+
.target("wasm32-wasip1")
7979
.build();
8080
println!("cargo:rerun-if-changed={root}/Cargo.toml");
8181
println!("cargo:rerun-if-changed={root}/Cargo.lock");
@@ -85,7 +85,7 @@ fn build_wasm_test_program(name: &'static str, root: &'static str) {
8585
fn has_wasm32_wasi_target() -> bool {
8686
// Using rustc here for systems that don't have rustup
8787
let output = run(
88-
vec!["rustc", "--print=target-libdir", "--target=wasm32-wasi"],
88+
vec!["rustc", "--print=target-libdir", "--target=wasm32-wasip1"],
8989
None,
9090
None,
9191
);
@@ -110,7 +110,7 @@ fn cargo_build(dir: &str) {
110110
"cargo",
111111
"build",
112112
"--target",
113-
"wasm32-wasi",
113+
"wasm32-wasip1",
114114
"--release",
115115
// Ensure that even if `CARGO_TARGET_DIR` is set
116116
// that we're still building into the right dir.

crates/componentize/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ the original module exported.
1212
This crate requires a [Rust](https://rustup.rs/) installation v1.68 or later and a couple of Wasm targets:
1313

1414
```shell
15-
rustup target add wasm32-wasi
15+
rustup target add wasm32-wasip1
1616
rustup target add wasm32-unknown-unknown
1717
```
1818

crates/componentize/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ mod tests {
413413
run_spin(
414414
&fs::read(concat!(
415415
env!("OUT_DIR"),
416-
"/wasm32-wasi/release/rust_case_02.wasm"
416+
"/wasm32-wasip1/release/rust_case_02.wasm"
417417
))
418418
.await?,
419419
)
@@ -426,7 +426,7 @@ mod tests {
426426
run_spin(
427427
&fs::read(concat!(
428428
env!("OUT_DIR"),
429-
"/wasm32-wasi/release/rust_case_08.wasm"
429+
"/wasm32-wasip1/release/rust_case_08.wasm"
430430
))
431431
.await?,
432432
)
@@ -458,7 +458,7 @@ mod tests {
458458
run_command(
459459
&fs::read(concat!(
460460
env!("OUT_DIR"),
461-
"/wasm32-wasi/release/rust-command.wasm"
461+
"/wasm32-wasip1/release/rust-command.wasm"
462462
))
463463
.await?,
464464
)
@@ -471,7 +471,7 @@ mod tests {
471471
cmd.arg("build")
472472
.current_dir(format!("tests/{name}"))
473473
.arg("--release")
474-
.arg("--target=wasm32-wasi")
474+
.arg("--target=wasm32-wasip1")
475475
.env("CARGO_TARGET_DIR", out_dir);
476476

477477
let status = cmd.status().unwrap();
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
spin-abi-conformance.wasm: target/wasm32-wasi/release/spin-rust.wasm
1+
spin-abi-conformance.wasm: target/wasm32-wasip1/release/spin-rust.wasm
22
cp $< $@
33

4-
target/wasm32-wasi/release/spin-rust.wasm: src/main.rs Cargo.toml
5-
cargo build --target wasm32-wasi --release
4+
target/wasm32-wasip1/release/spin-rust.wasm: src/main.rs Cargo.toml
5+
cargo build --target wasm32-wasip1 --release
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
[build]
2-
target = "wasm32-wasi"
2+
target = "wasm32-wasip1"

0 commit comments

Comments
 (0)