Skip to content

Commit 9abc549

Browse files
committed
Add git-commit-hash in source and extended tarballs too.
1 parent de038b7 commit 9abc549

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/bootstrap/dist.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -846,6 +846,8 @@ impl Step for PlainSourceTarball {
846846

847847
// Create the version file
848848
write_file(&plain_dst_src.join("version"), build.rust_version().as_bytes());
849+
let sha = build.rust_sha().unwrap_or("");
850+
write_file(&plain_dst_src.join("git-commit-hash"), sha.as_bytes());
849851

850852
// If we're building from git sources, we need to vendor a complete distribution.
851853
if build.rust_info.is_git() {
@@ -1158,7 +1160,9 @@ impl Step for Extended {
11581160
install(&build.src.join("LICENSE-APACHE"), &overlay, 0o644);
11591161
install(&build.src.join("LICENSE-MIT"), &overlay, 0o644);
11601162
let version = build.rust_version();
1163+
let sha = build.rust_sha().unwrap_or("");
11611164
t!(t!(File::create(overlay.join("version"))).write_all(version.as_bytes()));
1165+
t!(t!(File::create(overlay.join("git-commit-hash"))).write_all(sha.as_bytes()));
11621166
install(&etc.join("README.md"), &overlay, 0o644);
11631167

11641168
// When rust-std package split from rustc, we needed to ensure that during

0 commit comments

Comments
 (0)