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".
This commit is contained in:
teor 2021-04-27 13:27:32 +10:00
parent 52dcaa2544
commit 54080b0f6c
2 changed files with 6 additions and 2 deletions

4
Cargo.lock generated
View File

@ -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",

View File

@ -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;