diff options
author | Elliot Smith <elliot.smith@intel.com> | 2016-07-11 16:23:05 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-08-11 00:09:26 +0100 |
commit | c471740f5ba023dccc992438c75f1534950d26af (patch) | |
tree | 764bf652494355fc87e0a186414a23e9dfefd88f /bitbake/lib | |
parent | f4e65d1cd0ee4e847d286aa88639d7aac5bff094 (diff) | |
download | poky-c471740f5ba023dccc992438c75f1534950d26af.tar.gz |
bitbake: 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]
(Bitbake rev: ac02fda870965bf7d44ff5688eda54d2d11ab9c7)
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
-rw-r--r-- | bitbake/lib/bb/cooker.py | 4 | ||||
-rw-r--r-- | bitbake/lib/bb/event.py | 6 |
2 files changed, 9 insertions, 1 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py index a73a55de96..d4dd23f09c 100644 --- a/bitbake/lib/bb/cooker.py +++ b/bitbake/lib/bb/cooker.py | |||
@@ -1235,6 +1235,7 @@ class BBCooker: | |||
1235 | """ | 1235 | """ |
1236 | Build the file matching regexp buildfile | 1236 | Build the file matching regexp buildfile |
1237 | """ | 1237 | """ |
1238 | bb.event.fire(bb.event.BuildInit(), self.expanded_data) | ||
1238 | 1239 | ||
1239 | # Too many people use -b because they think it's how you normally | 1240 | # Too many people use -b because they think it's how you normally |
1240 | # specify a target to be built, so show a warning | 1241 | # specify a target to be built, so show a warning |
@@ -1377,6 +1378,9 @@ class BBCooker: | |||
1377 | if not task.startswith("do_"): | 1378 | if not task.startswith("do_"): |
1378 | task = "do_%s" % task | 1379 | task = "do_%s" % task |
1379 | 1380 | ||
1381 | packages = ["%s:%s" % (target, task) for target in targets] | ||
1382 | bb.event.fire(bb.event.BuildInit(packages), self.expanded_data) | ||
1383 | |||
1380 | taskdata, runlist, fulltargetlist = self.buildTaskData(targets, task, self.configuration.abort) | 1384 | taskdata, runlist, fulltargetlist = self.buildTaskData(targets, task, self.configuration.abort) |
1381 | 1385 | ||
1382 | buildname = self.data.getVar("BUILDNAME", False) | 1386 | buildname = self.data.getVar("BUILDNAME", False) |
diff --git a/bitbake/lib/bb/event.py b/bitbake/lib/bb/event.py index a5f026e151..1f3200e196 100644 --- a/bitbake/lib/bb/event.py +++ b/bitbake/lib/bb/event.py | |||
@@ -382,7 +382,11 @@ class BuildBase(Event): | |||
382 | 382 | ||
383 | 383 | ||
384 | 384 | ||
385 | 385 | class BuildInit(BuildBase): | |
386 | """buildFile or buildTargets was invoked""" | ||
387 | def __init__(self, p=[]): | ||
388 | name = None | ||
389 | BuildBase.__init__(self, name, p) | ||
386 | 390 | ||
387 | class BuildStarted(BuildBase, OperationStarted): | 391 | class BuildStarted(BuildBase, OperationStarted): |
388 | """bbmake build run started""" | 392 | """bbmake build run started""" |