diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-09-14 17:54:09 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-09-16 13:12:34 +0100 |
commit | 1181e691197ab223e325546185d0a991e5ccbf1c (patch) | |
tree | d0385d6fd4d310420e013c3f9d99bd58d06e2c25 | |
parent | 5fca4d286eec240ad57d90defa43cd0ff24f88ed (diff) | |
download | 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>
-rw-r--r-- | bitbake/lib/bb/build.py | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/bitbake/lib/bb/build.py b/bitbake/lib/bb/build.py index a53aba9c1a..7ee500773d 100644 --- a/bitbake/lib/bb/build.py +++ b/bitbake/lib/bb/build.py | |||
@@ -69,9 +69,10 @@ class FuncFailed(Exception): | |||
69 | class TaskBase(event.Event): | 69 | class TaskBase(event.Event): |
70 | """Base class for task events""" | 70 | """Base class for task events""" |
71 | 71 | ||
72 | def __init__(self, t, d ): | 72 | def __init__(self, t, logfile, d): |
73 | self._task = t | 73 | self._task = t |
74 | self._package = d.getVar("PF", True) | 74 | self._package = d.getVar("PF", True) |
75 | self.logfile = logfile | ||
75 | event.Event.__init__(self) | 76 | event.Event.__init__(self) |
76 | self._message = "recipe %s: task %s: %s" % (d.getVar("PF", True), t, self.getDisplayName()) | 77 | self._message = "recipe %s: task %s: %s" % (d.getVar("PF", True), t, self.getDisplayName()) |
77 | 78 | ||
@@ -96,16 +97,11 @@ class TaskFailed(TaskBase): | |||
96 | """Task execution failed""" | 97 | """Task execution failed""" |
97 | 98 | ||
98 | def __init__(self, task, logfile, metadata, errprinted = False): | 99 | def __init__(self, task, logfile, metadata, errprinted = False): |
99 | self.logfile = logfile | ||
100 | self.errprinted = errprinted | 100 | self.errprinted = errprinted |
101 | super(TaskFailed, self).__init__(task, metadata) | 101 | super(TaskFailed, self).__init__(task, logfile, metadata) |
102 | 102 | ||
103 | class TaskFailedSilent(TaskBase): | 103 | class TaskFailedSilent(TaskBase): |
104 | """Task execution failed (silently)""" | 104 | """Task execution failed (silently)""" |
105 | def __init__(self, task, logfile, metadata): | ||
106 | self.logfile = logfile | ||
107 | super(TaskFailedSilent, self).__init__(task, metadata) | ||
108 | |||
109 | def getDisplayName(self): | 105 | def getDisplayName(self): |
110 | # Don't need to tell the user it was silent | 106 | # Don't need to tell the user it was silent |
111 | return "Failed" | 107 | return "Failed" |
@@ -113,7 +109,7 @@ class TaskFailedSilent(TaskBase): | |||
113 | class TaskInvalid(TaskBase): | 109 | class TaskInvalid(TaskBase): |
114 | 110 | ||
115 | def __init__(self, task, metadata): | 111 | def __init__(self, task, metadata): |
116 | super(TaskInvalid, self).__init__(task, metadata) | 112 | super(TaskInvalid, self).__init__(task, None, metadata) |
117 | self._message = "No such task '%s'" % task | 113 | self._message = "No such task '%s'" % task |
118 | 114 | ||
119 | 115 | ||
@@ -416,7 +412,7 @@ def _exec_task(fn, task, d, quieterr): | |||
416 | localdata.setVar('BB_LOGFILE', logfn) | 412 | localdata.setVar('BB_LOGFILE', logfn) |
417 | localdata.setVar('BB_RUNTASK', task) | 413 | localdata.setVar('BB_RUNTASK', task) |
418 | 414 | ||
419 | event.fire(TaskStarted(task, localdata), localdata) | 415 | event.fire(TaskStarted(task, logfn, localdata), localdata) |
420 | try: | 416 | try: |
421 | for func in (prefuncs or '').split(): | 417 | for func in (prefuncs or '').split(): |
422 | exec_func(func, localdata) | 418 | exec_func(func, localdata) |
@@ -453,7 +449,7 @@ def _exec_task(fn, task, d, quieterr): | |||
453 | logger.debug(2, "Zero size logfn %s, removing", logfn) | 449 | logger.debug(2, "Zero size logfn %s, removing", logfn) |
454 | bb.utils.remove(logfn) | 450 | bb.utils.remove(logfn) |
455 | bb.utils.remove(loglink) | 451 | bb.utils.remove(loglink) |
456 | event.fire(TaskSucceeded(task, localdata), localdata) | 452 | event.fire(TaskSucceeded(task, logfn, localdata), localdata) |
457 | 453 | ||
458 | if not localdata.getVarFlag(task, 'nostamp') and not localdata.getVarFlag(task, 'selfstamp'): | 454 | if not localdata.getVarFlag(task, 'nostamp') and not localdata.getVarFlag(task, 'selfstamp'): |
459 | make_stamp(task, localdata) | 455 | make_stamp(task, localdata) |