File tree Expand file tree Collapse file tree 3 files changed +15
-9
lines changed Expand file tree Collapse file tree 3 files changed +15
-9
lines changed Original file line number Diff line number Diff line change 55 " cargo-miri/Cargo.toml" ,
66 " miri-script/Cargo.toml" ,
77 ],
8- "rust-analyzer.check.invocationLocation" : " root" ,
98 "rust-analyzer.check.invocationStrategy" : " once" ,
109 "rust-analyzer.check.overrideCommand" : [
11- " env" ,
12- " MIRI_AUTO_OPS=no" ,
1310 " ./miri" ,
1411 " clippy" , // make this `check` when working with a locally built rustc
1512 " --message-format=json" ,
1613 ],
14+ "rust-analyzer.cargo.extraEnv" : {
15+ "MIRI_AUTO_OPS" : " no" ,
16+ "MIRI_IN_RA" : " 1" ,
17+ },
1718 // Contrary to what the name suggests, this also affects proc macros.
18- "rust-analyzer.cargo.buildScripts.invocationLocation" : " root" ,
1919 "rust-analyzer.cargo.buildScripts.invocationStrategy" : " once" ,
2020 "rust-analyzer.cargo.buildScripts.overrideCommand" : [
21- " env" ,
22- " MIRI_AUTO_OPS=no" ,
2321 " ./miri" ,
2422 " check" ,
2523 " --message-format=json" ,
Original file line number Diff line number Diff line change 33# We want to call the binary directly, so we need to know where it ends up.
44ROOT_DIR=" $( dirname " $0 " ) "
55MIRI_SCRIPT_TARGET_DIR=" $ROOT_DIR " /miri-script/target
6- # If stdout is not a terminal and we are not on CI, assume that we are being invoked by RA, and use JSON output.
7- if ! [ -t 1 ] && [ -z " $CI " ]; then
6+ TOOLCHAIN=" +nightly"
7+ # If we are being invoked for RA, use JSON output and the default toolchain (to make proc-macros
8+ # work in RA). This needs a different target dir to avoid mixing up the builds.
9+ if [ -n " $MIRI_IN_RA " ]; then
810 MESSAGE_FORMAT=" --message-format=json"
11+ TOOLCHAIN=" "
12+ MIRI_SCRIPT_TARGET_DIR=" $MIRI_SCRIPT_TARGET_DIR " /ra
913fi
1014# We need a nightly toolchain, for `-Zroot-dir`.
11- cargo +nightly build $CARGO_EXTRA_FLAGS --manifest-path " $ROOT_DIR " /miri-script/Cargo.toml \
15+ cargo $TOOLCHAIN build $CARGO_EXTRA_FLAGS --manifest-path " $ROOT_DIR " /miri-script/Cargo.toml \
1216 -Zroot-dir=" $ROOT_DIR " \
1317 -q --target-dir " $MIRI_SCRIPT_TARGET_DIR " $MESSAGE_FORMAT || \
1418 ( echo " Failed to build miri-script. Is the 'nightly' toolchain installed?" ; exit 1 )
Original file line number Diff line number Diff line change @@ -564,6 +564,10 @@ impl Command {
564564 if bless {
565565 e. sh . set_var ( "RUSTC_BLESS" , "Gesundheit" ) ;
566566 }
567+ if e. sh . var ( "MIRI_TEST_TARGET" ) . is_ok ( ) {
568+ // Avoid trouble due to an incorrectly set env var.
569+ bail ! ( "MIRI_TEST_TARGET must not be set when invoking `./miri test`" ) ;
570+ }
567571 if let Some ( target) = target {
568572 // Tell the harness which target to test.
569573 e. sh . set_var ( "MIRI_TEST_TARGET" , target) ;
You can’t perform that action at this time.
0 commit comments