diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2012-01-13 17:01:52 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-01-15 10:06:23 +0000 |
commit | 684c6ef2d08ad503ce68ac3cc273f1b6a8a56ac7 (patch) | |
tree | cdd01d0f277ac8f47b30882a31fe68304967834f /bitbake/lib | |
parent | 9fd17bbe1ca3894437a16a625e05334dc97c5273 (diff) | |
download | poky-684c6ef2d08ad503ce68ac3cc273f1b6a8a56ac7.tar.gz |
bitbake/knotty: print task failure summary
Remove the error logged within cooker summarising the list of failed
tasks, and instead print this in the UI (knotty) where it belongs. This
also adds the actual name of the task that failed as well as the
corresponding recipe file that was being shown previously.
In addition, reformat the summary messages more tidily - no extra breaks
between lines and use correct English singular/plurals, with some
allowance for future translation.
(Bitbake rev: cdf69913f99d28bc7f51067a60257701f952c6cb)
Signed-off-by: Paul Eggleton <paul.eggleton@linux.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/ui/knotty.py | 24 |
2 files changed, 22 insertions, 6 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py index 6041410575..4197a02314 100644 --- a/bitbake/lib/bb/cooker.py +++ b/bitbake/lib/bb/cooker.py | |||
@@ -1065,8 +1065,6 @@ class BBCooker: | |||
1065 | try: | 1065 | try: |
1066 | retval = rq.execute_runqueue() | 1066 | retval = rq.execute_runqueue() |
1067 | except runqueue.TaskFailure as exc: | 1067 | except runqueue.TaskFailure as exc: |
1068 | for fnid in exc.args: | ||
1069 | buildlog.error("'%s' failed" % taskdata.fn_index[fnid]) | ||
1070 | failures += len(exc.args) | 1068 | failures += len(exc.args) |
1071 | retval = False | 1069 | retval = False |
1072 | except SystemExit as exc: | 1070 | except SystemExit as exc: |
@@ -1106,8 +1104,6 @@ class BBCooker: | |||
1106 | try: | 1104 | try: |
1107 | retval = rq.execute_runqueue() | 1105 | retval = rq.execute_runqueue() |
1108 | except runqueue.TaskFailure as exc: | 1106 | except runqueue.TaskFailure as exc: |
1109 | for fnid in exc.args: | ||
1110 | buildlog.error("'%s' failed" % taskdata.fn_index[fnid]) | ||
1111 | failures += len(exc.args) | 1107 | failures += len(exc.args) |
1112 | retval = False | 1108 | retval = False |
1113 | except SystemExit as exc: | 1109 | except SystemExit as exc: |
diff --git a/bitbake/lib/bb/ui/knotty.py b/bitbake/lib/bb/ui/knotty.py index 205a8d8f39..e1d42f7871 100644 --- a/bitbake/lib/bb/ui/knotty.py +++ b/bitbake/lib/bb/ui/knotty.py | |||
@@ -64,6 +64,12 @@ def new_progress(msg, maxval): | |||
64 | else: | 64 | else: |
65 | return NonInteractiveProgress(msg, maxval) | 65 | return NonInteractiveProgress(msg, maxval) |
66 | 66 | ||
67 | def pluralise(singular, plural, qty): | ||
68 | if(qty == 1): | ||
69 | return singular % qty | ||
70 | else: | ||
71 | return plural % qty | ||
72 | |||
67 | def main(server, eventHandler): | 73 | def main(server, eventHandler): |
68 | 74 | ||
69 | # Get values of variables which control our output | 75 | # Get values of variables which control our output |
@@ -107,6 +113,7 @@ def main(server, eventHandler): | |||
107 | return_value = 0 | 113 | return_value = 0 |
108 | errors = 0 | 114 | errors = 0 |
109 | warnings = 0 | 115 | warnings = 0 |
116 | taskfailures = [] | ||
110 | while True: | 117 | while True: |
111 | try: | 118 | try: |
112 | event = eventHandler.waitEvent(0.25) | 119 | event = eventHandler.waitEvent(0.25) |
@@ -240,6 +247,7 @@ def main(server, eventHandler): | |||
240 | continue | 247 | continue |
241 | 248 | ||
242 | if isinstance(event, bb.runqueue.runQueueTaskFailed): | 249 | if isinstance(event, bb.runqueue.runQueueTaskFailed): |
250 | taskfailures.append(event.taskstring) | ||
243 | logger.error("Task %s (%s) failed with exit code '%s'", | 251 | logger.error("Task %s (%s) failed with exit code '%s'", |
244 | event.taskid, event.taskstring, event.exitcode) | 252 | event.taskid, event.taskstring, event.exitcode) |
245 | continue | 253 | continue |
@@ -272,8 +280,20 @@ def main(server, eventHandler): | |||
272 | server.runCommand(["stateShutdown"]) | 280 | server.runCommand(["stateShutdown"]) |
273 | shutdown = shutdown + 1 | 281 | shutdown = shutdown + 1 |
274 | pass | 282 | pass |
283 | |||
284 | summary = "" | ||
285 | if taskfailures: | ||
286 | summary += pluralise("\nSummary: %s task failed:", | ||
287 | "\nSummary: %s tasks failed:", len(taskfailures)) | ||
288 | for failure in taskfailures: | ||
289 | summary += "\n %s" % failure | ||
275 | if warnings: | 290 | if warnings: |
276 | print("Summary: There were %s WARNING messages shown.\n" % warnings) | 291 | summary += pluralise("\nSummary: There was %s WARNING message shown.", |
292 | "\nSummary: There were %s WARNING messages shown.", warnings) | ||
277 | if return_value: | 293 | if return_value: |
278 | print("Summary: There were %s ERROR messages shown, returning a non-zero exit code.\n" % errors) | 294 | summary += pluralise("\nSummary: There was %s ERROR message shown, returning a non-zero exit code.", |
295 | "\nSummary: There were %s ERROR messages shown, returning a non-zero exit code.", errors) | ||
296 | if summary: | ||
297 | print(summary) | ||
298 | |||
279 | return return_value | 299 | return return_value |