Skip to content
Merged
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
18 changes: 11 additions & 7 deletions collector/src/toolchain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,16 +283,20 @@ impl ToolchainComponents {
for entry in fs::read_dir(dir).context("Cannot read lib dir to find components")? {
let entry = entry?;
let path = entry.path();
if path.is_file() && path.extension() == Some(OsStr::new("so")) {
if path.is_file() {
if let Some(filename) = path.file_name().and_then(|s| s.to_str()) {
// libLLVM.so can have a weird suffix, like libLLVM.so.<suffix>, so we don't
// check its .so suffix directly.
if filename.starts_with("libLLVM") {
self.lib_llvm = Some(path);
} else if filename.starts_with("librustc_driver") {
self.lib_rustc = Some(path);
} else if filename.starts_with("libstd") {
self.lib_std = Some(path);
} else if filename.starts_with("libtest") {
self.lib_test = Some(path);
} else if path.extension() == Some(OsStr::new("so")) {
if filename.starts_with("librustc_driver") {
self.lib_rustc = Some(path);
} else if filename.starts_with("libstd") {
self.lib_std = Some(path);
} else if filename.starts_with("libtest") {
self.lib_test = Some(path);
}
}
}
}
Expand Down