<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/poky.git/bitbake/lib/bb/parse/ast.py, branch scarthgap-5.0.15</title>
<subtitle>Mirror of git.yoctoproject.org/poky</subtitle>
<id>https://git.enea.com/cgit/linux/poky.git/atom?h=scarthgap-5.0.15</id>
<link rel='self' href='https://git.enea.com/cgit/linux/poky.git/atom?h=scarthgap-5.0.15'/>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/'/>
<updated>2025-06-11T15:17:34+00:00</updated>
<entry>
<title>bitbake: ast: Change deferred inherits to happen per recipe</title>
<updated>2025-06-11T15:17:34+00:00</updated>
<author>
<name>Richard Purdie</name>
<email>richard.purdie@linuxfoundation.org</email>
</author>
<published>2025-06-06T10:44:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=320b76cc477069d619fd44d28608d9d2c1efe77c'/>
<id>urn:sha1:320b76cc477069d619fd44d28608d9d2c1efe77c</id>
<content type='text'>
Currently deferred inherits get processed once for all class extensions
as a minor speed optimisation. Unfortunately this limits our options for
being able to report deferred classes to our code.

There are two challenges with using our deferred classes in OE at present.
One is that PACKAGECONFIG values don't work well with class overrides like
class-native if there are deferred classes based on PACKAGECONFIG, such
as python support. The second is that toolchain selection is proving
problematic to implement due to interactions between the toolchain deferred
inherit, the class extensions and class overrides being very late.

By changing deferred inherits to be recipe extension specific, we open
the way to generate events and "peek" at where things will end up,
allowing the class overrides to be set earlier.

The class extension code is updated to use a deferred inherit for the
class extension inheriting so that it is still inherited last.

(Bitbake rev: 139f61fe9eec221745184a14b3618d2dfa650b91)

Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
Signed-off-by: Steve Sakoman &lt;steve@sakoman.com&gt;
</content>
</entry>
<entry>
<title>bitbake: ast/BBHandler: Add inherit_defer support</title>
<updated>2024-01-18T10:15:58+00:00</updated>
<author>
<name>Richard Purdie</name>
<email>richard.purdie@linuxfoundation.org</email>
</author>
<published>2023-12-31T13:29:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=c56fce9e5621bf4353eb112a2555be7aadb048e6'/>
<id>urn:sha1:c56fce9e5621bf4353eb112a2555be7aadb048e6</id>
<content type='text'>
Add support for an inherit_defer statement which works as
inherit does but is only evaulated at the end of parsing.

This allows conditional expressions to be evaulated 'late' meaning changes
to PACKAGECONFIG from bbappends can be applied for example. This addresses
a usability/confusion issue users have with the current conditional
inherit mechanism since they don't realise the condition has to be
expanded immediately with the current model.

There is a commented out warning we could enable in future which
warns about the use of a conditional inherit that isn't deferred.

There is a behaviour difference in the placement of the inherit,
particularly around variables set using ?= which means wen swapping
from one to the other, caution must be used as values can change.

(Bitbake rev: 5c2e840eafeba1f0f754c226b87bfb674f7bea29)

Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>bitbake: ast: Fix EXPORT_FUNCTIONS bug</title>
<updated>2024-01-10T13:55:33+00:00</updated>
<author>
<name>Richard Purdie</name>
<email>richard.purdie@linuxfoundation.org</email>
</author>
<published>2024-01-09T13:47:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=c665a2c93337fc372207af604c21bdea5babb4e5'/>
<id>urn:sha1:c665a2c93337fc372207af604c21bdea5babb4e5</id>
<content type='text'>
If you have two classes, both of which set EXPORT_FUNCTIONS for the same funciton
and a standard funciton definition for the function that is exported, the export
function can sometimes overwrite the standard one.

The issue is that the internal flag the code uses isn't ovweritten if the variable
is giving a new value. Fix the issue by using a comment in the code that is injected
so that we know if it is ours or not.

Also add some testing for EXPORT_FUNCTIONS, not perfect but a start.

(Bitbake rev: 66306d5151acb0a26a171c338d8f60eb9eb16c6b)

Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>bitbake: fetch2: Add autorev warning when it is set too late</title>
<updated>2023-03-22T13:57:04+00:00</updated>
<author>
<name>Richard Purdie</name>
<email>richard.purdie@linuxfoundation.org</email>
</author>
<published>2023-03-21T14:48:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=04c27888d05e16791cfb5ebc3b51f9f02923775b'/>
<id>urn:sha1:04c27888d05e16791cfb5ebc3b51f9f02923775b</id>
<content type='text'>
Bitbake expects a consistent metadata environment when it parses. There
are plenty of ways you can set a recipe to autorev at a point where parts
of the fetcher have already been triggered leading to obsure bugs which
I struggled to debug, let alone anyone not familar with the code.

If anyone is running into the message from the commit, the issue is
likely one of timing. Keep in mind that the anonymous python code
in base.bbclass will expand variables like FILESPATH, WORKDIR and others
which contain PV. The recipe needs to be set to AUTOREV before that
anonymous python runs.

In particular, that means you can't set SRCREV = "${AUTOREV}" in other
anonymous python, it needs to happen earlier.

(Bitbake rev: 4d9ec332d5bfc8b60b54f8ec2a17d34e35aa903a)

Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>bitbake: ast/data/codeparser: Add dependencies from python module functions</title>
<updated>2022-12-17T08:52:28+00:00</updated>
<author>
<name>Richard Purdie</name>
<email>richard.purdie@linuxfoundation.org</email>
</author>
<published>2022-11-27T21:16:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=f3bcd3c9a91f6212c30b9c778c11f3c8a9f6f1d4'/>
<id>urn:sha1:f3bcd3c9a91f6212c30b9c778c11f3c8a9f6f1d4</id>
<content type='text'>
Moving code into python modules is a very effective way to reduce parsing
time and overhead in recipes. The downside has always been that any
dependency information on which variables those functions access is lost
and the hashes can therefore become less reliable.

This patch adds parsing of the imported module functions and that dependency
information is them injected back into the hash dependency information.

Intermodule function references are resolved to the full function
call names in our module namespace to ensure interfunction dependencies
are correctly handled too.

(Bitbake rev: 605c478ce14cdc3c02d6ef6d57146a76d436a83c)

(Bitbake rev: 91441e157e495b02db44e19e836afad366ee8924)

Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>bitbake: parse: Add support for addpylib conf file directive and BB_GLOBAL_PYMODULES</title>
<updated>2022-12-08T11:15:47+00:00</updated>
<author>
<name>Richard Purdie</name>
<email>richard.purdie@linuxfoundation.org</email>
</author>
<published>2022-11-27T17:08:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=42e8b2682f56f450c1258956213198052d6bcb96'/>
<id>urn:sha1:42e8b2682f56f450c1258956213198052d6bcb96</id>
<content type='text'>
For many years OE-Core has injected it's own python modules into the
python namespace using an immediate expansion of a variable in base.bbclass.
It also added all entries from BBPATH to sys.path.

We really need this to become a first class citizen of the langauge, this new
addpylib directive allows that. Usage is of the form:

addpylib &lt;directory&gt; &lt;namespace&gt;

The namespace is imported and if there is an attribute BBIMPORT, that
list of names is iterated and imported too.

This mirrors what OE-Core has done for a long time with one difference in
implmentation, sys.path is only appended to. This means later imported
namespaces can't overwrite an earlier one and can't overwrite the main
python module space. In practice we've never done that and it isn't
something we should encourage or support.

The new directive is only applied for .conf files and not other filetypes
as it only makes sense in that context. It is also only allowed in the
"base configuration" context of cookerdata since adding it at the recipe
level wouldn't work properly due to the way it changes the global namespace.

At the same time, move the list of modules to place in the global namespace
into a BB_GLOBAL_PYMODULES variable. It is intended that only the core layer
should touch this and it is meant to be a very small list, usually os and sys.
BB_GLOBAL_PYMODULES is expected to be set before the first addpylib directive.

Layers adding a lib directory will now need to use this directive as BBPATH
is not going to be added automatically by OE-Core in future. The directives are
immediate operations so it does make modules available sooner than the current
OE-Core approach.

The new code appends to sys.path rather than prepends as core did, as
overwriting python standard library modules would be a bad idea and naturally
encouraging people to collaborate around our own core modules is desireable.

(Bitbake rev: afb8478d3853f6edf3669b93588314627d617d6b)

Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>bitbake: ast: Improve function flags handling for EXPORT_FUNCTIONS</title>
<updated>2022-04-14T08:48:33+00:00</updated>
<author>
<name>Richard Purdie</name>
<email>richard.purdie@linuxfoundation.org</email>
</author>
<published>2021-11-16T17:51:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=73fa855f6af5ef9c3a78656aa56f09d213601be2'/>
<id>urn:sha1:73fa855f6af5ef9c3a78656aa56f09d213601be2</id>
<content type='text'>
Currently, if you use one of the functions from EXPORT_FUNCTIONS,
the meaning of cleandirs and fakeroot are lost. This leads to the function
changing in behaviour depending upon it's caller context. This isn't intended
so add mapping for the cleandirs and fakeroot flags too.

This does break devtool in OE-Core and there is a separate fix for that.

[YOCTO #8621]

(Bitbake rev: b074f4aff00923acc5bf6649d204d541a79fd2b6)

Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>bitbake: lib/bb: fix exit when found renamed variables</title>
<updated>2022-02-21T23:37:26+00:00</updated>
<author>
<name>Marta Rybczynska</name>
<email>rybczynska@gmail.com</email>
</author>
<published>2022-02-21T17:44:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=da4c443ac5ae7024d053f7e224c576f750a90085'/>
<id>urn:sha1:da4c443ac5ae7024d053f7e224c576f750a90085</id>
<content type='text'>
Until now, if a renamed variable was found, bitbake exited
immediately if it was in a class, but continued after an error
message if the variable was in a recipe. This was caused by
cookerdata.py CookerDataBuilder::parseBaseConfiguration checking
a different DataSmart instance than the variable was set in.
To solve the issue, add a special variable and set it when we
find a renamed variable. Check for it in ast.py and bail out
if needed.

(Bitbake rev: d12400600e30549c88dc9e7883dc3d63b1dc1117)

Signed-off-by: Marta Rybczynska &lt;marta.rybczynska@huawei.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>bitbake: parse/ast: Show warnings for append/prepend/remove operators combined with +=/.=</title>
<updated>2021-11-10T19:25:38+00:00</updated>
<author>
<name>Richard Purdie</name>
<email>richard.purdie@linuxfoundation.org</email>
</author>
<published>2021-11-04T13:37:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=02f36dc832ae786dd0f790d86820611a71f0b960'/>
<id>urn:sha1:02f36dc832ae786dd0f790d86820611a71f0b960</id>
<content type='text'>
Operations like XXX:append += "YYY" are almost always wrong and this
is a common mistake made in the metadata. Show warnings for these usages
with a view to making it a fatal error eventually.

(Bitbake rev: 8c31e75557dc6a8d8f407b5d24d6327889a3e3b1)

Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>bitbake: bitbake: Switch to using new override syntax</title>
<updated>2021-08-02T14:44:10+00:00</updated>
<author>
<name>Richard Purdie</name>
<email>richard.purdie@linuxfoundation.org</email>
</author>
<published>2021-07-25T21:23:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=2abf8a699edd513405befbd1a0eafc8f55d6b514'/>
<id>urn:sha1:2abf8a699edd513405befbd1a0eafc8f55d6b514</id>
<content type='text'>
This change updates the datastore to use the new override syntax using
colons instead of underscores exclusively. It is expected layers would
have to be converted to work with bitbake after this change.

Supporting mixed syntax isn't possible, it is only feasible to have
one internal representation of overrides.

Whilst we can't warn for every possible override that may be set in the
old format, show errors for _append/_prepend/_remove since those should
never be present.

(Bitbake rev: 7dcf317cc141dc980634f8c18bfa84f83e57206a)

Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
</feed>
