@@ -26,7 +26,7 @@ use crate::core::builder::{Builder, Compiler, Kind, RunConfig, ShouldRun, Step};
2626use crate :: core:: config:: flags:: get_completion;
2727use crate :: core:: config:: flags:: Subcommand ;
2828use crate :: core:: config:: TargetSelection ;
29- use crate :: utils:: exec:: { BootstrapCommand , OutputMode } ;
29+ use crate :: utils:: exec:: BootstrapCommand ;
3030use crate :: utils:: helpers:: {
3131 self , add_link_lib_path, add_rustdoc_cargo_linker_args, dylib_path, dylib_path_var,
3232 linker_args, linker_flags, output, t, target_supports_cranelift_backend, up_to_date,
@@ -150,16 +150,13 @@ You can skip linkcheck with --skip src/tools/linkchecker"
150150 builder. default_doc ( & [ ] ) ;
151151
152152 // Build the linkchecker before calling `msg`, since GHA doesn't support nested groups.
153- let mut linkchecker = builder. tool_cmd ( Tool :: Linkchecker ) ;
153+ let linkchecker = builder. tool_cmd ( Tool :: Linkchecker ) ;
154154
155155 // Run the linkchecker.
156156 let _guard =
157157 builder. msg ( Kind :: Test , compiler. stage , "Linkcheck" , bootstrap_host, bootstrap_host) ;
158158 let _time = helpers:: timeit ( builder) ;
159- builder. run (
160- BootstrapCommand :: from ( linkchecker. arg ( builder. out . join ( host. triple ) . join ( "doc" ) ) )
161- . delay_failure ( ) ,
162- ) ;
159+ builder. run ( linkchecker. delay_failure ( ) . arg ( builder. out . join ( host. triple ) . join ( "doc" ) ) ) ;
163160 }
164161
165162 fn should_run ( run : ShouldRun < ' _ > ) -> ShouldRun < ' _ > {
@@ -217,10 +214,7 @@ impl Step for HtmlCheck {
217214 ) ) ;
218215
219216 builder. run (
220- BootstrapCommand :: from (
221- builder. tool_cmd ( Tool :: HtmlChecker ) . arg ( builder. doc_out ( self . target ) ) ,
222- )
223- . delay_failure ( ) ,
217+ builder. tool_cmd ( Tool :: HtmlChecker ) . delay_failure ( ) . arg ( builder. doc_out ( self . target ) ) ,
224218 ) ;
225219 }
226220}
@@ -260,14 +254,13 @@ impl Step for Cargotest {
260254
261255 let _time = helpers:: timeit ( builder) ;
262256 let mut cmd = builder. tool_cmd ( Tool :: CargoTest ) ;
263- let cmd = cmd
264- . arg ( & cargo)
257+ cmd. arg ( & cargo)
265258 . arg ( & out_dir)
266259 . args ( builder. config . test_args ( ) )
267260 . env ( "RUSTC" , builder. rustc ( compiler) )
268261 . env ( "RUSTDOC" , builder. rustdoc ( compiler) ) ;
269- add_rustdoc_cargo_linker_args ( cmd, builder, compiler. host , LldThreads :: No ) ;
270- builder. run ( BootstrapCommand :: from ( cmd) . delay_failure ( ) ) ;
262+ add_rustdoc_cargo_linker_args ( & mut cmd, builder, compiler. host , LldThreads :: No ) ;
263+ builder. run ( cmd. delay_failure ( ) ) ;
271264 }
272265}
273266
@@ -763,12 +756,12 @@ impl Step for Clippy {
763756 cargo. env ( "HOST_LIBS" , host_libs) ;
764757
765758 cargo. add_rustc_lib_path ( builder) ;
766- let mut cargo = prepare_cargo_test ( cargo, & [ ] , & [ ] , "clippy" , compiler, host, builder) ;
759+ let cargo = prepare_cargo_test ( cargo, & [ ] , & [ ] , "clippy" , compiler, host, builder) ;
767760
768761 let _guard = builder. msg_sysroot_tool ( Kind :: Test , compiler. stage , "clippy" , host, host) ;
769762
770763 // Clippy reports errors if it blessed the outputs
771- if builder. run ( BootstrapCommand :: from ( & mut cargo) . allow_failure ( ) ) . is_success ( ) {
764+ if builder. run ( cargo. allow_failure ( ) ) . is_success ( ) {
772765 // The tests succeeded; nothing to do.
773766 return ;
774767 }
@@ -821,7 +814,7 @@ impl Step for RustdocTheme {
821814 . env ( "RUSTC_BOOTSTRAP" , "1" ) ;
822815 cmd. args ( linker_args ( builder, self . compiler . host , LldThreads :: No ) ) ;
823816
824- builder. run ( BootstrapCommand :: from ( & mut cmd) . delay_failure ( ) ) ;
817+ builder. run ( cmd. delay_failure ( ) ) ;
825818 }
826819}
827820
@@ -1099,7 +1092,7 @@ HELP: to skip test's attempt to check tidiness, pass `--skip src/tools/tidy` to
10991092 }
11001093
11011094 builder. info ( "tidy check" ) ;
1102- builder. run ( BootstrapCommand :: from ( & mut cmd) . delay_failure ( ) ) ;
1095+ builder. run ( cmd. delay_failure ( ) ) ;
11031096
11041097 builder. info ( "x.py completions check" ) ;
11051098 let [ bash, zsh, fish, powershell] = [ "x.py.sh" , "x.py.zsh" , "x.py.fish" , "x.py.ps1" ]
@@ -1306,7 +1299,7 @@ impl Step for RunMakeSupport {
13061299 & [ ] ,
13071300 ) ;
13081301
1309- builder. run ( cargo) ;
1302+ builder. run ( cargo. into_cmd ( ) ) ;
13101303
13111304 let lib_name = "librun_make_support.rlib" ;
13121305 let lib = builder. tools_dir ( self . compiler ) . join ( lib_name) ;
@@ -2185,7 +2178,7 @@ impl BookTest {
21852178 compiler. host ,
21862179 ) ;
21872180 let _time = helpers:: timeit ( builder) ;
2188- let cmd = BootstrapCommand :: from ( & mut rustbook_cmd) . delay_failure ( ) ;
2181+ let cmd = rustbook_cmd. delay_failure ( ) ;
21892182 let toolstate =
21902183 if builder. run ( cmd) . is_success ( ) { ToolState :: TestPass } else { ToolState :: TestFail } ;
21912184 builder. save_toolstate ( self . name , toolstate) ;
@@ -2316,7 +2309,7 @@ impl Step for ErrorIndex {
23162309 let guard =
23172310 builder. msg ( Kind :: Test , compiler. stage , "error-index" , compiler. host , compiler. host ) ;
23182311 let _time = helpers:: timeit ( builder) ;
2319- builder. run ( BootstrapCommand :: from ( & mut tool) . output_mode ( OutputMode :: OnlyOnFailure ) ) ;
2312+ builder. run ( tool. capture ( ) ) ;
23202313 drop ( guard) ;
23212314 // The tests themselves need to link to std, so make sure it is
23222315 // available.
@@ -2347,7 +2340,7 @@ fn markdown_test(builder: &Builder<'_>, compiler: Compiler, markdown: &Path) ->
23472340
23482341 cmd = cmd. delay_failure ( ) ;
23492342 if !builder. config . verbose_tests {
2350- cmd = cmd. print_on_failure ( ) ;
2343+ cmd = cmd. capture ( ) ;
23512344 }
23522345 builder. run ( cmd) . is_success ( )
23532346}
@@ -2373,10 +2366,13 @@ impl Step for RustcGuide {
23732366 builder. update_submodule ( & relative_path) ;
23742367
23752368 let src = builder. src . join ( relative_path) ;
2376- let mut rustbook_cmd = builder. tool_cmd ( Tool :: Rustbook ) ;
2377- let cmd = BootstrapCommand :: from ( rustbook_cmd. arg ( "linkcheck" ) . arg ( & src) ) . delay_failure ( ) ;
2378- let toolstate =
2379- if builder. run ( cmd) . is_success ( ) { ToolState :: TestPass } else { ToolState :: TestFail } ;
2369+ let mut rustbook_cmd = builder. tool_cmd ( Tool :: Rustbook ) . delay_failure ( ) ;
2370+ rustbook_cmd. arg ( "linkcheck" ) . arg ( & src) ;
2371+ let toolstate = if builder. run ( rustbook_cmd) . is_success ( ) {
2372+ ToolState :: TestPass
2373+ } else {
2374+ ToolState :: TestFail
2375+ } ;
23802376 builder. save_toolstate ( "rustc-dev-guide" , toolstate) ;
23812377 }
23822378}
@@ -3345,7 +3341,7 @@ impl Step for CodegenCranelift {
33453341 . arg ( "testsuite.extended_sysroot" ) ;
33463342 cargo. args ( builder. config . test_args ( ) ) ;
33473343
3348- builder. run ( cargo) ;
3344+ builder. run ( cargo. into_cmd ( ) ) ;
33493345 }
33503346}
33513347
@@ -3470,6 +3466,6 @@ impl Step for CodegenGCC {
34703466 . arg ( "--std-tests" ) ;
34713467 cargo. args ( builder. config . test_args ( ) ) ;
34723468
3473- builder. run ( cargo) ;
3469+ builder. run ( cargo. into_cmd ( ) ) ;
34743470 }
34753471}
0 commit comments