Skip to content

Commit 33d3519

Browse files
committed
Auto merge of rust-lang#102610 - dawnofmidnight:git-commit-hash, r=Mark-Simulacrum
re-add git-commit-hash file to tarballs rust-lang#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`
2 parents f47e9af + 5c908c6 commit 33d3519

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

src/bootstrap/channel.rs

+5
Original file line numberDiff line numberDiff line change
@@ -150,3 +150,8 @@ pub fn write_commit_info_file(root: &Path, info: &Info) {
150150
let commit_info = format!("{}\n{}\n{}\n", info.sha, info.short_sha, info.commit_date);
151151
t!(fs::write(root.join("git-commit-info"), &commit_info));
152152
}
153+
154+
/// Write the commit hash to the `git-commit-hash` file given the project root.
155+
pub fn write_commit_hash_file(root: &Path, sha: &str) {
156+
t!(fs::write(root.join("git-commit-hash"), sha));
157+
}

src/bootstrap/dist.rs

+1
Original file line numberDiff line numberDiff line change
@@ -920,6 +920,7 @@ impl Step for PlainSourceTarball {
920920
// Create the version file
921921
builder.create(&plain_dst_src.join("version"), &builder.rust_version());
922922
if let Some(info) = builder.rust_info.info() {
923+
channel::write_commit_hash_file(&plain_dst_src, &info.sha);
923924
channel::write_commit_info_file(&plain_dst_src, info);
924925
}
925926

src/bootstrap/tarball.rs

+1
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,7 @@ impl<'a> Tarball<'a> {
299299
t!(std::fs::create_dir_all(&self.overlay_dir));
300300
self.builder.create(&self.overlay_dir.join("version"), &self.overlay.version(self.builder));
301301
if let Some(info) = self.builder.rust_info.info() {
302+
channel::write_commit_hash_file(&self.overlay_dir, &info.sha);
302303
channel::write_commit_info_file(&self.overlay_dir, info);
303304
}
304305
for file in self.overlay.legal_and_readme() {

0 commit comments

Comments
 (0)