Repository: influxdata/influxdb
File: influxdb3_process/src/lib.rs (Rust)

Code before:
pub mod jemalloc;

#[cfg(tokio_unstable)]
use tokio_metrics_bridge::setup_tokio_metrics;

#[cfg(any(not(feature = "jemalloc_replacing_malloc"), target_env = "msvc"))]
pub fn build_malloc_conf() -> String {
    "system".to_string()
}

#[cfg(all(feature = "jemalloc_replacing_malloc", not(target_env = "msvc")))]
pub fn build_malloc_conf() -> String {
    tikv_jemalloc_ctl::config::malloc_conf::mib()
        .unwrap()
        .read()
        .unwrap()
        .to_string()
}

/// Package version.
pub static INFLUXDB3_VERSION: LazyLock<&'static str> =
    LazyLock::new(|| option_env!("CARGO_PKG_VERSION").unwrap_or("UNKNOWN"));

/// Build information.
pub static INFLUXDB3_BUILD: LazyLock<&'static str> =
    LazyLock::new(|| option_env!("INFLUXDB3_BUILD_VERSION").unwrap_or("Core"));

/// Build-time GIT revision hash.
pub static INFLUXDB3_GIT_HASH: &str = env!(
    "GIT_HASH",
    "Can not find find GIT HASH in build environment"
);

/// Build-time GIT revision hash.
pub static INFLUXDB3_GIT_HASH_SHORT: &str = env!(
    "GIT_HASH_SHORT",
    "Can not find find GIT HASH in build environment"
);

/// Version string that is combined from [`INFLUXDB3_VERSION`] and [`INFLUXDB3_GIT_HASH`].
pub static VERSION_STRING: LazyLock<&'static str> = LazyLock::new(|| {
    let s = format!(
        "{}, revision {}",
        &INFLUXDB3_VERSION[..],
        INFLUXDB3_GIT_HASH
    );
    let s: Box<str> = Box::from(s);
    Box::leak(s)
});

/// A UUID that is unique for the process lifetime.

Review comment (bug):
Maybe better to fail here than default to "Core"? I can only think of it going missing when removing by accident when resolving conflicts (when sync'ing with enterprise).

Code after:
pub mod jemalloc;

#[cfg(tokio_unstable)]
use tokio_metrics_bridge::setup_tokio_metrics;

#[cfg(any(not(feature = "jemalloc_replacing_malloc"), target_env = "msvc"))]
pub fn build_malloc_conf() -> String {
    "system".to_string()
}

#[cfg(all(feature = "jemalloc_replacing_malloc", not(target_env = "msvc")))]
pub fn build_malloc_conf() -> String {
    tikv_jemalloc_ctl::config::malloc_conf::mib()
        .unwrap()
        .read()
        .unwrap()
        .to_string()
}

/// Package version.
pub static INFLUXDB3_VERSION: LazyLock<&'static str> =
    LazyLock::new(|| option_env!("CARGO_PKG_VERSION").unwrap_or("UNKNOWN"));

/// Build information.
pub static INFLUXDB3_BUILD: LazyLock<&'static str> =
    LazyLock::new(|| env!("INFLUXDB3_BUILD_VERSION"));

/// Build-time GIT revision hash.
pub static INFLUXDB3_GIT_HASH: &str = env!(
    "GIT_HASH",
    "Can not find find GIT HASH in build environment"
);

/// Build-time GIT revision hash.
pub static INFLUXDB3_GIT_HASH_SHORT: &str = env!(
    "GIT_HASH_SHORT",
    "Can not find find GIT HASH in build environment"
);

/// Version string that is combined from [`INFLUXDB3_VERSION`] and [`INFLUXDB3_GIT_HASH`].
pub static VERSION_STRING: LazyLock<&'static str> = LazyLock::new(|| {
    let s = format!(
        "{}, revision {}",
        &INFLUXDB3_VERSION[..],
        INFLUXDB3_GIT_HASH
    );
    let s: Box<str> = Box::from(s);
    Box::leak(s)
});

/// A UUID that is unique for the process lifetime.