diff options
| author | Jakub Beránek <berykubik@gmail.com> | 2024-03-01 19:46:14 +0100 |
|---|---|---|
| committer | Jakub Beránek <berykubik@gmail.com> | 2024-03-01 19:46:14 +0100 |
| commit | 31ae82395c5e28a80c1e5633b8bc68d0ff33a974 (patch) | |
| tree | 5cd3ff5f268d9cde89b8763bca16b0bfe2ba2d91 | |
| parent | 6db96de66c2c0ea3f4f2f348ed1a83c2c507687d (diff) | |
Modify opt-dist logic for finding LLVM artifacts
| -rw-r--r-- | src/tools/opt-dist/src/utils/artifact_size.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/tools/opt-dist/src/utils/artifact_size.rs b/src/tools/opt-dist/src/utils/artifact_size.rs index eb1f6bcf21d..757f6d49709 100644 --- a/src/tools/opt-dist/src/utils/artifact_size.rs +++ b/src/tools/opt-dist/src/utils/artifact_size.rs @@ -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 |
