Skip to content

Commit 118b6e4

Browse files
committed
give a better error if renaming a temp file fails
1 parent 270d545 commit 118b6e4

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/bootstrap/src/core/download.rs

+8-1
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,10 @@ impl Config {
208208
Some(other) => panic!("unsupported protocol {other} in {url}"),
209209
None => panic!("no protocol in {url}"),
210210
}
211-
t!(std::fs::rename(&tempfile, dest_path));
211+
t!(
212+
std::fs::rename(&tempfile, dest_path),
213+
format!("failed to rename {tempfile:?} to {dest_path:?}")
214+
);
212215
}
213216

214217
fn download_http_with_retries(&self, tempfile: &Path, url: &str, help_on_error: &str) {
@@ -570,6 +573,10 @@ impl Config {
570573
key: &str,
571574
destination: &str,
572575
) {
576+
if self.dry_run() {
577+
return;
578+
}
579+
573580
let cache_dst = self.out.join("cache");
574581
let cache_dir = cache_dst.join(key);
575582
if !cache_dir.exists() {

0 commit comments

Comments
 (0)