feat: embed git SHA in version string via build.rs
Adds a build.rs that runs `git describe --tags --always --dirty` and
sets NUMA_BUILD_VERSION at compile time. A new `numa::version()` helper
returns the build version, falling back to CARGO_PKG_VERSION when git
is unavailable (source tarballs, Docker builds without .git).
Version strings:
tagged release: 0.13.1
commits ahead: 0.13.1+a87f907
uncommitted changes: 0.13.1+a87f907-dirty
no git: 0.13.1
Replaces all 6 inline env!("CARGO_PKG_VERSION") call sites with the
single version() function.
This commit is contained in:
@@ -43,7 +43,7 @@ impl HealthMeta {
|
||||
#[cfg(test)]
|
||||
pub fn test_fixture() -> Self {
|
||||
HealthMeta {
|
||||
version: env!("CARGO_PKG_VERSION"),
|
||||
version: crate::version(),
|
||||
hostname: "test-host".to_string(),
|
||||
sni: "numa.numa".to_string(),
|
||||
dot_enabled: false,
|
||||
@@ -99,7 +99,7 @@ impl HealthMeta {
|
||||
}
|
||||
|
||||
HealthMeta {
|
||||
version: env!("CARGO_PKG_VERSION"),
|
||||
version: crate::version(),
|
||||
hostname: crate::hostname(),
|
||||
sni: "numa.numa".to_string(),
|
||||
dot_enabled,
|
||||
|
||||
Reference in New Issue
Block a user