Internally, it may call `die`, but the effects of such do not trigger
until the subshell completes. This meant that after it dies, meson setup
still runs after the traceback. In fact, the fact that it runs at all is
a problem, because a symptom of it running is that it runs *after* the
"If you need support, [...]" bit, and logs the command line followed by
"ERROR: Cannot find specified native file:".
This makes it quite frustrating to locate the actual error.
Signed-off-by: Eli Schwartz <eschwartz@gentoo.org>
Signed-off-by: Michał Górny <mgorny@gentoo.org>
We call this program many times inside a heredoc. If it fails and runs
`|| die` then the heredoc isn't killed, the main ebuild process is
killed. But by that time possibly dozens of $(meson-format-array ...)'s
have been run, each one printing its own traceback from `die`, which is
quite confusing.
Signed-off-by: Eli Schwartz <eschwartz@gentoo.org>
Signed-off-by: Michał Górny <mgorny@gentoo.org>
After the previous commit, meson.eclass doesn't modify *FLAGS anymore,
which means it is safe again to call other build systems alongside a
single meson-python wheel build.
Signed-off-by: Eli Schwartz <eschwartz@gentoo.org>
Signed-off-by: Michał Górny <mgorny@gentoo.org>
We filter LTO in order to generate meson's machine files describing the
*FLAGS values, with LTO stripped out and replaced by meson's -D b_lto
builtin option. Since the values are frozen into the machine files, the
variables themselves don't need to persist past the end of the function.
We already run setup_meson_src_configure inside a subshell just to avoid
messing with the environment across meson-multilib.eclass calls, and we
do similar in distutils-r1.eclass when invoking the meson-python build
backend. It is simpler and more straightforward if we instead make
setup_meson_src_configure itself avoid side effects -- and we don't want
to use a subshell there anyway.
Signed-off-by: Eli Schwartz <eschwartz@gentoo.org>
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Pass --verify-tags to "gpep517 install-wheel" when a new enough version
is installed along with a new enough version of dev-python/packaging
(which is a PDEPEND).
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Part-of: https://codeberg.org/gentoo/gentoo/pulls/1732
Set PYTHON_USEDEP and PYTHON_SINGLE_USEDEP for sub-phase functions when
running the build in single-impl mode. This ensures parity with
multi-impl mode where these variables are set by python_foreach_impl().
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Part-of: https://codeberg.org/gentoo/gentoo/pulls/1732
distutils_wheel_create() always passes --sysroot to gpep517 whenever
SYSROOT is set, and gpep517 requires the target interpreter's own
_sysconfigdata under it -- even for a pure-Python package. DEPEND only
got PYTHON_DEPS when DISTUTILS_EXT was set, so the build dies whenever
SYSROOT and ROOT diverge and the interpreter isn't in SYSROOT.
Invisible under the common crossdev setup (SYSROOT == ROOT), but
reproducible with plain crossdev by pointing ROOT elsewhere:
ROOT=/some/other/root ${CHOST}-emerge dev-python/pysocks
dies with "should have found one _sysconfigdata file, found []".
Closes: https://bugs.gentoo.org/981568
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Part-of: https://codeberg.org/gentoo/gentoo/pulls/1732
Split DISTUTILS_WHEELS into a separate DISTUTILS_WHEELS array
and DISTUTILS_WHEEL_PATHS associative array, in order to preserve wheel
order. As it turns out, bash took associative arrays seriously and did
implement them as a hash map.
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Part-of: https://codeberg.org/gentoo/gentoo/pulls/1732
Add a safety check verifying whether all the previously built wheels
were built for a Python tag that's not newer than the current
implementation. Given we are always building from the oldest version to
newest, this must always be true and we fail immediately if it is not.
Note that since we're merely checking this particular aspect, we do not
check whether the combination of the Python tag and the ABI tag is
compatible.
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Part-of: https://codeberg.org/gentoo/gentoo/pulls/1732
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>