Skip to content

Commit

Permalink
Auto merge of rust-lang#102610 - dawnofmidnight:git-commit-hash, r=Ma…
Browse files Browse the repository at this point in the history
…rk-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`
  • Loading branch information
bors committed Oct 3, 2022
2 parents f47e9af + 5c908c6 commit 33d3519
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/bootstrap/channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
1 change: 1 addition & 0 deletions src/bootstrap/dist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
1 change: 1 addition & 0 deletions src/bootstrap/tarball.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 33d3519

Please sign in to comment.