Factor vergen stuff to a build-info crate

This commit is contained in:
Louis Dureuil 2024-02-27 18:34:52 +01:00
parent 86ce843f3d
commit c608b3f9b5
No known key found for this signature in database
15 changed files with 396 additions and 159 deletions

View file

@ -473,7 +473,9 @@ impl Segment {
create_all_stats(index_scheduler.into(), auth_controller.into(), &AuthFilter::default())
{
// Replace the version number with the prototype name if any.
let version = if let Some(prototype) = crate::prototype_name() {
let version = if let Some(prototype) = build_info::DescribeResult::from_build()
.and_then(|describe| describe.as_prototype())
{
prototype
} else {
env!("CARGO_PKG_VERSION")