@@ -266,6 +266,7 @@ def fork_off_task(cfg, data, databuilder, workerdata, extraconfigdata, runtask):
the_data = databuilder.mcdata[mc]
the_data.setVar("BB_WORKERCONTEXT", "1")
the_data.setVar("BB_TASKDEPDATA", taskdepdata)
+ the_data.setVar("BB_SETSCENE_CLAIMED_TASKS", " ".join(runtask.get('claimedtasks', [])))
the_data.setVar('BB_CURRENTTASK', taskname.replace("do_", ""))
if cfg.limited_deps:
the_data.setVar("BB_LIMITEDDEPS", "1")
@@ -1939,6 +1939,8 @@ class RunQueueExecute:
self.scenequeue_notcovered = set()
self.tasks_notcovered = set()
self.scenequeue_notneeded = set()
+ # Covered tasks already handed to a setscene task for log replay
+ self.sq_replay_assigned = set()
self.setscene_tids_generator = None
@@ -2297,6 +2299,14 @@ class RunQueueExecute:
startevent = sceneQueueTaskStarted(task, self.stats, self.rq)
bb.event.fire(startevent, self.cfgData)
+ # Each covered task of any recipe is claimed by exactly one setscene
+ # task across the build, so its log is replayed only once. Tasks
+ # explicitly requested as targets run natively, so don't replay them.
+ claimedtasks = (self.sqdata.sq_covered_tasks[task]
+ - self.sq_replay_assigned
+ - self.sqdata.cantskip)
+ self.sq_replay_assigned |= claimedtasks
+
taskdep = self.rqdata.dataCaches[mc].task_deps[taskfn]
realfn = bb.cache.virtualfn2realfn(taskfn)[0]
runtask = {
@@ -2305,6 +2315,7 @@ class RunQueueExecute:
'taskname' : taskname,
'taskhash' : self.rqdata.get_task_hash(task),
'unihash' : self.rqdata.get_task_unihash(task),
+ 'claimedtasks' : sorted(claimedtasks),
'quieterrors' : True,
'appends' : self.cooker.collections[mc].get_file_appends(taskfn),
'layername' : self.cooker.collections[mc].calc_bbfile_priority(realfn)[2],
When a setscene task starts, hand it the covered tasks of any recipe which were not yet handed to another setscene task, and pass their tids to the task through BB_SETSCENE_CLAIMED_TASKS. Several setscene tasks can cover the same task (e.g. do_populate_sysroot and do_package both cover do_compile), so this lets metadata replay the log of each covered task exactly once when restoring it from the sstate cache. AI-Generated: Uses opencode (DeepSeek V4 Flash) Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> --- bin/bitbake-worker | 1 + lib/bb/runqueue.py | 11 +++++++++++ 2 files changed, 12 insertions(+)