Skip to content

Commit b2c7cb2

Browse files
authored
Use wasm32-wasip1 instead of wasm32-wasi target for rust code (#4057)
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. covers the wasi-nn/test.
1 parent 7f1e612 commit b2c7cb2

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

.github/workflows/compilation_on_android_ubuntu.yml

+1-1
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"

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]

0 commit comments

Comments
 (0)