11# In the first container we want to assemble the `wasi-sysroot` by compiling it
22# from source. This requires a clang 8.0+ compiler with enough wasm support and
33# then we're just running a standard `make` inside of what we clone.
4- FROM ubuntu:19 .04 as wasi-sysroot
4+ FROM ubuntu:18 .04 as wasi-sysroot
55
66RUN apt-get update && \
77 apt-get install -y --no-install-recommends \
@@ -28,19 +28,19 @@ RUN mv /clang+llvm-8.0.0-x86_64-linux-gnu-ubuntu-18.04 /wasmcc
2828# those breaking changes on `libc`'s own CI
2929RUN git clone https://github.com/CraneStation/wasi-sysroot && \
3030 cd wasi-sysroot && \
31- git reset --hard 2201343c17b7149a75f543f523bea0c3243c6091
31+ git reset --hard eee6ee7566e26f2535eb6088c8494a112ff423b9
3232RUN make -C wasi-sysroot install -j $(nproc) WASM_CC=/wasmcc/bin/clang INSTALL_DIR=/wasi-sysroot
3333
3434# This is a small wrapper script which executes the actual clang binary in
3535# `/wasmcc` and then is sure to pass the right `--sysroot` argument which we
3636# just built above.
37- COPY docker/wasm32-unknown- wasi/clang.sh /wasi-sysroot/bin/clang
37+ COPY docker/wasm32-wasi/clang.sh /wasi-sysroot/bin/clang
3838
3939# In the second container we're going to build the `wasmtime` binary which is
4040# used to execute wasi executables. This is a standard Rust project so we're
4141# just checking out a known revision (which pairs with the sysroot one we
4242# downlaoded above) and then we're building it with Cargo
43- FROM ubuntu:19 .04 as wasmtime
43+ FROM ubuntu:18 .04 as wasmtime
4444
4545RUN apt-get update && \
4646 apt-get install -y --no-install-recommends \
@@ -58,15 +58,15 @@ RUN curl -sSf https://sh.rustup.rs | sh -s -- -y
5858ENV PATH=/root/.cargo/bin:$PATH
5959
6060RUN apt-get install -y --no-install-recommends python
61- RUN git clone https://github.com/CraneStation/wasmtime wasmtime && \
61+ RUN git clone --recursive https://github.com/CraneStation/wasmtime wasmtime && \
6262 cd wasmtime && \
63- git reset --hard a1c123c3dd8f9766990efe0f1734a646f61ba8a0
63+ git reset --hard 67edb00f29b62864b00179fe4bfa99bc29973285
6464RUN cargo build --release --manifest-path wasmtime/Cargo.toml
6565
6666# And finally in the last image we're going to assemble everything together.
6767# We'll install things needed at runtime for now and then copy over the
6868# sysroot/wasmtime artifacts into their final location.
69- FROM ubuntu:19 .04
69+ FROM ubuntu:18 .04
7070
7171RUN apt-get update && \
7272 apt-get install -y --no-install-recommends \
@@ -86,8 +86,8 @@ COPY --from=wasmtime /wasmtime/target/release/wasmtime /usr/bin/
8686# executable with the right sysroot, and then we're sure to turn off the
8787# crt-static feature to ensure that the CRT that we're specifying with `clang`
8888# is used.
89- ENV CARGO_TARGET_WASM32_UNKNOWN_WASI_RUNNER =wasmtime \
90- CARGO_TARGET_WASM32_UNKNOWN_WASI_LINKER =/wasi-sysroot/bin/clang \
91- CC_wasm32_unknown_wasi =/wasi-sysroot/bin/clang \
89+ ENV CARGO_TARGET_WASM32_WASI_RUNNER =wasmtime \
90+ CARGO_TARGET_WASM32_WASI_LINKER =/wasi-sysroot/bin/clang \
91+ CC_wasm32_wasi =/wasi-sysroot/bin/clang \
9292 PATH=$PATH:/rust/bin \
9393 RUSTFLAGS=-Ctarget-feature=-crt-static
0 commit comments