From 52dcaa254491cf97289bf461b136e163332a05f2 Mon Sep 17 00:00:00 2001 From: teor Date: Mon, 26 Apr 2021 14:08:58 +1000 Subject: [PATCH] Stop ignoring lightweight git tags in panic metadata Unfortunately, Zebra's first alpha release is an annotated tag, but GitHub defaults to lightweight tags. (At least for pre-releases.) --- zebrad/build.rs | 1 + zebrad/src/application.rs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/zebrad/build.rs b/zebrad/build.rs index 656a4463..ff6eacd9 100644 --- a/zebrad/build.rs +++ b/zebrad/build.rs @@ -28,6 +28,7 @@ fn main() { disable_non_reproducible(&mut config); *config.git_mut().sha_kind_mut() = ShaKind::Short; + *config.git_mut().semver_kind_mut() = SemverKind::Lightweight; // Disable env vars we aren't using right now *config.cargo_mut().features_mut() = false; diff --git a/zebrad/src/application.rs b/zebrad/src/application.rs index 3abeb5fc..42db6e08 100644 --- a/zebrad/src/application.rs +++ b/zebrad/src/application.rs @@ -45,7 +45,7 @@ pub fn app_config() -> config::Reader { /// For details, see https://semver.org/ pub fn app_version() -> Version { const CARGO_PKG_VERSION: &str = env!("CARGO_PKG_VERSION"); - let vergen_git_semver: Option<&str> = option_env!("VERGEN_GIT_SEMVER"); + let vergen_git_semver: Option<&str> = option_env!("VERGEN_GIT_SEMVER_LIGHTWEIGHT"); match vergen_git_semver { // change the git semver format to the semver 2.0 format