File tree 1 file changed +13
-1
lines changed
src/bootstrap/src/core/config
1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -1189,7 +1189,19 @@ impl Config {
1189
1189
pub fn parse ( args : & [ String ] ) -> Config {
1190
1190
#[ cfg( test) ]
1191
1191
fn get_toml ( _: & Path ) -> TomlConfig {
1192
- TomlConfig :: default ( )
1192
+ let mut default = TomlConfig :: default ( ) ;
1193
+
1194
+ // When configuring bootstrap for tests, make sure to set the rustc and Cargo to the
1195
+ // same ones used to call the tests. If we don't do that, bootstrap will use its own
1196
+ // detection logic to find a suitable rustc and Cargo, which doesn't work when the
1197
+ // caller is specìfying a custom local rustc or Cargo in their config.toml.
1198
+ default. build = Some ( Build {
1199
+ rustc : std:: env:: var_os ( "RUSTC" ) . map ( |v| v. into ( ) ) ,
1200
+ cargo : std:: env:: var_os ( "CARGO" ) . map ( |v| v. into ( ) ) ,
1201
+ ..Build :: default ( )
1202
+ } ) ;
1203
+
1204
+ default
1193
1205
}
1194
1206
1195
1207
#[ cfg( not( test) ) ]
You can’t perform that action at this time.
0 commit comments