@@ -7,6 +7,8 @@ use std::io::BufReader;
7
7
use std:: path:: PathBuf ;
8
8
use std:: process:: Command ;
9
9
10
+ use rustc_version:: VersionMeta ;
11
+
10
12
use crate :: { setup:: * , util:: * } ;
11
13
12
14
const CARGO_MIRI_HELP : & str = r#"Runs binary crates and tests in Miri
@@ -90,12 +92,14 @@ pub fn phase_cargo_miri(mut args: impl Iterator<Item = String>) {
90
92
let verbose = num_arg_flag ( "-v" ) ;
91
93
92
94
// Determine the involved architectures.
93
- let host = version_info ( ) . host ;
95
+ let rustc_version = VersionMeta :: for_command ( miri_for_host ( ) )
96
+ . expect ( "failed to determine underlying rustc version of Miri" ) ;
97
+ let host = & rustc_version. host ;
94
98
let target = get_arg_flag_value ( "--target" ) ;
95
- let target = target. as_ref ( ) . unwrap_or ( & host) ;
99
+ let target = target. as_ref ( ) . unwrap_or ( host) ;
96
100
97
101
// We always setup.
98
- setup ( & subcommand, & host , target ) ;
102
+ setup ( & subcommand, target , & rustc_version ) ;
99
103
100
104
// Invoke actual cargo for the job, but with different flags.
101
105
// We re-use `cargo test` and `cargo run`, which makes target and binary handling very easy but
@@ -146,7 +150,7 @@ pub fn phase_cargo_miri(mut args: impl Iterator<Item = String>) {
146
150
if get_arg_flag_value ( "--target" ) . is_none ( ) {
147
151
// No target given. Explicitly pick the host.
148
152
cmd. arg ( "--target" ) ;
149
- cmd. arg ( & host) ;
153
+ cmd. arg ( host) ;
150
154
}
151
155
152
156
// Set ourselves as runner for al binaries invoked by cargo.
@@ -204,7 +208,7 @@ pub fn phase_cargo_miri(mut args: impl Iterator<Item = String>) {
204
208
205
209
#[ derive( Debug , Copy , Clone , PartialEq ) ]
206
210
pub enum RustcPhase {
207
- /// `rustc` called via `xargo` for sysroot build.
211
+ /// `rustc` called during sysroot build.
208
212
Setup ,
209
213
/// `rustc` called by `cargo` for regular build.
210
214
Build ,
@@ -264,7 +268,7 @@ pub fn phase_rustc(mut args: impl Iterator<Item = String>, phase: RustcPhase) {
264
268
let verbose = std:: env:: var ( "MIRI_VERBOSE" )
265
269
. map_or ( 0 , |verbose| verbose. parse ( ) . expect ( "verbosity flag must be an integer" ) ) ;
266
270
let target_crate = is_target_crate ( ) ;
267
- // Determine whether this is cargo/xargo invoking rustc to get some infos.
271
+ // Determine whether this is cargo invoking rustc to get some infos.
268
272
let info_query = get_arg_flag_value ( "--print" ) . is_some ( ) || has_arg_flag ( "-vV" ) ;
269
273
270
274
let store_json = |info : CrateRunInfo | {
0 commit comments