Skip to content

Commit aee946b

Browse files
committed
Install and prepare Miri in the primary container
The other tools exist in all channels and Miri is the odd one out, so we make it look a bit more odd.
1 parent f14e3a8 commit aee946b

File tree

3 files changed

+14
-10
lines changed

3 files changed

+14
-10
lines changed

compiler/base/Dockerfile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ RUN curl https://sh.rustup.rs -sSf | sh -s -- \
4646
--default-toolchain "${channel}" \
4747
--target wasm32-unknown-unknown \
4848
--component rustfmt \
49-
--component clippy
49+
--component clippy \
50+
--component rust-src
51+
RUN if [ "${channel}" = 'nightly' ]; then rustup component add miri; fi
5052

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

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

116119
COPY --from=modify-cargo-toml /playground/modify-cargo-toml/target/release/modify-cargo-toml /playground/.cargo/bin
117120
COPY --from=build-orchestrator /playground/.cargo/bin/worker /playground/.cargo/bin/worker
118121
COPY --from=wasm-tools /playground/.cargo/bin/wasm-tools /playground/.cargo/bin
119-
COPY --chown=playground cargo-wasm /playground/.cargo/bin/
122+
COPY --chown=playground cargo-wasm /playground/.cargo/bin
123+
COPY --chown=playground cargo-miri-playground /playground/.cargo/bin
120124

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

compiler/base/cargo-miri-playground

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
3+
set -eu
4+
5+
export MIRI_SYSROOT=~/.cache/miri
6+
export MIRIFLAGS="-Zmiri-disable-isolation"
7+
exec cargo miri run

compiler/miri/Dockerfile

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
ARG base_image=shepmaster/rust-nightly
22
FROM ${base_image}
33

4-
RUN rustup component add rust-src miri
5-
6-
RUN echo 'fn main() {}' > src/main.rs
7-
RUN cargo miri setup
8-
RUN cargo miri run
9-
RUN rm src/*.rs
10-
11-
ADD --chown=playground cargo-miri-playground /playground/.cargo/bin
4+
# The base image takes care of all this for now
125

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

0 commit comments

Comments
 (0)