From: Stefano Tondo <stondo@gmail.com>
To: bitbake-devel@lists.openembedded.org
Cc: Thomas Perrot <thomas.perrot@bootlin.com>,
Alexander Kanavin <alex.kanavin@gmail.com>,
Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>,
Peter Marko <peter.marko@siemens.com>,
stefano.tondo.ext@siemens.com
Subject: [PATCH 1/2] cooker: Write variables that are not JSON types to the event log
Date: Fri, 20 Nov 2026 14:53:22 +0100 [thread overview]
Message-ID: <20261120135323.2627478-2-stondo@gmail.com> (raw)
In-Reply-To: <20261120135323.2627478-1-stondo@gmail.com>
From: Stefano Tondo <stefano.tondo.ext@siemens.com>
EventWriter.write_variables() writes the history of all variables to
the event log as JSON. A variable can hold a Python object. For
example, sstate.bbclass stores compiled regular expressions in
_SSTATE_EXCLUDEDEPS_SYSROOT during a build. When the same server runs
a second build, json.dumps() fails:
TypeError: Object of type Pattern is not JSON serializable
This occurs with tinfoil, for example in "recipetool create", which
starts more than one build in one server.
Write such values as strings.
Signed-off-by: Stefano Tondo <stefano.tondo.ext@siemens.com>
---
lib/bb/cooker.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/bb/cooker.py b/lib/bb/cooker.py
index a6bc2827d..abc516649 100644
--- a/lib/bb/cooker.py
+++ b/lib/bb/cooker.py
@@ -124,7 +124,7 @@ class EventWriter:
def write_variables(self):
with self._open() as f:
- f.write("%s\n" % json.dumps({ "allvariables" : self.cooker.getAllKeysWithFlags(["doc", "func"])}))
+ f.write("%s\n" % json.dumps({ "allvariables" : self.cooker.getAllKeysWithFlags(["doc", "func"])}, default=str))
def send(self, event):
with self._open() as f:
--
2.56.1
next prev parent reply other threads:[~2026-11-20 13:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-20 13:53 [PATCH 0/2] fetch/npm: no npm executable, and an event log fix Stefano Tondo
2026-11-20 13:53 ` Stefano Tondo [this message]
2026-11-20 18:46 ` [bitbake-devel] [PATCH 1/2] cooker: Write variables that are not JSON types to the event log Richard Purdie
2026-11-20 13:53 ` [PATCH 2/2] fetch/npm: Build the tarball URL without the npm executable Stefano Tondo
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=20261120135323.2627478-2-stondo@gmail.com \
--to=stondo@gmail.com \
--cc=alex.kanavin@gmail.com \
--cc=bitbake-devel@lists.openembedded.org \
--cc=peter.marko@siemens.com \
--cc=stefan.herbrechtsmeier@weidmueller.com \
--cc=stefano.tondo.ext@siemens.com \
--cc=thomas.perrot@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 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.