Skip to contentSkip to conversation

[2.8][PATCH 1/3] ui/knotty: print log paths for failed tasks in summary

bitbake-devel [email protected] 2 participants 3 messages Jan 21, 2025 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Hi Steve,

Just wanted to check to see if you saw my backports to Scarthgap from a few weeks ago. It's definitely possible I did them incorrectly.

Thanks,
Chris

Quoted 121 lines

-----Original Message-----
From: [email protected] <bitbake- [email protected]> On Behalf Of Chris Laplante via lists.openembedded.org
Sent: Tuesday, January 7, 2025 4:54 PM
To: [email protected]
Cc: [email protected]; LAPLANTE,CHRIS (Agilent USA) <[email protected]>; Richard Purdie <[email protected]>
Subject: [bitbake-devel] [scarthgap][2.8][PATCH 1/3] ui/knotty: print log paths for failed tasks in summary

External Sender - Use caution opening files, clicking links, or responding to requests.

From: Chris Laplante <[email protected]>

When tasks fail, it's very frustrating to have to scroll up to find the log path(s). Many of us have the muscle memory to navigate to the 'temp' directories under tmp/work/, but new users do not.

This change enhances the final summary to include log paths (reported via bb.build.TaskFailed events). Here's an example:

NOTE: Tasks Summary: Attempted 856 tasks of which 853 didn't need to be rerun and 3 failed.

Summary: 3 tasks failed:
virtual:native:/home/chris/repos/poky/meta/recipes-
core/ncurses/ncurses_6.5.bb:do_fetch

    log: /home/chris/repos/poky/build/tmp/work/x86_64-linux/ncurses-
native/6.5/temp/log.do_fetch.1253462
  /home/chris/repos/poky/meta/recipes-
core/ncurses/ncurses_6.5.bb:do_fetch
    log: /home/chris/repos/poky/build/tmp/work/core2-64-poky-

linux/ncurses/6.5/temp/log.do_fetch.1253466
virtual:nativesdk:/home/chris/repos/poky/meta/recipes-
core/ncurses/ncurses_6.5.bb:do_fetch
log: /home/chris/repos/poky/build/tmp/work/x86_64-nativesdk-pokysdk-
linux/nativesdk-ncurses/6.5/temp/log.do_fetch.1253467
Summary: There were 3 WARNING messages.
Summary: There were 6 ERROR messages, returning a non-zero exit code.

Each log is rendered as a clickable hyperlink in the terminal. See
https://gist.git/
hub.com%2Fegmontkob%2Feb114294efbcd5adb1944c9f3cb5feda&data=05% 7C02%7Cchris.laplante%40agilent.com%7C5b537b9495ee47796cca08dd2f66 26a2%7Ca9c0bc098b46420693512ba12fb4a5c0%7C0%7C0%7C63871883797 6736782%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOi IwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0 %7C%7C%7C&sdata=S%2BTUoiFdgIoeVg0J%2F7VWsV91R3Qa14Lcsvff8SjTDlc %3D&reserved=0

---
 lib/bb/ui/knotty.py | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)
lib/bb/ui/knotty.py index renamed from lib/bb/ui/knotty.py +0 -0

f86999bb0..5956ab177 100644

lib/bb/ui/knotty.py +0 -0
@@ -640,7 +640,7 @@ def main(server, eventHandler, params, tf =

TerminalFilter):
return_value = 0
errors = 0
warnings = 0

lib/bb/ui/knotty.py +1 -1
-    taskfailures = []
+    taskfailures = {}
 
     printintervaldelta = 10 * 60 # 10 minutes
     printinterval = printintervaldelta
@@ -726,6 +726,8 @@ def main(server, eventHandler, params, tf =

TerminalFilter):
if isinstance(event, bb.build.TaskFailed):
return_value = 1
print_event_log(event, includelogs, loglines, termfilter)

lib/bb/ui/knotty.py +2 -0
+                k = "{}:{}".format(event._fn, event._task)
+                taskfailures[k] = event.logfile
             if isinstance(event, bb.build.TaskBase):
                 logger.info(event._message)
                 continue
@@ -821,7 +823,7 @@ def main(server, eventHandler, params, tf =

TerminalFilter):

if isinstance(event, bb.runqueue.runQueueTaskFailed):
return_value = 1

lib/bb/ui/knotty.py +1 -1
-                taskfailures.append(event.taskstring)
+                taskfailures.setdefault(event.taskstring)
                 logger.error(str(event))
                 continue
@@ -942,11 +944,19 @@ def main(server, eventHandler, params, tf =

TerminalFilter):
try:
termfilter.clearFooter()
summary = ""

lib/bb/ui/knotty.py +9 -1
+        def print_hyperlink(url, link_text):
+            start = f'\033]8;;{url}\033\\'
+            end = '\033]8;;\033\\'
+            return f'{start}{link_text}{end}'
+
         if taskfailures:
             summary += pluralise("\nSummary: %s task failed:",
                                  "\nSummary: %s tasks failed:", len(taskfailures))
-            for failure in taskfailures:
+            for (failure, log_file) in taskfailures.items():
                 summary += "\n  %s" % failure
+                if log_file:
+                    hyperlink = print_hyperlink(f"file://{log_file}", log_file)
+                    summary += "\n    log: {}".format(hyperlink)
         if warnings:
             summary += pluralise("\nSummary: There was %s WARNING message.",
                                  "\nSummary: There were %s WARNING messages.",

warnings)
--
2.43.0

#2 lore raw
Quoted 4 lines · On Tue, Jan 21, 2025 at 7:59 AM [email protected]…

Hi Steve,

Just wanted to check to see if you saw my backports to Scarthgap from a few weeks ago. It's definitely possible I did them incorrectly.

Sorry, I somehow missed them! Will work on those today.

Thanks for the reminder!

Steve

Quoted 122 lines
Quoted 121 lines

-----Original Message-----
From: [email protected] <bitbake- [email protected]> On Behalf Of Chris Laplante via lists.openembedded.org
Sent: Tuesday, January 7, 2025 4:54 PM
To: [email protected]
Cc: [email protected]; LAPLANTE,CHRIS (Agilent USA) <[email protected]>; Richard Purdie <[email protected]>
Subject: [bitbake-devel] [scarthgap][2.8][PATCH 1/3] ui/knotty: print log paths for failed tasks in summary

External Sender - Use caution opening files, clicking links, or responding to requests.

From: Chris Laplante <[email protected]>

When tasks fail, it's very frustrating to have to scroll up to find the log path(s). Many of us have the muscle memory to navigate to the 'temp' directories under tmp/work/, but new users do not.

This change enhances the final summary to include log paths (reported via bb.build.TaskFailed events). Here's an example:

NOTE: Tasks Summary: Attempted 856 tasks of which 853 didn't need to be rerun and 3 failed.

Summary: 3 tasks failed:
virtual:native:/home/chris/repos/poky/meta/recipes-
core/ncurses/ncurses_6.5.bb:do_fetch

    log: /home/chris/repos/poky/build/tmp/work/x86_64-linux/ncurses-
native/6.5/temp/log.do_fetch.1253462
  /home/chris/repos/poky/meta/recipes-
core/ncurses/ncurses_6.5.bb:do_fetch
    log: /home/chris/repos/poky/build/tmp/work/core2-64-poky-

linux/ncurses/6.5/temp/log.do_fetch.1253466
virtual:nativesdk:/home/chris/repos/poky/meta/recipes-
core/ncurses/ncurses_6.5.bb:do_fetch
log: /home/chris/repos/poky/build/tmp/work/x86_64-nativesdk-pokysdk-
linux/nativesdk-ncurses/6.5/temp/log.do_fetch.1253467
Summary: There were 3 WARNING messages.
Summary: There were 6 ERROR messages, returning a non-zero exit code.

Each log is rendered as a clickable hyperlink in the terminal. See
https://gist.git/
hub.com%2Fegmontkob%2Feb114294efbcd5adb1944c9f3cb5feda&data=05% 7C02%7Cchris.laplante%40agilent.com%7C5b537b9495ee47796cca08dd2f66 26a2%7Ca9c0bc098b46420693512ba12fb4a5c0%7C0%7C0%7C63871883797 6736782%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOi IwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0 %7C%7C%7C&sdata=S%2BTUoiFdgIoeVg0J%2F7VWsV91R3Qa14Lcsvff8SjTDlc %3D&reserved=0

---
 lib/bb/ui/knotty.py | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)
lib/bb/ui/knotty.py index renamed from lib/bb/ui/knotty.py +0 -0

f86999bb0..5956ab177 100644

lib/bb/ui/knotty.py +0 -0
@@ -640,7 +640,7 @@ def main(server, eventHandler, params, tf =

TerminalFilter):
return_value = 0
errors = 0
warnings = 0

lib/bb/ui/knotty.py +1 -1
-    taskfailures = []
+    taskfailures = {}
 
     printintervaldelta = 10 * 60 # 10 minutes
     printinterval = printintervaldelta
@@ -726,6 +726,8 @@ def main(server, eventHandler, params, tf =

TerminalFilter):
if isinstance(event, bb.build.TaskFailed):
return_value = 1
print_event_log(event, includelogs, loglines, termfilter)

lib/bb/ui/knotty.py +2 -0
+                k = "{}:{}".format(event._fn, event._task)
+                taskfailures[k] = event.logfile
             if isinstance(event, bb.build.TaskBase):
                 logger.info(event._message)
                 continue
@@ -821,7 +823,7 @@ def main(server, eventHandler, params, tf =

TerminalFilter):

if isinstance(event, bb.runqueue.runQueueTaskFailed):
return_value = 1

lib/bb/ui/knotty.py +1 -1
-                taskfailures.append(event.taskstring)
+                taskfailures.setdefault(event.taskstring)
                 logger.error(str(event))
                 continue
@@ -942,11 +944,19 @@ def main(server, eventHandler, params, tf =

TerminalFilter):
try:
termfilter.clearFooter()
summary = ""

lib/bb/ui/knotty.py +9 -1
+        def print_hyperlink(url, link_text):
+            start = f'\033]8;;{url}\033\\'
+            end = '\033]8;;\033\\'
+            return f'{start}{link_text}{end}'
+
         if taskfailures:
             summary += pluralise("\nSummary: %s task failed:",
                                  "\nSummary: %s tasks failed:", len(taskfailures))
-            for failure in taskfailures:
+            for (failure, log_file) in taskfailures.items():
                 summary += "\n  %s" % failure
+                if log_file:
+                    hyperlink = print_hyperlink(f"file://{log_file}", log_file)
+                    summary += "\n    log: {}".format(hyperlink)
         if warnings:
             summary += pluralise("\nSummary: There was %s WARNING message.",
                                  "\nSummary: There were %s WARNING messages.",

warnings)
--
2.43.0

#3 lore raw

RE: UNVERIFIED SENDER Re: [bitbake-devel] [scarthgap][2.8][PATCH 1/3] ui/knotty: print log paths for failed tasks in summary

Quoted 5 lines
Quoted 3 lines · On Tue, Jan 21, 2025 at 7:59 AM [email protected]…

Hi Steve,

Quoted 8 lines
Quoted 1 line

Just wanted to check to see if you saw my backports to Scarthgap from a few

weeks ago. It's definitely possible I did them incorrectly.

Sorry, I somehow missed them! Will work on those today.

Thanks for the reminder!

Steve

No worries, I appreciate it! (And I appreciate you maintaining Scarthgap!)

Thanks,
Chris