Skip to content

Commit eb6ad31

Browse files
committed
Use wasm32-wasip1 instead of wasm32-wasi target for rust code
Rust compiler previously deprecated, and now removed the wasm32-wasi target and replaced it with wasm32-wasip1. This change updates all the occurrences of wasm32-wasi in the context of Rust compilation
1 parent b6dea22 commit eb6ad31

File tree

6 files changed

+23
-23
lines changed

6 files changed

+23
-23
lines changed

.github/workflows/compilation_on_android_ubuntu.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,7 @@ jobs:
675675
test_option: $MEMORY64_TEST_OPTIONS
676676
- running_mode: "multi-tier-jit"
677677
test_option: $MEMORY64_TEST_OPTIONS
678-
# aot, fast-interp, fast-jit, llvm-jit, multi-tier-jit don't support Multi Memory
678+
# aot, fast-interp, fast-jit, llvm-jit, multi-tier-jit don't support Multi Memory
679679
- running_mode: "aot"
680680
test_option: $MULTI_MEMORY_TEST_OPTIONS
681681
- running_mode: "fast-interp"
@@ -817,7 +817,7 @@ jobs:
817817

818818
- name: install dependencies
819819
run: |
820-
rustup target add wasm32-wasi
820+
rustup target add wasm32-wasip1
821821
sudo apt update && sudo apt-get install -y lld ninja-build
822822
npm install
823823
working-directory: test-tools/wamr-ide/VSCode-Extension

core/iwasm/libraries/wasi-nn/test/Dockerfile.wasi-nn-smoke

+9-9
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ RUN apt-get update \
1313
&& apt-get upgrade -y \
1414
&& apt-get install -y --no-install-recommends cmake
1515

16-
RUN rustup target add wasm32-wasi
16+
RUN rustup target add wasm32-wasip1
1717

1818
#
1919
# Openvino
@@ -37,10 +37,10 @@ WORKDIR /workspaces/wasi-nn
3737
RUN git clone --depth 1 https://github.com/bytecodealliance/wasi-nn.git .
3838

3939
WORKDIR /workspaces/wasi-nn/rust/examples/classification-example/
40-
RUN cargo build --target=wasm32-wasi
40+
RUN cargo build --target=wasm32-wasip1
4141

4242
WORKDIR /workspaces/wasi-nn/rust/examples/classification-example/build
43-
RUN cp ../target/wasm32-wasi/debug/wasi-nn-example.wasm . \
43+
RUN cp ../target/wasm32-wasip1/debug/wasi-nn-example.wasm . \
4444
&& wget -q --no-clobber https://github.com/intel/openvino-rs/raw/main/crates/openvino/tests/fixtures/mobilenet/mobilenet.xml \
4545
&& wget -q --no-clobber https://github.com/intel/openvino-rs/raw/main/crates/openvino/tests/fixtures/mobilenet/mobilenet.bin
4646
# There are model files(mobilenet*) and wasm files(wasi-nn-example.wasm) in the directory,
@@ -67,30 +67,30 @@ RUN git apply ./bump_wasi_nn_to_0_6_0.patch
6767
# recompile with wasi-nn 0.6.0
6868
WORKDIR /workspaces/wasmedge-wasinn-examples/openvino-mobilenet-image/
6969
RUN pushd rust \
70-
&& cargo build --target=wasm32-wasi \
70+
&& cargo build --target=wasm32-wasip1 \
7171
&& popd \
7272
&& ./download_mobilenet.sh . \
7373
&& ls -l mobilenet.xml mobilenet.bin
7474

7575
WORKDIR /workspaces/wasmedge-wasinn-examples/openvino-mobilenet-raw/
7676
RUN pushd rust \
77-
&& cargo build --target=wasm32-wasi \
77+
&& cargo build --target=wasm32-wasip1 \
7878
&& popd \
7979
&& ./download_mobilenet.sh . \
8080
&& ls -l mobilenet.xml mobilenet.bin tensor-1x224x224x3-f32.bgr
8181

8282
WORKDIR /workspaces/wasmedge-wasinn-examples/openvino-road-segmentation-adas/
8383
RUN pushd openvino-road-seg-adas \
84-
&& cargo build --target=wasm32-wasi
84+
&& cargo build --target=wasm32-wasip1
8585

8686
WORKDIR /workspaces/wasmedge-wasinn-examples/tflite-birds_v1-image/
8787
RUN pushd rust \
88-
&& cargo build --target=wasm32-wasi
88+
&& cargo build --target=wasm32-wasip1
8989

9090
# mount models when running
9191
WORKDIR /workspaces/wasmedge-wasinn-examples/wasmedge-ggml/qwen
9292
RUN wget --progress=dot:giga https://www.modelscope.cn/models/qwen/Qwen1.5-0.5B-Chat-GGUF/resolve/master/qwen1_5-0_5b-chat-q2_k.gguf
93-
RUN cargo build --target=wasm32-wasi
93+
RUN cargo build --target=wasm32-wasip1
9494

9595
#
9696
# iwasm. build from source
@@ -107,7 +107,7 @@ RUN OpenVINO_DIR=/usr/lib/openvino-2023.2.0 \
107107
-DWAMR_BUILD_WASI_NN_LLAMACPP=1 \
108108
&& cmake --build build \
109109
&& cmake --install build
110-
110+
111111
ENV LD_LIBRARY_PATH=/usr/local/lib
112112

113113
# add smoke test script

core/iwasm/libraries/wasi-nn/test/run_smoke_test.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def execute_openvino_road_segmentation_adas_once(
5353
"""
5454

5555
wasm_file = (
56-
"./openvino-road-seg-adas/target/wasm32-wasi/debug/openvino-road-seg-adas.wasm"
56+
"./openvino-road-seg-adas/target/wasm32-wasip1/debug/openvino-road-seg-adas.wasm"
5757
)
5858
wasm_args = [
5959
"./model/road-segmentation-adas-0001.xml",
@@ -70,7 +70,7 @@ def execute_openvino_mobilenet_raw_once(
7070
execute openvino-mobilenet-image with iwasm and wasmedge
7171
"""
7272

73-
wasm_file = "./rust/target/wasm32-wasi/debug/wasmedge-wasinn-example-mobilenet.wasm"
73+
wasm_file = "./rust/target/wasm32-wasip1/debug/wasmedge-wasinn-example-mobilenet.wasm"
7474
wasm_args = [
7575
"mobilenet.xml",
7676
"mobilenet.bin",
@@ -87,7 +87,7 @@ def execute_openvino_mobilenet_image_once(
8787
"""
8888

8989
wasm_file = (
90-
"./rust/target/wasm32-wasi/debug/wasmedge-wasinn-example-mobilenet-image.wasm"
90+
"./rust/target/wasm32-wasip1/debug/wasmedge-wasinn-example-mobilenet-image.wasm"
9191
)
9292
wasm_args = [
9393
"mobilenet.xml",
@@ -105,7 +105,7 @@ def execute_tflite_birds_v1_image_once(
105105
"""
106106

107107
wasm_file = (
108-
"rust/target/wasm32-wasi/debug/wasmedge-wasinn-example-tflite-bird-image.wasm"
108+
"rust/target/wasm32-wasip1/debug/wasmedge-wasinn-example-tflite-bird-image.wasm"
109109
)
110110
wasm_args = ["lite-model_aiy_vision_classifier_birds_V1_3.tflite", "bird.jpg"]
111111
return execute_once(runtime_bin, runtime_args, wasm_file, wasm_args, cwd)
@@ -262,7 +262,7 @@ def filter_output(output: str) -> str:
262262

263263
def execute_wasmedge_ggml_qwen(iwasm_bin: str, wasmedge_bin: str, cwd: Path):
264264
iwasm_args = ["--dir=."]
265-
wasm_file = ["./target/wasm32-wasi/debug/wasmedge-ggml-qwen.wasm"]
265+
wasm_file = ["./target/wasm32-wasip1/debug/wasmedge-ggml-qwen.wasm"]
266266
wasm_args = ["./qwen1_5-0_5b-chat-q2_k.gguf"]
267267

268268
cmd = [iwasm_bin]

doc/build_wasm_app.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -16,24 +16,24 @@ For [AssemblyScript](https://github.com/AssemblyScript/assemblyscript), please r
1616

1717
For Rust, please refer to [Install Rust and Cargo](https://doc.rust-lang.org/cargo/getting-started/installation.html) to install *cargo*, *rustc* and *rustup*. By default they are under ~/.cargo/bin.
1818

19-
And then run such a command to install `wasm32-wasi` target.
19+
And then run such a command to install `wasm32-wasip1` target.
2020

2121
``` bash
22-
$ rustup target add wasm32-wasi
22+
$ rustup target add wasm32-wasip1
2323
```
2424

2525
To build WASM applications, run
2626

2727
``` bash
28-
$ cargo build --target wasm32-wasi
28+
$ cargo build --target wasm32-wasip1
2929
```
3030

31-
The output files are under `target/wasm32-wasi`.
31+
The output files are under `target/wasm32-wasip1`.
3232

3333
To build a release version
3434

3535
``` bash
36-
$ cargo build --release --target wasm32-wasi
36+
$ cargo build --release --target wasm32-wasip1
3737
```
3838

3939

Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# compile with debug symbols and no optimization
2-
rustc --target wasm32-wasi ./test.rs -g -C opt-level=0
2+
rustc --target wasm32-wasip1 ./test.rs -g -C opt-level=0

test-tools/wamr-ide/VSCode-Extension/src/test/suite/utils.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export function setBpAtMarker(file: string, bpMarker: string): void {
3939
export function compileRustToWasm(): void {
4040
const testResourceFolder = `${EXTENSION_PATH}/resource/test`;
4141
// compile with debug symbols and no optimization
42-
const cmd = `rustc --target wasm32-wasi ${testResourceFolder}/test.rs -g -C opt-level=0 -o ${testResourceFolder}/test.wasm`;
42+
const cmd = `rustc --target wasm32-wasip1 ${testResourceFolder}/test.rs -g -C opt-level=0 -o ${testResourceFolder}/test.wasm`;
4343

4444
try {
4545
cp.execSync(cmd, { stdio: [null, null, process.stderr] });

0 commit comments

Comments
 (0)