All of lore.kernel.org
 help / color / mirror / Atom feed
* What is the motivation behind the "??=" weak default value operator?
@ 2019-03-09 22:03 Loïc Domaigné
  0 siblings, 0 replies; only message in thread
From: Loïc Domaigné @ 2019-03-09 22:03 UTC (permalink / raw)
  To: yocto

Salut, 

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!

Cheers!
ljd, 0x5f375a86


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-03-09 22:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-09 22:03 What is the motivation behind the "??=" weak default value operator? Loïc Domaigné

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.