Skip to contentSkip to conversation

ui/knotty: print log paths for failed tasks in summary

RFC PATCH [email protected] 2 participants 5 messages Jun 18, 2024 – Aug 14, 2024 1 message not in the archive

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive
Quoted 27 lines

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.

Quoted 8 lines

Each log is rendered as a clickable hyperlink in the terminal. See
https://gist.githu/
b.com%2Fegmontkob%2Feb114294efbcd5adb1944c9f3cb5feda&data=05%7C02 %7Cchris.laplante%40agilent.com%7C81ac6523ef43415e28c008dc8f093617%7 Ca9c0bc098b46420693512ba12fb4a5c0%7C0%7C0%7C638542517027782743% 7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTi I6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=JSz4jByKq5f5NjguXlR8S YS%2BZQ3FoJbz07BKRkheSjU%3D&reserved=0

I probably should have included a cover letter, but FYI the reason this is RFC is that I'm unsure if we should disable the hyperlinking in response to NO_COLOR being set. I'm leaning towards 'yes, it should disable'.

Unfortunately there is no universal reliable way to detect if hyperlinking is supported by the terminal (at least according to https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda).

Thanks,
Chris

#2 lore raw
Quoted 37 lines

-----Original Message-----
From: [email protected] <bitbake- [email protected]> On Behalf Of Chris Laplante via lists.openembedded.org
Sent: den 18 juni 2024 18:37
To: [email protected]
Subject: Re: [bitbake-devel] [RFC PATCH] ui/knotty: print log paths for failed tasks in summary

Quoted 20 lines

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
Quoted 5 lines

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.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda

I probably should have included a cover letter, but FYI the reason this is RFC is that I'm unsure if we should disable the hyperlinking in response to NO_COLOR being set. I'm leaning towards 'yes, it should disable'.

Quoted 6 lines

Unfortunately there is no universal reliable way to detect if hyperlinking is supported by the terminal (at least according to
https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda).

Thanks,
Chris

I don't have anything to say about the link support as the terminal I use does not support it, but I would very much like to have the support for listing the log files integrated. I have added this patch to my two main build trees and it helps a lot to not have to go hunt for the log files when there is a build error.

//Peter

#3 lore raw

Hi Peter,

Quoted 17 lines
Quoted 3 lines

I probably should have included a cover letter, but FYI the reason this is RFC is that I'm unsure if we should disable the hyperlinking in response to NO_COLOR being set. I'm leaning towards 'yes, it should

disable'.

Quoted 4 lines

Unfortunately there is no universal reliable way to detect if hyperlinking is supported by the terminal (at least according to

https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgist.
github.com%2Fegmontkob%2Feb114294efbcd5adb1944c9f3cb5feda&data= 05%7C02%7Cchris.laplante%40agilent.com%7C3bd654f041734bd60ee508d cab4d8dc1%7Ca9c0bc098b46420693512ba12fb4a5c0%7C0%7C0%7C6385 73596794212235%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMD AiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&s data=qFMRLWNPjXTL11pB%2Ft97P4CzJ4QRzBXcWS9AUnCXxcQ%3D&reserv ed=0).

Quoted 1 line
Quoted 7 lines
Quoted 2 lines

Thanks,
Chris

I don't have anything to say about the link support as the terminal I use does not support it, but I would very much like to have the support for listing the log files integrated. I have added this patch to my two main build trees and it helps a lot to not have to go hunt for the log files when there is a build error.

Did you have to tweak the code to suppress printing the hyperlink ANSI codes, or did your terminal just gracefully ignore them?

The feedback is much appreciated, thanks!

Thanks,
Chris

#4 lore raw
Quoted 36 lines

-----Original Message-----
From: [email protected] <[email protected]>
Sent: den 24 juli 2024 15:50
To: Peter Kjellerstedt <[email protected]>; bitbake- [email protected]
Subject: RE: [bitbake-devel] [RFC PATCH] ui/knotty: print log paths for failed tasks in summary

Hi Peter,

Quoted 17 lines
Quoted 8 lines

I probably should have included a cover letter, but FYI the reason this is RFC is that I'm unsure if we should disable the hyperlinking in response to NO_COLOR being set. I'm leaning towards 'yes, it should disable'.

Unfortunately there is no universal reliable way to detect if hyperlinking is supported by the terminal (at least according to

https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgist.
github.com%2Fegmontkob%2Feb114294efbcd5adb1944c9f3cb5feda&data= 05%7C02%7Cchris.laplante%40agilent.com%7C3bd654f041734bd60ee508d cab4d8dc1%7Ca9c0bc098b46420693512ba12fb4a5c0%7C0%7C0%7C6385 73596794212235%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMD AiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&s data=qFMRLWNPjXTL11pB%2Ft97P4CzJ4QRzBXcWS9AUnCXxcQ%3D&reserv ed=0).

Quoted 1 line
Quoted 8 lines
Quoted 2 lines

Thanks,
Chris

I don't have anything to say about the link support as the terminal I use does not support it, but I would very much like to have the support for listing the log files integrated. I have added this patch to my two main build trees and it helps a lot to not have to go hunt for the log files when there is a build error.

Quoted 7 lines

Did you have to tweak the code to suppress printing the hyperlink ANSI codes, or did your terminal just gracefully ignore them?

The feedback is much appreciated, thanks!

Thanks,
Chris

I use MobaXterm (on Windows) and connect using SSH. It silently ignores the hyperlink. Same with Xterm running on my Linux computer.
Gnome Terminal shows the hyperlink properly.

//Peter

#5 lore raw

Hi Peter,

Quoted 5 lines
Quoted 5 lines

Did you have to tweak the code to suppress printing the hyperlink ANSI codes, or did your terminal just gracefully ignore them?

The feedback is much appreciated, thanks!

Quoted 8 lines
Quoted 2 lines

Thanks,
Chris

I use MobaXterm (on Windows) and connect using SSH. It silently ignores the hyperlink. Same with Xterm running on my Linux computer.
Gnome Terminal shows the hyperlink properly.

//Peter

Many thanks for the info! Submitting the patch to upstream now.

Thanks,
Chris