[bitbake-devel] suddenly confused by appends and overrides being used together
Robert P. J. Day
rpjday at crashcourse.ca
Sat Mar 7 16:16:45 UTC 2015
thought i understood how appending and overrides work together but a
simple example suggests i have no clue. from the in-progress bitbake
user manual here:
http://www.yoctoproject.org/docs/latest/bitbake-user-manual/bitbake-user-manual.html
section 3.2.3, this first example looks right (start excerpt):
OVERRIDES = "foo"
A = "Z"
A_foo_append = "X"
For this case, A is unconditionally set to "Z" and "X" is
unconditionally and immediately appended to the variable A_foo.
Because overrides have not been applied yet, A_foo is set to "X" due
to the append and A simply equals "Z"." (end of manual excerpt)
ok, i buy that ... A is set to "Z", and the statement after that
then appends "X" to the variable (in this case) A_foo. and, if i
understand this properly, that string "A_foo" has no special override
processing because it was, in a sense, protected by the _append
operator. so using chris larson's "bb" utility i can verify:
$ bb show A
A="Z"
$ bb show A_foo
A_foo="X"
however, i'm confused by the statement above, "Because overrides
have not been applied yet, ...". well, it's not so much that the
overrides haven't been applied "yet" as that they will *not* be
applied in this case, correct? in what way will assigning something to
the expression "A_foo_append" have any effect on the final value of A?
the next example in the manual right below that also looks correct,
as the override is the *last* part of the LHS expression and is
therefore(?) processed immediately and has an effect:
"This next example changes the order of the override and the append:
OVERRIDES = "foo"
A = "Z"
A_append_foo = "X"
For this case, before overrides are handled, A is set to "Z" and
A_append_foo is set to "X". Once the override for "foo" is applied,
however, A gets appended with "X". Consequently, A becomes "ZX".
Notice that spaces are not appended. (end of excerpt)
and i accept all that as well, as shown by "bb":
$ bb show A
A="ZX"
$ bb show A_foo
WARNING: Requested variable 'A_foo' does not exist
but it's the next example that's confusing:
"This next example has the order of the appends and overrides reversed
back as in the first example:
OVERRIDES = "foo"
A = "Y"
A_foo_append = "Z"
A_foo_append += "X"
For this case, before any overrides are resolved, A is set to "Y"
using an immediate assignment. After this immediate assignment, A_foo
is set to "Z", and then further appended with "X" leaving the variable
set to "Z X". Finally, applying the override for "foo" results in the
conditional variable A becoming "Z X" (i.e. A is replaced with A_foo).
(end of excerpt)
um ... what? in what way is this any different from the *first*
example above, for which the final values are:
$ bb show A
A="Y"
$ bb show A_foo
A_foo="Z X"
so, no, the final value of A is not "Z X" as the above suggests. am
i misreading this? am i getting misleading answers from "bb"? i'm
having trouble seeing the value of the expression:
VAR_<override>_append = ...
where i just don't see how that will have any effect on the final
value of VAR.
rday
--
========================================================================
Robert P. J. Day Ottawa, Ontario, CANADA
http://crashcourse.ca
Twitter: http://twitter.com/rpjday
LinkedIn: http://ca.linkedin.com/in/rpjday
========================================================================
More information about the bitbake-devel
mailing list