@@ -8,8 +8,8 @@ use crate::core::builder::{
88 self , Alias , Builder , Kind , RunConfig , ShouldRun , Step , crate_description,
99} ;
1010use crate :: core:: config:: TargetSelection ;
11- use crate :: utils:: build_stamp:: BuildStamp ;
12- use crate :: { Compiler , Mode , Subcommand } ;
11+ use crate :: utils:: build_stamp:: { self , BuildStamp } ;
12+ use crate :: { Mode , Subcommand } ;
1313
1414#[ derive( Debug , Clone , PartialEq , Eq , Hash ) ]
1515pub struct Std {
@@ -82,22 +82,16 @@ impl Step for Std {
8282 format_args ! ( "library artifacts{}" , crate_description( & self . crates) ) ,
8383 target,
8484 ) ;
85- run_cargo (
86- builder,
87- cargo,
88- builder. config . free_args . clone ( ) ,
89- & libstd_stamp ( builder, compiler, target) ,
90- vec ! [ ] ,
91- true ,
92- false ,
93- ) ;
85+
86+ let stamp = build_stamp:: libstd_stamp ( builder, compiler, target) . with_prefix ( "check" ) ;
87+ run_cargo ( builder, cargo, builder. config . free_args . clone ( ) , & stamp, vec ! [ ] , true , false ) ;
9488
9589 // We skip populating the sysroot in non-zero stage because that'll lead
9690 // to rlib/rmeta conflicts if std gets built during this session.
9791 if compiler. stage == 0 {
9892 let libdir = builder. sysroot_target_libdir ( compiler, target) ;
9993 let hostdir = builder. sysroot_target_libdir ( compiler, compiler. host ) ;
100- add_to_sysroot ( builder, & libdir, & hostdir, & libstd_stamp ( builder , compiler , target ) ) ;
94+ add_to_sysroot ( builder, & libdir, & hostdir, & stamp ) ;
10195 }
10296 drop ( _guard) ;
10397
@@ -138,16 +132,9 @@ impl Step for Std {
138132 cargo. arg ( "-p" ) . arg ( krate) ;
139133 }
140134
135+ let stamp = build_stamp:: libstd_stamp ( builder, compiler, target) . with_prefix ( "check-test" ) ;
141136 let _guard = builder. msg_check ( "library test/bench/example targets" , target) ;
142- run_cargo (
143- builder,
144- cargo,
145- builder. config . free_args . clone ( ) ,
146- & libstd_test_stamp ( builder, compiler, target) ,
147- vec ! [ ] ,
148- true ,
149- false ,
150- ) ;
137+ run_cargo ( builder, cargo, builder. config . free_args . clone ( ) , & stamp, vec ! [ ] , true , false ) ;
151138 }
152139}
153140
@@ -248,19 +235,14 @@ impl Step for Rustc {
248235 format_args ! ( "compiler artifacts{}" , crate_description( & self . crates) ) ,
249236 target,
250237 ) ;
251- run_cargo (
252- builder,
253- cargo,
254- builder. config . free_args . clone ( ) ,
255- & librustc_stamp ( builder, compiler, target) ,
256- vec ! [ ] ,
257- true ,
258- false ,
259- ) ;
238+
239+ let stamp = build_stamp:: librustc_stamp ( builder, compiler, target) . with_prefix ( "check" ) ;
240+
241+ run_cargo ( builder, cargo, builder. config . free_args . clone ( ) , & stamp, vec ! [ ] , true , false ) ;
260242
261243 let libdir = builder. sysroot_target_libdir ( compiler, target) ;
262244 let hostdir = builder. sysroot_target_libdir ( compiler, compiler. host ) ;
263- add_to_sysroot ( builder, & libdir, & hostdir, & librustc_stamp ( builder , compiler , target ) ) ;
245+ add_to_sysroot ( builder, & libdir, & hostdir, & stamp ) ;
264246 }
265247}
266248
@@ -314,15 +296,10 @@ impl Step for CodegenBackend {
314296
315297 let _guard = builder. msg_check ( backend, target) ;
316298
317- run_cargo (
318- builder,
319- cargo,
320- builder. config . free_args . clone ( ) ,
321- & codegen_backend_stamp ( builder, compiler, target, backend) ,
322- vec ! [ ] ,
323- true ,
324- false ,
325- ) ;
299+ let stamp = build_stamp:: codegen_backend_stamp ( builder, compiler, target, backend)
300+ . with_prefix ( "check" ) ;
301+
302+ run_cargo ( builder, cargo, builder. config . free_args . clone ( ) , & stamp, vec ! [ ] , true , false ) ;
326303 }
327304}
328305
@@ -379,23 +356,13 @@ impl Step for RustAnalyzer {
379356 cargo. arg ( "--benches" ) ;
380357 }
381358
382- let _guard = builder. msg_check ( "rust-analyzer artifacts" , target) ;
383- run_cargo (
384- builder,
385- cargo,
386- builder. config . free_args . clone ( ) ,
387- & stamp ( builder, compiler, target) ,
388- vec ! [ ] ,
389- true ,
390- false ,
391- ) ;
359+ // Cargo's output path in a given stage, compiled by a particular
360+ // compiler for the specified target.
361+ let stamp = BuildStamp :: new ( & builder. cargo_out ( compiler, Mode :: ToolRustc , target) )
362+ . with_prefix ( "rust-analyzer-check" ) ;
392363
393- /// Cargo's output path in a given stage, compiled by a particular
394- /// compiler for the specified target.
395- fn stamp ( builder : & Builder < ' _ > , compiler : Compiler , target : TargetSelection ) -> BuildStamp {
396- BuildStamp :: new ( & builder. cargo_out ( compiler, Mode :: ToolRustc , target) )
397- . with_prefix ( "rust-analyzer-check" )
398- }
364+ let _guard = builder. msg_check ( "rust-analyzer artifacts" , target) ;
365+ run_cargo ( builder, cargo, builder. config . free_args . clone ( ) , & stamp, vec ! [ ] , true , false ) ;
399366 }
400367}
401368
@@ -498,42 +465,3 @@ tool_check_step!(RunMakeSupport { path: "src/tools/run-make-support", default: f
498465// Compiletest is implicitly "checked" when it gets built in order to run tests,
499466// so this is mainly for people working on compiletest to run locally.
500467tool_check_step ! ( Compiletest { path: "src/tools/compiletest" , default : false } ) ;
501-
502- /// Cargo's output path for the standard library in a given stage, compiled
503- /// by a particular compiler for the specified target.
504- fn libstd_stamp ( builder : & Builder < ' _ > , compiler : Compiler , target : TargetSelection ) -> BuildStamp {
505- BuildStamp :: new ( & builder. cargo_out ( compiler, Mode :: Std , target) ) . with_prefix ( "libstd-check" )
506- }
507-
508- /// Cargo's output path for the standard library in a given stage, compiled
509- /// by a particular compiler for the specified target.
510- fn libstd_test_stamp (
511- builder : & Builder < ' _ > ,
512- compiler : Compiler ,
513- target : TargetSelection ,
514- ) -> BuildStamp {
515- BuildStamp :: new ( & builder. cargo_out ( compiler, Mode :: Std , target) )
516- . with_prefix ( "libstd-check-test" )
517- }
518-
519- /// Cargo's output path for librustc in a given stage, compiled by a particular
520- /// compiler for the specified target.
521- fn librustc_stamp (
522- builder : & Builder < ' _ > ,
523- compiler : Compiler ,
524- target : TargetSelection ,
525- ) -> BuildStamp {
526- BuildStamp :: new ( & builder. cargo_out ( compiler, Mode :: Rustc , target) ) . with_prefix ( "librustc-check" )
527- }
528-
529- /// Cargo's output path for librustc_codegen_llvm in a given stage, compiled by a particular
530- /// compiler for the specified target and backend.
531- fn codegen_backend_stamp (
532- builder : & Builder < ' _ > ,
533- compiler : Compiler ,
534- target : TargetSelection ,
535- backend : & str ,
536- ) -> BuildStamp {
537- BuildStamp :: new ( & builder. cargo_out ( compiler, Mode :: Codegen , target) )
538- . with_prefix ( & format ! ( "librustc_codegen_{backend}-check" ) )
539- }
0 commit comments