On 7/4/20 3:18 PM, Jacob Kroon via lists.openembedded.org wrote:
On 7/3/20 4:31 PM, Richard Purdie wrote:
I'm growing increasingly concerned about default value assignments in OE. The basic problem is people don't understand the way default values work and the mechanisms we do have don't let people do all the things they want to do.
I'll pick on the example found by Ross/Jon in meta-arm. If you set:
BB_HASHBASE_WHITELIST += "X"
in layer.conf, the BB_HASHBASE_WHITELIST ?= "Y" from bitbake.conf is lost as by then the variable already has a value. Another user reported the same issue today in irc.
Another example would be whether recipes should set PACKAGECONFIG with "=", "?=" or "??=". All work well for some scenarios and not for others, often depending on whether the user wants to add to or remove from the original value, or change it to something else entirely.
We then have a complete lack of standarisation of how bbclass files set default values.
I don't have a fully thought out solution to all of this at this point. I think it is clear out existing syntax isn't really capable of expressing everything we need though and confusion current reigns.
I was partly responsible for introducing "??=" as a syntax for "default" value. The problem with it is that "+=" doesn't modify it, a deliberate (and necessary) choice at the time which makes it pretty ineffective.
If bitbake started tracking whether an assignment has been used on a given value vs. just += and =+ it would be possible to have an operator which could have a behaviour more in line with what users expect?
Whether that could/should be some new assignment operator, or whether we could "rescue" ??= I'm also not sure. A new operator would certainly be safer.
Does anyone else:
a) Agree there is a usability issue here?
The example you mention with BB_HASHBASE_WHITELIST, it sounds to me like the underlying problem is that the order of file inclusion is not apparent to people, and not that there is any confusion about the ?=/+= operators ?
Here is a crazy idea: merge oe-core/meta/conf/bitbake.conf into oe-core/meta/conf/layer.conf, skip parsing a bitbake.conf altogether, and tell people to put the oe-core layer first in BBLAYERS. Then people can use += in their custom layer.conf's to modify oe-core configuration with expected(?) results. At least to me, that would be a more intuitive order of parsing the configuration files. I'm probably missing something obvious.
I realise now that this will break for instance the inclusion of distro conf's from additional layers.