about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/bootstrap/channel.rs5
-rw-r--r--src/bootstrap/dist.rs1
-rw-r--r--src/bootstrap/tarball.rs1
3 files changed, 7 insertions, 0 deletions
diff --git a/src/bootstrap/channel.rs b/src/bootstrap/channel.rs
index 363556c1ede..258352a21a4 100644
--- a/src/bootstrap/channel.rs
+++ b/src/bootstrap/channel.rs
@@ -150,3 +150,8 @@ pub fn write_commit_info_file(root: &Path, info: &Info) {
     let commit_info = format!("{}\n{}\n{}\n", info.sha, info.short_sha, info.commit_date);
     t!(fs::write(root.join("git-commit-info"), &commit_info));
 }
+
+/// Write the commit hash to the `git-commit-hash` file given the project root.
+pub fn write_commit_hash_file(root: &Path, sha: &str) {
+    t!(fs::write(root.join("git-commit-hash"), sha));
+}
diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs
index f273e0249e8..de945398c58 100644
--- a/src/bootstrap/dist.rs
+++ b/src/bootstrap/dist.rs
@@ -920,6 +920,7 @@ impl Step for PlainSourceTarball {
         // Create the version file
         builder.create(&plain_dst_src.join("version"), &builder.rust_version());
         if let Some(info) = builder.rust_info.info() {
+            channel::write_commit_hash_file(&plain_dst_src, &info.sha);
             channel::write_commit_info_file(&plain_dst_src, info);
         }
 
diff --git a/src/bootstrap/tarball.rs b/src/bootstrap/tarball.rs
index 3b1beacf0f4..d999b6c1503 100644
--- a/src/bootstrap/tarball.rs
+++ b/src/bootstrap/tarball.rs
@@ -299,6 +299,7 @@ impl<'a> Tarball<'a> {
         t!(std::fs::create_dir_all(&self.overlay_dir));
         self.builder.create(&self.overlay_dir.join("version"), &self.overlay.version(self.builder));
         if let Some(info) = self.builder.rust_info.info() {
+            channel::write_commit_hash_file(&self.overlay_dir, &info.sha);
             channel::write_commit_info_file(&self.overlay_dir, info);
         }
         for file in self.overlay.legal_and_readme() {