summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2012-02-27 18:54:11 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-02-28 12:27:22 +0000
commitce0ecf5d847b168ad05117cdd1f5fdcc561d770d (patch)
tree994a7639091021cff978e90c74e2db6cb8b27e81 /bitbake
parente7952c188374508bcf65903d85ae27a593de7465 (diff)
downloadpoky-ce0ecf5d847b168ad05117cdd1f5fdcc561d770d.tar.gz
bitbake: fix setscene task start/failure handling
* When a setscene task starts, print out that it's starting in the UI (ensuring we get the correct task name) * When a setscene task fails, ensure we remove it from the list of running tasks so that if you break out any time afterwards it is not still listed. (Bitbake rev: e8a3499c95a6d4f2b8fed002fb9504733c5be3c6) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/build.py10
-rw-r--r--bitbake/lib/bb/runqueue.py18
-rw-r--r--bitbake/lib/bb/ui/knotty.py9
-rw-r--r--bitbake/lib/bb/ui/uihelper.py3
4 files changed, 32 insertions, 8 deletions
diff --git a/bitbake/lib/bb/build.py b/bitbake/lib/bb/build.py
index e85d7c4f3e..b7031ab6d3 100644
--- a/bitbake/lib/bb/build.py
+++ b/bitbake/lib/bb/build.py
@@ -96,6 +96,12 @@ class TaskFailed(TaskBase):
96 self.errprinted = errprinted 96 self.errprinted = errprinted
97 super(TaskFailed, self).__init__(task, metadata) 97 super(TaskFailed, self).__init__(task, metadata)
98 98
99class TaskFailedSilent(TaskBase):
100 """Task execution failed (silently)"""
101 def __init__(self, task, logfile, metadata):
102 self.logfile = logfile
103 super(TaskFailedSilent, self).__init__(task, metadata)
104
99class TaskInvalid(TaskBase): 105class TaskInvalid(TaskBase):
100 106
101 def __init__(self, task, metadata): 107 def __init__(self, task, metadata):
@@ -334,7 +340,9 @@ def _exec_task(fn, task, d, quieterr):
334 for func in (postfuncs or '').split(): 340 for func in (postfuncs or '').split():
335 exec_func(func, localdata) 341 exec_func(func, localdata)
336 except FuncFailed as exc: 342 except FuncFailed as exc:
337 if not quieterr: 343 if quieterr:
344 event.fire(TaskFailedSilent(task, logfn, localdata), localdata)
345 else:
338 errprinted = errchk.triggered 346 errprinted = errchk.triggered
339 logger.error(str(exc)) 347 logger.error(str(exc))
340 event.fire(TaskFailed(task, logfn, localdata, errprinted), localdata) 348 event.fire(TaskFailed(task, logfn, localdata, errprinted), localdata)
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py
index 0e5d5c35a9..d4b2cd49aa 100644
--- a/bitbake/lib/bb/runqueue.py
+++ b/bitbake/lib/bb/runqueue.py
@@ -1724,6 +1724,15 @@ class runQueueEvent(bb.event.Event):
1724 self.stats = stats.copy() 1724 self.stats = stats.copy()
1725 bb.event.Event.__init__(self) 1725 bb.event.Event.__init__(self)
1726 1726
1727class sceneQueueEvent(runQueueEvent):
1728 """
1729 Base sceneQueue event class
1730 """
1731 def __init__(self, task, stats, rq, noexec=False):
1732 runQueueEvent.__init__(self, task, stats, rq)
1733 realtask = rq.rqdata.runq_setscene[task]
1734 self.taskstring = rq.rqdata.get_user_idstring(realtask, "_setscene")
1735
1727class runQueueTaskStarted(runQueueEvent): 1736class runQueueTaskStarted(runQueueEvent):
1728 """ 1737 """
1729 Event notifing a task was started 1738 Event notifing a task was started
@@ -1732,12 +1741,12 @@ class runQueueTaskStarted(runQueueEvent):
1732 runQueueEvent.__init__(self, task, stats, rq) 1741 runQueueEvent.__init__(self, task, stats, rq)
1733 self.noexec = noexec 1742 self.noexec = noexec
1734 1743
1735class sceneQueueTaskStarted(runQueueEvent): 1744class sceneQueueTaskStarted(sceneQueueEvent):
1736 """ 1745 """
1737 Event notifing a setscene task was started 1746 Event notifing a setscene task was started
1738 """ 1747 """
1739 def __init__(self, task, stats, rq, noexec=False): 1748 def __init__(self, task, stats, rq, noexec=False):
1740 runQueueEvent.__init__(self, task, stats, rq) 1749 sceneQueueEvent.__init__(self, task, stats, rq)
1741 self.noexec = noexec 1750 self.noexec = noexec
1742 1751
1743class runQueueTaskFailed(runQueueEvent): 1752class runQueueTaskFailed(runQueueEvent):
@@ -1748,14 +1757,13 @@ class runQueueTaskFailed(runQueueEvent):
1748 runQueueEvent.__init__(self, task, stats, rq) 1757 runQueueEvent.__init__(self, task, stats, rq)
1749 self.exitcode = exitcode 1758 self.exitcode = exitcode
1750 1759
1751class sceneQueueTaskFailed(runQueueEvent): 1760class sceneQueueTaskFailed(sceneQueueEvent):
1752 """ 1761 """
1753 Event notifing a setscene task failed 1762 Event notifing a setscene task failed
1754 """ 1763 """
1755 def __init__(self, task, stats, exitcode, rq): 1764 def __init__(self, task, stats, exitcode, rq):
1756 runQueueEvent.__init__(self, task, stats, rq) 1765 sceneQueueEvent.__init__(self, task, stats, rq)
1757 self.exitcode = exitcode 1766 self.exitcode = exitcode
1758 self.taskstring = rq.rqdata.get_user_idstring(task, "_setscene")
1759 1767
1760class runQueueTaskCompleted(runQueueEvent): 1768class runQueueTaskCompleted(runQueueEvent):
1761 """ 1769 """
diff --git a/bitbake/lib/bb/ui/knotty.py b/bitbake/lib/bb/ui/knotty.py
index e2e6ac3d65..14989d47d9 100644
--- a/bitbake/lib/bb/ui/knotty.py
+++ b/bitbake/lib/bb/ui/knotty.py
@@ -238,6 +238,10 @@ def main(server, eventHandler):
238 logger.error("%s", reason) 238 logger.error("%s", reason)
239 continue 239 continue
240 240
241 if isinstance(event, bb.runqueue.sceneQueueTaskStarted):
242 logger.info("Running setscene task %d of %d (%s)" % (event.stats.completed + event.stats.active + event.stats.failed + 1, event.stats.total, event.taskstring))
243 continue
244
241 if isinstance(event, bb.runqueue.runQueueTaskStarted): 245 if isinstance(event, bb.runqueue.runQueueTaskStarted):
242 if event.noexec: 246 if event.noexec:
243 tasktype = 'noexec task' 247 tasktype = 'noexec task'
@@ -256,6 +260,11 @@ def main(server, eventHandler):
256 event.taskid, event.taskstring, event.exitcode) 260 event.taskid, event.taskstring, event.exitcode)
257 continue 261 continue
258 262
263 if isinstance(event, bb.runqueue.sceneQueueTaskFailed):
264 logger.warn("Setscene task %s (%s) failed with exit code '%s' - real task will be run instead",
265 event.taskid, event.taskstring, event.exitcode)
266 continue
267
259 # ignore 268 # ignore
260 if isinstance(event, (bb.event.BuildBase, 269 if isinstance(event, (bb.event.BuildBase,
261 bb.event.StampUpdate, 270 bb.event.StampUpdate,
diff --git a/bitbake/lib/bb/ui/uihelper.py b/bitbake/lib/bb/ui/uihelper.py
index bbf5135b70..4116dabf94 100644
--- a/bitbake/lib/bb/ui/uihelper.py
+++ b/bitbake/lib/bb/ui/uihelper.py
@@ -32,9 +32,8 @@ class BBUIHelper:
32 if isinstance(event, bb.build.TaskSucceeded): 32 if isinstance(event, bb.build.TaskSucceeded):
33 del self.running_tasks[event.pid] 33 del self.running_tasks[event.pid]
34 self.needUpdate = True 34 self.needUpdate = True
35 if isinstance(event, bb.build.TaskFailed): 35 if isinstance(event, bb.build.TaskFailed) or isinstance(event, bb.build.TaskFailedSilent):
36 del self.running_tasks[event.pid] 36 del self.running_tasks[event.pid]
37 self.failed_tasks.append( { 'title' : "%s %s" % (event._package, event._task)})
38 self.needUpdate = True 37 self.needUpdate = True
39 38
40 def getTasks(self): 39 def getTasks(self):