Skip to content

Commit

Permalink
update bootstrap hacks
Browse files Browse the repository at this point in the history
  • Loading branch information
jieyouxu committed Sep 2, 2024
1 parent 66aeb26 commit 18d4729
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/bootstrap/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1668,11 +1668,6 @@ Executed at: {executed_at}"#,

if let Err(e) = fs::remove_file(dst) {
if cfg!(windows) && e.kind() != io::ErrorKind::NotFound {
// workaround for https://github.com/rust-lang/rust/issues/127126
// if removing the file fails, attempt to rename it instead.
let now = t!(SystemTime::now().duration_since(SystemTime::UNIX_EPOCH));
let _ = fs::rename(dst, format!("{}-{}", dst.display(), now.as_nanos()));

#[cfg(windows)]
{
eprintln!(
Expand Down Expand Up @@ -1727,6 +1722,11 @@ Executed at: {executed_at}"#,
}
}
}

// workaround for https://github.com/rust-lang/rust/issues/127126
// if removing the file fails, attempt to rename it instead.
let now = t!(SystemTime::now().duration_since(SystemTime::UNIX_EPOCH));
let _ = fs::rename(dst, format!("{}-{}", dst.display(), now.as_nanos()));
}
}
let metadata = t!(src.symlink_metadata(), format!("src = {}", src.display()));
Expand Down

0 comments on commit 18d4729

Please sign in to comment.