From: James Le Cuirot <chewi@gentoo.org>
To: gentoo-dev <gentoo-dev@lists.gentoo.org>
Cc: James Le Cuirot <chewi@gentoo.org>
Subject: [gentoo-dev] [PATCH 5/5 v3] distutils-r1.eclass: Use cargo_env when appropriate for flag handling
Date: Thu, 25 Jul 2024 12:19:40 +0100 [thread overview]
Message-ID: <20240725112005.10045-11-chewi@gentoo.org> (raw)
In-Reply-To: <20240725112005.10045-3-chewi@gentoo.org>
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>
---
eclass/distutils-r1.eclass | 16 ++++------------
1 file changed, 4 insertions(+), 12 deletions(-)
diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
index fa8edb5cdfb77..743242b2acee8 100644
--- a/eclass/distutils-r1.eclass
+++ b/eclass/distutils-r1.eclass
@@ -1251,7 +1251,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
@@ -1390,7 +1392,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}"
@@ -1792,16 +1794,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+
--
2.45.2
next prev parent reply other threads:[~2024-07-25 11:21 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-25 11:19 [gentoo-dev] [PATCH 1/5 v3] cargo.eclass: Add cargo_env helper and use it in compile, test, install James Le Cuirot
2024-07-25 11:19 ` [gentoo-dev] [PATCH 2/5 v3] cargo.eclass: Handle LDFLAGS and RUSTFLAGS better James Le Cuirot
2024-07-25 11:19 ` [gentoo-dev] [PATCH 3/5 v3] cargo.eclass: Explicitly tell rustc not to strip binaries James Le Cuirot
2024-07-25 11:19 ` [gentoo-dev] [PATCH 4/5 v3] cargo.eclass: Shadow flag variables so that LTO filtering remains local James Le Cuirot
2024-07-25 11:50 ` Sam James
2024-07-25 11:19 ` James Le Cuirot [this message]
2024-07-25 11:48 ` [gentoo-dev] [PATCH 1/5 v3] cargo.eclass: Add cargo_env helper and use it in compile, test, install Sam James
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240725112005.10045-11-chewi@gentoo.org \
--to=chewi@gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox