Move GIT_VERSION injection later in build chain to reduce build times

This commit is contained in:
Alex Auvolat
2022-09-07 11:59:56 +02:00
parent 6f02c36a89
commit db61f41030
13 changed files with 76 additions and 79 deletions
+1
View File
@@ -24,6 +24,7 @@ async-trait = "0.1.7"
arc-swap = "1.0"
blake2 = "0.9"
err-derive = "0.3"
git-version = "0.3.4"
hex = "0.4"
base64 = "0.13"
tracing = "0.1.30"
+1
View File
@@ -19,3 +19,4 @@ pub mod s3;
pub mod garage;
pub mod helper;
pub mod migrate;
pub mod version;
+7
View File
@@ -0,0 +1,7 @@
pub fn garage_version() -> &'static str {
option_env!("GIT_VERSION").unwrap_or(git_version::git_version!(
prefix = "git:",
cargo_prefix = "cargo:",
fallback = "unknown"
))
}