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


Robert P. J. Day
 

On Sat, 8 Feb 2020, Jonatan Palsson wrote:

Hello Robert & Leon,

So I think it might be harmful to replace it with "=", as it would no
longer provide libpcre.
I had a look at the variable expansions bitbake -e. Here are two
examples. The vim recipe uses "PROVIDES = xxd" (which would cause
weird effects if = simply overwrote any existing ${PN} value), and the
libpcre2 recipe uses "PROVIDES += pcre2", as already mentioned.

vim:
# $PROVIDES [4 operations]
# set ... /poky/meta/conf/bitbake.conf:275
# ""
# _prepend ... /poky/meta/conf/bitbake.conf:276
# "${PN} "
# set ... /poky/meta/conf/documentation.conf:335
# [doc] "A list of aliases that a recipe also provides. ... SNIP ...
# set ... /poky/meta/recipes-support/vim/vim_8.2.bb:3
# "xxd"
# pre-expansion value:
# "${PN} xxd"
PROVIDES="vim xxd"

libpcre2:
# $PROVIDES [4 operations]
# set ... /poky/meta/conf/bitbake.conf:275
# ""
# _prepend ... /poky/meta/conf/bitbake.conf:276
# "${PN} "
# set ... /poky/meta/conf/documentation.conf:335
# [doc] "A list of aliases that a recipe also provides. ... SNIP ....
# append ... /poky/meta/recipes-support/libpcre/libpcre2_10.33.bb:24
# "pcre2"
# pre-expansion value:
# "${PN} pcre2"
PROVIDES="libpcre2 pcre2"
argh ... that is, of course, what i should have done first, just
check the environment for the recipe. ok, that pretty much confirms
that, barring some exceptional circumstances, most instances of
"PROVIDES +=" are not harmful, just redundant.

rday

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