Proposed bitbake syntax simplification


Richard Purdie
 

Hi All,

I shared a patch on the bitbake mailing list to make some syntax generate
warnings, specifically things of the form:

XXX_append += "YYY"
XXX_prepend += "YYY"
XXX_remove += "YYY"

and the ?=, =+, .= and =. variants. This also covers variants with overrides in
there too. It would basically mean that you need to use "=" with the append
operator and friends.

We found one reference of that use in OE-Core and one in meta-intel. There are
others in other layers but the usage isn't that widespread.

Why should we warn against this? The += usage in particular is sometimes used to
add a space so:

XXX_append += "YYY"

and

XXX_append = " YYY"

are equivalent but this is more of an accident rather than a specific bitbake
design. It is extremely confusing to new users and has been complained about
before as an issue effecting usability. New users often think that += will stack
the append strings much like += does on a normal variable but that is not the
case and can lead to confusion.

I'm been looking at ways we can simplify without hurting functionality and
having this slightly obscure usage doesn't really seem to help much. If we agree
to do this, I would make it an error in due course after users have seen the
warnings for a while. I'd probably want to do that before the LTS next year.

Cheers,

Richard

Join {openembedded-architecture@lists.openembedded.org to automatically receive all group messages.