From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 47B99159C96 for ; Thu, 25 Jul 2024 18:08:14 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 8AFC02BC06D; Thu, 25 Jul 2024 18:06:39 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 4467B2BC06A for ; Thu, 25 Jul 2024 18:06:39 +0000 (UTC) From: James Le Cuirot To: gentoo-dev Cc: rust@gentoo.org, python@gentoo.org, James Le Cuirot Subject: [gentoo-dev] [PATCH 6/6] distutils-r1.eclass: Use cargo_env when appropriate for flag handling Date: Thu, 25 Jul 2024 19:02:19 +0100 Message-ID: <20240725180612.19453-7-chewi@gentoo.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240725180612.19453-1-chewi@gentoo.org> References: <20240725180612.19453-1-chewi@gentoo.org> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Archives-Salt: a669e82b-643f-4032-b47b-42faa9228a37 X-Archives-Hash: 34215b18481aa544856ba002ff434f36 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 --- 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