@@ -1242,59 +1242,6 @@ macro_rules! test {
12421242 } ;
12431243}
12441244
1245- #[ derive( Debug , Copy , Clone , Hash , PartialEq , Eq , Ord , PartialOrd ) ]
1246- pub struct RunMakeSupport {
1247- pub compiler : Compiler ,
1248- pub target : TargetSelection ,
1249- }
1250-
1251- impl Step for RunMakeSupport {
1252- type Output = PathBuf ;
1253- const DEFAULT : bool = true ;
1254-
1255- fn should_run ( run : ShouldRun < ' _ > ) -> ShouldRun < ' _ > {
1256- run. never ( )
1257- }
1258-
1259- fn make_run ( run : RunConfig < ' _ > ) {
1260- let compiler = run. builder . compiler ( run. builder . top_stage , run. build_triple ( ) ) ;
1261- run. builder . ensure ( RunMakeSupport { compiler, target : run. build_triple ( ) } ) ;
1262- }
1263-
1264- /// Builds run-make-support and returns the path to the resulting rlib.
1265- fn run ( self , builder : & Builder < ' _ > ) -> PathBuf {
1266- builder. ensure ( compile:: Std :: new ( self . compiler , self . target ) ) ;
1267-
1268- let cargo = tool:: prepare_tool_cargo (
1269- builder,
1270- self . compiler ,
1271- Mode :: ToolStd ,
1272- self . target ,
1273- Kind :: Build ,
1274- "src/tools/run-make-support" ,
1275- SourceType :: InTree ,
1276- & [ ] ,
1277- ) ;
1278-
1279- let _guard = builder. msg_tool (
1280- Kind :: Build ,
1281- Mode :: ToolStd ,
1282- "run-make-support" ,
1283- self . compiler . stage ,
1284- & self . compiler . host ,
1285- & self . target ,
1286- ) ;
1287- cargo. into_cmd ( ) . run ( builder) ;
1288-
1289- let lib_name = "librun_make_support.rlib" ;
1290- let lib = builder. tools_dir ( self . compiler ) . join ( lib_name) ;
1291-
1292- let cargo_out = builder. cargo_out ( self . compiler , Mode :: ToolStd , self . target ) . join ( lib_name) ;
1293- builder. copy_link ( & cargo_out, & lib) ;
1294- lib
1295- }
1296- }
1297-
12981245/// Runs `cargo test` on the `src/tools/run-make-support` crate.
12991246/// That crate is used by run-make tests.
13001247#[ derive( Debug , Clone , PartialEq , Eq , Hash ) ]
@@ -1446,40 +1393,7 @@ test!(Pretty {
14461393 only_hosts: true ,
14471394} ) ;
14481395
1449- /// Special-handling is needed for `run-make`, so don't use `test!` for defining `RunMake`
1450- /// tests.
1451- #[ derive( Debug , Copy , Clone , PartialEq , Eq , Hash ) ]
1452- pub struct RunMake {
1453- pub compiler : Compiler ,
1454- pub target : TargetSelection ,
1455- }
1456-
1457- impl Step for RunMake {
1458- type Output = ( ) ;
1459- const DEFAULT : bool = true ;
1460- const ONLY_HOSTS : bool = false ;
1461-
1462- fn should_run ( run : ShouldRun < ' _ > ) -> ShouldRun < ' _ > {
1463- run. suite_path ( "tests/run-make" )
1464- }
1465-
1466- fn make_run ( run : RunConfig < ' _ > ) {
1467- let compiler = run. builder . compiler ( run. builder . top_stage , run. build_triple ( ) ) ;
1468- run. builder . ensure ( RunMakeSupport { compiler, target : run. build_triple ( ) } ) ;
1469- run. builder . ensure ( RunMake { compiler, target : run. target } ) ;
1470- }
1471-
1472- fn run ( self , builder : & Builder < ' _ > ) {
1473- builder. ensure ( Compiletest {
1474- compiler : self . compiler ,
1475- target : self . target ,
1476- mode : "run-make" ,
1477- suite : "run-make" ,
1478- path : "tests/run-make" ,
1479- compare_mode : None ,
1480- } ) ;
1481- }
1482- }
1396+ test ! ( RunMake { path: "tests/run-make" , mode: "run-make" , suite: "run-make" , default : true } ) ;
14831397
14841398test ! ( Assembly { path: "tests/assembly" , mode: "assembly" , suite: "assembly" , default : true } ) ;
14851399
@@ -1722,6 +1636,9 @@ NOTE: if you're sure you want to do this, please open an issue as to why. In the
17221636 host : target,
17231637 } ) ;
17241638 }
1639+ if suite == "run-make" {
1640+ builder. tool_exe ( Tool :: RunMakeSupport ) ;
1641+ }
17251642
17261643 // Also provide `rust_test_helpers` for the host.
17271644 builder. ensure ( TestHelpers { target : compiler. host } ) ;
@@ -1774,6 +1691,11 @@ NOTE: if you're sure you want to do this, please open an issue as to why. In the
17741691 } ;
17751692
17761693 cmd. arg ( "--cargo-path" ) . arg ( cargo_path) ;
1694+
1695+ // We need to pass the compiler that was used to compile run-make-support,
1696+ // because we have to use the same compiler to compile rmake.rs recipes.
1697+ let stage0_rustc_path = builder. compiler ( 0 , compiler. host ) ;
1698+ cmd. arg ( "--stage0-rustc-path" ) . arg ( builder. rustc ( stage0_rustc_path) ) ;
17771699 }
17781700
17791701 // Avoid depending on rustdoc when we don't need it.
0 commit comments