Skip to contentSkip to conversation

meta/lib/oe/recipeutils.py: handle fetcher errors when checking for new commits

PATCH New Alexander Kanavin 1 participant 3 messages Mar 18, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 meta/lib/oe/recipeutils.py: handle fetcher errors when checking for new commits

From: Alexander Kanavin <[email protected]>

Recent freedesktop instabilities are causing 'devtool check-upgrade-status' to fail with:

bb.fetch2.FetchError: Fetcher failure: Fetch command export PSEUDO_DISABLED=1; git -c gc.autoDetach=false -c core.pager=cat -c safe.bareRepository=all -c clone.defaultRemoteName=origin ls-remote https://gitlab.>
fatal: unable to access 'https://gitlab.freedesktop.org/mesa/kmscube/': The requested URL returned error: 502

and not print any results for this one or any unrelated recipes included in the check.

This change handles the error, so that if some upstream server isn't working properly, latest upstream revision for that is marked as unknown, a warning is printed and upstream version check for other recipes isn't thwarted:

WARNING: Unable to obtain latest revision: Fetcher failure: Fetch command export PSEUDO_DISABLED=1; git -c gc.autoDetach=false -c core.pager=cat -c safe.bareRepository=all -c clone.defaultRemoteName=origin ls-remote https://gitlab.freedesktop.org/mesa/piglit.git failed with exit code 128, output:
remote: GitLab is not responding
fatal: unable to access 'https://gitlab.freedesktop.org/mesa/piglit.git/': The requested URL returned error: 502

piglit 1.0 UNKNOWN_BROKEN Ross Burton <[email protected]>

---
 meta/lib/oe/recipeutils.py | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)
meta/lib/oe/recipeutils.py +9 -4
index 56be75dc9c9..044f1bfa614 100644
@@ -1070,10 +1070,15 @@ def get_recipe_upstream_version(rd):
         ud = bb.fetch2.FetchData(src_uri, rd)
         if rd.getVar("UPSTREAM_CHECK_COMMITS") == "1":
             bb.fetch2.get_srcrev(rd)
-            revision = ud.method.latest_revision(ud, rd, 'default')
-            upversion = pv
-            if revision != rd.getVar("SRCREV"):
-                upversion = upversion + "-new-commits-available"
+            upversion = None
+            revision = None
+            try:
+                revision = ud.method.latest_revision(ud, rd, 'default')
+                upversion = pv
+                if revision != rd.getVar("SRCREV"):
+                    upversion = upversion + "-new-commits-available"
+            except bb.fetch2.FetchError as e:
+                bb.warn("Unable to obtain latest revision: {}".format(e))
         else:
             pupver = ud.method.latest_versionstring(ud, rd)
             (upversion, revision) = pupver
Signature · 1 line
2.39.5
#1 lore raw

PATCH 2/3 qemu: fix upstream version check

From: Alexander Kanavin <[email protected]>

---
 meta/recipes-devtools/qemu/qemu.inc | 2 ++
 1 file changed, 2 insertions(+)
meta/recipes-devtools/qemu/qemu.inc +2 -0
index d253529b3d8..53f48375e4a 100644
@@ -35,6 +35,8 @@ SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \
            file://qemu-guest-agent.init \
            file://qemu-guest-agent.udev \
            "
+# file index at download.qemu.org isn't reliable: https://gitlab.com/qemu-project/qemu-web/-/issues/9
+UPSTREAM_CHECK_URI = "https://www.qemu.org"
 UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar"
 
 SRC_URI[sha256sum] = "f859f0bc65e1f533d040bbe8c92bcfecee5af2c921a6687c652fb44d089bd894"
Signature · 1 line
2.39.5
#2 lore raw

PATCH 3/3 libsdl2: only include 2.x releases in version check

In reply to Alexander Kanavin

From: Alexander Kanavin <[email protected]>

libsdl3 has its own recipe in meta-oe, which will
probably migrate to core in due time.

---
 meta/recipes-graphics/libsdl2/libsdl2_2.32.2.bb | 1 +
 1 file changed, 1 insertion(+)
meta/recipes-graphics/libsdl2/libsdl2_2.32.2.bb +1 -0
index d075b335f5d..8226774a9eb 100644
@@ -29,6 +29,7 @@ S = "${WORKDIR}/SDL2-${PV}"
 SRC_URI[sha256sum] = "c5f30c427fd8107ee4a400c84d4447dd211352512eaf0b6e89cc6a50a2821922"
 
 inherit cmake lib_package binconfig-disabled pkgconfig upstream-version-is-even
+UPSTREAM_CHECK_REGEX = "SDL2-(?P<pver>\d+\.(\d*[02468])+(\.\d+)+)\.tar"
 
 BINCONFIG = "${bindir}/sdl2-config"
 
Signature · 1 line
2.39.5