All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
To: Richard Purdie <richard.purdie@linuxfoundation.org>,
	Jose Quaresma <quaresma.jose@gmail.com>
Cc: OE-core <openembedded-core@lists.openembedded.org>
Subject: RE: [OE-core] [PATCH] externalsrc.bbclass: Allow externalsrc to be extended with extra classes
Date: Wed, 20 Oct 2021 12:42:08 +0000	[thread overview]
Message-ID: <b03ac354b3ea439890dc320bca27de6c@axis.com> (raw)
In-Reply-To: <4a4329e7ec5640aea90f15d5d851becd548b69c7.camel@linuxfoundation.org>

> -----Original Message-----
> From: openembedded-core@lists.openembedded.org <openembedded-
> core@lists.openembedded.org> On Behalf Of Richard Purdie
> Sent: den 20 oktober 2021 13:22
> To: Peter Kjellerstedt <peter.kjellerstedt@axis.com>; Jose Quaresma
> <quaresma.jose@gmail.com>
> Cc: OE-core <openembedded-core@lists.openembedded.org>
> Subject: Re: [OE-core] [PATCH] externalsrc.bbclass: Allow externalsrc to
> be extended with extra classes
> 
> On Wed, 2021-10-20 at 10:57 +0000, Peter Kjellerstedt wrote:
> > > -----Original Message-----
> > > From: Richard Purdie <richard.purdie@linuxfoundation.org>
> > > Sent: den 20 oktober 2021 11:59
> > > To: Peter Kjellerstedt <peter.kjellerstedt@axis.com>; Jose Quaresma
> > > <quaresma.jose@gmail.com>
> > > Cc: OE-core <openembedded-core@lists.openembedded.org>
> > > Subject: Re: [OE-core] [PATCH] externalsrc.bbclass: Allow externalsrc
> to
> > > be extended with extra classes
> > >
> > > On Wed, 2021-10-20 at 09:09 +0000, Peter Kjellerstedt wrote:
> > > > I thought of another problem with the wrapper class solution: if we
> > > > needto actually backport a newer version of the class from, e.g.,
> > > > Poky master, then there is now no natural place for it since it is
> > > > occupied by the wrapper class. That means we would either have to
> > > > rename the backported class, or put it somewhere else than in
> > > > "classes". It also means backporting a class requires the wrapper
> > > > class to be modified.
> > > >
> > > > Here is a question for Richard: what do you think of an idea I had
> to
> > > > add support in bitbake for extending classes? I do not mean to add
> > > > something like bbclassappend, as I know that is troublesome. My idea
> > > > instead is something like the prefuncs/postfuncs that we have for
> > > > functions. I.e., before actually doing the inherit of a classfoo,
> > > > bitbake would inherit anything specified in BBCLASS_PRE_INHERIT:foo,
> > > > and after inheriting the class it would automatically inherit
> > > > anything in BBCLASS_POST_INHERIT:foo.  That way one can simply
> extend
> > > > a class through normal variable operations, making it easy to do,
> > > > e.g., in the distro configuration.
> > >
> > > That sounds very like a bbclassappend under a different name?
> > >
> > > Cheers,
> > >
> > > Richard
> >
> > Well, I guess it is similar to what a bbclassappend file suffix would Do
> we
> > want to allow users to do whatever
> > entail, but more flexible and controlled. Do you think something like
> > this would work, or have I missed some technical problems that would
> > prevent it? And if you think it is technically possible, would you be
> > willing to accept a patch that implements it?
> 
> How is it more flexible and controlled? We'd swap a concept most users
> understand (bbappend) for one that is less obvious and more complex.

More flexible in that it allows prepending changes as well as appending them.
More controlled in that it is not automatically applied the way bbappends are 
just by including a layer (which I believe is good from a Yocto Compatible 
standpoint). You actually need to set the variables, which, e.g., can be done 
differently in different distro files.

> The issue with bbclassappend was never a technical one, it is a question
> of policy. We already allow users to do pretty much anything to the system
> but the question is how easy we make certain things. We've tended to believe 
> that encouraging class changes back to their parent classes was a good thing
> overall.

And I absolutely agree that changes that are relevant for upstream should 
be upstreamed. But just like bbappends, not all changes are relevant for 
upstream. 

In our case we have this unittest class that is an extension of native and 
it is typically used by adding to BBCLASSEXTEND. It is used to run our 
unit tests as native, which makes them extremely quick to run. However, this 
is IMHO a horrible hack that I wish we had never invented, but it is what 
we have and I do not see an easy way out of it. So obviously I do not want 
to upstream this, but at the same time we need to make some adoptions to 
upstream classes to handle unittest where there are hardcoded tests for 
native, like in the externalsrc class.

> You are basically saying we no longer want to do that and stop encouraging
> people to do it. I'm not sure that is true, quite the opposite.
> 
> We actively chose not to implement bbclassappend and I'm not sure the
> underlying reasons for doing that have changed.

I definitely do not want to change the policy that changes that can be 
upstreamed should be upstreamed. However, I do see a need for supporting 
changes that cannot be upstreamed. And sure, there are always workarounds; 
we can manage with an externalsrc wrapper class, so it is not like we 
cannot proceed, but it would have been nicer to use an officially supported 
method for extending classes rather than hacking around it.

So, I will not push for this change. I think it would have been nice with 
an official way to extend classes and I am willing to implement it, but if 
you think it is too much of an issue and stops encouraging people to 
upstream their changes, then we will make do with the workarounds. It is 
not like we have to backport that many classes, so it is definitely 
manageable, albeit a bit inconvenient.

> Cheers,
> 
> Richard

//Peter


  reply	other threads:[~2021-10-20 12:42 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-19 17:03 [PATCH] externalsrc.bbclass: Allow externalsrc to be extended with extra classes Peter Kjellerstedt
2021-10-19 17:15 ` [OE-core] " Jose Quaresma
2021-10-20  1:31   ` Peter Kjellerstedt
     [not found]   ` <16AF9916496D59D2.6466@lists.openembedded.org>
2021-10-20  9:09     ` Peter Kjellerstedt
2021-10-20  9:58       ` Richard Purdie
2021-10-20 10:57         ` Peter Kjellerstedt
2021-10-20 11:21           ` Richard Purdie
2021-10-20 12:42             ` Peter Kjellerstedt [this message]
2021-10-20 12:58               ` Alexander Kanavin
2021-10-20 20:39       ` Douglas Royds

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=b03ac354b3ea439890dc320bca27de6c@axis.com \
    --to=peter.kjellerstedt@axis.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=quaresma.jose@gmail.com \
    --cc=richard.purdie@linuxfoundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.