Skip to content

Commit a77e201

Browse files
committed
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.
1 parent 571e5be commit a77e201

File tree

3 files changed

+38
-0
lines changed

3 files changed

+38
-0
lines changed

.github/workflows/full_ci.yml

+1
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ jobs:
119119
s390x-unknown-linux-gnu,
120120
riscv64gc-unknown-linux-gnu,
121121
wasm32-wasip1,
122+
wasm32-wasip2,
122123
sparc64-unknown-linux-gnu,
123124
wasm32-unknown-emscripten,
124125
x86_64-linux-android,

ci/docker/wasm32-wasip1/Dockerfile

+3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ RUN apt-get update && \
99

1010
# Wasmtime is used to execute tests and wasi-sdk is used to compile tests.
1111
# Download appropriate versions here and configure various flags below.
12+
#
13+
# Note that these versions are kept in sync with the `wasm32-wasip2/Dockerfile`
14+
# as well.
1215
ENV WASMTIME 24.0.0
1316
ENV WASI_SDK 24
1417

ci/docker/wasm32-wasip2/Dockerfile

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
FROM ubuntu:24.04
2+
3+
RUN apt-get update && \
4+
apt-get install -y --no-install-recommends \
5+
ca-certificates \
6+
curl \
7+
clang \
8+
xz-utils
9+
10+
# Wasmtime is used to execute tests and wasi-sdk is used to compile tests.
11+
# Download appropriate versions here and configure various flags below.
12+
#
13+
# Note that these versions are kept in sync with the `wasm32-wasip2/Dockerfile`
14+
# as well.
15+
ENV WASMTIME 24.0.0
16+
ENV WASI_SDK 24
17+
18+
RUN curl -L https://github.com/bytecodealliance/wasmtime/releases/download/v$WASMTIME/wasmtime-v$WASMTIME-x86_64-linux.tar.xz | \
19+
tar xJf -
20+
ENV PATH=$PATH:/wasmtime-v$WASMTIME-x86_64-linux
21+
22+
RUN curl -LO https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-$WASI_SDK/wasi-sdk-$WASI_SDK.0-x86_64-linux.deb
23+
RUN dpkg -i ./wasi-sdk-*.deb
24+
25+
# Note that most of these are copied from `wasm32-wasip1/Dockerfile`
26+
#
27+
# FIXME: the `-Clink-arg` to export `cabi_realloc` is a bug in the target
28+
# itself, this should be fixed upstream.
29+
ENV CARGO_TARGET_WASM32_WASIP2_RUNNER=wasmtime \
30+
CARGO_TARGET_WASM32_WASIP2_LINKER=/opt/wasi-sdk/bin/clang \
31+
CARGO_TARGET_WASM32_WASIP2_RUSTFLAGS="-lwasi-emulated-process-clocks -Ctarget-feature=-crt-static -Clink-arg=-Wl,--export,cabi_realloc" \
32+
CC_wasm32_wasip2=/opt/wasi-sdk/bin/clang \
33+
CFLAGS_wasm32_wasip2=-D_WASI_EMULATED_PROCESS_CLOCKS \
34+
PATH=$PATH:/rust/bin

0 commit comments

Comments
 (0)