-
Notifications
You must be signed in to change notification settings - Fork 250
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability to install armv7l manylinux/musllinux
wheels on armv8l
#690
Conversation
src/packaging/_manylinux.py
Outdated
if arch == "armv8l": | ||
# armv8l wheels are not accepted on PyPI | ||
# As long as we pass the the ABI check below, | ||
# the armv7l wheels can be installed. | ||
arch = "armv7l" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This boils down to the fact that PyPI only accepts armv7l
for now.
A more future proof way to do this would be to refactor _have_compatible_abi
to return a list of architectures and yield multiple arch per manylinux version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any reason PyPI has that restriction? Or should we ask PyPI to update to accept the newer architecture?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For reference, the architectures accepted by PyPI are defined there : https://github.com/pypi/warehouse/blob/f2b3ed3724b064fab8621960fc8658a867b95e1e/warehouse/forklift/legacy.py#L95-L149
Those architectures were defined through the various PEPs for manylinux/musllinux, they are more or less equivalent to what distros offers, with, in this case, armv7l
==armhf
.
While there's nothing preventing PyPI from accepting other architectures, except maybe going through a new PEP, IMHO, it's not worth adding armv8l
there.
I think the demand for 32-bit ARM wheels is most likely linked to armv7/armhf wheels availability for platforms like RaspberryPI or other embedded systems (e.g. OpenWRT based ones for musllinux).
When it comes to building/testing such armv7l
wheels, there are multiple routes for CI:
- use such an armv7 system but then, you're on your own to manage a self-hosted CI node
- use qemu which is painfully slow
- use an aarch64 system in 32-bit mode, I only tested Travis CI AWS Graviton 2 nodes in 32-bit mode for now but it should also be applicable to at least CirrusCI, Circle CI both using AWS Graviton 2 and the future GitHub-Hosted aarch64 runners.
For that last route, being able to install armv7l
is important, publishing armv8l
wheels probably less so.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be better to yield armv8l
tags followed by armv7l
tags since the former is fully compatible with the latter. That way there's no data loss as well as being able to use the wheels uploaded to PyPI.
src/packaging/_manylinux.py
Outdated
@@ -204,6 +204,11 @@ def _is_compatible(name: str, arch: str, version: _GLibCVersion) -> bool: | |||
|
|||
|
|||
def platform_tags(linux: str, arch: str) -> Iterator[str]: | |||
if arch == "armv8l": | |||
# armv8l wheels are not accepted on PyPI |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# armv8l wheels are not accepted on PyPI | |
# armv8l wheels are not accepted on PyPI. |
fdcf5dc
to
377b114
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but there's unfortunately a merge conflict due to me accepting another of your PRs before getting to this one 😅.
src/packaging/_manylinux.py
Outdated
return _is_linux_i686(executable) | ||
return arch in {"x86_64", "aarch64", "ppc64", "ppc64le", "s390x"} | ||
return len(set(archs) & {"x86_64", "aarch64", "ppc64", "ppc64le", "s390x"}) > 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return len(set(archs) & {"x86_64", "aarch64", "ppc64", "ppc64le", "s390x"}) > 0 | |
return any(arch in {"x86_64", "aarch64", "ppc64", "ppc64le", "s390x"} for arch in archs) |
aarch64 systems running under linux32 emulation will report an armv8l machine rather than armv7l. This shall not prevent packaging to report musllinux/manylinux armv7l compatibiility as long as the running python has a compatible ABI.
@brettcannon, |
Thanks for your patience with this PR! |
This PR contains the following updates: | Package | Update | Change | |---|---|---| | [packaging](https://togithub.com/pypa/packaging) | minor | `==23.1` -> `==23.2` | --- ### Release Notes <details> <summary>pypa/packaging (packaging)</summary> ### [`v23.2`](https://togithub.com/pypa/packaging/releases/tag/23.2) [Compare Source](https://togithub.com/pypa/packaging/compare/23.1...23.2) #### What's Changed - parse_marker should consume the entire source string by [@​mwerschy](https://togithub.com/mwerschy) in [https://github.com/pypa/packaging/pull/687](https://togithub.com/pypa/packaging/pull/687) - Create a Security Policy file by [@​joycebrum](https://togithub.com/joycebrum) in [https://github.com/pypa/packaging/pull/695](https://togithub.com/pypa/packaging/pull/695) - Add python 3.12 to CI by [@​mayeut](https://togithub.com/mayeut) in [https://github.com/pypa/packaging/pull/689](https://togithub.com/pypa/packaging/pull/689) - Remove URL validation from requirement parsing by [@​uranusjr](https://togithub.com/uranusjr) in [https://github.com/pypa/packaging/pull/684](https://togithub.com/pypa/packaging/pull/684) - Add types for packaging.version.\_Version by [@​hauntsaninja](https://togithub.com/hauntsaninja) in [https://github.com/pypa/packaging/pull/665](https://togithub.com/pypa/packaging/pull/665) - Add PyPy 3.10 to CI by [@​mayeut](https://togithub.com/mayeut) in [https://github.com/pypa/packaging/pull/699](https://togithub.com/pypa/packaging/pull/699) - Remove unused argument in `_manylinux._is_compatible` by [@​mayeut](https://togithub.com/mayeut) in [https://github.com/pypa/packaging/pull/700](https://togithub.com/pypa/packaging/pull/700) - Canonicalize names for requirements comparison by [@​astrojuanlu](https://togithub.com/astrojuanlu) in [https://github.com/pypa/packaging/pull/696](https://togithub.com/pypa/packaging/pull/696) - Add platform tag support for LoongArch by [@​loongson-zn](https://togithub.com/loongson-zn) in [https://github.com/pypa/packaging/pull/693](https://togithub.com/pypa/packaging/pull/693) - Ability to install `armv7l manylinux/musllinux` wheels on `armv8l` by [@​mayeut](https://togithub.com/mayeut) in [https://github.com/pypa/packaging/pull/690](https://togithub.com/pypa/packaging/pull/690) - Include CHANGELOG.rst in sdist by [@​astrojuanlu](https://togithub.com/astrojuanlu) in [https://github.com/pypa/packaging/pull/704](https://togithub.com/pypa/packaging/pull/704) - Update pyupgrade to Python 3.7+ by [@​fangchenli](https://togithub.com/fangchenli) in [https://github.com/pypa/packaging/pull/580](https://togithub.com/pypa/packaging/pull/580) - Fix version pattern pre-releases by [@​deathaxe](https://togithub.com/deathaxe) in [https://github.com/pypa/packaging/pull/705](https://togithub.com/pypa/packaging/pull/705) - Fix typos found by codespell by [@​DimitriPapadopoulos](https://togithub.com/DimitriPapadopoulos) in [https://github.com/pypa/packaging/pull/706](https://togithub.com/pypa/packaging/pull/706) - Support enriched metadata by [@​brettcannon](https://togithub.com/brettcannon) in [https://github.com/pypa/packaging/pull/686](https://togithub.com/pypa/packaging/pull/686) - Correct rST syntax in CHANGELOG.rst by [@​atugushev](https://togithub.com/atugushev) in [https://github.com/pypa/packaging/pull/709](https://togithub.com/pypa/packaging/pull/709) - fix: platform tag for GraalPy by [@​mayeut](https://togithub.com/mayeut) in [https://github.com/pypa/packaging/pull/711](https://togithub.com/pypa/packaging/pull/711) - Document that this library uses a calendar-based versioning scheme by [@​faph](https://togithub.com/faph) in [https://github.com/pypa/packaging/pull/717](https://togithub.com/pypa/packaging/pull/717) - fix: Update copyright date for docs by [@​garrypolley](https://togithub.com/garrypolley) in [https://github.com/pypa/packaging/pull/713](https://togithub.com/pypa/packaging/pull/713) - Bump pip version to avoid known vulnerabilities by [@​joycebrum](https://togithub.com/joycebrum) in [https://github.com/pypa/packaging/pull/720](https://togithub.com/pypa/packaging/pull/720) - Typing annotations fixed in version.py by [@​jolaf](https://togithub.com/jolaf) in [https://github.com/pypa/packaging/pull/723](https://togithub.com/pypa/packaging/pull/723) - parse\_{sdist,wheel}\_filename: don't raise InvalidVersion by [@​SpecLad](https://togithub.com/SpecLad) in [https://github.com/pypa/packaging/pull/721](https://togithub.com/pypa/packaging/pull/721) - Fix code blocks in CHANGELOG.md by [@​edmorley](https://togithub.com/edmorley) in [https://github.com/pypa/packaging/pull/724](https://togithub.com/pypa/packaging/pull/724) #### New Contributors - [@​mwerschy](https://togithub.com/mwerschy) made their first contribution in [https://github.com/pypa/packaging/pull/687](https://togithub.com/pypa/packaging/pull/687) - [@​joycebrum](https://togithub.com/joycebrum) made their first contribution in [https://github.com/pypa/packaging/pull/695](https://togithub.com/pypa/packaging/pull/695) - [@​astrojuanlu](https://togithub.com/astrojuanlu) made their first contribution in [https://github.com/pypa/packaging/pull/696](https://togithub.com/pypa/packaging/pull/696) - [@​loongson-zn](https://togithub.com/loongson-zn) made their first contribution in [https://github.com/pypa/packaging/pull/693](https://togithub.com/pypa/packaging/pull/693) - [@​fangchenli](https://togithub.com/fangchenli) made their first contribution in [https://github.com/pypa/packaging/pull/580](https://togithub.com/pypa/packaging/pull/580) - [@​deathaxe](https://togithub.com/deathaxe) made their first contribution in [https://github.com/pypa/packaging/pull/705](https://togithub.com/pypa/packaging/pull/705) - [@​DimitriPapadopoulos](https://togithub.com/DimitriPapadopoulos) made their first contribution in [https://github.com/pypa/packaging/pull/706](https://togithub.com/pypa/packaging/pull/706) - [@​atugushev](https://togithub.com/atugushev) made their first contribution in [https://github.com/pypa/packaging/pull/709](https://togithub.com/pypa/packaging/pull/709) - [@​faph](https://togithub.com/faph) made their first contribution in [https://github.com/pypa/packaging/pull/717](https://togithub.com/pypa/packaging/pull/717) - [@​garrypolley](https://togithub.com/garrypolley) made their first contribution in [https://github.com/pypa/packaging/pull/713](https://togithub.com/pypa/packaging/pull/713) - [@​jolaf](https://togithub.com/jolaf) made their first contribution in [https://github.com/pypa/packaging/pull/723](https://togithub.com/pypa/packaging/pull/723) - [@​SpecLad](https://togithub.com/SpecLad) made their first contribution in [https://github.com/pypa/packaging/pull/721](https://togithub.com/pypa/packaging/pull/721) - [@​edmorley](https://togithub.com/edmorley) made their first contribution in [https://github.com/pypa/packaging/pull/724](https://togithub.com/pypa/packaging/pull/724) **Full Changelog**: pypa/packaging@23.1...23.2 </details> --- ### Configuration 📅 **Schedule**: Branch creation - "before 4am on the first day of the month" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://togithub.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi4xMDkuNCIsInVwZGF0ZWRJblZlciI6IjM2LjEwOS40IiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->
aarch64
systems running underlinux32
emulation will report anarmv8l
machine rather thanarmv7l
.This shall not prevent packaging to report
musllinux/manylinux armv7l
compatibiility as long as the running python has a compatible ABI.fix #476 (partial)
Some choices were made based on what PyPI accepts today to get a first level of support. A more generic approach would require to refactor some things but would probably be doable as well. I'll comment a bit more inline.