Skip to content

Commit a172930

Browse files
Merge pull request #1830 from Kobzol/find-llvm
Update logic that finds libLLVM.so artifact
2 parents 9580e15 + d1e8474 commit a172930

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

collector/src/toolchain.rs

+11-7
Original file line numberDiff line numberDiff line change
@@ -283,16 +283,20 @@ impl ToolchainComponents {
283283
for entry in fs::read_dir(dir).context("Cannot read lib dir to find components")? {
284284
let entry = entry?;
285285
let path = entry.path();
286-
if path.is_file() && path.extension() == Some(OsStr::new("so")) {
286+
if path.is_file() {
287287
if let Some(filename) = path.file_name().and_then(|s| s.to_str()) {
288+
// libLLVM.so can have a weird suffix, like libLLVM.so.<suffix>, so we don't
289+
// check its .so suffix directly.
288290
if filename.starts_with("libLLVM") {
289291
self.lib_llvm = Some(path);
290-
} else if filename.starts_with("librustc_driver") {
291-
self.lib_rustc = Some(path);
292-
} else if filename.starts_with("libstd") {
293-
self.lib_std = Some(path);
294-
} else if filename.starts_with("libtest") {
295-
self.lib_test = Some(path);
292+
} else if path.extension() == Some(OsStr::new("so")) {
293+
if filename.starts_with("librustc_driver") {
294+
self.lib_rustc = Some(path);
295+
} else if filename.starts_with("libstd") {
296+
self.lib_std = Some(path);
297+
} else if filename.starts_with("libtest") {
298+
self.lib_test = Some(path);
299+
}
296300
}
297301
}
298302
}

0 commit comments

Comments
 (0)