Skip to content

Commit fb6da33

Browse files
committed
Remove a workaround for a bug
I don't think it is necessary anymore. As I understand it from issue 39504 the original problem was that rustbuild changed a hardlink in the cargo build dir to point to copy in the sysroot while cargo may have hardlinked it to the original first. I don't think this happens anymore and as such this workaround is no longer necessary.
1 parent 6786a09 commit fb6da33

File tree

1 file changed

+0
-26
lines changed

1 file changed

+0
-26
lines changed

compiler/rustc_metadata/src/locator.rs

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -589,32 +589,6 @@ impl<'a> CrateLocator<'a> {
589589
continue;
590590
}
591591

592-
// Ok so at this point we've determined that `(lib, kind)` above is
593-
// a candidate crate to load, and that `slot` is either none (this
594-
// is the first crate of its kind) or if some the previous path has
595-
// the exact same hash (e.g., it's the exact same crate).
596-
//
597-
// In principle these two candidate crates are exactly the same so
598-
// we can choose either of them to link. As a stupidly gross hack,
599-
// however, we favor crate in the sysroot.
600-
//
601-
// You can find more info in rust-lang/rust#39518 and various linked
602-
// issues, but the general gist is that during testing libstd the
603-
// compilers has two candidates to choose from: one in the sysroot
604-
// and one in the deps folder. These two crates are the exact same
605-
// crate but if the compiler chooses the one in the deps folder
606-
// it'll cause spurious errors on Windows.
607-
//
608-
// As a result, we favor the sysroot crate here. Note that the
609-
// candidates are all canonicalized, so we canonicalize the sysroot
610-
// as well.
611-
if let Some((prev, _)) = &ret {
612-
let sysroot = self.sysroot;
613-
let sysroot = sysroot.canonicalize().unwrap_or_else(|_| sysroot.to_path_buf());
614-
if prev.starts_with(&sysroot) {
615-
continue;
616-
}
617-
}
618592
*slot = Some((hash, metadata));
619593
ret = Some((lib, kind));
620594
}

0 commit comments

Comments
 (0)