Skip to content

Commit

Permalink
Properly handle lddtree error
Browse files Browse the repository at this point in the history
Updated lddtree to 0.2.6
  • Loading branch information
messense committed Feb 4, 2022
1 parent 0370091 commit 85f853b
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 27 deletions.
56 changes: 31 additions & 25 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ ignore = "0.4.18"
dialoguer = "0.9.0"
console = "0.15.0"
minijinja = "0.13.0"
lddtree = "0.2.5"
lddtree = "0.2.6"
cc = "1.0.72"
clap = { version = "3.0.13", features = ["derive", "env", "wrap_help"] }
clap_complete = "3.0.4"
Expand Down
3 changes: 3 additions & 0 deletions src/auditwheel/audit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ pub enum AuditWheelError {
/// This platform tag isn't defined by auditwheel yet
#[error("{0} compatibility policy is not defined by auditwheel yet, pass `--skip-auditwheel` to proceed anyway")]
UndefinedPolicy(String),
/// Failed to analyze external shared library dependencies of the wheel
#[error("Failed to analyze external shared library dependencies of the wheel")]
DependencyAnalysisError(#[source] lddtree::Error),
}

#[derive(Clone, Debug)]
Expand Down
4 changes: 3 additions & 1 deletion src/auditwheel/repair.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ pub fn find_external_libs(
sysroot: PathBuf,
) -> Result<Vec<lddtree::Library>, AuditWheelError> {
let dep_analyzer = DependencyAnalyzer::new(sysroot);
let deps = dep_analyzer.analyze(artifact).unwrap();
let deps = dep_analyzer
.analyze(artifact)
.map_err(|err| AuditWheelError::DependencyAnalysisError(err))?;
let mut ext_libs = Vec::new();
for (name, lib) in deps.libraries {
// Skip dynamic linker/loader and white-listed libs
Expand Down

0 comments on commit 85f853b

Please sign in to comment.