Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/bootstrap/download.rs
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,13 @@ impl Config {
#[cfg(not(windows))]
{
let legacy_rustfmt = self.initial_rustc.with_file_name(exe("rustfmt", host));
if !legacy_rustfmt.exists() {

// Note: we check here whether the symlink itself exists. `Path::exists` would follow
// the symlink and return whether the linked file exists instead. If `rustfmt_path` does
// not exist but the `legacy_rustfmt` link does, we would recreate it. This was one of
// the perf.rlo errors related to issue #108258.
let symlink_exists = std::fs::read_link(&legacy_rustfmt).is_ok();
if !symlink_exists {
t!(self.symlink_file(&rustfmt_path, &legacy_rustfmt));
}
}
Expand Down