public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Subject: Re: [gentoo-dev] [PATCH 2/2] cargo.eclass: Preserve project-specific [build] flags by reading config
Date: Thu, 08 Aug 2024 04:17:53 +0200	[thread overview]
Message-ID: <d7980c83a3003c54201f50abf3de61407acdd5f3.camel@gentoo.org> (raw)
In-Reply-To: <95535f7206f0ab02c70444e37c29dbcb073554f2.camel@gentoo.org>

[-- Attachment #1: Type: text/plain, Size: 1770 bytes --]

On Wed, 2024-08-07 at 21:19 +0100, James Le Cuirot wrote:
> On Wed, 2024-08-07 at 19:39 +0200, Michał Górny 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 any
> > > generic [build] flags set by the project, requiring ebuilds to set these
> > > 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.
> > > 
> > > Signed-off-by: James Le Cuirot <chewi@gentoo.org>
> > > ---
> > >  eclass/cargo.eclass | 28 +++++++++++++++++-----------
> > >  1 file changed, 17 insertions(+), 11 deletions(-)
> > > 
> > > 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
> > >  
> > >  inherit flag-o-matic multiprocessing rust-toolchain toolchain-funcs
> > >  
> > > -[[ ! ${CARGO_OPTIONAL} ]] && BDEPEND="${RUST_DEPEND}"
> > > +# app-misc/yq is needed for tomlq.
> > > +[[ ! ${CARGO_OPTIONAL} ]] && BDEPEND="${RUST_DEPEND} app-misc/yq"
> > >  
> > 
> > Doesn't this imply that all ebuilds using CARGO_OPTIONAL will now have
> > to explicitly depend on yq?
> 
> 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.
> 

Still, this sounds like hardcoding implementation details into ebuilds,
and implementation details can change over time.

-- 
Best regards,
Michał Górny


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 512 bytes --]

      parent reply	other threads:[~2024-08-08  2:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-07 15:52 [gentoo-dev] [PATCH 0/2] cargo.eclass: Change RUSTFLAGS approach following recent build failures James Le Cuirot
2024-08-07 15:52 ` [gentoo-dev] [PATCH 1/2] " James Le Cuirot
2024-08-07 15:52 ` [gentoo-dev] [PATCH 2/2] cargo.eclass: Preserve project-specific [build] flags by reading config James Le Cuirot
2024-08-07 17:39   ` Michał Górny
2024-08-07 20:19     ` James Le Cuirot
2024-08-07 22:42       ` Ionen Wolkens
2024-08-08  2:17       ` Michał Górny [this message]

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=d7980c83a3003c54201f50abf3de61407acdd5f3.camel@gentoo.org \
    --to=mgorny@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