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 7A1D2159C9B for ; Wed, 7 Aug 2024 22:42:15 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id F2377E2D24; Wed, 7 Aug 2024 22:42:10 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 96BAFE2D21 for ; Wed, 7 Aug 2024 22:42:10 +0000 (UTC) Date: Wed, 7 Aug 2024 18:42:06 -0400 From: Ionen Wolkens To: gentoo-dev@lists.gentoo.org Subject: Re: [gentoo-dev] [PATCH 2/2] cargo.eclass: Preserve project-specific [build] flags by reading config Message-ID: Mail-Followup-To: gentoo-dev@lists.gentoo.org References: <20240807160221.1035675-1-chewi@gentoo.org> <20240807160221.1035675-3-chewi@gentoo.org> <95535f7206f0ab02c70444e37c29dbcb073554f2.camel@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-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="/HEuAa6A3I04O4kZ" Content-Disposition: inline In-Reply-To: <95535f7206f0ab02c70444e37c29dbcb073554f2.camel@gentoo.org> X-Archives-Salt: 51765e89-a0ad-4894-b608-d1ca1a415276 X-Archives-Hash: 76bd34e78207afbfdc5898509da39909 --/HEuAa6A3I04O4kZ Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Aug 07, 2024 at 09:19:36PM +0100, James Le Cuirot wrote: > On Wed, 2024-08-07 at 19:39 +0200, Micha=C5=82 G=C3=B3rny wrote: > > On Wed, 2024-08-07 at 16:52 +0100, James Le Cuirot wrote: > > > The flags we set an a target-specific environment variable override a= ny > > > generic [build] flags set by the project, requiring ebuilds to set th= ese > > > themselves, which is undesirable. Work around this by using tomlq to > > > read the flags from the config files checked by Cargo and prepending > > > them to our environment variable. > > >=20 > > > Signed-off-by: James Le Cuirot > > > --- > > > eclass/cargo.eclass | 28 +++++++++++++++++----------- > > > 1 file changed, 17 insertions(+), 11 deletions(-) > > >=20 > > > diff --git a/eclass/cargo.eclass b/eclass/cargo.eclass > > > index 6d4cf1b425eb..dea8c49e4585 100644 > > > --- a/eclass/cargo.eclass > > > +++ b/eclass/cargo.eclass > > > @@ -36,7 +36,8 @@ esac > > > =20 > > > inherit flag-o-matic multiprocessing rust-toolchain toolchain-funcs > > > =20 > > > -[[ ! ${CARGO_OPTIONAL} ]] && BDEPEND=3D"${RUST_DEPEND}" > > > +# app-misc/yq is needed for tomlq. > > > +[[ ! ${CARGO_OPTIONAL} ]] && BDEPEND=3D"${RUST_DEPEND} app-misc/yq" > > > =20 > >=20 > > Doesn't this imply that all ebuilds using CARGO_OPTIONAL will now have > > to explicitly depend on yq? >=20 > Good catch, thanks. I can update the eclass docs accordingly. I count 23 > ebuilds across 8 packages, and this can be done without a revbump, so it'= s not > too bad. Even if it were missing, it would just continue without applying > these extra flags. Probably no reason to not just add it to RUST_DEPEND, some ebuilds already use that variable with OPTIONAL. Albeit yeah, it's not documented nor required to use it at the moment. >=20 > I have also noticed that yq will need some keywording first. >=20 > I considered some inline Python with just tomli instead, but then you get= into > the mess of micro-managing the Python versions. I don't think there's a w= ay to > say "use whatever Python tomli is installed for". If want to use python, I think simplest would the equivalent of meson.eclass' dev-build/meson-format-array. Then the ebuild could handle all the dependencies rather than the eclass. Could be handy to pull less dependencies, with >=3Dpython3.11 can use the stdlib's tomllib rather than tomli too, be very low footprint. But is it really worth it over just using yq? I don't know :) --=20 ionen --/HEuAa6A3I04O4kZ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEx3SLh1HBoPy/yLVYskQGsLCsQzQFAmaz+D4ACgkQskQGsLCs QzTVawgAjEndJZqlRXhTPSHk5Ow72t6cNbBRQEfRDJplogUGhHlPUdjBtXPKjVil cb9QzbukuCHwjpKniAft6P2U/ja6iItb41/DKH02hubLNMqy0CGPoUNSi3PbrDUf 1ySjBRTL2wa88Q+Sn82eT8/BJEdKBUtdn1Ue60vKso+P6QZLXcVTAZtx4KyPwuiu 9T1TkJnC8c+8xylCEH1TizwgUGjjvIJ0D/GjvDl+fiBDL64I8AbP0nfSb9P/Izh/ 8bQBHJJpQhBStbxee4m95ECtHesY6dnHDcP5KMnwtqKCULI3JdvuNJ4bcbmsrKyZ gEssm+PoMRB9QHkDS1xZTpVWu5XF6w== =f3e7 -----END PGP SIGNATURE----- --/HEuAa6A3I04O4kZ--