@@ -26,7 +26,7 @@ use crate::core::builder::{Builder, Compiler, Kind, RunConfig, ShouldRun, Step};
26
26
use crate :: core:: config:: flags:: get_completion;
27
27
use crate :: core:: config:: flags:: Subcommand ;
28
28
use crate :: core:: config:: TargetSelection ;
29
- use crate :: utils:: exec:: { BootstrapCommand , OutputMode } ;
29
+ use crate :: utils:: exec:: BootstrapCommand ;
30
30
use crate :: utils:: helpers:: {
31
31
self , add_link_lib_path, add_rustdoc_cargo_linker_args, dylib_path, dylib_path_var,
32
32
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"
150
150
builder. default_doc ( & [ ] ) ;
151
151
152
152
// 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 ) ;
154
154
155
155
// Run the linkchecker.
156
156
let _guard =
157
157
builder. msg ( Kind :: Test , compiler. stage , "Linkcheck" , bootstrap_host, bootstrap_host) ;
158
158
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" ) ) ) ;
163
160
}
164
161
165
162
fn should_run ( run : ShouldRun < ' _ > ) -> ShouldRun < ' _ > {
@@ -217,10 +214,7 @@ impl Step for HtmlCheck {
217
214
) ) ;
218
215
219
216
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 ) ) ,
224
218
) ;
225
219
}
226
220
}
@@ -260,14 +254,13 @@ impl Step for Cargotest {
260
254
261
255
let _time = helpers:: timeit ( builder) ;
262
256
let mut cmd = builder. tool_cmd ( Tool :: CargoTest ) ;
263
- let cmd = cmd
264
- . arg ( & cargo)
257
+ cmd. arg ( & cargo)
265
258
. arg ( & out_dir)
266
259
. args ( builder. config . test_args ( ) )
267
260
. env ( "RUSTC" , builder. rustc ( compiler) )
268
261
. 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 ( ) ) ;
271
264
}
272
265
}
273
266
@@ -763,12 +756,12 @@ impl Step for Clippy {
763
756
cargo. env ( "HOST_LIBS" , host_libs) ;
764
757
765
758
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) ;
767
760
768
761
let _guard = builder. msg_sysroot_tool ( Kind :: Test , compiler. stage , "clippy" , host, host) ;
769
762
770
763
// 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 ( ) {
772
765
// The tests succeeded; nothing to do.
773
766
return ;
774
767
}
@@ -821,7 +814,7 @@ impl Step for RustdocTheme {
821
814
. env ( "RUSTC_BOOTSTRAP" , "1" ) ;
822
815
cmd. args ( linker_args ( builder, self . compiler . host , LldThreads :: No ) ) ;
823
816
824
- builder. run ( BootstrapCommand :: from ( & mut cmd) . delay_failure ( ) ) ;
817
+ builder. run ( cmd. delay_failure ( ) ) ;
825
818
}
826
819
}
827
820
@@ -1099,7 +1092,7 @@ HELP: to skip test's attempt to check tidiness, pass `--skip src/tools/tidy` to
1099
1092
}
1100
1093
1101
1094
builder. info ( "tidy check" ) ;
1102
- builder. run ( BootstrapCommand :: from ( & mut cmd) . delay_failure ( ) ) ;
1095
+ builder. run ( cmd. delay_failure ( ) ) ;
1103
1096
1104
1097
builder. info ( "x.py completions check" ) ;
1105
1098
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 {
1306
1299
& [ ] ,
1307
1300
) ;
1308
1301
1309
- builder. run ( cargo) ;
1302
+ builder. run ( cargo. into_cmd ( ) ) ;
1310
1303
1311
1304
let lib_name = "librun_make_support.rlib" ;
1312
1305
let lib = builder. tools_dir ( self . compiler ) . join ( lib_name) ;
@@ -2187,7 +2180,7 @@ impl BookTest {
2187
2180
compiler. host ,
2188
2181
) ;
2189
2182
let _time = helpers:: timeit ( builder) ;
2190
- let cmd = BootstrapCommand :: from ( & mut rustbook_cmd) . delay_failure ( ) ;
2183
+ let cmd = rustbook_cmd. delay_failure ( ) ;
2191
2184
let toolstate =
2192
2185
if builder. run ( cmd) . is_success ( ) { ToolState :: TestPass } else { ToolState :: TestFail } ;
2193
2186
builder. save_toolstate ( self . name , toolstate) ;
@@ -2318,7 +2311,7 @@ impl Step for ErrorIndex {
2318
2311
let guard =
2319
2312
builder. msg ( Kind :: Test , compiler. stage , "error-index" , compiler. host , compiler. host ) ;
2320
2313
let _time = helpers:: timeit ( builder) ;
2321
- builder. run ( BootstrapCommand :: from ( & mut tool) . output_mode ( OutputMode :: OnlyOnFailure ) ) ;
2314
+ builder. run ( tool. capture ( ) ) ;
2322
2315
drop ( guard) ;
2323
2316
// The tests themselves need to link to std, so make sure it is
2324
2317
// available.
@@ -2349,7 +2342,7 @@ fn markdown_test(builder: &Builder<'_>, compiler: Compiler, markdown: &Path) ->
2349
2342
2350
2343
cmd = cmd. delay_failure ( ) ;
2351
2344
if !builder. config . verbose_tests {
2352
- cmd = cmd. print_on_failure ( ) ;
2345
+ cmd = cmd. capture ( ) ;
2353
2346
}
2354
2347
builder. run ( cmd) . is_success ( )
2355
2348
}
@@ -2375,10 +2368,13 @@ impl Step for RustcGuide {
2375
2368
builder. update_submodule ( & relative_path) ;
2376
2369
2377
2370
let src = builder. src . join ( relative_path) ;
2378
- let mut rustbook_cmd = builder. tool_cmd ( Tool :: Rustbook ) ;
2379
- let cmd = BootstrapCommand :: from ( rustbook_cmd. arg ( "linkcheck" ) . arg ( & src) ) . delay_failure ( ) ;
2380
- let toolstate =
2381
- if builder. run ( cmd) . is_success ( ) { ToolState :: TestPass } else { ToolState :: TestFail } ;
2371
+ let mut rustbook_cmd = builder. tool_cmd ( Tool :: Rustbook ) . delay_failure ( ) ;
2372
+ rustbook_cmd. arg ( "linkcheck" ) . arg ( & src) ;
2373
+ let toolstate = if builder. run ( rustbook_cmd) . is_success ( ) {
2374
+ ToolState :: TestPass
2375
+ } else {
2376
+ ToolState :: TestFail
2377
+ } ;
2382
2378
builder. save_toolstate ( "rustc-dev-guide" , toolstate) ;
2383
2379
}
2384
2380
}
@@ -3347,7 +3343,7 @@ impl Step for CodegenCranelift {
3347
3343
. arg ( "testsuite.extended_sysroot" ) ;
3348
3344
cargo. args ( builder. config . test_args ( ) ) ;
3349
3345
3350
- builder. run ( cargo) ;
3346
+ builder. run ( cargo. into_cmd ( ) ) ;
3351
3347
}
3352
3348
}
3353
3349
@@ -3472,6 +3468,6 @@ impl Step for CodegenGCC {
3472
3468
. arg ( "--std-tests" ) ;
3473
3469
cargo. args ( builder. config . test_args ( ) ) ;
3474
3470
3475
- builder. run ( cargo) ;
3471
+ builder. run ( cargo. into_cmd ( ) ) ;
3476
3472
}
3477
3473
}
0 commit comments