Skip to content

Commit bb2f56e

Browse files
committed
rust: Fix building of unit-wasm
When building the unit-wasm crate we were getting the following compiler error error: failed to run `rustc` to learn about target-specific information ... --- stderr error: Error loading target specification: Could not find specification for target "wasm32-wasi". Run `rustc --print target-list` for a list of built-in targets This is due to wasm32-wasi being renamed to wasm32-wasip1, with wasm32-wasi being kept clear for an eventual WASI 1.0 release. Signed-off-by: Andrew Clayton <[email protected]>
1 parent 4d4f1f2 commit bb2f56e

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

.github/workflows/build_tests.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
steps:
3232
- name: Install tools/deps
3333
run: |
34-
dnf -y install git wget clang llvm compiler-rt lld make wasi-libc-devel cargo rust rust-std-static-wasm32-unknown-unknown rust-std-static-wasm32-wasi
34+
dnf -y install git wget clang llvm compiler-rt lld make wasi-libc-devel cargo rust rust-std-static-wasm32-wasip1
3535
wget -O- https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-20/libclang_rt.builtins-wasm32-wasi-20.0.tar.gz | tar --strip-components=1 -xvzf - -C $(dirname $(clang -print-runtime-dir))
3636
3737
- uses: actions/checkout@v3
@@ -55,7 +55,7 @@ jobs:
5555
wget -O- https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-20/libclang_rt.builtins-wasm32-wasi-20.0.tar.gz | tar --strip-components=1 -xvzf - -C $(dirname $(clang -print-runtime-dir))
5656
curl https://sh.rustup.rs -sSf | sh -s -- -y
5757
. "$HOME/.cargo/env"
58-
rustup target add wasm32-wasi
58+
rustup target add wasm32-wasip1
5959
wget -O- https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-20/wasi-sysroot-20.0.tar.gz | tar -xzf - -C ${RUNNER_TEMP}
6060
6161
- uses: actions/checkout@v3

src/rust/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ include ../../shared.mk
33
SDIR = src/rust
44

55
rustlib:
6-
$(PP_GEN) $(SDIR)/target/wasm32-wasi
7-
$(v)cargo build --target=wasm32-wasi
6+
$(PP_GEN) $(SDIR)/target/wasm32-wasip1
7+
$(v)cargo build --target=wasm32-wasip1
88

99
clean:
1010
rm -f Cargo.lock unit-wasm-sys/Cargo.lock

src/rust/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ cargo add unit-wasm
99

1010
## Prerequisites
1111

12-
- target add wasm32-wasi. `rustup target add wasm32-wasi`
12+
- target add wasm32-wasip1. `rustup target add wasm32-wasip1`
1313

1414
## From Source
1515

0 commit comments

Comments
 (0)