File tree Expand file tree Collapse file tree 2 files changed +17
-13
lines changed Expand file tree Collapse file tree 2 files changed +17
-13
lines changed Original file line number Diff line number Diff line change @@ -418,9 +418,9 @@ Moreover, Miri recognizes some environment variables:
418
418
sysroot to use. Only set this if you do not want to use the automatically
419
419
created sysroot. (The `miri` driver sysroot is controlled via the `--sysroot`
420
420
flag instead.)
421
- * `MIRI_TEST_TARGET` (recognized by the test suite) indicates which target
422
- architecture to test against. `miri` and `cargo miri` accept the `--target`
423
- flag for the same purpose.
421
+ * `MIRI_TEST_TARGET` (recognized by the test suite and the `./miri` script ) indicates which target
422
+ architecture to test against. `miri` and `cargo miri` accept the `--target` flag for the same
423
+ purpose.
424
424
* `MIRI_NO_STD` (recognized by `cargo miri` and the test suite) makes sure that the target's
425
425
sysroot is built without libstd. This allows testing and running no_std programs.
426
426
* `MIRI_BLESS` (recognized by the test suite) overwrite all `stderr` and `stdout` files
Original file line number Diff line number Diff line change @@ -167,17 +167,21 @@ test|test-debug|bless|bless-debug)
167
167
$CARGO test $CARGO_BUILD_FLAGS --manifest-path " $MIRIDIR " /ui_test/Cargo.toml " $@ "
168
168
;;
169
169
run|run-debug)
170
- # Scan for "--target" to set the "MIRI_TEST_TARGET" env var so
170
+ # Scan for "--target" to overwrite the "MIRI_TEST_TARGET" env var so
171
171
# that we set the MIRI_SYSROOT up the right way.
172
- if [ -z " $MIRI_TEST_TARGET " ]; then
173
- for ARG in " $@ " ; do
174
- if [ " $LAST_ARG " = " --target" ]; then
175
- # Found it!
176
- export MIRI_TEST_TARGET=" $ARG "
177
- break
178
- fi
179
- LAST_ARG=" $ARG "
180
- done
172
+ FOUND_TARGET_OPT=0
173
+ for ARG in " $@ " ; do
174
+ if [ " $LAST_ARG " = " --target" ]; then
175
+ # Found it!
176
+ export MIRI_TEST_TARGET=" $ARG "
177
+ FOUND_TARGET_OPT=1
178
+ break
179
+ fi
180
+ LAST_ARG=" $ARG "
181
+ done
182
+ if [ " $FOUND_TARGET_OPT " = " 0" ] && [ -n " $MIRI_TEST_TARGET " ]; then
183
+ # Make sure Miri actually uses this target.
184
+ MIRIFLAGS=" $MIRIFLAGS --target $MIRI_TEST_TARGET "
181
185
fi
182
186
# First build and get a sysroot.
183
187
$CARGO build $CARGO_BUILD_FLAGS --manifest-path " $MIRIDIR " /Cargo.toml
You can’t perform that action at this time.
0 commit comments