Skip to content

Commit 1a631a2

Browse files
committed
fix(repair): keep wheels when auditwheel InvalidLibc on Linux ARMv7
1 parent 53b7382 commit 1a631a2

1 file changed

Lines changed: 18 additions & 2 deletions

File tree

repair_wheels.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import zipfile
1818

1919
from pathlib import Path
20+
from typing import List
2021
from typing import Set
2122
from typing import Tuple
2223
from typing import Union
@@ -26,9 +27,9 @@
2627
from _helper_functions import print_color
2728

2829

29-
def _dedupe_wheel_paths(wheels_dir: Path) -> list[Path]:
30+
def _dedupe_wheel_paths(wheels_dir: Path) -> List[Path]:
3031
"""Collect *.whl under wheels_dir once per inode (rglob can list the same file twice via symlinks)."""
31-
wheels: list[Path] = []
32+
wheels: List[Path] = []
3233
seen: Set[Tuple[int, int]] = set()
3334
for p in sorted(wheels_dir.rglob("*.whl")):
3435
try:
@@ -287,6 +288,12 @@ def main() -> None:
287288
# manylinux wheel can't find its libraries
288289
# it means it was already properly repaired
289290
or ("manylinux" in wheel.name and "could not be located" in error_msg)
291+
# ARMv7 CI runs under QEMU; auditwheel may fail libc detection on abi3/native .so
292+
or (
293+
current_platform == "Linux"
294+
and current_arch == "armv7l"
295+
and ("InvalidLibc" in error_msg or "couldn't detect libc" in error_msg)
296+
)
290297
)
291298

292299
has_error = (
@@ -308,6 +315,15 @@ def main() -> None:
308315
print_color(" -> Keeping original wheel (build issue: needs older toolchain)", Fore.YELLOW)
309316
elif "manylinux" in wheel.name and "could not be located" in error_msg:
310317
print_color(" -> Keeping original wheel (already bundled from PyPI)", Fore.GREEN)
318+
elif (
319+
current_platform == "Linux"
320+
and current_arch == "armv7l"
321+
and ("InvalidLibc" in error_msg or "couldn't detect libc" in error_msg)
322+
):
323+
print_color(
324+
" -> Keeping original wheel (auditwheel libc detection failed on ARMv7 runner; often QEMU)",
325+
Fore.YELLOW,
326+
)
311327
skipped_count += 1
312328
elif has_error:
313329
# Actual error occurred (even if a wheel was created, it may be broken)

0 commit comments

Comments
 (0)