Re: OVERRIDES v2


Richard Purdie
 

On Mon, 2021-04-26 at 11:46 +0200, Quentin Schulz wrote:
Hi all,

I submitted a presentation about OVERRIDES, _append, +=, =. and others
for YP Summit 2021 in a month. While sharing the description with some
people in the Yocto community, I've been made aware that I'm missing
some (history) bits about OVERRIDES.

I've been told that it was added as a temporary measure/hack
Not sure who told you that but OVERRIDES has been around since bitbake 
(then oemake) was split out from openembedded which is probably around 2004.

and that some had tried to get it removed/reconsidered back in 2015 (been 
given this link: https://www.openembedded.org/wiki/OEDEM_2015#Agenda) but it
was already largely (ab)used?
Reading that agenda item, I suspect I was the one who added and discussed it 
and it was less about removing OVERRIDES and more about considering whether 
there was some better operator/format to clearly differentiate between
a variable name and an override. It was a way to see if anyone had ideas, no
great replacement was identified (but was worth asking IMO).

So now, my questions:
  - why was OVERRIDES implemented in the first place? What was it trying
to resolve?
They're one of the ways OE tried to handle conditional configuration changes
which are needed on a machine or policy (distro) basis and as a way of allowing
customisation. I'd say on balance they've been highly successful at it.

  - why was it considered for removal/reimplementation back in 2015 (or
even earlier?)?
Not removal, considered for reimplementation. Is there a better syntax which
could be used? It is an open question, we've not identified one.

  - what made you decide to not go for it? Already too widely used?
We'd need to demonstrate that there was an issue being solved, that there was
enough of a benefit for people to take any pain of migration. The fact they are
widely used is a big factor.

  - is there something you'd have done differently?
I suspect lots of things. Specifically with overrides, I've personally wondered
about whether a specific operator syntax would make sense.

  - what are you thoughts on OVERRIDES today?
  - is there a plan to code a new implementation of OVERRIDES or a
similar mechanism? If so, what are the ideas you have currently on how
to do it? (hence the clickbait title :) )
I think you might find there was actually a newly coded backend implementation
of overrides around the 2015 timeframe as I quite radically changed the way the
datastore worked behind the scenes. There were some user visible changes but
they were minor and mostly corrections making the behaviour consistent.

What changed behind the scenes was the datastore became dynamic. Previously you
updated OVERRIDES and then called dd.data.update_data(). This was removed in:

http://git.yoctoproject.org/cgit.cgi/poky/commit/bitbake/lib/bb/data_smart.py?id=e7ccd9071233d66afb0bc72774b0032fb8229fe4

We also changed the default on getVar to expand by default in 2016.

Reading the history of:

http://git.yoctoproject.org/cgit.cgi/poky/log/bitbake/lib/bb/data_smart.py

may give some insight.

Another big change was dependency tracking of variables allowing hash calculation
for signatures. We also mandated overrides by lower case, which helps parsing as it
becomes easier for the code to identify or ignore possible overrides.

Basically, we needed those fixes for various reasons such as sstate hashes, or to
fix parsing performance issues but we were able to make the existing APIs mostly
work so we didn't change the user visible side. That removed much of the pressure
to change the user visible implementation.

Just FWIW, much of our parsing speed pain now is in the tons of anonymous python 
people keep adding, thinking little of the overhead about trying to parse it all
for dependencies and run it all...

Whether my presentation is selected does not matter, still curious
nonetheless :)
Cheers,

Richard

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