]> git.lizzy.rs Git - rust.git/blobdiff - build.rs
Reintroduce `extern crate` for non-Cargo dependencies.
[rust.git] / build.rs
index 1c930c1b2c95e531928f002e295c50f0eb31d782..146a8dae74596a25c5042447e846f4a38c1888c2 100644 (file)
--- a/build.rs
+++ b/build.rs
@@ -1,8 +1,15 @@
-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()
+    );
 }