public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: benjamin.robin@bootlin.com, Joshua Watt <jpewhacker@gmail.com>
Cc: openembedded-core@lists.openembedded.org,
	kamel.bouhara@bootlin.com,  mathieu.dubois-briand@bootlin.com,
	jeremie.dautheribes@bootlin.com,  thomas.petazzoni@bootlin.com,
	antonin.godard@bootlin.com, pascal.eberhard@se.com
Subject: Re: [OE-core] [PATCH v2] meta: fix generation of kernel CONFIG_ in SPDX3
Date: Tue, 24 Feb 2026 09:22:49 +0000	[thread overview]
Message-ID: <5cae187821817287fbb153a76a27e20d278159c2.camel@linuxfoundation.org> (raw)
In-Reply-To: <2030868.PYKUYFuaPT@brobin-bootlin>

On Tue, 2026-02-24 at 10:10 +0100, Benjamin Robin via lists.openembedded.org wrote:
> 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.

I think it would work as the emit_python_func code generates code for
debugging, it isn't what is actually run. What actually happens is all
the python functions are compiled and then called within the current
python execution environment.

Improving emit_func_python() to be more accurate is something I've
wanted to do for a while as the data store is missing, as is most of
the fakeroot execution environment that the shell/python tasks
sometimes use too.

Cheers,

Richard


      reply	other threads:[~2026-02-24  9:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-16  8:47 [PATCH v2] meta: fix generation of kernel CONFIG_ in SPDX3 Benjamin Robin
2026-02-23 17:43 ` Joshua Watt
2026-02-24  9:10   ` Benjamin ROBIN
2026-02-24  9:22     ` Richard Purdie [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5cae187821817287fbb153a76a27e20d278159c2.camel@linuxfoundation.org \
    --to=richard.purdie@linuxfoundation.org \
    --cc=antonin.godard@bootlin.com \
    --cc=benjamin.robin@bootlin.com \
    --cc=jeremie.dautheribes@bootlin.com \
    --cc=jpewhacker@gmail.com \
    --cc=kamel.bouhara@bootlin.com \
    --cc=mathieu.dubois-briand@bootlin.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=pascal.eberhard@se.com \
    --cc=thomas.petazzoni@bootlin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox