summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/build.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2013-09-14 17:54:09 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-09-16 13:12:34 +0100
commit1181e691197ab223e325546185d0a991e5ccbf1c (patch)
treed0385d6fd4d310420e013c3f9d99bd58d06e2c25 /bitbake/lib/bb/build.py
parent5fca4d286eec240ad57d90defa43cd0ff24f88ed (diff)
downloadast2050-yocto-poky-1181e691197ab223e325546185d0a991e5ccbf1c.zip
ast2050-yocto-poky-1181e691197ab223e325546185d0a991e5ccbf1c.tar.gz
bitbake: build: Add logfile to add TaskBase events
We add the path to the logfile for all Task events except TaskInvalid so that we can trace back the logfile locations at some future point. TaskInvalid doesn't ever have a logfile. (Bitbake rev: 8344d84c609446f59f9619cc7ca0d693b7e2bbd6) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/build.py')
-rw-r--r--bitbake/lib/bb/build.py16
1 files changed, 6 insertions, 10 deletions
diff --git a/bitbake/lib/bb/build.py b/bitbake/lib/bb/build.py
index a53aba9..7ee5007 100644
--- a/bitbake/lib/bb/build.py
+++ b/bitbake/lib/bb/build.py
@@ -69,9 +69,10 @@ class FuncFailed(Exception):
class TaskBase(event.Event):
"""Base class for task events"""
- def __init__(self, t, d ):
+ def __init__(self, t, logfile, d):
self._task = t
self._package = d.getVar("PF", True)
+ self.logfile = logfile
event.Event.__init__(self)
self._message = "recipe %s: task %s: %s" % (d.getVar("PF", True), t, self.getDisplayName())
@@ -96,16 +97,11 @@ class TaskFailed(TaskBase):
"""Task execution failed"""
def __init__(self, task, logfile, metadata, errprinted = False):
- self.logfile = logfile
self.errprinted = errprinted
- super(TaskFailed, self).__init__(task, metadata)
+ super(TaskFailed, self).__init__(task, logfile, metadata)
class TaskFailedSilent(TaskBase):
"""Task execution failed (silently)"""
- def __init__(self, task, logfile, metadata):
- self.logfile = logfile
- super(TaskFailedSilent, self).__init__(task, metadata)
-
def getDisplayName(self):
# Don't need to tell the user it was silent
return "Failed"
@@ -113,7 +109,7 @@ class TaskFailedSilent(TaskBase):
class TaskInvalid(TaskBase):
def __init__(self, task, metadata):
- super(TaskInvalid, self).__init__(task, metadata)
+ super(TaskInvalid, self).__init__(task, None, metadata)
self._message = "No such task '%s'" % task
@@ -416,7 +412,7 @@ def _exec_task(fn, task, d, quieterr):
localdata.setVar('BB_LOGFILE', logfn)
localdata.setVar('BB_RUNTASK', task)
- event.fire(TaskStarted(task, localdata), localdata)
+ event.fire(TaskStarted(task, logfn, localdata), localdata)
try:
for func in (prefuncs or '').split():
exec_func(func, localdata)
@@ -453,7 +449,7 @@ def _exec_task(fn, task, d, quieterr):
logger.debug(2, "Zero size logfn %s, removing", logfn)
bb.utils.remove(logfn)
bb.utils.remove(loglink)
- event.fire(TaskSucceeded(task, localdata), localdata)
+ event.fire(TaskSucceeded(task, logfn, localdata), localdata)
if not localdata.getVarFlag(task, 'nostamp') and not localdata.getVarFlag(task, 'selfstamp'):
make_stamp(task, localdata)
OpenPOWER on IntegriCloud