1FROM ubuntu:24.10
2
3COPY wasi.sh /
4RUN /wasi.sh
5
6# Note that `-D_WASI_EMULATED_PROCESS_CLOCKS` is used to enable access to
7# clock-related defines even though they're emulated. Also note that the usage
8# of `-Ctarget-feature=-crt-static` here forces usage of the external wasi-libc
9# installed via `wasi-sdk` instead of the version that comes with the standard
10# library.
11ENV CARGO_TARGET_WASM32_WASIP1_RUNNER=wasmtime \
12    CARGO_TARGET_WASM32_WASIP1_LINKER=/opt/wasi-sdk/bin/clang \
13    CARGO_TARGET_WASM32_WASIP1_RUSTFLAGS="-lwasi-emulated-process-clocks -Ctarget-feature=-crt-static" \
14    CC_wasm32_wasip1=/opt/wasi-sdk/bin/clang \
15    CFLAGS_wasm32_wasip1=-D_WASI_EMULATED_PROCESS_CLOCKS \
16    PATH=$PATH:/rust/bin:/wasmtime
17