File tree 4 files changed +46
-19
lines changed
4 files changed +46
-19
lines changed Original file line number Diff line number Diff line change @@ -119,6 +119,7 @@ jobs:
119
119
s390x-unknown-linux-gnu,
120
120
riscv64gc-unknown-linux-gnu,
121
121
wasm32-wasip1,
122
+ wasm32-wasip2,
122
123
sparc64-unknown-linux-gnu,
123
124
wasm32-unknown-emscripten,
124
125
x86_64-linux-android,
Original file line number Diff line number Diff line change 1
1
FROM ubuntu:24.04
2
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
- ENV WASMTIME 24.0.0
13
- ENV WASI_SDK 24
14
-
15
- RUN curl -L https://github.com/bytecodealliance/wasmtime/releases/download/v$WASMTIME/wasmtime-v$WASMTIME-x86_64-linux.tar.xz | \
16
- tar xJf -
17
- ENV PATH=$PATH:/wasmtime-v$WASMTIME-x86_64-linux
18
-
19
- RUN curl -LO https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-$WASI_SDK/wasi-sdk-$WASI_SDK.0-x86_64-linux.deb
20
- RUN dpkg -i ./wasi-sdk-*.deb
3
+ COPY wasi.sh /
4
+ RUN bash /wasi.sh
21
5
22
6
# Note that `-D_WASI_EMULATED_PROCESS_CLOCKS` is used to enable access to
23
7
# clock-related defines even though they're emulated. Also note that the usage
@@ -29,4 +13,4 @@ ENV CARGO_TARGET_WASM32_WASIP1_RUNNER=wasmtime \
29
13
CARGO_TARGET_WASM32_WASIP1_RUSTFLAGS="-lwasi-emulated-process-clocks -Ctarget-feature=-crt-static" \
30
14
CC_wasm32_wasip1=/opt/wasi-sdk/bin/clang \
31
15
CFLAGS_wasm32_wasip1=-D_WASI_EMULATED_PROCESS_CLOCKS \
32
- PATH=$PATH:/rust/bin
16
+ PATH=$PATH:/rust/bin:/wasmtime
Original file line number Diff line number Diff line change
1
+ FROM ubuntu:24.04
2
+
3
+ COPY wasi.sh /
4
+ RUN bash /wasi.sh
5
+
6
+ # Note that most of these are copied from `wasm32-wasip1/Dockerfile`
7
+ #
8
+ # FIXME: the `-Clink-arg` to export `cabi_realloc` is a bug in the target
9
+ # itself, this should be fixed upstream.
10
+ ENV CARGO_TARGET_WASM32_WASIP2_RUNNER=wasmtime \
11
+ CARGO_TARGET_WASM32_WASIP2_LINKER=/opt/wasi-sdk/bin/clang \
12
+ CARGO_TARGET_WASM32_WASIP2_RUSTFLAGS="-lwasi-emulated-process-clocks -Ctarget-feature=-crt-static -Clink-arg=-Wl,--export,cabi_realloc" \
13
+ CC_wasm32_wasip2=/opt/wasi-sdk/bin/clang \
14
+ CFLAGS_wasm32_wasip2=-D_WASI_EMULATED_PROCESS_CLOCKS \
15
+ PATH=$PATH:/rust/bin:/wasmtime
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ set -ex
4
+
5
+ apt-get update
6
+ apt-get install -y --no-install-recommends \
7
+ ca-certificates \
8
+ curl \
9
+ clang \
10
+ xz-utils
11
+
12
+ # Wasmtime is used to execute tests and wasi-sdk is used to compile tests.
13
+ # Download appropriate versions here and configure various flags below.
14
+ #
15
+ # At the time of this writing wasmtime 24.0.0 is the latest release and
16
+ # wasi-sdk-24 is the latest release, that these numbers match is just
17
+ # coincidence.
18
+ wasmtime=24.0.0
19
+ wasi_sdk=24
20
+
21
+ curl -L https://github.com/bytecodealliance/wasmtime/releases/download/v$wasmtime /wasmtime-v$wasmtime -x86_64-linux.tar.xz | \
22
+ tar xJf -
23
+ mv wasmtime-v$wasmtime -x86_64-linux wasmtime
24
+
25
+ # The pre-built `*.deb` files for wasi-sdk install to `/opt/wasi-sdk`
26
+ curl -LO https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-$wasi_sdk /wasi-sdk-$wasi_sdk .0-x86_64-linux.deb
27
+ dpkg -i ./wasi-sdk-* .deb
You can’t perform that action at this time.
0 commit comments