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), }