All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] bitbake-worker: Set BB_CURRENTTASK earlier
@ 2021-10-13 14:11 Richard Purdie
  0 siblings, 0 replies; only message in thread
From: Richard Purdie @ 2021-10-13 14:11 UTC (permalink / raw)
  To: bitbake-devel

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.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 bin/bitbake-worker | 1 +
 lib/bb/build.py    | 1 -
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/bitbake-worker b/bin/bitbake-worker
index 6a12e1fed2..c8eb65567f 100755
--- a/bin/bitbake-worker
+++ b/bin/bitbake-worker
@@ -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"])
diff --git a/lib/bb/build.py b/lib/bb/build.py
index 7e4ab9f64c..d6418e40b3 100644
--- a/lib/bb/build.py
+++ b/lib/bb/build.py
@@ -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()
-- 
2.32.0



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-10-13 14:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-13 14:11 [PATCH] bitbake-worker: Set BB_CURRENTTASK earlier Richard Purdie

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.