Skip to content

Commit 01a97ed

Browse files
committed
bootstrap: fix trying to modify file times on read-only file
1 parent 5e5ec8a commit 01a97ed

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/bootstrap/src/lib.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -1777,9 +1777,8 @@ Executed at: {executed_at}"#,
17771777
}
17781778
}
17791779
if let Ok(()) = fs::hard_link(&src, dst) {
1780-
// Attempt to "easy copy" by creating a hard link
1781-
// (symlinks don't work on windows), but if that fails
1782-
// just fall back to a slow `copy` operation.
1780+
// Attempt to "easy copy" by creating a hard link (symlinks are priviledged on windows),
1781+
// but if that fails just fall back to a slow `copy` operation.
17831782
} else {
17841783
if let Err(e) = fs::copy(&src, dst) {
17851784
panic!("failed to copy `{}` to `{}`: {}", src.display(), dst.display(), e)
@@ -1790,7 +1789,7 @@ Executed at: {executed_at}"#,
17901789
.set_accessed(t!(metadata.accessed()))
17911790
.set_modified(t!(metadata.modified()));
17921791

1793-
let dst_file = t!(fs::File::open(dst));
1792+
let dst_file = t!(File::options().write(true).open(dst));
17941793
t!(dst_file.set_times(file_times));
17951794
}
17961795
}

0 commit comments

Comments
 (0)