| Message ID | 20261120135323.2627478-2-stondo@gmail.com |
|---|---|
| State | New |
| Headers | show |
| Series | fetch/npm: no npm executable, and an event log fix | expand |
On Fri, 2026-11-20 at 14:53 +0100, Stefano Tondo via bitbake-devel wrote: > 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. This worries me a bit (well, a lot!), specifically the "second build" piece. Why is this persisting across builds? Does: https://git.openembedded.org/bitbake/commit/?id=606786d17351534ce35d1b0f89815461546a66fe have any effect on that? Cheers, Richard
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: