@@ -11,9 +11,9 @@ use xz2::bufread::XzDecoder;
11
11
12
12
use crate :: core:: config:: BUILDER_CONFIG_FILENAME ;
13
13
use crate :: utils:: build_stamp:: BuildStamp ;
14
- use crate :: utils:: exec:: { BootstrapCommand , command } ;
15
- use crate :: utils:: helpers:: { check_run, exe, hex_encode, move_file, program_out_of_date } ;
16
- use crate :: { Config , t } ;
14
+ use crate :: utils:: exec:: { command , BootstrapCommand } ;
15
+ use crate :: utils:: helpers:: { check_run, exe, hex_encode, move_file} ;
16
+ use crate :: { t , Config } ;
17
17
18
18
static SHOULD_FIX_BINS_AND_DYLIBS : OnceLock < bool > = OnceLock :: new ( ) ;
19
19
@@ -427,9 +427,10 @@ impl Config {
427
427
let version = & self . stage0_metadata . compiler . version ;
428
428
let host = self . build ;
429
429
430
- let clippy_stamp = BuildStamp :: new ( & self . initial_sysroot ) . with_prefix ( "clippy" ) ;
430
+ let clippy_stamp =
431
+ BuildStamp :: new ( & self . initial_sysroot ) . with_prefix ( "clippy" ) . with_stamp ( date) ;
431
432
let cargo_clippy = self . initial_sysroot . join ( "bin" ) . join ( exe ( "cargo-clippy" , host) ) ;
432
- if cargo_clippy. exists ( ) && ! program_out_of_date ( & clippy_stamp, date ) {
433
+ if cargo_clippy. exists ( ) && clippy_stamp. is_up_to_date ( ) {
433
434
return cargo_clippy;
434
435
}
435
436
@@ -440,7 +441,7 @@ impl Config {
440
441
self . fix_bin_or_dylib ( & cargo_clippy. with_file_name ( exe ( "clippy-driver" , host) ) ) ;
441
442
}
442
443
443
- self . create ( & clippy_stamp, date ) ;
444
+ t ! ( clippy_stamp. write ( ) ) ;
444
445
cargo_clippy
445
446
}
446
447
@@ -461,8 +462,8 @@ impl Config {
461
462
let host = self . build ;
462
463
let bin_root = self . out . join ( host) . join ( "rustfmt" ) ;
463
464
let rustfmt_path = bin_root. join ( "bin" ) . join ( exe ( "rustfmt" , host) ) ;
464
- let rustfmt_stamp = BuildStamp :: new ( & bin_root) . with_prefix ( "rustfmt" ) ;
465
- if rustfmt_path. exists ( ) && ! program_out_of_date ( & rustfmt_stamp, & channel ) {
465
+ let rustfmt_stamp = BuildStamp :: new ( & bin_root) . with_prefix ( "rustfmt" ) . with_stamp ( channel ) ;
466
+ if rustfmt_path. exists ( ) && rustfmt_stamp. is_up_to_date ( ) {
466
467
return Some ( rustfmt_path) ;
467
468
}
468
469
@@ -493,7 +494,7 @@ impl Config {
493
494
}
494
495
}
495
496
496
- self . create ( & rustfmt_stamp, & channel ) ;
497
+ t ! ( rustfmt_stamp. write ( ) ) ;
497
498
Some ( rustfmt_path)
498
499
}
499
500
@@ -568,10 +569,10 @@ impl Config {
568
569
) {
569
570
let host = self . build . triple ;
570
571
let bin_root = self . out . join ( host) . join ( sysroot) ;
571
- let rustc_stamp = BuildStamp :: new ( & bin_root) . with_prefix ( "rustc" ) ;
572
+ let rustc_stamp = BuildStamp :: new ( & bin_root) . with_prefix ( "rustc" ) . with_stamp ( stamp_key ) ;
572
573
573
574
if !bin_root. join ( "bin" ) . join ( exe ( "rustc" , self . build ) ) . exists ( )
574
- || program_out_of_date ( & rustc_stamp, stamp_key )
575
+ || ! rustc_stamp. is_up_to_date ( )
575
576
{
576
577
if bin_root. exists ( ) {
577
578
t ! ( fs:: remove_dir_all( & bin_root) ) ;
@@ -602,7 +603,7 @@ impl Config {
602
603
}
603
604
}
604
605
605
- t ! ( fs :: write( rustc_stamp , stamp_key ) ) ;
606
+ t ! ( rustc_stamp . write( ) ) ;
606
607
}
607
608
}
608
609
@@ -729,10 +730,10 @@ download-rustc = false
729
730
}
730
731
731
732
let llvm_root = self . ci_llvm_root ( ) ;
732
- let llvm_stamp = BuildStamp :: new ( & llvm_root) . with_prefix ( "llvm" ) ;
733
733
let llvm_sha = detect_llvm_sha ( self , self . rust_info . is_managed_git_subrepository ( ) ) ;
734
- let key = format ! ( "{}{}" , llvm_sha, self . llvm_assertions) ;
735
- if program_out_of_date ( & llvm_stamp, & key) && !self . dry_run ( ) {
734
+ let stamp_key = format ! ( "{}{}" , llvm_sha, self . llvm_assertions) ;
735
+ let llvm_stamp = BuildStamp :: new ( & llvm_root) . with_prefix ( "llvm" ) . with_stamp ( stamp_key) ;
736
+ if !llvm_stamp. is_up_to_date ( ) && !self . dry_run ( ) {
736
737
self . download_ci_llvm ( & llvm_sha) ;
737
738
738
739
if self . should_fix_bins_and_dylibs ( ) {
@@ -765,7 +766,7 @@ download-rustc = false
765
766
}
766
767
}
767
768
768
- t ! ( fs :: write( llvm_stamp , key ) ) ;
769
+ t ! ( llvm_stamp . write( ) ) ;
769
770
}
770
771
771
772
if let Some ( config_path) = & self . config {
0 commit comments