Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update logic that finds libLLVM.so artifact #1830

Merged
merged 1 commit into from
Mar 7, 2024
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
Loading