about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-10-03 14:20:32 +0000
committerbors <bors@rust-lang.org>2022-10-03 14:20:32 +0000
commit33d351972ad9c43bc30e87edd2765de9a4898629 (patch)
treed5e59cc94b920c030ada12d533f3dd180f891978 /src
parentf47e9af824a2c13873af6b898f2d65a36d029466 (diff)
parent5c908c642b799ca8d7bdc774eaed5caad3027215 (diff)
downloadrust-33d351972ad9c43bc30e87edd2765de9a4898629.tar.gz
rust-33d351972ad9c43bc30e87edd2765de9a4898629.zip
Auto merge of #102610 - dawnofmidnight:git-commit-hash, r=Mark-Simulacrum
re-add git-commit-hash file to tarballs

rust-lang/rust#100557 removed the `git-commit-hash` file and replaced it with `git-commit-info`. However, build-manifest relies on the `git-commit-hash` file being present, so this adds it back.

r? `@Mark-Simulacrum`
Diffstat (limited to 'src')
-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() {