Re: clarifying "PROVIDES =" versus "PROVIDES +=" (pedantic stuff)


Robert P. J. Day
 

On Tue, 11 Feb 2020, Richard Purdie wrote:

On Tue, 2020-02-11 at 05:32 -0500, rpjday@crashcourse.ca wrote:
second, i think we all agree that it is rarely necessary to use
"PROVIDES +=", although i did run across one case in
recipes-core/glibc/glibc.inc:

PROVIDES = "virtual/libc"
PROVIDES += "virtual/libintl virtual/libiconv"

where, sure, if you break it over more than one line, yes, then you
need it.
I think the original intent was that bitbake.conf defines the basic
PROVIDES/DEPENDS and then the recipes adjust as needed.

As such, PROVIDES and DEPENDS would then always use +=.

Unfortunately over the years this has gotten lost and bitbake.conf
and base.bbclass had to become more inventive about how they set the
defaults for the variables.

As such, I think += actually makes sense but I realise that isn't
the way most recipes work now. We could try and fix that but it does
seem like a marginal gain when there are bigger issues.
oh, i wasn't suggesting any sort of massive cleanup; i just wanted
to make sure i was explaining it properly to any potential students to
make sure they appreciated corner cases like this.

rday

Join yocto@lists.yoctoproject.org to automatically receive all group messages.