diff options
Diffstat (limited to 'bitbake/lib/bb/ui')
-rw-r--r-- | bitbake/lib/bb/ui/knotty.py | 20 | ||||
-rw-r--r-- | bitbake/lib/bb/ui/teamcity.py | 5 |
2 files changed, 17 insertions, 8 deletions
diff --git a/bitbake/lib/bb/ui/knotty.py b/bitbake/lib/bb/ui/knotty.py index f86999bb09..3784c93ad8 100644 --- a/bitbake/lib/bb/ui/knotty.py +++ b/bitbake/lib/bb/ui/knotty.py | |||
@@ -577,6 +577,8 @@ def main(server, eventHandler, params, tf = TerminalFilter): | |||
577 | else: | 577 | else: |
578 | log_exec_tty = False | 578 | log_exec_tty = False |
579 | 579 | ||
580 | should_print_hyperlinks = sys.stdout.isatty() and os.environ.get('NO_COLOR', '') == '' | ||
581 | |||
580 | helper = uihelper.BBUIHelper() | 582 | helper = uihelper.BBUIHelper() |
581 | 583 | ||
582 | # Look for the specially designated handlers which need to be passed to the | 584 | # Look for the specially designated handlers which need to be passed to the |
@@ -640,7 +642,7 @@ def main(server, eventHandler, params, tf = TerminalFilter): | |||
640 | return_value = 0 | 642 | return_value = 0 |
641 | errors = 0 | 643 | errors = 0 |
642 | warnings = 0 | 644 | warnings = 0 |
643 | taskfailures = [] | 645 | taskfailures = {} |
644 | 646 | ||
645 | printintervaldelta = 10 * 60 # 10 minutes | 647 | printintervaldelta = 10 * 60 # 10 minutes |
646 | printinterval = printintervaldelta | 648 | printinterval = printintervaldelta |
@@ -726,6 +728,8 @@ def main(server, eventHandler, params, tf = TerminalFilter): | |||
726 | if isinstance(event, bb.build.TaskFailed): | 728 | if isinstance(event, bb.build.TaskFailed): |
727 | return_value = 1 | 729 | return_value = 1 |
728 | print_event_log(event, includelogs, loglines, termfilter) | 730 | print_event_log(event, includelogs, loglines, termfilter) |
731 | k = "{}:{}".format(event._fn, event._task) | ||
732 | taskfailures[k] = event.logfile | ||
729 | if isinstance(event, bb.build.TaskBase): | 733 | if isinstance(event, bb.build.TaskBase): |
730 | logger.info(event._message) | 734 | logger.info(event._message) |
731 | continue | 735 | continue |
@@ -821,7 +825,7 @@ def main(server, eventHandler, params, tf = TerminalFilter): | |||
821 | 825 | ||
822 | if isinstance(event, bb.runqueue.runQueueTaskFailed): | 826 | if isinstance(event, bb.runqueue.runQueueTaskFailed): |
823 | return_value = 1 | 827 | return_value = 1 |
824 | taskfailures.append(event.taskstring) | 828 | taskfailures.setdefault(event.taskstring) |
825 | logger.error(str(event)) | 829 | logger.error(str(event)) |
826 | continue | 830 | continue |
827 | 831 | ||
@@ -942,11 +946,21 @@ def main(server, eventHandler, params, tf = TerminalFilter): | |||
942 | try: | 946 | try: |
943 | termfilter.clearFooter() | 947 | termfilter.clearFooter() |
944 | summary = "" | 948 | summary = "" |
949 | def format_hyperlink(url, link_text): | ||
950 | if should_print_hyperlinks: | ||
951 | start = f'\033]8;;{url}\033\\' | ||
952 | end = '\033]8;;\033\\' | ||
953 | return f'{start}{link_text}{end}' | ||
954 | return link_text | ||
955 | |||
945 | if taskfailures: | 956 | if taskfailures: |
946 | summary += pluralise("\nSummary: %s task failed:", | 957 | summary += pluralise("\nSummary: %s task failed:", |
947 | "\nSummary: %s tasks failed:", len(taskfailures)) | 958 | "\nSummary: %s tasks failed:", len(taskfailures)) |
948 | for failure in taskfailures: | 959 | for (failure, log_file) in taskfailures.items(): |
949 | summary += "\n %s" % failure | 960 | summary += "\n %s" % failure |
961 | if log_file: | ||
962 | hyperlink = format_hyperlink(f"file://{log_file}", log_file) | ||
963 | summary += "\n log: {}".format(hyperlink) | ||
950 | if warnings: | 964 | if warnings: |
951 | summary += pluralise("\nSummary: There was %s WARNING message.", | 965 | summary += pluralise("\nSummary: There was %s WARNING message.", |
952 | "\nSummary: There were %s WARNING messages.", warnings) | 966 | "\nSummary: There were %s WARNING messages.", warnings) |
diff --git a/bitbake/lib/bb/ui/teamcity.py b/bitbake/lib/bb/ui/teamcity.py index fca46c2874..7eeaab8d63 100644 --- a/bitbake/lib/bb/ui/teamcity.py +++ b/bitbake/lib/bb/ui/teamcity.py | |||
@@ -30,7 +30,6 @@ import bb.build | |||
30 | import bb.command | 30 | import bb.command |
31 | import bb.cooker | 31 | import bb.cooker |
32 | import bb.event | 32 | import bb.event |
33 | import bb.exceptions | ||
34 | import bb.runqueue | 33 | import bb.runqueue |
35 | from bb.ui import uihelper | 34 | from bb.ui import uihelper |
36 | 35 | ||
@@ -102,10 +101,6 @@ class TeamcityLogFormatter(logging.Formatter): | |||
102 | details = "" | 101 | details = "" |
103 | if hasattr(record, 'bb_exc_formatted'): | 102 | if hasattr(record, 'bb_exc_formatted'): |
104 | details = ''.join(record.bb_exc_formatted) | 103 | details = ''.join(record.bb_exc_formatted) |
105 | elif hasattr(record, 'bb_exc_info'): | ||
106 | etype, value, tb = record.bb_exc_info | ||
107 | formatted = bb.exceptions.format_exception(etype, value, tb, limit=5) | ||
108 | details = ''.join(formatted) | ||
109 | 104 | ||
110 | if record.levelno in [bb.msg.BBLogFormatter.ERROR, bb.msg.BBLogFormatter.CRITICAL]: | 105 | if record.levelno in [bb.msg.BBLogFormatter.ERROR, bb.msg.BBLogFormatter.CRITICAL]: |
111 | # ERROR gets a separate errorDetails field | 106 | # ERROR gets a separate errorDetails field |