X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=build.rs;h=336f0295bdf6fc9fda9b593a69bf22cdf6fb7dbf;hb=f6882ede4dc32684e000d256644c9e192ea8c738;hp=1c930c1b2c95e531928f002e295c50f0eb31d782;hpb=dc164f4c46d666822a87db250ec43e2862356d93;p=rust.git diff --git a/build.rs b/build.rs index 1c930c1b2c9..336f0295bdf 100644 --- a/build.rs +++ b/build.rs @@ -1,8 +1,25 @@ -use std::env; +// Copyright 2014-2018 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + 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() + ); }