@@ -12,7 +12,7 @@ use xz2::bufread::XzDecoder;
1212use crate :: core:: config:: BUILDER_CONFIG_FILENAME ;
1313use crate :: utils:: build_stamp:: BuildStamp ;
1414use crate :: utils:: exec:: { BootstrapCommand , command} ;
15- use crate :: utils:: helpers:: { check_run, exe, hex_encode, move_file, program_out_of_date } ;
15+ use crate :: utils:: helpers:: { check_run, exe, hex_encode, move_file} ;
1616use crate :: { Config , t} ;
1717
1818static SHOULD_FIX_BINS_AND_DYLIBS : OnceLock < bool > = OnceLock :: new ( ) ;
@@ -427,9 +427,10 @@ impl Config {
427427 let version = & self . stage0_metadata . compiler . version ;
428428 let host = self . build ;
429429
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) ;
431432 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 ( ) {
433434 return cargo_clippy;
434435 }
435436
@@ -440,7 +441,7 @@ impl Config {
440441 self . fix_bin_or_dylib ( & cargo_clippy. with_file_name ( exe ( "clippy-driver" , host) ) ) ;
441442 }
442443
443- self . create ( & clippy_stamp, date ) ;
444+ t ! ( clippy_stamp. write ( ) ) ;
444445 cargo_clippy
445446 }
446447
@@ -461,8 +462,8 @@ impl Config {
461462 let host = self . build ;
462463 let bin_root = self . out . join ( host) . join ( "rustfmt" ) ;
463464 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 ( ) {
466467 return Some ( rustfmt_path) ;
467468 }
468469
@@ -493,7 +494,7 @@ impl Config {
493494 }
494495 }
495496
496- self . create ( & rustfmt_stamp, & channel ) ;
497+ t ! ( rustfmt_stamp. write ( ) ) ;
497498 Some ( rustfmt_path)
498499 }
499500
@@ -568,10 +569,10 @@ impl Config {
568569 ) {
569570 let host = self . build . triple ;
570571 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 ) ;
572573
573574 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 ( )
575576 {
576577 if bin_root. exists ( ) {
577578 t ! ( fs:: remove_dir_all( & bin_root) ) ;
@@ -602,7 +603,7 @@ impl Config {
602603 }
603604 }
604605
605- t ! ( fs :: write( rustc_stamp , stamp_key ) ) ;
606+ t ! ( rustc_stamp . write( ) ) ;
606607 }
607608 }
608609
@@ -729,10 +730,10 @@ download-rustc = false
729730 }
730731
731732 let llvm_root = self . ci_llvm_root ( ) ;
732- let llvm_stamp = BuildStamp :: new ( & llvm_root) . with_prefix ( "llvm" ) ;
733733 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 ( ) {
736737 self . download_ci_llvm ( & llvm_sha) ;
737738
738739 if self . should_fix_bins_and_dylibs ( ) {
@@ -765,7 +766,7 @@ download-rustc = false
765766 }
766767 }
767768
768- t ! ( fs :: write( llvm_stamp , key ) ) ;
769+ t ! ( llvm_stamp . write( ) ) ;
769770 }
770771
771772 if let Some ( config_path) = & self . config {
0 commit comments