Received: from kernel.crashing.org (kernel.crashing.org [76.164.61.194]) by mx.groups.io with SMTP id smtpd.web10.8242.1589383067038028008 for ; Wed, 13 May 2020 08:17:47 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=permerror, err=syntax error for token: (domain: kernel.crashing.org, ip: 76.164.61.194, mailfrom: mark.hatle@kernel.crashing.org) Received: from lons-builder.int.hatle.net ([192.40.192.88]) by kernel.crashing.org (8.14.7/8.14.7) with ESMTP id 04DFHheM025378 for ; Wed, 13 May 2020 10:17:44 -0500 From: "Mark Hatle" To: openembedded-core@lists.openembedded.org Subject: [PATCH] sstate.bbclass: When siginfo or sig files are missing, stop fetcher errors Date: Wed, 13 May 2020 10:17:43 -0500 Message-Id: <20200513151743.160971-1-mark.hatle@kernel.crashing.org> X-Mailer: git-send-email 2.17.1 From: Mark Hatle Prior to fetching, the system checks if the sstate file is present either locally or on the mirror. If it is, then it goes to the fetch stage. Up to three files can be fetched, sstate, sstate.siginfo and sstate.sig (if signature validation is enabled). The previous pstaging_fetch function would iterate over these, and if a download error occurred would spew forth a great amount of fetcher failure messages as well as stop fetching the next item in the set. This was resolved by adding a fetcher.checkstatus() call prior to the download. If the file isn't present, then the exception will be triggered, and no fetcher failure messages will reach the user. The exception handler is then modified to be a pass so that it will loop and pull the rest of the files that that are requested. Additionally, a check for the existance of the .sig file was added to the sstate_installpkg to avoid an error trying to load the .sig if it wasn't downloaded. Signed-off-by: Mark Hatle Signed-off-by: Mark Hatle --- meta/classes/sstate.bbclass | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass index aa9c30b4e1..da8d5e78f4 100644 --- a/meta/classes/sstate.bbclass +++ b/meta/classes/sstate.bbclass @@ -355,6 +355,9 @@ def sstate_installpkg(ss, d): d.setVar('SSTATE_INSTDIR', sstateinst) if bb.utils.to_boolean(d.getVar("SSTATE_VERIFY_SIG"), False): + if not os.path.isfile(sstatepkg + '.sig'): + bb.warn("Not signature file for sstate package %s, skipping acceleration..." % sstatepkg) + return False signer = get_signer(d, 'local') if not signer.verify(sstatepkg + '.sig'): bb.warn("Cannot verify signature on sstate package %s, skipping acceleration..." % sstatepkg) @@ -733,10 +736,11 @@ def pstaging_fetch(sstatefetch, d): localdata.setVar('SRC_URI', srcuri) try: fetcher = bb.fetch2.Fetch([srcuri], localdata, cache=False) + fetcher.checkstatus() fetcher.download() except bb.fetch2.BBFetchException: - break + pass def sstate_setscene(d): shared_state = sstate_state_fromvars(d) -- 2.17.1