Skip to content

Commit 28e96f6

Browse files
authored
Rename usage of wasm32-wasi to wasm32-wasip1 (#1634)
* Rename usage of `wasm32-wasi` to `wasm32-wasip1` This'll start warning on nightly soon so go ahead and get a rename in now that stable supports this target name. * Add wasm32-wasip1 target * More wasi installs * Update libdl build * Bless some test changes, more CI tweaks
1 parent a5fa1eb commit 28e96f6

File tree

11 files changed

+324
-367
lines changed

11 files changed

+324
-367
lines changed

.github/workflows/main.yml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ jobs:
3333
- build: aarch64-linux
3434
os: ubuntu-latest
3535
target: aarch64-unknown-linux-gnu
36-
- build: wasm32-wasi
36+
- build: wasm32-wasip1
3737
os: ubuntu-latest
38-
target: wasm32-wasi
38+
target: wasm32-wasip1
3939
steps:
4040
- uses: actions/checkout@v4
4141
with:
@@ -44,7 +44,7 @@ jobs:
4444
- uses: bytecodealliance/wasmtime/.github/actions/[email protected]
4545
with:
4646
name: ${{ matrix.build }}
47-
if: matrix.build != 'wasm32-wasi'
47+
if: matrix.build != 'wasm32-wasip1'
4848
- run: |
4949
echo CARGO_BUILD_TARGET=${{ matrix.target }} >> $GITHUB_ENV
5050
rustup target add ${{ matrix.target }}
@@ -132,11 +132,12 @@ jobs:
132132
submodules: true
133133
- uses: bytecodealliance/wasmtime/.github/actions/[email protected]
134134
with:
135-
toolchain: 1.77.0
135+
toolchain: 1.79.0
136+
- run: rustup target add wasm32-wasip1
136137
- run: |
137-
curl -LO https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-21/wasi-sdk-21.0-linux.tar.gz
138-
tar xf wasi-sdk-21.0-linux.tar.gz
139-
export WASI_SDK_PATH=$(pwd)/wasi-sdk-21.0
138+
curl -LO https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-22/wasi-sdk-22.0-linux.tar.gz
139+
tar xf wasi-sdk-22.0-linux.tar.gz
140+
export WASI_SDK_PATH=$(pwd)/wasi-sdk-22.0
140141
cd crates/wit-component/dl && bash check.sh
141142
142143
wasm:
@@ -147,13 +148,14 @@ jobs:
147148
with:
148149
submodules: true
149150
- uses: bytecodealliance/wasmtime/.github/actions/[email protected]
151+
- run: rustup target add wasm32-wasip1
150152
- run: |
151153
tag=v10.0.1
152154
curl -LO https://github.com/bytecodealliance/wasmtime/releases/download/${tag}/wasmtime-${tag}-x86_64-linux.tar.xz
153155
tar xf wasmtime-${tag}-x86_64-linux.tar.xz
154156
echo `pwd`/wasmtime-${tag}-x86_64-linux >> $GITHUB_PATH
155-
echo CARGO_TARGET_WASM32_WASI_RUNNER='wasmtime run --dir . --' >> $GITHUB_ENV
156-
echo CARGO_BUILD_TARGET='wasm32-wasi' >> $GITHUB_ENV
157+
echo CARGO_TARGET_WASM32_WASIP1_RUNNER='wasmtime run --dir . --' >> $GITHUB_ENV
158+
echo CARGO_BUILD_TARGET='wasm32-wasip1' >> $GITHUB_ENV
157159
- run: |
158160
cargo --locked test --workspace \
159161
--exclude fuzz-stats \

.github/workflows/playground.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ jobs:
3030
- uses: cargo-bins/[email protected]
3131
- run: cargo binstall cargo-component -y
3232
- run: rustup component add rustfmt # needed for cargo-component, apparently?
33+
- run: rustup target add wasm32-wasip1
3334
- run: npm ci
3435
working-directory: playground
3536
- run: npm run build

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ merged once all tests are passing. CI checks currently include:
107107
* Code is all formatted correctly (use `cargo fmt` locally to pass this)
108108
* Tests pass on Rust stable, beta, and Nightly.
109109
* Tests pass on Linux, macOS, and Windows.
110-
* This tool can be compiled to WebAssembly using the `wasm32-wasi` target.
110+
* This tool can be compiled to WebAssembly using the `wasm32-wasip1` target.
111111
* Fuzzers can be built.
112112
* Various miscellaneous checks such as building the tool with various
113113
combinations of Cargo features.

ci/build-tarballs.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ fmt=tar
1919
if [ "$platform" = "x86_64-windows" ]; then
2020
cp target/release/wasm-tools.exe tmp/$bin_pkgname
2121
fmt=zip
22-
elif [ "$target" = "wasm32-wasi" ]; then
23-
cp target/wasm32-wasi/release/wasm-tools.wasm tmp/$bin_pkgname
22+
elif [ "$target" = "wasm32-wasip1" ]; then
23+
cp target/wasm32-wasip1/release/wasm-tools.wasm tmp/$bin_pkgname
2424
elif [ "$target" = "" ]; then
2525
cp target/release/wasm-tools tmp/$bin_pkgname
2626
else

crates/wit-component/dl/build.sh

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

88
set -ex
99

10-
CARGO_PROFILE_RELEASE_LTO=true RUSTFLAGS="-C relocation-model=pic" cargo build --release --target=wasm32-wasi
11-
$WASI_SDK_PATH/bin/clang -shared -o $1 -Wl,--whole-archive ../../../target/wasm32-wasi/release/libdl.a -Wl,--no-whole-archive
10+
CARGO_PROFILE_RELEASE_LTO=true RUSTFLAGS="-C relocation-model=pic" cargo build --release --target=wasm32-wasip1
11+
$WASI_SDK_PATH/bin/clang -shared -o $1 -Wl,--whole-archive ../../../target/wasm32-wasip1/release/libdl.a -Wl,--no-whole-archive
1212
cargo run --manifest-path ../../../Cargo.toml -- strip $1 -o $1
1313
cargo run --manifest-path ../../../Cargo.toml -- strip --delete name $1 -o $1

crates/wit-component/dl/check.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
set -ex
22

3-
bash ./build.sh ../../../target/wasm32-wasi/release/tmp.so
4-
if diff ../../../target/wasm32-wasi/release/tmp.so ../libdl.so; then
3+
bash ./build.sh ../../../target/wasm32-wasip1/release/tmp.so
4+
if diff ../../../target/wasm32-wasip1/release/tmp.so ../libdl.so; then
55
exit 0
66
else
77
echo "libdl.so is out-of-date; please run crates/wit-component/dl/build.sh to update it">&2

crates/wit-component/libdl.so

-44 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)