still confused about _append and OVERRIDES and = and +=, argh
i'm trying to write a more comprehensive tutorial about what's
currently in the bitbake manual, section 2.2.1, "Override and append ordering" and it's becoming clear that i still don't have a handle on this.
by way of intro, this is what got me wondering this morning so does
it make any sense?
meta/recipes-extended/chkconfig/chkconfig_1.3.58.bb:FILES_${PN}_append_linuxstdbase += "${libdir}/lsb"
note the combination of "_append_"? and "+=", which strikes me as redundant, or so i thought until i played with this and now i'm more confused than ever, so i ran some tests wherein i added this to my local.conf:
OVERRIDES .= ":rday"
and started playing with chris larson's "bitbake-env" utility and here's what i learned (for better or worse) based on adding different sets of test settings underneath that in local.conf.
test 1:
BLAH = "A"
$ bitbake-env BLAH BLAH="A" $
totally predictable. movin on ...
test 2:
BLAH = "A"BLAH_rday = "B"
$ bitbake-env BLAH BLAH="B" $
that looks good, it's exactly what i expected given the override.
keep going ...
test 3:
BLAH = "A"BLAH_rday = "B"BLAH_rday = "C"
$ bitbake-env BLAH BLAH="C" $
again, so far, so good -- the second override superseded the first,
correct?
test 4:
BLAH = "A"BLAH_rday = "B"BLAH_rday_append = "C"
$ bitbake-env BLAH BLAH="B" $
????? that confuses me. according to section 2.2.1 in bitbake
manual (very first example):
OVERRIDES = "foo"
A_foo_append = "X"
"In this case, X is unconditionally appended to the variable A_foo. Since foo is an override, A_foo would then replace A."
according to that, i should expect BLAH to have the value "BC", no?
more to the point, i don't see a lot of assignments of the form:
VAR_<overridevalue>_append =
i see *loads* of
VAR_append_<overridevalue> =
which makes much more sense. so how is one supposed to interpret the above based on the explanation in the current bitbake manual?
rday
Signature · 7 lines
========================================================================
Robert P. J. Day Ottawa, Ontario, CANADA
http://crashcourse.ca
Twitter: http://twitter.com/rpjday
LinkedIn: http://ca.linkedin.com/in/rpjday
========================================================================Quoted 17 lines · Robert P. J. Day
again, so far, so good -- the second override superseded the first,
correct?test 4:BLAH = "A"
BLAH_rday= "B"BLAH_rday_append= "C"$ bitbake-env BLAH BLAH="B" $????? that confuses me. according to section 2.2.1 in bitbake
manual (very first example):
Quoted 9 lines
OVERRIDES = "foo"
A_foo_append= "X""In this case, X is unconditionally appended to the variable
A_foo. Since foo is an override,A_foowould then replace A."according to that, i should expect BLAH to have the value "BC", no?
Yeah, as far as I'm aware that's what should have happened, but as you noticed, this form is extremely unusual. Usually if one wants to do this, they just use an immediate operator like .= or += instead of _append. Sounds like a bitbake "bug", but one that one is unlikely to hit in practice. Honestly, we should really cut back on the overuse of _append and _prepend in general, as a janitorial task, if for no other reason than to reduce confusion :)
Signature · 1 line
Christopher Larson
Quoted 24 lines · Chris Larson
On Tue, Jan 1, 2013 at 7:12 AM, Robert P. J. Day <[email protected]> wrote:
again, so far, so good -- the second override superseded the first, correct?test 4:
BLAH = "A"
BLAH_rday= "B"
BLAH_rday_append= "C"$ bitbake-env BLAH
BLAH="B"
$????? that confuses me. according to section 2.2.1 in bitbake manual (very first example):
OVERRIDES = "foo"
A_foo_append= "X"
Quoted 8 lines
"In this case, X is unconditionally appended to the variable
A_foo. Since foo is an override,A_foowould then replace A."according to that, i should expect BLAH to have the value "BC", no?
Yeah, as far as I'm aware that's what should have happened, but as you noticed, this form is extremely unusual.
now that i look at it, i don't think i know of *any* usage of the
form VAR_<override>_append. is it actually used anywhere? if not, i'm just going to omit talking about it in future classes.
rday
Signature · 7 lines
========================================================================
Robert P. J. Day Ottawa, Ontario, CANADA
http://crashcourse.ca
Twitter: http://twitter.com/rpjday
LinkedIn: http://ca.linkedin.com/in/rpjday
========================================================================Quoted 1 line · Robert P. J. Day
and started playing with chris larson's "bitbake-env" utility
Is there any chance of, or interest in, including "bitbake-env" in the Yocto Project?
Quoted 6 lines · Trevor Woerner
Quoted 1 line · Robert P. J. Day
and started playing with chris larson's "bitbake-env" utility
Is there any chance of, or interest in, including "bitbake-env" in the Yocto Project?
Personally, my intent is for it to become part of a subcommand-based bitbake command, which could then be integrated into bitbake, but that depends on interest from Richard. See
https://github.com/kergoth/bb#readmefor the very early prototype, with bitbake-env as its 'show' subcommand.
If there's no interest in that sort of thing, I'd certainly be open to bitbake-env being pulled into the bitbake repository, as there's certainly value/convenience there. For reference, Robert has put together information on it at http://www.crashcourse.ca/wiki/index.php/OE_bitbake-env_utility.
Signature · 1 line
Christopher Larson