Skip to content

Commit 51f4839

Browse files
committed
Auto merge of rust-lang#121866 - Kobzol:opt-dist-find-llvm, r=Mark-Simulacrum
Modify opt-dist logic for finding LLVM artifacts This is the `rustc` side of fixing rust-lang#121395 (comment).
2 parents 1508a03 + 31ae823 commit 51f4839

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/tools/opt-dist/src/utils/artifact_size.rs

+13
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,21 @@ pub fn print_binary_sizes(env: &Environment) -> anyhow::Result<()> {
1515

1616
let root = env.build_artifacts().join("stage2");
1717

18+
let all_lib_files = get_files_from_dir(&root.join("lib"), None)?;
19+
1820
let mut files = get_files_from_dir(&root.join("bin"), None)?;
1921
files.extend(get_files_from_dir(&root.join("lib"), Some(".so"))?);
22+
23+
// libLLVM.so can be named libLLVM.so.<suffix>, so we try to explicitly add it here if it
24+
// wasn't found by the above call.
25+
if !files.iter().any(|f| f.file_name().unwrap_or_default().starts_with("libLLVM")) {
26+
if let Some(llvm_lib) =
27+
all_lib_files.iter().find(|f| f.file_name().unwrap_or_default().starts_with("libLLVM"))
28+
{
29+
files.push(llvm_lib.clone());
30+
}
31+
}
32+
2033
files.sort_unstable();
2134

2235
let items: Vec<_> = files

0 commit comments

Comments
 (0)