From a5a364f266c3ff99d3b6a8847042c0dffcf78f72 Mon Sep 17 00:00:00 2001 From: messense Date: Fri, 4 Feb 2022 10:51:54 +0800 Subject: [PATCH] Properly handle lddtree error Updated lddtree to 0.2.6 --- Cargo.lock | 56 ++++++++++++++++++++++------------------ Cargo.toml | 2 +- Changelog.md | 1 + src/auditwheel/audit.rs | 3 +++ src/auditwheel/repair.rs | 4 ++- 5 files changed, 39 insertions(+), 27 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d25781c5f..23706c52e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -101,9 +101,9 @@ checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" [[package]] name = "backtrace" -version = "0.3.63" +version = "0.3.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "321629d8ba6513061f26707241fa9bc89524ff1cd7a915a97ef0c62c666ce1b6" +checksum = "5e121dee8023ce33ab248d9ce1493df03c3b38a659b240096fcbd7048ff9c31f" dependencies = [ "addr2line", "cc", @@ -308,9 +308,9 @@ dependencies = [ [[package]] name = "clap" -version = "3.0.13" +version = "3.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08799f92c961c7a1cf0cc398a9073da99e21ce388b46372c37f3191f2f3eed3e" +checksum = "b63edc3f163b3c71ec8aa23f9bd6070f77edbf3d1d198b164afa90ff00e4ec62" dependencies = [ "atty", "bitflags", @@ -326,9 +326,9 @@ dependencies = [ [[package]] name = "clap_complete" -version = "3.0.4" +version = "3.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d044e9db8cd0f68191becdeb5246b7462e4cf0c069b19ae00d1bf3fa9889498d" +checksum = "be4dabb7e2f006497e1da045feaa512acf0686f76b68d94925da2d9422dcb521" dependencies = [ "clap", ] @@ -345,9 +345,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "3.0.6" +version = "3.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "517358c28fcef6607bf6f76108e02afad7e82297d132a6b846dcc1fc3efcd153" +checksum = "9a1132dc3944b31c20dd8b906b3a9f0a5d0243e092d59171414969657ac6aa85" dependencies = [ "heck 0.4.0", "proc-macro-error", @@ -449,6 +449,12 @@ dependencies = [ "subtle", ] +[[package]] +name = "data-encoding" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ee2393c4a91429dffb4bedf19f4d6abf27d8a732c8ce4980305d782e5426d57" + [[package]] name = "derivative" version = "2.2.0" @@ -967,9 +973,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "lddtree" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b67aac3709c5c1f31dfc635ba91bfbd137b7d599dda3f325798cc84ba569d1cd" +checksum = "439978803e67626f97c926273736cddcb1bceab7ebb432505caab3c429c4a3ee" dependencies = [ "fs-err", "glob", @@ -978,9 +984,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.112" +version = "0.2.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b03d17f364a3a042d5e5d46b053bbbf82c92c9430c592dd4c064dc6ee997125" +checksum = "e74d72e0f9b65b5b4ca49a346af3976df0f9c61d550727f349ecd559f251a26c" [[package]] name = "log" @@ -993,12 +999,12 @@ dependencies = [ [[package]] name = "mailparse" -version = "0.13.7" +version = "0.13.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d70ae0840b192a2f7d1dc46e75f38720a7e3c52dfdc968ba3202fa270668dc67" +checksum = "8cae768a50835557749599277fc59f7c728118724eb34185e8feb633ef266a32" dependencies = [ - "base64", "charset", + "data-encoding", "quoted_printable", ] @@ -1697,9 +1703,9 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d09d3c15d814eda1d6a836f2f2b56a6abc1446c8a34351cb3180d3db92ffe4ce" +checksum = "3fed7948b6c68acbb6e20c334f55ad635dc0f75506963de4464289fbd3b051ac" dependencies = [ "bitflags", "core-foundation", @@ -1710,9 +1716,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e90dd10c41c6bfc633da6e0c659bd25d31e0791e5974ac42970267d59eba87f7" +checksum = "a57321bf8bc2362081b2599912d2961fe899c0efadf1b4b2f8d48b3e253bb96c" dependencies = [ "core-foundation-sys", "libc", @@ -1813,9 +1819,9 @@ checksum = "f67ad224767faa3c7d8b6d91985b78e70a1324408abcb1cfcc2be4c06bc06043" [[package]] name = "socket2" -version = "0.4.2" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dc90fe6c7be1a323296982db1836d1ea9e47b6839496dde9a541bc496df3516" +checksum = "66d72b759436ae32898a2af0a14218dbf55efde3feeb170eb623637db85ee1e0" dependencies = [ "libc", "winapi", @@ -1869,9 +1875,9 @@ dependencies = [ [[package]] name = "target-lexicon" -version = "0.12.2" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9bffcddbc2458fa3e6058414599e3c838a022abae82e5c67b4f7f80298d5bff" +checksum = "d7fa7e55043acb85fca6b3c01485a2eeb6b69c5d21002e273c79e465f43b7ac1" [[package]] name = "tempfile" @@ -2299,9 +2305,9 @@ dependencies = [ [[package]] name = "zeroize" -version = "1.5.0" +version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc222aec311c323c717f56060324f32b82da1ce1dd81d9a09aa6a9030bfe08db" +checksum = "7c88870063c39ee00ec285a2f8d6a966e5b6fb2becc4e8dac77ed0d370ed6006" [[package]] name = "zip" diff --git a/Cargo.toml b/Cargo.toml index b2145f406..b0e27b317 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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" diff --git a/Changelog.md b/Changelog.md index 651890835..37bb9ef14 100644 --- a/Changelog.md +++ b/Changelog.md @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * Fix missing Python submodule in wheel in [#772](https://github.com/PyO3/maturin/pull/772) * Add support for specifying cargo manifest path in pyproject.toml in [#781](https://github.com/PyO3/maturin/pull/781) * Add support for passing arguments to pep517 command via `MATURIN_PEP517_ARGS` env var in [#786](https://github.com/PyO3/maturin/pull/786) +* Fix auditwheel `No such file or directory` error when `LD_LIBRARY_PATH` contains non-existent paths in [#794](https://github.com/PyO3/maturin/pull/794) ## [0.12.6] - 2021-12-31 diff --git a/src/auditwheel/audit.rs b/src/auditwheel/audit.rs index b2abcd9b6..1934a5358 100644 --- a/src/auditwheel/audit.rs +++ b/src/auditwheel/audit.rs @@ -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)] diff --git a/src/auditwheel/repair.rs b/src/auditwheel/repair.rs index 7374744f0..318e3748f 100644 --- a/src/auditwheel/repair.rs +++ b/src/auditwheel/repair.rs @@ -10,7 +10,9 @@ pub fn find_external_libs( sysroot: PathBuf, ) -> Result, AuditWheelError> { let dep_analyzer = DependencyAnalyzer::new(sysroot); - let deps = dep_analyzer.analyze(artifact).unwrap(); + let deps = dep_analyzer + .analyze(artifact) + .map_err(AuditWheelError::DependencyAnalysisError)?; let mut ext_libs = Vec::new(); for (name, lib) in deps.libraries { // Skip dynamic linker/loader and white-listed libs