summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Le Cuirot <chewi@gentoo.org>2024-07-25 12:09:21 +0100
committerMichał Górny <mgorny@gentoo.org>2024-08-06 10:30:13 +0200
commit9b2def86a9c7fd8821a5b83df7d250fc4c73540f (patch)
tree817a28c34516b0ca0227660642a85c41848d7e7c /eclass/distutils-r1.eclass
parentcargo.eclass: Shadow flag variables so that LTO filtering remains local (diff)
downloadgentoo-9b2def86a9c7fd8821a5b83df7d250fc4c73540f.tar.gz
gentoo-9b2def86a9c7fd8821a5b83df7d250fc4c73540f.tar.bz2
gentoo-9b2def86a9c7fd8821a5b83df7d250fc4c73540f.zip
distutils-r1.eclass: Use cargo_env when appropriate for flag handling
cargo_env handles linker flags and enables cross-compiling. It also handles LTO filtering, so we can remove that from this eclass. Signed-off-by: James Le Cuirot <chewi@gentoo.org> Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'eclass/distutils-r1.eclass')
-rw-r--r--eclass/distutils-r1.eclass16
1 files changed, 4 insertions, 12 deletions
diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
index 5d9f97474b29..129ba21ab0d4 100644
--- a/eclass/distutils-r1.eclass
+++ b/eclass/distutils-r1.eclass
@@ -1252,7 +1252,9 @@ distutils_pep517_install() {
die "mydistutilsargs are banned in PEP517 mode (use DISTUTILS_ARGS)"
fi
- local config_settings=
+ local cmd=() config_settings=
+ has cargo ${INHERITED} && cmd+=( cargo_env )
+
case ${DISTUTILS_USE_PEP517} in
maturin)
# `maturin pep517 build-wheel --help` for options
@@ -1391,7 +1393,7 @@ distutils_pep517_install() {
local build_backend=$(_distutils-r1_get_backend)
einfo " Building the wheel for ${PWD#${WORKDIR}/} via ${build_backend}"
- local cmd=(
+ cmd+=(
"${EPYTHON}" -m gpep517 build-wheel
--prefix="${EPREFIX}/usr"
--backend "${build_backend}"
@@ -1793,16 +1795,6 @@ distutils-r1_run_phase() {
# bug fixes from Cython (this works only when setup.py is using
# cythonize() but it's better than nothing)
local -x CYTHON_FORCE_REGEN=1
-
- # Rust extensions are incompatible with C/C++ LTO compiler
- # see e.g. https://bugs.gentoo.org/910220
- if has cargo ${INHERITED}; then
- local x
- for x in $(all-flag-vars); do
- local -x "${x}=${!x}"
- done
- filter-lto
- fi
fi
# silence warnings when pydevd is loaded on Python 3.11+