@@ -541,52 +541,77 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules {
541541 //
542542 // Tools used during the build system but not shipped
543543 rules. build ( "tool-rustbook" , "src/tools/rustbook" )
544+ . default ( build. config . build_all_tools )
545+ . host ( true )
544546 . dep ( |s| s. name ( "maybe-clean-tools" ) )
545547 . dep ( |s| s. name ( "librustc-tool" ) )
546548 . run ( move |s| compile:: tool ( build, s. stage , s. target , "rustbook" ) ) ;
547549 rules. build ( "tool-error-index" , "src/tools/error_index_generator" )
550+ . default ( build. config . build_all_tools )
551+ . host ( true )
548552 . dep ( |s| s. name ( "maybe-clean-tools" ) )
549553 . dep ( |s| s. name ( "librustc-tool" ) )
550554 . run ( move |s| compile:: tool ( build, s. stage , s. target , "error_index_generator" ) ) ;
551555 rules. build ( "tool-unstable-book-gen" , "src/tools/unstable-book-gen" )
556+ . default ( build. config . build_all_tools )
557+ . host ( true )
552558 . dep ( |s| s. name ( "maybe-clean-tools" ) )
553559 . dep ( |s| s. name ( "libstd-tool" ) )
554560 . run ( move |s| compile:: tool ( build, s. stage , s. target , "unstable-book-gen" ) ) ;
555561 rules. build ( "tool-tidy" , "src/tools/tidy" )
562+ . default ( build. config . build_all_tools )
563+ . host ( true )
564+ . only_build ( true )
556565 . dep ( |s| s. name ( "maybe-clean-tools" ) )
557566 . dep ( |s| s. name ( "libstd-tool" ) )
558567 . run ( move |s| compile:: tool ( build, s. stage , s. target , "tidy" ) ) ;
559568 rules. build ( "tool-linkchecker" , "src/tools/linkchecker" )
569+ . default ( build. config . build_all_tools )
570+ . host ( true )
560571 . dep ( |s| s. name ( "maybe-clean-tools" ) )
561572 . dep ( |s| s. name ( "libstd-tool" ) )
562573 . run ( move |s| compile:: tool ( build, s. stage , s. target , "linkchecker" ) ) ;
563574 rules. build ( "tool-cargotest" , "src/tools/cargotest" )
575+ . default ( build. config . build_all_tools )
576+ . host ( true )
564577 . dep ( |s| s. name ( "maybe-clean-tools" ) )
565578 . dep ( |s| s. name ( "libstd-tool" ) )
566579 . run ( move |s| compile:: tool ( build, s. stage , s. target , "cargotest" ) ) ;
567580 rules. build ( "tool-compiletest" , "src/tools/compiletest" )
581+ . default ( build. config . build_all_tools )
582+ . host ( true )
568583 . dep ( |s| s. name ( "maybe-clean-tools" ) )
569584 . dep ( |s| s. name ( "libtest-tool" ) )
570585 . run ( move |s| compile:: tool ( build, s. stage , s. target , "compiletest" ) ) ;
571586 rules. build ( "tool-build-manifest" , "src/tools/build-manifest" )
587+ . default ( build. config . build_all_tools )
588+ . host ( true )
589+ . only_build ( true )
590+ . only_host_build ( true )
572591 . dep ( |s| s. name ( "maybe-clean-tools" ) )
573592 . dep ( |s| s. name ( "libstd-tool" ) )
574593 . run ( move |s| compile:: tool ( build, s. stage , s. target , "build-manifest" ) ) ;
575594 rules. build ( "tool-remote-test-server" , "src/tools/remote-test-server" )
595+ . default ( build. config . build_all_tools )
596+ . host ( true )
576597 . dep ( |s| s. name ( "maybe-clean-tools" ) )
577598 . dep ( |s| s. name ( "libstd-tool" ) )
578599 . run ( move |s| compile:: tool ( build, s. stage , s. target , "remote-test-server" ) ) ;
579600 rules. build ( "tool-remote-test-client" , "src/tools/remote-test-client" )
601+ . default ( build. config . build_all_tools )
602+ . host ( true )
580603 . dep ( |s| s. name ( "maybe-clean-tools" ) )
581604 . dep ( |s| s. name ( "libstd-tool" ) )
582605 . run ( move |s| compile:: tool ( build, s. stage , s. target , "remote-test-client" ) ) ;
583606 rules. build ( "tool-rust-installer" , "src/tools/rust-installer" )
607+ . default ( build. config . build_all_tools )
608+ . host ( true )
584609 . dep ( |s| s. name ( "maybe-clean-tools" ) )
585610 . dep ( |s| s. name ( "libstd-tool" ) )
586611 . run ( move |s| compile:: tool ( build, s. stage , s. target , "rust-installer" ) ) ;
587612 rules. build ( "tool-cargo" , "src/tools/cargo" )
613+ . default ( build. config . extended || build. config . build_all_tools )
588614 . host ( true )
589- . default ( build. config . extended )
590615 . dep ( |s| s. name ( "maybe-clean-tools" ) )
591616 . dep ( |s| s. name ( "libstd-tool" ) )
592617 . dep ( |s| s. stage ( 0 ) . host ( s. target ) . name ( "openssl" ) )
@@ -599,8 +624,8 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules {
599624 } )
600625 . run ( move |s| compile:: tool ( build, s. stage , s. target , "cargo" ) ) ;
601626 rules. build ( "tool-rls" , "src/tools/rls" )
627+ . default ( build. config . extended || build. config . build_all_tools )
602628 . host ( true )
603- . default ( build. config . extended )
604629 . dep ( |s| s. name ( "librustc-tool" ) )
605630 . dep ( |s| s. stage ( 0 ) . host ( s. target ) . name ( "openssl" ) )
606631 . dep ( move |s| {
0 commit comments