Skip to content

Commit

Permalink
Auto merge of #121866 - Kobzol:opt-dist-find-llvm, r=Mark-Simulacrum
Browse files Browse the repository at this point in the history
Modify opt-dist logic for finding LLVM artifacts

This is the `rustc` side of fixing #121395 (comment).
  • Loading branch information
bors committed Mar 7, 2024
2 parents 1508a03 + 31ae823 commit 51f4839
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/tools/opt-dist/src/utils/artifact_size.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,21 @@ pub fn print_binary_sizes(env: &Environment) -> anyhow::Result<()> {

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

let all_lib_files = get_files_from_dir(&root.join("lib"), None)?;

let mut files = get_files_from_dir(&root.join("bin"), None)?;
files.extend(get_files_from_dir(&root.join("lib"), Some(".so"))?);

// libLLVM.so can be named libLLVM.so.<suffix>, so we try to explicitly add it here if it
// wasn't found by the above call.
if !files.iter().any(|f| f.file_name().unwrap_or_default().starts_with("libLLVM")) {
if let Some(llvm_lib) =
all_lib_files.iter().find(|f| f.file_name().unwrap_or_default().starts_with("libLLVM"))
{
files.push(llvm_lib.clone());
}
}

files.sort_unstable();

let items: Vec<_> = files
Expand Down

0 comments on commit 51f4839

Please sign in to comment.