When choosing the wheel to reuse, prefer the latest wheel that is
compatible with the target. This matches the behavior of Python
installers, and ensures that when both cp312-abi3 and cp315-abi3.abi3t
wheels are available, the latter is preferred.
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Part-of: https://codeberg.org/gentoo/gentoo/pulls/1732
Add explicit support for reusing *-abi3t-* wheels when installing for
freethreading Python. Tested by calling src_compile() in cryptography
twice.
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Part-of: https://codeberg.org/gentoo/gentoo/pulls/1732
Modify the wheel reuse logic to split the tags from the wheel filename,
and match them precisely rather than applying a broad match. Notably,
this fixes handling compressed tag sets, and therefore enables us to
reuse *-abi3.abi3t-* wheels on Python 3.15.
Note that this currently does not strictly following the installer
behavior, as earlier wheels are preferred over later wheels.
For example, for cryptography the *-cp312-abi3-*.whl will be used rather
than the *-cp315-abi3.abi3t-*.whl, if built. In other words, this will
currently make a difference only if you're building for 3.15+3.15t with
no earlier implementations.
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Part-of: https://codeberg.org/gentoo/gentoo/pulls/1732
Reorder the implementations so that the builds are run in ascending
versions, rather than having all freethreading builds done first. This
still preserves the assumption that for a given Python version,
freethreading build is done before the GIL-enabled build (and therefore
the latter is preferred -- and we want this as long as we consider
freethreading experimental and potentially suboptimal for general use).
However, it also ensures that a newer Python version would not be built
before an earlier version.
This is an assumption we've made when implementing wheel reuse.
Normally, wheels encode the minimum supported Python version using
the Python tag. For example, an ABI3 wheel for Python 3.12+ is named
*-cp312-abi3-*.whl.
However, rather than parsing these tags, we rely on the assumption that
a given Python version needs to be able to run wheels it is building,
so it will not output wheels requiring a newer Python versions.
Therefore, as long as earlier versions are built first, we can assume
that the wheels in the reuse list will be compatible with the subsequent
implementations.
For this assumption to hold, we were relying on the fact that
freethreading builds did not support the limited API, and therefore
could not produce reusable wheels. With Python 3.15, this is no longer
the case and a 3.15t build can produce an *-cp315-abi3.abi3t-*.whl that
is compatible with GIL-enabled Python 3.15, but not lower versions.
This did not explode straight away because our overcautious logic
specifically required *-abi3-*.whl, but it's still worth fixing.
Of course, it would probably be even better to actually look
at the Python tag, but one does not preclude the other.
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Part-of: https://codeberg.org/gentoo/gentoo/pulls/1732
Now with experimental x86_64 support, which opting to enable
right away (please stick to 2.2.3 for now if have issues).
Quite possible overlooked something with all the changes, not
to mention the Makefile is trying harder to do autoconf/meson
and friend's job and may have rough edges.
Signed-off-by: Ionen Wolkens <ionen@gentoo.org>