From 54080b0f6c0b12f2d91c14fc4709ce21da09f49e Mon Sep 17 00:00:00 2001 From: teor Date: Tue, 27 Apr 2021 13:27:32 +1000 Subject: [PATCH] Add a "modified" flag to the panic report metadata If the source code doesn't match the commit, the reported version will end with ".modified". --- Cargo.lock | 4 ++-- zebrad/build.rs | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f7df3fb6..b18c6483 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4052,9 +4052,9 @@ checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" [[package]] name = "vergen" -version = "5.1.4" +version = "5.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "575b693376dacf6a9825ab3e61a033cf0e94040e620fca8447b055ef8ce82d2b" +checksum = "adf0b57f76a4f7e9673db1e7ffa4541d215ae8336fee45f5c1378bdeb22a0314" dependencies = [ "anyhow", "cfg-if 1.0.0", diff --git a/zebrad/build.rs b/zebrad/build.rs index ff6eacd9..4f16a954 100644 --- a/zebrad/build.rs +++ b/zebrad/build.rs @@ -29,6 +29,10 @@ fn main() { *config.git_mut().sha_kind_mut() = ShaKind::Short; *config.git_mut().semver_kind_mut() = SemverKind::Lightweight; + // git typically uses "-dirty", but we change that so: + // - we're explicit and direct about source code state + // - it matches the SemVer 2.0 format, using dot separators + *config.git_mut().semver_dirty_mut() = Some(".modified"); // Disable env vars we aren't using right now *config.cargo_mut().features_mut() = false;