Skip to content

Commit

Permalink
test: use wasm32-wasip1 instead of wasm32-wasi
Browse files Browse the repository at this point in the history
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
  • Loading branch information
giuseppe committed Jan 10, 2025
1 parent 6f010b5 commit 68e8d9a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/wasm-wasi-example.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ podman run -it -p 8080:8080 --name=wasm-example --platform=wasi/wasm32 micha
println!("{}", "This is from a main function from a wasm module");
}
```
* Compile to `wasm32-wasi` target using `wasm-pack` or any other relevant tool. We are going to be using `cargo build --target wasm32-wasi`
* Compile to `wasm32-wasip1` target using `wasm-pack` or any other relevant tool. We are going to be using `cargo build --target wasm32-wasip2`
* Create relevant image and use your container manager. But for this example we will be running directly using crun and plub config manually.
```console
$ crun run wasm-container
Expand Down
7 changes: 4 additions & 3 deletions tests/wasmedge-build/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM fedora:latest

ARG WASM_EDGE_VERSION="0.14.0"

# Install the deps for building crun
Expand All @@ -21,10 +22,10 @@ ADD hello_wasm /hello_wasm
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
SHELL ["/bin/bash", "-c"]
RUN source "$HOME/.cargo/env" && \
rustup target add wasm32-wasi && \
rustup target add wasm32-wasip1 && \
cd /hello_wasm/hello && \
cargo build --release --target wasm32-wasi && \
cp ./target/wasm32-wasi/release/hello.wasm /hello_wasm && \
cargo build --release --target wasm32-wasip1 && \
cp ./target/wasm32-wasip1/release/hello.wasm /hello_wasm && \
cd / && \
rm -rf /hello_wasm/hello

Expand Down

0 comments on commit 68e8d9a

Please sign in to comment.