Skip to content

Commit 436ee3b

Browse files
committed
No repair support for cross compiled wheel yet
1 parent 3913e3a commit 436ee3b

File tree

1 file changed

+18
-7
lines changed

1 file changed

+18
-7
lines changed

src/auditwheel/audit.rs

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@ pub fn auditwheel_rs(
255255
if !target.is_linux() || platform_tag == Some(PlatformTag::Linux) {
256256
return Ok((Policy::default(), false));
257257
}
258+
let cross_compiling = target.cross_compiling();
258259
let arch = target.target_arch().to_string();
259260
let mut file = File::open(path).map_err(AuditWheelError::IoError)?;
260261
let mut buffer = Vec::new();
@@ -298,10 +299,15 @@ pub fn auditwheel_rs(
298299
should_repair = false;
299300
break;
300301
}
301-
Err(AuditWheelError::LinksForbiddenLibrariesError(..)) => {
302-
highest_policy = Some(policy.clone());
303-
should_repair = true;
304-
break;
302+
Err(err @ AuditWheelError::LinksForbiddenLibrariesError(..)) => {
303+
// TODO: support repair for cross compiled wheels
304+
if !cross_compiling {
305+
highest_policy = Some(policy.clone());
306+
should_repair = true;
307+
break;
308+
} else {
309+
return Err(err);
310+
}
305311
}
306312
Err(AuditWheelError::VersionedSymbolTooNewError(..))
307313
| Err(AuditWheelError::BlackListedSymbolsError(..))
@@ -333,9 +339,14 @@ pub fn auditwheel_rs(
333339
should_repair = false;
334340
Ok(policy)
335341
}
336-
Err(AuditWheelError::LinksForbiddenLibrariesError(..)) => {
337-
should_repair = true;
338-
Ok(policy)
342+
Err(err @ AuditWheelError::LinksForbiddenLibrariesError(..)) => {
343+
// TODO: support repair for cross compiled wheels
344+
if !cross_compiling {
345+
should_repair = true;
346+
Ok(policy)
347+
} else {
348+
Err(err)
349+
}
339350
}
340351
Err(err) => Err(err),
341352
}

0 commit comments

Comments
 (0)