Skip to contentSkip to conversation

bitbake-worker: Set BB_CURRENTTASK earlier

PATCH New Richard Purdie 1 participant 1 message Oct 13, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bitbake-worker: Set BB_CURRENTTASK earlier

For some debugging, BB_CURRENTTASK is set too late to be useful as it isn't present in some event handlers for example. There is no other way to know which task is actually running so set the value earlier.

---
 bin/bitbake-worker | 1 +
 lib/bb/build.py    | 1 -
 2 files changed, 1 insertion(+), 1 deletion(-)
bin/bitbake-worker +1 -0
index 6a12e1fed2..c8eb65567f 100755
@@ -237,6 +237,7 @@ def fork_off_task(cfg, data, databuilder, workerdata, fn, task, taskname, taskha
                 the_data = databuilder.mcdata[mc]
                 the_data.setVar("BB_WORKERCONTEXT", "1")
                 the_data.setVar("BB_TASKDEPDATA", taskdepdata)
+                the_data.setVar('BB_CURRENTTASK', taskname.replace("do_", ""))
                 if cfg.limited_deps:
                     the_data.setVar("BB_LIMITEDDEPS", "1")
                 the_data.setVar("BUILDNAME", workerdata["buildname"])
lib/bb/build.py +0 -1
index 7e4ab9f64c..d6418e40b3 100644
@@ -569,7 +569,6 @@ exit $ret
 def _task_data(fn, task, d):
     localdata = bb.data.createCopy(d)
     localdata.setVar('BB_FILENAME', fn)
-    localdata.setVar('BB_CURRENTTASK', task[3:])
     localdata.setVar('OVERRIDES', 'task-%s:%s' %
                      (task[3:].replace('_', '-'), d.getVar('OVERRIDES', False)))
     localdata.finalize()
Signature · 1 line
2.32.0