[oe-commits] [bitbake] 06/40: cooker: add BuildInit event
git at git.openembedded.org
git at git.openembedded.org
Wed Aug 10 23:11:49 UTC 2016
rpurdie pushed a commit to branch master
in repository bitbake.
commit ac02fda870965bf7d44ff5688eda54d2d11ab9c7
Author: Elliot Smith <elliot.smith at intel.com>
AuthorDate: Mon Jul 11 16:23:05 2016 +0100
cooker: add BuildInit event
In situations where a bitbake run fails before the build
properly starts and BuildStarted is fired, a UI has no way
to get at the targets passed to the build. This makes it
difficult for the UI to report on the targets which failed.
Fire a BuildInit event before running buildTargets() or
buildFile(). This enables a UI to capture targets passed to
buildTargets(), even if the build fails (e.g. the targets
themselves are invalid).
[YOCTO #8440]
Signed-off-by: Elliot Smith <elliot.smith at intel.com>
---
lib/bb/cooker.py | 4 ++++
lib/bb/event.py | 6 +++++-
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/lib/bb/cooker.py b/lib/bb/cooker.py
index a73a55d..d4dd23f 100644
--- a/lib/bb/cooker.py
+++ b/lib/bb/cooker.py
@@ -1235,6 +1235,7 @@ class BBCooker:
"""
Build the file matching regexp buildfile
"""
+ bb.event.fire(bb.event.BuildInit(), self.expanded_data)
# Too many people use -b because they think it's how you normally
# specify a target to be built, so show a warning
@@ -1377,6 +1378,9 @@ class BBCooker:
if not task.startswith("do_"):
task = "do_%s" % task
+ packages = ["%s:%s" % (target, task) for target in targets]
+ bb.event.fire(bb.event.BuildInit(packages), self.expanded_data)
+
taskdata, runlist, fulltargetlist = self.buildTaskData(targets, task, self.configuration.abort)
buildname = self.data.getVar("BUILDNAME", False)
diff --git a/lib/bb/event.py b/lib/bb/event.py
index a5f026e..1f3200e 100644
--- a/lib/bb/event.py
+++ b/lib/bb/event.py
@@ -382,7 +382,11 @@ class BuildBase(Event):
-
+class BuildInit(BuildBase):
+ """buildFile or buildTargets was invoked"""
+ def __init__(self, p=[]):
+ name = None
+ BuildBase.__init__(self, name, p)
class BuildStarted(BuildBase, OperationStarted):
"""bbmake build run started"""
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Openembedded-commits
mailing list