Skip to content

Commit 9248aec

Browse files
committed
Install binaries to the miri toolchain's sysroot
1 parent 0ba1f4a commit 9248aec

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

ci.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ function run_tests {
6262
if [ "$HOST_TARGET" = x86_64-unknown-linux-gnu ]; then
6363
# These act up on Windows (`which miri` produces a filename that does not exist?!?),
6464
# so let's do this only on Linux. Also makes sure things work without these set.
65-
export RUSTC=$(which rustc)
66-
export MIRI=$(which miri)
65+
export RUSTC=$(which rustc) # Produces a warning unless we also set MIRI
66+
export MIRI=$(rustc +miri --print sysroot)/bin/miri
6767
fi
6868
mkdir -p .cargo
6969
echo 'build.rustc-wrapper = "thisdoesnotexist"' > .cargo/config.toml

miri

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,8 +281,9 @@ find_sysroot() {
281281
case "$COMMAND" in
282282
install)
283283
# "--locked" to respect the Cargo.lock file if it exists.
284-
$CARGO install $CARGO_EXTRA_FLAGS --path "$MIRIDIR" --force --locked "$@"
285-
$CARGO install $CARGO_EXTRA_FLAGS --path "$MIRIDIR"/cargo-miri --force --locked "$@"
284+
# Install binaries to the miri toolchain's sysroot so they do not interact with other toolchains
285+
$CARGO install $CARGO_EXTRA_FLAGS --path "$MIRIDIR" --force --locked --root "$SYSROOT" "$@"
286+
$CARGO install $CARGO_EXTRA_FLAGS --path "$MIRIDIR"/cargo-miri --force --locked --root "$SYSROOT" "$@"
286287
;;
287288
check)
288289
# Check, and let caller control flags.

0 commit comments

Comments
 (0)