On Monday, February 23, 2026 at 6:43 PM, Joshua Watt wrote:
> I like this in general, but if you're going to bbappend, the `return`
> will mess with any other appends, so it needs to be avoided. Probably
> just put all the code under a
> `if bb.data.inherits_class("create-spdx-3.0", d):` instead
Indeed, thank you for your feedback.
My initial plan was to move all code inside a Python function named
create_kernel_config_spdx, and to call this function from
do_create_spdx:append().
Sadly, the generated code looks like this:
```
def do_create_spdx(d):
import oe.spdx30_tasks
oe.spdx30_tasks.create_spdx(d)
create_kernel_config_spdx()
do_create_spdx(d)
def create_kernel_config_spdx(d):
# Code of the function
```
This is not going to work, since the create_kernel_config_spdx() is declared
after the call to do_create_spdx().
From my point of view, there is a bug in bitbake code : The emit_func_python()
function declared in lib/bb/data.py does not generate code in the right
order: The "write_func(func, o, True)" should be called at the end of
emit_func_python().
I am missing something, or is there any reason why emit_func_python() is
implemented that way?
Anyway I am preparing a v3, that solve this issue differently.
Best regards,
--
Benjamin Robin, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#231751):
https://lists.openembedded.org/g/openembedded-core/message/231751
Mute This Topic: https://lists.openembedded.org/mt/117836081/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-