@@ -133,7 +133,7 @@ impl Step for ToolBuild {
133
133
builder. std ( self . build_compiler , target) ;
134
134
}
135
135
}
136
- Mode :: ToolBootstrap => { } // uses downloaded stage0 compiler libs
136
+ Mode :: ToolBootstrap | Mode :: ToolTarget => { } // uses downloaded stage0 compiler libs
137
137
_ => panic ! ( "unexpected Mode for tool build" ) ,
138
138
}
139
139
@@ -196,7 +196,7 @@ impl Step for ToolBuild {
196
196
Kind :: Build ,
197
197
self . mode ,
198
198
self . tool ,
199
- self . build_compiler . stage ,
199
+ self . build_compiler . stage + 1 ,
200
200
& self . build_compiler . host ,
201
201
& self . target ,
202
202
) ;
@@ -365,15 +365,15 @@ pub(crate) fn get_tool_rustc_compiler(
365
365
builder. compiler ( target_compiler. stage . saturating_sub ( 1 ) , builder. config . host_target )
366
366
}
367
367
368
- /// Returns a compiler that is able to compile a `ToolTarget` tool for the given `target`.
369
- pub ( crate ) fn get_tool_target_compiler ( builder : & Builder < ' _ > , target : TargetSelection ) -> Compiler {
370
- todo ! ( "FIX" ) ;
371
- if builder. host_target == target {
368
+ /// Returns the smallest stage compiler that is able to compile code for the given `target`.
369
+ pub ( crate ) fn get_compiler_for_target ( builder : & Builder < ' _ > , target : TargetSelection ) -> Compiler {
370
+ let compiler = if builder. host_target == target {
372
371
builder. compiler ( 0 , builder. host_target )
373
372
} else {
374
- // FIXME: should this be builder.top_stage to avoid rebuilds?
375
- builder. compiler ( 1 , target)
376
- }
373
+ builder. compiler ( 1 , builder. host_target )
374
+ } ;
375
+ builder. std ( compiler, target) ;
376
+ compiler
377
377
}
378
378
379
379
/// Links a built tool binary with the given `name` from the build directory to the
@@ -648,7 +648,7 @@ impl Step for ErrorIndex {
648
648
649
649
#[ derive( Debug , Clone , Hash , PartialEq , Eq ) ]
650
650
pub struct RemoteTestServer {
651
- pub compiler : Compiler ,
651
+ pub build_compiler : Compiler ,
652
652
pub target : TargetSelection ,
653
653
}
654
654
@@ -661,17 +661,17 @@ impl Step for RemoteTestServer {
661
661
662
662
fn make_run ( run : RunConfig < ' _ > ) {
663
663
run. builder . ensure ( RemoteTestServer {
664
- compiler : run . builder . compiler ( run. builder . top_stage , run. builder . config . host_target ) ,
664
+ build_compiler : get_compiler_for_target ( run. builder , run. target ) ,
665
665
target : run. target ,
666
666
} ) ;
667
667
}
668
668
669
669
fn run ( self , builder : & Builder < ' _ > ) -> ToolBuildResult {
670
670
builder. ensure ( ToolBuild {
671
- build_compiler : self . compiler ,
671
+ build_compiler : self . build_compiler ,
672
672
target : self . target ,
673
673
tool : "remote-test-server" ,
674
- mode : Mode :: ToolStd ,
674
+ mode : Mode :: ToolTarget ,
675
675
path : "src/tools/remote-test-server" ,
676
676
source_type : SourceType :: InTree ,
677
677
extra_features : Vec :: new ( ) ,
@@ -680,6 +680,10 @@ impl Step for RemoteTestServer {
680
680
artifact_kind : ToolArtifactKind :: Binary ,
681
681
} )
682
682
}
683
+
684
+ fn metadata ( & self ) -> Option < StepMetadata > {
685
+ Some ( StepMetadata :: build ( "remote-test-server" , self . target ) . built_by ( self . build_compiler ) )
686
+ }
683
687
}
684
688
685
689
#[ derive( Debug , Clone , Hash , PartialEq , Eq , Ord , PartialOrd ) ]
0 commit comments