diff options
Diffstat (limited to 'bitbake/lib/bb/ui')
| -rw-r--r-- | bitbake/lib/bb/ui/knotty.py | 32 | ||||
| -rw-r--r-- | bitbake/lib/bb/ui/taskexp.py | 5 |
2 files changed, 29 insertions, 8 deletions
diff --git a/bitbake/lib/bb/ui/knotty.py b/bitbake/lib/bb/ui/knotty.py index 87e873d644..d1f74389db 100644 --- a/bitbake/lib/bb/ui/knotty.py +++ b/bitbake/lib/bb/ui/knotty.py | |||
| @@ -227,7 +227,9 @@ class TerminalFilter(object): | |||
| 227 | 227 | ||
| 228 | def keepAlive(self, t): | 228 | def keepAlive(self, t): |
| 229 | if not self.cuu: | 229 | if not self.cuu: |
| 230 | print("Bitbake still alive (%ds)" % t) | 230 | print("Bitbake still alive (no events for %ds). Active tasks:" % t) |
| 231 | for t in self.helper.running_tasks: | ||
| 232 | print(t) | ||
| 231 | sys.stdout.flush() | 233 | sys.stdout.flush() |
| 232 | 234 | ||
| 233 | def updateFooter(self): | 235 | def updateFooter(self): |
| @@ -380,14 +382,27 @@ _evt_list = [ "bb.runqueue.runQueueExitWait", "bb.event.LogExecTTY", "logging.Lo | |||
| 380 | "bb.event.BuildBase", "bb.build.TaskStarted", "bb.build.TaskSucceeded", "bb.build.TaskFailedSilent", | 382 | "bb.event.BuildBase", "bb.build.TaskStarted", "bb.build.TaskSucceeded", "bb.build.TaskFailedSilent", |
| 381 | "bb.build.TaskProgress", "bb.event.ProcessStarted", "bb.event.ProcessProgress", "bb.event.ProcessFinished"] | 383 | "bb.build.TaskProgress", "bb.event.ProcessStarted", "bb.event.ProcessProgress", "bb.event.ProcessFinished"] |
| 382 | 384 | ||
| 385 | def drain_events_errorhandling(eventHandler): | ||
| 386 | # We don't have logging setup, we do need to show any events we see before exiting | ||
| 387 | event = True | ||
| 388 | logger = bb.msg.logger_create('bitbake', sys.stdout) | ||
| 389 | while event: | ||
| 390 | event = eventHandler.waitEvent(0) | ||
| 391 | if isinstance(event, logging.LogRecord): | ||
| 392 | logger.handle(event) | ||
| 393 | |||
| 383 | def main(server, eventHandler, params, tf = TerminalFilter): | 394 | def main(server, eventHandler, params, tf = TerminalFilter): |
| 384 | 395 | ||
| 385 | if not params.observe_only: | 396 | try: |
| 386 | params.updateToServer(server, os.environ.copy()) | 397 | if not params.observe_only: |
| 398 | params.updateToServer(server, os.environ.copy()) | ||
| 387 | 399 | ||
| 388 | includelogs, loglines, consolelogfile, logconfigfile = _log_settings_from_server(server, params.observe_only) | 400 | includelogs, loglines, consolelogfile, logconfigfile = _log_settings_from_server(server, params.observe_only) |
| 389 | 401 | ||
| 390 | loglevel, _ = bb.msg.constructLogOptions() | 402 | loglevel, _ = bb.msg.constructLogOptions() |
| 403 | except bb.BBHandledException: | ||
| 404 | drain_events_errorhandling(eventHandler) | ||
| 405 | return 1 | ||
| 391 | 406 | ||
| 392 | if params.options.quiet == 0: | 407 | if params.options.quiet == 0: |
| 393 | console_loglevel = loglevel | 408 | console_loglevel = loglevel |
| @@ -584,7 +599,8 @@ def main(server, eventHandler, params, tf = TerminalFilter): | |||
| 584 | warnings = 0 | 599 | warnings = 0 |
| 585 | taskfailures = [] | 600 | taskfailures = [] |
| 586 | 601 | ||
| 587 | printinterval = 5000 | 602 | printintervaldelta = 10 * 60 # 10 minutes |
| 603 | printinterval = printintervaldelta | ||
| 588 | lastprint = time.time() | 604 | lastprint = time.time() |
| 589 | 605 | ||
| 590 | termfilter = tf(main, helper, console_handlers, params.options.quiet) | 606 | termfilter = tf(main, helper, console_handlers, params.options.quiet) |
| @@ -594,7 +610,7 @@ def main(server, eventHandler, params, tf = TerminalFilter): | |||
| 594 | try: | 610 | try: |
| 595 | if (lastprint + printinterval) <= time.time(): | 611 | if (lastprint + printinterval) <= time.time(): |
| 596 | termfilter.keepAlive(printinterval) | 612 | termfilter.keepAlive(printinterval) |
| 597 | printinterval += 5000 | 613 | printinterval += printintervaldelta |
| 598 | event = eventHandler.waitEvent(0) | 614 | event = eventHandler.waitEvent(0) |
| 599 | if event is None: | 615 | if event is None: |
| 600 | if main.shutdown > 1: | 616 | if main.shutdown > 1: |
| @@ -625,7 +641,7 @@ def main(server, eventHandler, params, tf = TerminalFilter): | |||
| 625 | 641 | ||
| 626 | if isinstance(event, logging.LogRecord): | 642 | if isinstance(event, logging.LogRecord): |
| 627 | lastprint = time.time() | 643 | lastprint = time.time() |
| 628 | printinterval = 5000 | 644 | printinterval = printintervaldelta |
| 629 | if event.levelno >= bb.msg.BBLogFormatter.ERROR: | 645 | if event.levelno >= bb.msg.BBLogFormatter.ERROR: |
| 630 | errors = errors + 1 | 646 | errors = errors + 1 |
| 631 | return_value = 1 | 647 | return_value = 1 |
diff --git a/bitbake/lib/bb/ui/taskexp.py b/bitbake/lib/bb/ui/taskexp.py index 2b246710ca..c00eaf6638 100644 --- a/bitbake/lib/bb/ui/taskexp.py +++ b/bitbake/lib/bb/ui/taskexp.py | |||
| @@ -8,6 +8,7 @@ | |||
| 8 | # | 8 | # |
| 9 | 9 | ||
| 10 | import sys | 10 | import sys |
| 11 | import traceback | ||
| 11 | 12 | ||
| 12 | try: | 13 | try: |
| 13 | import gi | 14 | import gi |
| @@ -196,6 +197,7 @@ def main(server, eventHandler, params): | |||
| 196 | gtkgui.start() | 197 | gtkgui.start() |
| 197 | 198 | ||
| 198 | try: | 199 | try: |
| 200 | params.updateToServer(server, os.environ.copy()) | ||
| 199 | params.updateFromServer(server) | 201 | params.updateFromServer(server) |
| 200 | cmdline = params.parseActions() | 202 | cmdline = params.parseActions() |
| 201 | if not cmdline: | 203 | if not cmdline: |
| @@ -218,6 +220,9 @@ def main(server, eventHandler, params): | |||
| 218 | except client.Fault as x: | 220 | except client.Fault as x: |
| 219 | print("XMLRPC Fault getting commandline:\n %s" % x) | 221 | print("XMLRPC Fault getting commandline:\n %s" % x) |
| 220 | return | 222 | return |
| 223 | except Exception as e: | ||
| 224 | print("Exception in startup:\n %s" % traceback.format_exc()) | ||
| 225 | return | ||
| 221 | 226 | ||
| 222 | if gtkthread.quit.isSet(): | 227 | if gtkthread.quit.isSet(): |
| 223 | return | 228 | return |
