-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
wasm32-wasip2
to the test matrix on CI
This is similar to #3869 except that it adds tests for `wasm32-wasip2` in addition to `wasm32-wasip1`. This is intended to eventually empower definitions from rust-lang/rust#129638 to move into this repository.
- Loading branch information
1 parent
571e5be
commit a77e201
Showing
3 changed files
with
38 additions
and
0 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,34 @@ | ||
FROM ubuntu:24.04 | ||
|
||
RUN 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. | ||
# | ||
# Note that these versions are kept in sync with the `wasm32-wasip2/Dockerfile` | ||
# as well. | ||
ENV WASMTIME 24.0.0 | ||
ENV WASI_SDK 24 | ||
|
||
RUN curl -L https://github.com/bytecodealliance/wasmtime/releases/download/v$WASMTIME/wasmtime-v$WASMTIME-x86_64-linux.tar.xz | \ | ||
tar xJf - | ||
ENV PATH=$PATH:/wasmtime-v$WASMTIME-x86_64-linux | ||
|
||
RUN curl -LO https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-$WASI_SDK/wasi-sdk-$WASI_SDK.0-x86_64-linux.deb | ||
RUN dpkg -i ./wasi-sdk-*.deb | ||
|
||
# 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 |