diff mbox series

bin/bitbake-setup: print a note about fetcher log if something fails there

Message ID 20260907173208.3672064-1-alex.kanavin@gmail.com
State New
Headers show
Series bin/bitbake-setup: print a note about fetcher log if something fails there | expand

Commit Message

Alexander Kanavin Sept. 7, 2026, 5:32 p.m. UTC
From: Alexander Kanavin <alex@linutronix.de>

Fetcher errors can sometimes be not particularly helpful, e.g.

ERROR: Fetcher failure for URL: '<url>'. Unable to fetch URL from any source.

In such situations, fetcher log can contain the actual information about what
went wrong, but bitbake-setup would not say where it is (unlike bitbake proper
which does).

So if a log exists, and isn't empty, print a note to try to help users:

ERROR: Check /home/alex/bitbake-builds/poky-master-poky-distro_poky-machine_qemux86-64/layers/logs/fetch_log.20260907192613 for additional information to diagnoze the issue.
ERROR: Fetcher failure for URL: '<url>'. Unable to fetch URL from any source.

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
---
 bin/bitbake-setup | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/bin/bitbake-setup b/bin/bitbake-setup
index 427a2d835..d18d32ba0 100755
--- a/bin/bitbake-setup
+++ b/bin/bitbake-setup
@@ -985,6 +985,10 @@  def do_fetch(fetcher, dir):
         try:
             fetcher.download()
             fetcher.unpack_update(dir)
+        except:
+            if os.path.exists(fetchlog) and os.path.getsize(fetchlog) > 0:
+                logger.error("Check {} for additional information that may help diagnoze the issue.".format(fetchlog))
+            raise
         finally:
             sys.stdout = oldstdout