diff options
Diffstat (limited to 'bitbake/lib/bb/ui/knotty.py')
| -rw-r--r-- | bitbake/lib/bb/ui/knotty.py | 32 |
1 files changed, 24 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 |
