We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3200982 commit 6f041ecCopy full SHA for 6f041ec
src/bootstrap/download.rs
@@ -342,7 +342,13 @@ impl Config {
342
#[cfg(not(windows))]
343
{
344
let legacy_rustfmt = self.initial_rustc.with_file_name(exe("rustfmt", host));
345
- if !legacy_rustfmt.exists() {
+
346
+ // Note: we check here whether the symlink itself exists. `Path::exists` would follow
347
+ // the symlink and return whether the linked file exists instead. If `rustfmt_path` does
348
+ // not exist but the `legacy_rustfmt` link does, we would recreate it. This was one of
349
+ // the perf.rlo errors related to issue #108258.
350
+ let symlink_exists = std::fs::read_link(&legacy_rustfmt).is_ok();
351
+ if !symlink_exists {
352
t!(self.symlink_file(&rustfmt_path, &legacy_rustfmt));
353
}
354
0 commit comments