All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] tinfoil: add new "finalizeData" API
@ 2024-11-12 23:05 Yoann Congal
  2024-11-12 23:05 ` [PATCH 2/2] bitbake-getvar: use finalizeData tinfoil API to get identical result to "bitbake -e" Yoann Congal
  0 siblings, 1 reply; 4+ messages in thread
From: Yoann Congal @ 2024-11-12 23:05 UTC (permalink / raw)
  To: bitbake-devel; +Cc: Yoann Congal

From: Yoann Congal <yoann.congal@smile.fr>

Create a new tinfoil API "finalizeData" which does key expantion and
runs the anonymous functions to allow bitbake-getvar to have the same
output as "bitbake -e".

Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
---
 lib/bb/command.py | 8 ++++++++
 lib/bb/tinfoil.py | 6 ++++++
 2 files changed, 14 insertions(+)

diff --git a/lib/bb/command.py b/lib/bb/command.py
index 1fcb9bf14..3d094fc34 100644
--- a/lib/bb/command.py
+++ b/lib/bb/command.py
@@ -24,6 +24,7 @@ import io
 import bb.event
 import bb.cooker
 import bb.remotedata
+import bb.parse
 
 class DataStoreConnectionHandle(object):
     def __init__(self, dsindex=0):
@@ -582,6 +583,13 @@ class CommandsSync:
         return DataStoreConnectionHandle(idx)
     parseRecipeFile.readonly = True
 
+    def finalizeData(self, command, params):
+        newdata = command.cooker.data.createCopy()
+        bb.data.expandKeys(newdata)
+        bb.parse.ast.runAnonFuncs(newdata)
+        idx = command.remotedatastores.store(newdata)
+        return DataStoreConnectionHandle(idx)
+
 class CommandsAsync:
     """
     A class of asynchronous commands
diff --git a/lib/bb/tinfoil.py b/lib/bb/tinfoil.py
index dcd3910cc..0e937fba3 100644
--- a/lib/bb/tinfoil.py
+++ b/lib/bb/tinfoil.py
@@ -633,6 +633,12 @@ class Tinfoil:
         fn = self.get_recipe_file(pn)
         return self.parse_recipe_file(fn)
 
+    def finalizeData(self):
+        """
+        Run anonymous functions and expand keys
+        """
+        return self._reconvert_type(self.run_command('finalizeData'), 'DataStoreConnectionHandle')
+
     def parse_recipe_file(self, fn, appends=True, appendlist=None, config_data=None):
         """
         Parse the specified recipe file (with or without bbappends)


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] bitbake-getvar: use finalizeData tinfoil API to get identical result to "bitbake -e"
  2024-11-12 23:05 [PATCH 1/2] tinfoil: add new "finalizeData" API Yoann Congal
@ 2024-11-12 23:05 ` Yoann Congal
  2024-11-13 14:50   ` [bitbake-devel] " Mathieu Dubois-Briand
  0 siblings, 1 reply; 4+ messages in thread
From: Yoann Congal @ 2024-11-12 23:05 UTC (permalink / raw)
  To: bitbake-devel; +Cc: Yoann Congal

From: Yoann Congal <yoann.congal@smile.fr>

Fixes [YOCTO #15638]

Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
---
 bin/bitbake-getvar | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/bin/bitbake-getvar b/bin/bitbake-getvar
index 8901f99ae..bc0b989c8 100755
--- a/bin/bitbake-getvar
+++ b/bin/bitbake-getvar
@@ -45,6 +45,10 @@ if __name__ == "__main__":
             tinfoil.prepare(quiet=2, config_only=True)
             d = tinfoil.config_data
 
+        # Expand keys and run anonymous functions to get identical result to
+        # "bitbake -e"
+        d = tinfoil.finalizeData()
+
         value = None
         if args.flag:
             value = d.getVarFlag(args.variable, args.flag, expand=not args.unexpand)


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [bitbake-devel] [PATCH 2/2] bitbake-getvar: use finalizeData tinfoil API to get identical result to "bitbake -e"
  2024-11-12 23:05 ` [PATCH 2/2] bitbake-getvar: use finalizeData tinfoil API to get identical result to "bitbake -e" Yoann Congal
@ 2024-11-13 14:50   ` Mathieu Dubois-Briand
  2024-11-14 22:22     ` Yoann Congal
  0 siblings, 1 reply; 4+ messages in thread
From: Mathieu Dubois-Briand @ 2024-11-13 14:50 UTC (permalink / raw)
  To: yoann.congal; +Cc: bitbake-devel

On Wed, Nov 13, 2024 at 12:05:59AM +0100, Yoann Congal via lists.openembedded.org wrote:
> From: Yoann Congal <yoann.congal@smile.fr>
> 
> Fixes [YOCTO #15638]
> 
> Signed-off-by: Yoann Congal <yoann.congal@smile.fr>

Hi Yoann,

I believe this commit is responsible of build failures on the
autobuilder, on oe-selftest* and *-tc builders:

RuntimeError: core-image-minimal - FAILED to start qemu - check the task
log and the boot log

https://valkyrie.yoctoproject.org/#/builders/28/builds/402/steps/12/logs/stdio
https://valkyrie.yoctoproject.org/#/builders/28/builds/402/steps/12/logs/stdio

Can you have a look at this issue please ?

-- 
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [bitbake-devel] [PATCH 2/2] bitbake-getvar: use finalizeData tinfoil API to get identical result to "bitbake -e"
  2024-11-13 14:50   ` [bitbake-devel] " Mathieu Dubois-Briand
@ 2024-11-14 22:22     ` Yoann Congal
  0 siblings, 0 replies; 4+ messages in thread
From: Yoann Congal @ 2024-11-14 22:22 UTC (permalink / raw)
  To: bitbake-devel

Le 13/11/2024 à 15:50, Mathieu Dubois-Briand a écrit :
> On Wed, Nov 13, 2024 at 12:05:59AM +0100, Yoann Congal via lists.openembedded.org wrote:
>> From: Yoann Congal <yoann.congal@smile.fr>
>>
>> Fixes [YOCTO #15638]
>>
>> Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
> 
> Hi Yoann,
> 
> I believe this commit is responsible of build failures on the
> autobuilder, on oe-selftest* and *-tc builders:
> 
> RuntimeError: core-image-minimal - FAILED to start qemu - check the task
> log and the boot log
> 
> https://valkyrie.yoctoproject.org/#/builders/28/builds/402/steps/12/logs/stdio
> https://valkyrie.yoctoproject.org/#/builders/28/builds/402/steps/12/logs/stdio
> 
> Can you have a look at this issue please ?

It was indeed my patches that created the above issues. Nice catch!
I've now sent a v2 that fixes the failing test locally.

Thanks!
-- 
Yoann Congal
Smile ECS - Tech Expert


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-11-14 22:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-12 23:05 [PATCH 1/2] tinfoil: add new "finalizeData" API Yoann Congal
2024-11-12 23:05 ` [PATCH 2/2] bitbake-getvar: use finalizeData tinfoil API to get identical result to "bitbake -e" Yoann Congal
2024-11-13 14:50   ` [bitbake-devel] " Mathieu Dubois-Briand
2024-11-14 22:22     ` Yoann Congal

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.