Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: use wasm32-wasip1 instead of wasm32-wasi #1638

Merged
merged 1 commit into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading