@@ -8,8 +8,8 @@ use crate::core::builder::{
8
8
self , Alias , Builder , Kind , RunConfig , ShouldRun , Step , crate_description,
9
9
} ;
10
10
use 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 } ;
13
13
14
14
#[ derive( Debug , Clone , PartialEq , Eq , Hash ) ]
15
15
pub struct Std {
@@ -82,22 +82,16 @@ impl Step for Std {
82
82
format_args ! ( "library artifacts{}" , crate_description( & self . crates) ) ,
83
83
target,
84
84
) ;
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 ) ;
94
88
95
89
// We skip populating the sysroot in non-zero stage because that'll lead
96
90
// to rlib/rmeta conflicts if std gets built during this session.
97
91
if compiler. stage == 0 {
98
92
let libdir = builder. sysroot_target_libdir ( compiler, target) ;
99
93
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 ) ;
101
95
}
102
96
drop ( _guard) ;
103
97
@@ -138,16 +132,9 @@ impl Step for Std {
138
132
cargo. arg ( "-p" ) . arg ( krate) ;
139
133
}
140
134
135
+ let stamp = build_stamp:: libstd_stamp ( builder, compiler, target) . with_prefix ( "check-test" ) ;
141
136
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 ) ;
151
138
}
152
139
}
153
140
@@ -248,19 +235,14 @@ impl Step for Rustc {
248
235
format_args ! ( "compiler artifacts{}" , crate_description( & self . crates) ) ,
249
236
target,
250
237
) ;
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 ) ;
260
242
261
243
let libdir = builder. sysroot_target_libdir ( compiler, target) ;
262
244
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 ) ;
264
246
}
265
247
}
266
248
@@ -314,15 +296,10 @@ impl Step for CodegenBackend {
314
296
315
297
let _guard = builder. msg_check ( backend, target) ;
316
298
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 ) ;
326
303
}
327
304
}
328
305
@@ -379,23 +356,13 @@ impl Step for RustAnalyzer {
379
356
cargo. arg ( "--benches" ) ;
380
357
}
381
358
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" ) ;
392
363
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 ) ;
399
366
}
400
367
}
401
368
@@ -498,42 +465,3 @@ tool_check_step!(RunMakeSupport { path: "src/tools/run-make-support", default: f
498
465
// Compiletest is implicitly "checked" when it gets built in order to run tests,
499
466
// so this is mainly for people working on compiletest to run locally.
500
467
tool_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