Don’t ICE if fs::canonicalise fails in meta-load
This might fail when --extern library is a symlink to an invalid location. Instead just pretend it doesn’t exist at all.
This commit is contained in:
parent
c78c0994b1
commit
ab86face01
4 changed files with 49 additions and 7 deletions
|
|
@ -429,13 +429,14 @@ impl<'a> Context<'a> {
|
|||
let slot = candidates.entry(hash_str)
|
||||
.or_insert_with(|| (HashMap::new(), HashMap::new()));
|
||||
let (ref mut rlibs, ref mut dylibs) = *slot;
|
||||
if rlib {
|
||||
rlibs.insert(fs::canonicalize(path).unwrap(), kind);
|
||||
} else {
|
||||
dylibs.insert(fs::canonicalize(path).unwrap(), kind);
|
||||
}
|
||||
|
||||
FileMatches
|
||||
fs::canonicalize(path).map(|p| {
|
||||
if rlib {
|
||||
rlibs.insert(p, kind);
|
||||
} else {
|
||||
dylibs.insert(p, kind);
|
||||
}
|
||||
FileMatches
|
||||
}).unwrap_or(FileDoesntMatch)
|
||||
});
|
||||
self.rejected_via_kind.extend(staticlibs.into_iter());
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue