File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -545,7 +545,11 @@ pub fn prepare_build_cmd<'a, 'cfg>(
545
545
debug ! ( "fingerprint at: {}" , loc. display( ) ) ;
546
546
547
547
let ( local, output_path) = build_script_local_fingerprints ( cx, unit) ?;
548
- let mut fingerprint = Fingerprint { local, ..Fingerprint :: new ( ) } ;
548
+ let mut fingerprint = Fingerprint {
549
+ local,
550
+ rustc : util:: hash_u64 ( & cx. bcx . rustc . verbose_version ) ,
551
+ ..Fingerprint :: new ( )
552
+ } ;
549
553
let compare = compare_old_fingerprint ( & loc, & fingerprint) ;
550
554
log_compare ( unit, & compare) ;
551
555
@@ -648,6 +652,10 @@ fn local_fingerprints_deps(
648
652
}
649
653
650
654
fn write_fingerprint ( loc : & Path , fingerprint : & Fingerprint ) -> CargoResult < ( ) > {
655
+ debug_assert_ne ! ( fingerprint. rustc, 0 ) ;
656
+ // fingerprint::new().rustc == 0, make sure it doesn't make it to the file system.
657
+ // This is mostly so outside tools can reliably find out what rust version this file is for,
658
+ // as we can use the full hash.
651
659
let hash = fingerprint. hash ( ) ;
652
660
debug ! ( "write fingerprint: {}" , loc. display( ) ) ;
653
661
paths:: write ( loc, util:: to_hex ( hash) . as_bytes ( ) ) ?;
You can’t perform that action at this time.
0 commit comments