From c7f7c8cfeeea17a7f6739a4ebed2fbc1583478a9 Mon Sep 17 00:00:00 2001 From: messense Date: Sun, 12 Dec 2021 21:09:49 +0800 Subject: [PATCH] No repair support for cross compiled wheel yet --- src/auditwheel/audit.rs | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/src/auditwheel/audit.rs b/src/auditwheel/audit.rs index e4819c26e..e7377e111 100644 --- a/src/auditwheel/audit.rs +++ b/src/auditwheel/audit.rs @@ -255,6 +255,7 @@ pub fn auditwheel_rs( if !target.is_linux() || platform_tag == Some(PlatformTag::Linux) { return Ok((Policy::default(), false)); } + let cross_compiling = target.cross_compiling(); let arch = target.target_arch().to_string(); let mut file = File::open(path).map_err(AuditWheelError::IoError)?; let mut buffer = Vec::new(); @@ -298,10 +299,15 @@ pub fn auditwheel_rs( should_repair = false; break; } - Err(AuditWheelError::LinksForbiddenLibrariesError(..)) => { - highest_policy = Some(policy.clone()); - should_repair = true; - break; + Err(err @ AuditWheelError::LinksForbiddenLibrariesError(..)) => { + // TODO: support repair for cross compiled wheels + if !cross_compiling { + highest_policy = Some(policy.clone()); + should_repair = true; + break; + } else { + return Err(err); + } } Err(AuditWheelError::VersionedSymbolTooNewError(..)) | Err(AuditWheelError::BlackListedSymbolsError(..)) @@ -333,9 +339,14 @@ pub fn auditwheel_rs( should_repair = false; Ok(policy) } - Err(AuditWheelError::LinksForbiddenLibrariesError(..)) => { - should_repair = true; - Ok(policy) + Err(err @ AuditWheelError::LinksForbiddenLibrariesError(..)) => { + // TODO: support repair for cross compiled wheels + if !cross_compiling { + should_repair = true; + Ok(policy) + } else { + Err(err) + } } Err(err) => Err(err), }