]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
cooker: add BuildInit event
authorElliot Smith <elliot.smith@intel.com>
Mon, 11 Jul 2016 15:23:05 +0000 (16:23 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 10 Aug 2016 23:08:17 +0000 (00:08 +0100)
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@intel.com>
lib/bb/cooker.py
lib/bb/event.py

index a73a55de964f1aba439d439fb0cb80b0ff93f797..d4dd23f09cd26a1f4d29f5f3965b2942416ffdbb 100644 (file)
@@ -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)
index a5f026e151ff8aff6c6f96bd0c8d13b99c4551cc..1f3200e196e29a694a4e2b7e5cb2227967e979bb 100644 (file)
@@ -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"""