@@ -268,10 +268,6 @@ macro_rules! bootstrap_tool {
268268 }
269269
270270 impl Tool {
271- pub fn get_mode( & self ) -> Mode {
272- Mode :: ToolBootstrap
273- }
274-
275271 /// Whether this tool requires LLVM to run
276272 pub fn uses_llvm_tools( & self ) -> bool {
277273 match self {
@@ -345,6 +341,7 @@ bootstrap_tool!(
345341 Compiletest , "src/tools/compiletest" , "compiletest" , llvm_tools = true ;
346342 BuildManifest , "src/tools/build-manifest" , "build-manifest" ;
347343 RemoteTestClient , "src/tools/remote-test-client" , "remote-test-client" ;
344+ RemoteTestServer , "src/tools/remote-test-server" , "remote-test-server" ;
348345 RustInstaller , "src/tools/rust-installer" , "fabricate" , is_external_tool = true ;
349346 RustdocTheme , "src/tools/rustdoc-themes" , "rustdoc-themes" ;
350347) ;
@@ -397,40 +394,6 @@ impl Step for ErrorIndex {
397394 }
398395}
399396
400- #[ derive( Debug , Copy , Clone , Hash , PartialEq , Eq ) ]
401- pub struct RemoteTestServer {
402- pub compiler : Compiler ,
403- pub target : Interned < String > ,
404- }
405-
406- impl Step for RemoteTestServer {
407- type Output = PathBuf ;
408-
409- fn should_run ( run : ShouldRun < ' _ > ) -> ShouldRun < ' _ > {
410- run. path ( "src/tools/remote-test-server" )
411- }
412-
413- fn make_run ( run : RunConfig < ' _ > ) {
414- run. builder . ensure ( RemoteTestServer {
415- compiler : run. builder . compiler ( run. builder . top_stage , run. builder . config . build ) ,
416- target : run. target ,
417- } ) ;
418- }
419-
420- fn run ( self , builder : & Builder < ' _ > ) -> PathBuf {
421- builder. ensure ( ToolBuild {
422- compiler : self . compiler ,
423- target : self . target ,
424- tool : "remote-test-server" ,
425- mode : Mode :: ToolStd ,
426- path : "src/tools/remote-test-server" ,
427- is_optional_tool : false ,
428- source_type : SourceType :: InTree ,
429- extra_features : Vec :: new ( ) ,
430- } ) . expect ( "expected to build -- essential tool" )
431- }
432- }
433-
434397#[ derive( Debug , Copy , Clone , Hash , PartialEq , Eq ) ]
435398pub struct Rustdoc {
436399 /// This should only ever be 0 or 2.
@@ -659,23 +622,14 @@ impl<'a> Builder<'a> {
659622 pub fn tool_cmd ( & self , tool : Tool ) -> Command {
660623 let mut cmd = Command :: new ( self . tool_exe ( tool) ) ;
661624 let compiler = self . compiler ( 0 , self . config . build ) ;
662- self . prepare_tool_cmd ( compiler, tool, & mut cmd) ;
663- cmd
664- }
665-
666- /// Prepares the `cmd` provided to be able to run the `compiler` provided.
667- ///
668- /// Notably this munges the dynamic library lookup path to point to the
669- /// right location to run `compiler`.
670- fn prepare_tool_cmd ( & self , compiler : Compiler , tool : Tool , cmd : & mut Command ) {
671625 let host = & compiler. host ;
626+ // Prepares the `cmd` provided to be able to run the `compiler` provided.
627+ //
628+ // Notably this munges the dynamic library lookup path to point to the
629+ // right location to run `compiler`.
672630 let mut lib_paths: Vec < PathBuf > = vec ! [
673- if compiler. stage == 0 {
674- self . build. rustc_snapshot_libdir( )
675- } else {
676- PathBuf :: from( & self . sysroot_libdir( compiler, compiler. host) )
677- } ,
678- self . cargo_out( compiler, tool. get_mode( ) , * host) . join( "deps" ) ,
631+ self . build. rustc_snapshot_libdir( ) ,
632+ self . cargo_out( compiler, Mode :: ToolBootstrap , * host) . join( "deps" ) ,
679633 ] ;
680634
681635 // On MSVC a tool may invoke a C compiler (e.g., compiletest in run-make
@@ -696,6 +650,7 @@ impl<'a> Builder<'a> {
696650 }
697651 }
698652
699- add_lib_path ( lib_paths, cmd) ;
653+ add_lib_path ( lib_paths, & mut cmd) ;
654+ cmd
700655 }
701656}
0 commit comments