fn register_build_id() {
    // Set the build ID, which is either unknown or the git hash
    let unknown_build = String::from("unknown");
    let build_id = match Command::new("git")
        .arg("rev-parse")
        .arg("--short")
        .arg("HEAD")
        .output()
    {
        Ok(output) => String::from_utf8(output.stdout).unwrap_or(unknown_build),
        Err(_) => unknown_build,
    };
    println!("cargo:rustc-env=BUILD_ID={}", build_id);
}
Write the build ID into an environment variable.
weld/build.rs