Explanation of bitbake variable flags seems confusing
This section in the BitBake manual:
introduces variable flags, and as examples shows usage:
variable = d.getVarFlags("variable")
self.d.setVarFlags("FOO", {"func": True})
then refers the reader for more explanation to:
But that latter section of the manual doesn't expand on what was at the first link, it uses the subscripting form for setting flags, so a beginner might get confused about the sudden change in syntax.
Instead, the additional detail that would follow from that first section is found here further down that page:
but that table is still a bit confusing, as it mixes together both variable access and flag access; I would think that it would be clearer if that table were broken in two, part 1 being variable access and part 2 being flag access explained separately.
[Note: in that table, the description for "d.getVarFlag()" is incorrect, it was clearly just copied from the earlier description of d.getVar()]
In any event, that explanation does seem to be potentially confusing.
Thoughts?
rday
Hi Robert,
Quoted 28 lines · Robert P. J. Day via lists.yoctoproject.org
This section in the BitBake manual:
introduces variable flags, and as examples shows usage:
variable =
d.getVarFlags("variable")
self.d.setVarFlags("FOO", {"func": True})then refers the reader for more explanation to:
But that latter section of the manual doesn't expand on what was at the first link, it uses the subscripting form for setting flags, so a beginner might get confused about the sudden change in syntax.
Instead, the additional detail that would follow from that first section is found here further down that page:
but that table is still a bit confusing, as it mixes together both variable access and flag access; I would think that it would be clearer if that table were broken in two, part 1 being variable access and part 2 being flag access explained separately.
Quoted 8 lines
[Note: in that table, the description for "
d.getVarFlag()" is incorrect, it was clearly just copied from the earlier description ofd.getVar()]In any event, that explanation does seem to be potentially confusing.
Thoughts?
Agreed. One of the issues I have is that it's not clear why {"func": True}
is passed to setVarFlags.
This section (3.7) also only states that the variable flags are used for tasks, but that isn't necessarily true, as those could be used for functions I believe and also to variables (e.g. the [doc] example).
I would also make sure "append" and "prepend" have their operator made explicit (.= and +=, and =. and =+) to avoid the confusion with :append and :prepend (which aren't allowed).
"""
BitBake has a defined set of varflags available for recipes and classes """
is also confusing, it isn't clear what we wanted to say there as we say earlier in the section we use varflags for tasks. Probably would benefit from some rewording :)
Cheers,
Quentin