Skip to content

Commit

Permalink
Install and prepare Miri in the primary container
Browse files Browse the repository at this point in the history
The other tools exist in all channels and Miri is the odd one out, so
we make it look a bit more odd.
  • Loading branch information
shepmaster committed Nov 29, 2023
1 parent f14e3a8 commit aee946b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
8 changes: 6 additions & 2 deletions compiler/base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ RUN curl https://sh.rustup.rs -sSf | sh -s -- \
--default-toolchain "${channel}" \
--target wasm32-unknown-unknown \
--component rustfmt \
--component clippy
--component clippy \
--component rust-src
RUN if [ "${channel}" = 'nightly' ]; then rustup component add miri; fi

COPY --chown=playground entrypoint.sh /playground/tools/

Expand Down Expand Up @@ -111,11 +113,13 @@ ARG channel
RUN cargo build
RUN cargo build --release
RUN cargo clippy
RUN if [ "${channel}" = 'nightly' ]; then cargo miri setup; cargo miri run; fi
RUN rm src/*.rs

COPY --from=modify-cargo-toml /playground/modify-cargo-toml/target/release/modify-cargo-toml /playground/.cargo/bin
COPY --from=build-orchestrator /playground/.cargo/bin/worker /playground/.cargo/bin/worker
COPY --from=wasm-tools /playground/.cargo/bin/wasm-tools /playground/.cargo/bin
COPY --chown=playground cargo-wasm /playground/.cargo/bin/
COPY --chown=playground cargo-wasm /playground/.cargo/bin
COPY --chown=playground cargo-miri-playground /playground/.cargo/bin

ENTRYPOINT ["/playground/tools/entrypoint.sh"]
7 changes: 7 additions & 0 deletions compiler/base/cargo-miri-playground
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

set -eu

export MIRI_SYSROOT=~/.cache/miri
export MIRIFLAGS="-Zmiri-disable-isolation"
exec cargo miri run
9 changes: 1 addition & 8 deletions compiler/miri/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
ARG base_image=shepmaster/rust-nightly
FROM ${base_image}

RUN rustup component add rust-src miri

RUN echo 'fn main() {}' > src/main.rs
RUN cargo miri setup
RUN cargo miri run
RUN rm src/*.rs

ADD --chown=playground cargo-miri-playground /playground/.cargo/bin
# The base image takes care of all this for now

ENTRYPOINT ["/playground/tools/entrypoint.sh"]

0 comments on commit aee946b

Please sign in to comment.