[yocto] What is the motivation behind the "??=" weak default value operator?

Loïc Domaigné tech at domaigne.com
Sat Mar 9 14:03:57 PST 2019


I have a question regarding the usage of the weak default value operator ??= 
I do understand the rules associated with this operator, in particular wrt. to the other assignment operators = and ?= 

Could someone shed some lights on why "??=" was introduced in the first place? I couldn't find the relevant thread on the yocto MLs :(

Modulo my little understanding of Yocto, I have worked out a scenario where "??=" would make sense... But not sure if a) this understanding is correct, and b) if it was indeed (one of) the motivation for "??=". I prefer getting "first (developer) hand info" whenever possible :)

possible explanation for "??=":
AFAIK, bitbake will parse configuration files in a certain order, starting from bblayers.conf, then going to the corresponding layer.conf, then bitbake.conf, then the conf/{site,auto,local}.conf etc. If a default value for -- say FOO -- is set using the ?= operator in one of the config file parsed before by bitbake, then there is no way to redefine/customize that default value later on (by the way ?= works). We could set it (using standard = operator), but that might be too strong (for the cases where we want to have another default value if not set). This is where the ??= operator could be very handy. 

Am I on the right track or is it just a nice story? Any pointers (ML thread, source code, explanation) about the motivation behind "??=" operator is greatly appreciated. TIA!

ljd, 0x5f375a86

More information about the yocto mailing list