Skip to content

Commit e332cd0

Browse files
committed
don't ask rustc for miri's stuff
1 parent ecc0dd1 commit e332cd0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

run-test.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ set -euo pipefail
88
## ./run-test.sh CRATE_NAME CARGO_TEST_ARGS
99
## Environment variables:
1010
## MIRI_LIB_SRC: The path to the Rust library directory (`library`).
11-
## Defaults to `$(rustc --print sysroot)/lib/rustlib/src/rust/library`.
11+
## Defaults to `$(miri --print sysroot)/lib/rustlib/src/rust/library`.
1212

1313
CRATE=${1:-}
1414
if [[ -z "$CRATE" ]]; then
@@ -18,7 +18,7 @@ fi
1818
shift
1919

2020
# compute the library directory (and export for Miri)
21-
MIRI_LIB_SRC=${MIRI_LIB_SRC:-$(rustc --print sysroot)/lib/rustlib/src/rust/library}
21+
MIRI_LIB_SRC=${MIRI_LIB_SRC:-$(MIRI_BE_RUSTC=host miri --print sysroot)/lib/rustlib/src/rust/library}
2222
if ! test -d "$MIRI_LIB_SRC/core"; then
2323
echo "Rust source dir ($MIRI_LIB_SRC) does not contain a 'core' subdirectory."
2424
echo "Set MIRI_LIB_SRC to the Rust source directory, or install the rust-src component."
@@ -33,7 +33,7 @@ rm -f library
3333
ln -s "$MIRI_LIB_SRC" library
3434

3535
# use the rust-src lockfile
36-
cp "$(rustc --print sysroot)/lib/rustlib/src/rust/Cargo.lock" Cargo.lock
36+
cp "$MIRI_LIB_SRC/../Cargo.lock" Cargo.lock
3737

3838
# run test
3939
cd ./${CRATE}_miri_test

0 commit comments

Comments
 (0)