auditwheel icon indicating copy to clipboard operation
auditwheel copied to clipboard

Add ability to repair wheels for other architectures

Open rhelmot opened this issue 1 year ago • 4 comments

#244 represents a problem in need of a solution - how to audit wheels for other architectures, e.g. those built with a cross toolchain? Not all build environments can set up binfmt_misc or are performant enough to build in a VM.

Here is a proposed solution: manually specifying the architecture for the wheels to patch. I have verified that this is able to repair wheels built for aarch64 using a cross toolchain on an x86_64 machine.

rhelmot avatar Aug 23 '24 16:08 rhelmot

I think the arch shall be deduced from the input wheel. The information is already there, there should be no need to ask the user for input.

mayeut avatar Aug 24 '24 10:08 mayeut

Codecov Report

Attention: Patch coverage is 30.00000% with 7 lines in your changes missing coverage. Please review.

Project coverage is 91.43%. Comparing base (f3025f2) to head (a3224fa).

Files Patch % Lines
src/auditwheel/main_repair.py 30.00% 6 Missing and 1 partial :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #512      +/-   ##
==========================================
- Coverage   92.33%   91.43%   -0.91%     
==========================================
  Files          20       20              
  Lines        1266     1272       +6     
  Branches      305      281      -24     
==========================================
- Hits         1169     1163       -6     
- Misses         56       63       +7     
- Partials       41       46       +5     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Aug 24 '24 12:08 codecov[bot]

This was a much more difficult refactor with this requirement but it has been done. I tried to stay true to the original intent as much as possible but the wheel policies stuff was really, really insistent that it should be able to know exactly what platform it's running for at all times.

In order to streamline a common use case ("please repair my wheel; I don't care what you repair it to but it doesn't necessarily have to be the highest-priority policy for the given platform"), I added the repair --best-plat flag.

rhelmot avatar Aug 26 '24 19:08 rhelmot

Thanks @rhelmot for the deep analysis and the work done on this. I've not forgotten about it. Indeed the wheel policies is really insistent on knowing everything before hand. I want to get some work done before getting back to this but taking into account the work you've done.

mayeut avatar Feb 09 '25 08:02 mayeut