-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3870 from alexcrichton/test-wasip2
Add `wasm32-wasip2` to the test matrix on CI
- Loading branch information
Showing
4 changed files
with
46 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
FROM ubuntu:24.04 | ||
|
||
COPY wasi.sh / | ||
RUN bash /wasi.sh | ||
|
||
# Note that most of these are copied from `wasm32-wasip1/Dockerfile` | ||
# | ||
# FIXME: the `-Clink-arg` to export `cabi_realloc` is a bug in the target | ||
# itself, this should be fixed upstream. | ||
ENV CARGO_TARGET_WASM32_WASIP2_RUNNER=wasmtime \ | ||
CARGO_TARGET_WASM32_WASIP2_LINKER=/opt/wasi-sdk/bin/clang \ | ||
CARGO_TARGET_WASM32_WASIP2_RUSTFLAGS="-lwasi-emulated-process-clocks -Ctarget-feature=-crt-static -Clink-arg=-Wl,--export,cabi_realloc" \ | ||
CC_wasm32_wasip2=/opt/wasi-sdk/bin/clang \ | ||
CFLAGS_wasm32_wasip2=-D_WASI_EMULATED_PROCESS_CLOCKS \ | ||
PATH=$PATH:/rust/bin:/wasmtime |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -ex | ||
|
||
apt-get update | ||
apt-get install -y --no-install-recommends \ | ||
ca-certificates \ | ||
curl \ | ||
clang \ | ||
xz-utils | ||
|
||
# Wasmtime is used to execute tests and wasi-sdk is used to compile tests. | ||
# Download appropriate versions here and configure various flags below. | ||
# | ||
# At the time of this writing wasmtime 24.0.0 is the latest release and | ||
# wasi-sdk-24 is the latest release, that these numbers match is just | ||
# coincidence. | ||
wasmtime=24.0.0 | ||
wasi_sdk=24 | ||
|
||
curl -L https://github.com/bytecodealliance/wasmtime/releases/download/v$wasmtime/wasmtime-v$wasmtime-x86_64-linux.tar.xz | \ | ||
tar xJf - | ||
mv wasmtime-v$wasmtime-x86_64-linux wasmtime | ||
|
||
# The pre-built `*.deb` files for wasi-sdk install to `/opt/wasi-sdk` | ||
curl -LO https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-$wasi_sdk/wasi-sdk-$wasi_sdk.0-x86_64-linux.deb | ||
dpkg -i ./wasi-sdk-*.deb |