diff --git a/pgml-extension/Cargo.lock b/pgml-extension/Cargo.lock index b9aa0c4e4..4de78b7d1 100644 --- a/pgml-extension/Cargo.lock +++ b/pgml-extension/Cargo.lock @@ -1870,6 +1870,7 @@ dependencies = [ "serde_json", "signal-hook", "typetag", + "vergen", "xgboost", ] @@ -3230,6 +3231,17 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" +[[package]] +name = "vergen" +version = "8.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85e7dc29b3c54a2ea67ef4f953d5ec0c4085035c0ae2d325be1c0d2144bd9f16" +dependencies = [ + "anyhow", + "rustversion", + "time", +] + [[package]] name = "version_check" version = "0.9.4" diff --git a/pgml-extension/Cargo.toml b/pgml-extension/Cargo.toml index 1d0d13a0f..440e69a43 100644 --- a/pgml-extension/Cargo.toml +++ b/pgml-extension/Cargo.toml @@ -53,6 +53,9 @@ csv = "1.2" [dev-dependencies] pgrx-tests = "=0.10.0" +[build-dependencies] +vergen = { version = "8", features = ["build", "git", "gitcl"] } + [profile.dev] panic = "unwind" lto = "thin" diff --git a/pgml-extension/build.rs b/pgml-extension/build.rs index ae6761a6a..355c19293 100644 --- a/pgml-extension/build.rs +++ b/pgml-extension/build.rs @@ -16,4 +16,6 @@ fn main() { "cargo:link-args=-Wl,--version-script={}/ld.map", std::env::current_dir().unwrap().to_string_lossy(), ); + + vergen::EmitBuilder::builder().all_git().emit().unwrap(); } diff --git a/pgml-extension/src/api.rs b/pgml-extension/src/api.rs index e1339d948..ad952e485 100644 --- a/pgml-extension/src/api.rs +++ b/pgml-extension/src/api.rs @@ -84,7 +84,7 @@ pub fn validate_shared_library() { #[pg_extern(immutable, parallel_safe)] fn version() -> String { - crate::VERSION.to_string() + format!("{} ({})", crate::VERSION, crate::COMMIT) } #[allow(clippy::too_many_arguments)] diff --git a/pgml-extension/src/lib.rs b/pgml-extension/src/lib.rs index c93718898..ce0bdbeb2 100644 --- a/pgml-extension/src/lib.rs +++ b/pgml-extension/src/lib.rs @@ -7,6 +7,7 @@ extern crate signal_hook; use pgrx::*; pub const VERSION: &str = env!("CARGO_PKG_VERSION"); +pub const COMMIT: &str = env!("VERGEN_GIT_SHA"); pub mod api; pub mod bindings; pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy