X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=build.rs;h=b5484bec3c8b8dca5dc0a00930d846e60533d4a7;hb=71c1e873907be8b50a54bce1be01fb5308ccbc0d;hp=1c930c1b2c95e531928f002e295c50f0eb31d782;hpb=b7587d8176ee1b866e8c2eb49e32a1ff4f029a2f;p=rust.git diff --git a/build.rs b/build.rs index 1c930c1b2c9..b5484bec3c8 100644 --- a/build.rs +++ b/build.rs @@ -1,8 +1,19 @@ -use std::env; - fn main() { // Forward the profile to the main compilation - println!("cargo:rustc-env=PROFILE={}", env::var("PROFILE").unwrap()); + println!("cargo:rustc-env=PROFILE={}", std::env::var("PROFILE").unwrap()); // Don't rebuild even if nothing changed println!("cargo:rerun-if-changed=build.rs"); + // forward git repo hashes we build at + println!( + "cargo:rustc-env=GIT_HASH={}", + rustc_tools_util::get_commit_hash().unwrap_or_default() + ); + println!( + "cargo:rustc-env=COMMIT_DATE={}", + rustc_tools_util::get_commit_date().unwrap_or_default() + ); + println!( + "cargo:rustc-env=RUSTC_RELEASE_CHANNEL={}", + rustc_tools_util::get_channel() + ); }