Skip to content

Commit cf8800a

Browse files
committed
Auto merge of #9026 - kassens:master, r=Eh2406
Clarify fingerprint log messages I had to look up the source to figure out which side was the old value for a RUSTFLAGS fingerprint mismatch. Making the logs a bit more explicit about which value is old and new would've helped me.
2 parents 134f614 + 4538ade commit cf8800a

File tree

1 file changed

+25
-13
lines changed

1 file changed

+25
-13
lines changed

Diff for: src/cargo/core/compiler/fingerprint.rs

+25-13
Original file line numberDiff line numberDiff line change
@@ -817,9 +817,9 @@ impl Fingerprint {
817817
}
818818
if self.features != old.features {
819819
bail!(
820-
"features have changed: {} != {}",
821-
self.features,
822-
old.features
820+
"features have changed: previously {}, now {}",
821+
old.features,
822+
self.features
823823
)
824824
}
825825
if self.target != old.target {
@@ -833,9 +833,9 @@ impl Fingerprint {
833833
}
834834
if self.rustflags != old.rustflags {
835835
bail!(
836-
"RUSTFLAGS has changed: {:?} != {:?}",
837-
self.rustflags,
838-
old.rustflags
836+
"RUSTFLAGS has changed: previously {:?}, now {:?}",
837+
old.rustflags,
838+
self.rustflags
839839
)
840840
}
841841
if self.metadata != old.metadata {
@@ -853,15 +853,23 @@ impl Fingerprint {
853853
match (new, old) {
854854
(LocalFingerprint::Precalculated(a), LocalFingerprint::Precalculated(b)) => {
855855
if a != b {
856-
bail!("precalculated components have changed: {} != {}", a, b)
856+
bail!(
857+
"precalculated components have changed: previously {}, now {}",
858+
b,
859+
a
860+
)
857861
}
858862
}
859863
(
860864
LocalFingerprint::CheckDepInfo { dep_info: adep },
861865
LocalFingerprint::CheckDepInfo { dep_info: bdep },
862866
) => {
863867
if adep != bdep {
864-
bail!("dep info output changed: {:?} != {:?}", adep, bdep)
868+
bail!(
869+
"dep info output changed: previously {:?}, now {:?}",
870+
bdep,
871+
adep
872+
)
865873
}
866874
}
867875
(
@@ -875,13 +883,17 @@ impl Fingerprint {
875883
},
876884
) => {
877885
if aout != bout {
878-
bail!("rerun-if-changed output changed: {:?} != {:?}", aout, bout)
886+
bail!(
887+
"rerun-if-changed output changed: previously {:?}, now {:?}",
888+
bout,
889+
aout
890+
)
879891
}
880892
if apaths != bpaths {
881893
bail!(
882-
"rerun-if-changed output changed: {:?} != {:?}",
883-
apaths,
894+
"rerun-if-changed output changed: previously {:?}, now {:?}",
884895
bpaths,
896+
apaths,
885897
)
886898
}
887899
}
@@ -896,11 +908,11 @@ impl Fingerprint {
896908
},
897909
) => {
898910
if *akey != *bkey {
899-
bail!("env vars changed: {} != {}", akey, bkey);
911+
bail!("env vars changed: previously {}, now {}", bkey, akey);
900912
}
901913
if *avalue != *bvalue {
902914
bail!(
903-
"env var `{}` changed: previously {:?} now {:?}",
915+
"env var `{}` changed: previously {:?}, now {:?}",
904916
akey,
905917
bvalue,
906918
avalue

0 commit comments

Comments
 (0)