summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrederic Martinsons <frederic.martinsons@gmail.com>2023-04-01 17:21:01 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-04-04 13:12:23 +0100
commitbbf2e79f88153b531af1e32a62497412adeb4c8a (patch)
tree89e91a247ba5133bf7b869759c110c6a7f5e44e3
parent97986cbfc29a4ffbd3cb9802b77735b0c3b9315b (diff)
downloadpoky-bbf2e79f88153b531af1e32a62497412adeb4c8a.tar.gz
bitbake: fetch2: Display all missing checksum at once
Instead of only display the first and stop. For recipe (crago based) that can contains several artifacts to fetch with their checksum, it will particularly handy to display all of missing one. An example of error message would be NOTE: Executing Tasks ERROR: zvariant-3.12.0-r0 do_fetch: Missing SRC_URI checksum, please add those to the recipe: SRC_URI[anyhow-1.0.70.sha256sum] = "7de8ce5e0f9f8d88245311066a578d72b7af3e7088f32783804676302df237e4" SRC_URI[chrono-0.4.24.sha256sum] = "4e3c5919066adf22df73762e50cffcde3a758f2a848b113b586d1f86728b673b" SRC_URI[serde-1.0.158.sha256sum] = "771d4d9c4163ee138805e12c710dd365e4f44be8be0503cb1bb9eb989425d9c9" SRC_URI[system-deps-1.3.2.sha256sum] = "0f3ecc17269a19353b3558b313bba738b25d82993e30d62a18406a24aba4649b" ERROR: zvariant-3.12.0-r0 do_fetch: Bitbake Fetcher Error: BBFetchException('There was some missing checksums in the recipe') ERROR: Logfile of failure stored in: /home/jenkins/yocto-poky-master/poky/build/tmp/work/core2-64-poky-linux/zvariant/3.12.0-r0/temp/log.do_fetch.1025 ERROR: Task (/home/jenkins/yocto-poky-master/poky/meta-selftest/recipes-extended/zvariant/zvariant_3.12.0.bb:do_fetch) failed with exit code '1' (Bitbake rev: dafa07c080e05975b6319b5adf78a9691c6b6643) Signed-off-by: Frederic Martinsons <frederic.martinsons@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--bitbake/lib/bb/fetch2/__init__.py18
1 files changed, 10 insertions, 8 deletions
diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py
index 31729885ab..1a86d8fd81 100644
--- a/bitbake/lib/bb/fetch2/__init__.py
+++ b/bitbake/lib/bb/fetch2/__init__.py
@@ -560,7 +560,6 @@ def verify_checksum(ud, d, precomputed={}, localpath=None, fatal_nochecksum=True
560 file against those in the recipe each time, rather than only after 560 file against those in the recipe each time, rather than only after
561 downloading. See https://bugzilla.yoctoproject.org/show_bug.cgi?id=5571. 561 downloading. See https://bugzilla.yoctoproject.org/show_bug.cgi?id=5571.
562 """ 562 """
563
564 if ud.ignore_checksums or not ud.method.supports_checksum(ud): 563 if ud.ignore_checksums or not ud.method.supports_checksum(ud):
565 return {} 564 return {}
566 565
@@ -605,11 +604,7 @@ def verify_checksum(ud, d, precomputed={}, localpath=None, fatal_nochecksum=True
605 604
606 # If strict checking enabled and neither sum defined, raise error 605 # If strict checking enabled and neither sum defined, raise error
607 if strict == "1": 606 if strict == "1":
608 messages.append("No checksum specified for '%s', please add at " \ 607 raise NoChecksumError("\n".join(checksum_lines))
609 "least one to the recipe:" % ud.localpath)
610 messages.extend(checksum_lines)
611 logger.error("\n".join(messages))
612 raise NoChecksumError("Missing SRC_URI checksum", ud.url)
613 608
614 bb.event.fire(MissingChecksumEvent(ud.url, **checksum_event), d) 609 bb.event.fire(MissingChecksumEvent(ud.url, **checksum_event), d)
615 610
@@ -1728,6 +1723,7 @@ class Fetch(object):
1728 network = self.d.getVar("BB_NO_NETWORK") 1723 network = self.d.getVar("BB_NO_NETWORK")
1729 premirroronly = bb.utils.to_boolean(self.d.getVar("BB_FETCH_PREMIRRORONLY")) 1724 premirroronly = bb.utils.to_boolean(self.d.getVar("BB_FETCH_PREMIRRORONLY"))
1730 1725
1726 checksum_missing_messages = []
1731 for u in urls: 1727 for u in urls:
1732 ud = self.ud[u] 1728 ud = self.ud[u]
1733 ud.setup_localpath(self.d) 1729 ud.setup_localpath(self.d)
@@ -1739,7 +1735,6 @@ class Fetch(object):
1739 1735
1740 try: 1736 try:
1741 self.d.setVar("BB_NO_NETWORK", network) 1737 self.d.setVar("BB_NO_NETWORK", network)
1742
1743 if m.verify_donestamp(ud, self.d) and not m.need_update(ud, self.d): 1738 if m.verify_donestamp(ud, self.d) and not m.need_update(ud, self.d):
1744 done = True 1739 done = True
1745 elif m.try_premirror(ud, self.d): 1740 elif m.try_premirror(ud, self.d):
@@ -1811,13 +1806,20 @@ class Fetch(object):
1811 raise ChecksumError("Stale Error Detected") 1806 raise ChecksumError("Stale Error Detected")
1812 1807
1813 except BBFetchException as e: 1808 except BBFetchException as e:
1814 if isinstance(e, ChecksumError): 1809 if isinstance(e, NoChecksumError):
1810 (message, _) = e.args
1811 checksum_missing_messages.append(message)
1812 continue
1813 elif isinstance(e, ChecksumError):
1815 logger.error("Checksum failure fetching %s" % u) 1814 logger.error("Checksum failure fetching %s" % u)
1816 raise 1815 raise
1817 1816
1818 finally: 1817 finally:
1819 if ud.lockfile: 1818 if ud.lockfile:
1820 bb.utils.unlockfile(lf) 1819 bb.utils.unlockfile(lf)
1820 if checksum_missing_messages:
1821 logger.error("Missing SRC_URI checksum, please add those to the recipe: \n%s", "\n".join(checksum_missing_messages))
1822 raise BBFetchException("There was some missing checksums in the recipe")
1821 1823
1822 def checkstatus(self, urls=None): 1824 def checkstatus(self, urls=None):
1823 """ 1825 """