about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2017-09-11 22:49:20 +0000
committerbors <bors@rust-lang.org>2017-09-11 22:49:20 +0000
commit07d950f38f1719e2a54d9a515178b0e11dbaf108 (patch)
tree485da2b847bdb42710538c7c703f525059d83f93
parenteba374fb21b63751ac10a09dbf269fd5067d4eb8 (diff)
parenteb26d5b7c928646983c53bcbd33ce578acbf238f (diff)
downloadrust-07d950f38f1719e2a54d9a515178b0e11dbaf108.tar.gz
rust-07d950f38f1719e2a54d9a515178b0e11dbaf108.zip
Auto merge of #44498 - alexcrichton:fix-nightlies, r=alexcrichton
rustbuild: Fix a distribution bug with rustdoc

Apparently `File::create` was called when there was an existing hard link or the
like, causing an existing file to get accidentally truncated!

Closes #44487
-rw-r--r--src/bootstrap/dist.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs
index e18850b08b1..8e11e1b0580 100644
--- a/src/bootstrap/dist.rs
+++ b/src/bootstrap/dist.rs
@@ -900,6 +900,7 @@ impl Step for PlainSourceTarball {
 fn install(src: &Path, dstdir: &Path, perms: u32) {
     let dst = dstdir.join(src.file_name().unwrap());
     t!(fs::create_dir_all(dstdir));
+    drop(fs::remove_file(&dst));
     {
         let mut s = t!(fs::File::open(&src));
         let mut d = t!(fs::File::create(&dst));