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>(
545545 debug ! ( "fingerprint at: {}" , loc. display( ) ) ;
546546
547547 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+ } ;
549553 let compare = compare_old_fingerprint ( & loc, & fingerprint) ;
550554 log_compare ( unit, & compare) ;
551555
@@ -648,6 +652,10 @@ fn local_fingerprints_deps(
648652}
649653
650654fn 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.
651659 let hash = fingerprint. hash ( ) ;
652660 debug ! ( "write fingerprint: {}" , loc. display( ) ) ;
653661 paths:: write ( loc, util:: to_hex ( hash) . as_bytes ( ) ) ?;
You can’t perform that action at this time.
0 commit comments