public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Adriaan Schmidt <adriaan.schmidt@siemens.com>
To: <isar-users@googlegroups.com>
Cc: Adriaan Schmidt <adriaan.schmidt@siemens.com>
Subject: [PATCH v2 1/3] fix(isar-sstate): catch errors during signature reading
Date: Tue, 19 Jul 2022 14:35:07 +0200	[thread overview]
Message-ID: <20220719123509.308439-2-adriaan.schmidt@siemens.com> (raw)
In-Reply-To: <20220719123509.308439-1-adriaan.schmidt@siemens.com>

Those errors happen when the sstate cache contains both pre and post
bitbake-2.0 signatures, which have a different format (pickle vs. compressed json).

Signed-off-by: Adriaan Schmidt <adriaan.schmidt@siemens.com>
---
 scripts/isar-sstate | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/scripts/isar-sstate b/scripts/isar-sstate
index 8ea85edc..5c47b479 100755
--- a/scripts/isar-sstate
+++ b/scripts/isar-sstate
@@ -781,7 +781,10 @@ def sstate_analyze(source, target, **kwargs):
 
             local_file = source.download(s.path)
             remote_file = target.download(t.path)
-            out = compare_sigfiles(remote_file, local_file, recursecb, color=True)
+            try:
+                out = compare_sigfiles(remote_file, local_file, recursecb, color=True)
+            except:
+                out = ["Failed to compare signatures."]
             source.release(local_file)
             target.release(remote_file)
             # shorten hashes from 64 to 8 characters for better readability
@@ -803,8 +806,12 @@ def sstate_lint(target, verbose, sources_dir, build_dir, exit_code, **kwargs):
     for sig in cache_sigs.values():
         sig_file = target.download(sig.path)
         with open(sig_file, 'rb') as f:
-            sigdata_raw = pickle.Unpickler(f)
-            sigdata = sigdata_raw.load()
+            try:
+                sigdata_raw = pickle.Unpickler(f)
+                sigdata = sigdata_raw.load()
+            except:
+                # invalid file or format... never mind
+                continue
 
             pn_issues = []
             for name, val in sigdata['varvals'].items():
-- 
2.30.2


  reply	other threads:[~2022-07-19 12:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-19 12:35 [PATCH v2 0/3] isar-sstate improvements Adriaan Schmidt
2022-07-19 12:35 ` Adriaan Schmidt [this message]
2022-07-19 12:35 ` [PATCH v2 2/3] isar-sstate: refactor exit codes and error messages Adriaan Schmidt
2022-07-19 12:35 ` [PATCH v2 3/3] docs(isar-sstate): update documentation of lint command Adriaan Schmidt
2022-07-26  6:51 ` [PATCH v2 0/3] isar-sstate improvements Anton Mikanovich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220719123509.308439-2-adriaan.schmidt@siemens.com \
    --to=adriaan.schmidt@siemens.com \
    --cc=isar-users@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox