From 10a8487689702ec753f545782ca172f3f1284e41 Mon Sep 17 00:00:00 2001 From: messense Date: Fri, 26 Feb 2021 14:30:53 +0800 Subject: [PATCH] Improve error message when auditwheel failed to find versioned offending symbols --- src/auditwheel/mod.rs | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/auditwheel/mod.rs b/src/auditwheel/mod.rs index 1863320ff..2f7d908f3 100644 --- a/src/auditwheel/mod.rs +++ b/src/auditwheel/mod.rs @@ -232,11 +232,19 @@ pub fn auditwheel_rs( .map(|v| format!("{}_{}", name, v)) .collect(); let offending_symbols = find_incompliant_symbols(&elf, &offending_symbol_versions)?; - let offender = format!( - "{} offending symbols: {}", - library.name, - offending_symbols.join(", ") - ); + let offender = if offending_symbols.is_empty() { + format!( + "{} offending versions: {}", + library.name, + offending_symbol_versions.join(", ") + ) + } else { + format!( + "{} offending symbols: {}", + library.name, + offending_symbols.join(", ") + ) + }; offenders.insert(offender); } }