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 2/7] bitbake-diffsigs: make finding of changed signatures more robust
Date: Mon, 9 May 2022 12:15:59 +0200	[thread overview]
Message-ID: <20220509101604.3249558-3-adriaan.schmidt@siemens.com> (raw)
In-Reply-To: <20220509101604.3249558-1-adriaan.schmidt@siemens.com>

In `runtaskhashes`, the keys contain the absolute paths to the recipe. When
working with shared sstate caches (where these absolute paths can be different)
we see that compare_sigfiles does not identifiy a changed hash of a dependent
task as "changed", but instead as "removed"&"added", preventing the function
from recursing and continuing the comparison.

By calling `clean_basepaths` before comparing the `runtaskhashes` dicts, we
avoid this.

Backported from upstream:
https://git.openembedded.org/bitbake/commit/?id=7358378b90b68111779e6ae72948e5e7a3de00a9

Signed-off-by: Adriaan Schmidt <adriaan.schmidt@siemens.com>
---
 bitbake/lib/bb/siggen.py | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/bitbake/lib/bb/siggen.py b/bitbake/lib/bb/siggen.py
index 0d88c6ec..8b23fd04 100644
--- a/bitbake/lib/bb/siggen.py
+++ b/bitbake/lib/bb/siggen.py
@@ -944,8 +944,8 @@ def compare_sigfiles(a, b, recursecb=None, color=False, collapsed=False):
 
 
     if 'runtaskhashes' in a_data and 'runtaskhashes' in b_data:
-        a = a_data['runtaskhashes']
-        b = b_data['runtaskhashes']
+        a = clean_basepaths(a_data['runtaskhashes'])
+        b = clean_basepaths(b_data['runtaskhashes'])
         changed, added, removed = dict_diff(a, b)
         if added:
             for dep in added:
@@ -956,7 +956,7 @@ def compare_sigfiles(a, b, recursecb=None, color=False, collapsed=False):
                             #output.append("Dependency on task %s was replaced by %s with same hash" % (dep, bdep))
                             bdep_found = True
                 if not bdep_found:
-                    output.append(color_format("{color_title}Dependency on task %s was added{color_default} with hash %s") % (clean_basepath(dep), b[dep]))
+                    output.append(color_format("{color_title}Dependency on task %s was added{color_default} with hash %s") % (dep, b[dep]))
         if removed:
             for dep in removed:
                 adep_found = False
@@ -966,11 +966,11 @@ def compare_sigfiles(a, b, recursecb=None, color=False, collapsed=False):
                             #output.append("Dependency on task %s was replaced by %s with same hash" % (adep, dep))
                             adep_found = True
                 if not adep_found:
-                    output.append(color_format("{color_title}Dependency on task %s was removed{color_default} with hash %s") % (clean_basepath(dep), a[dep]))
+                    output.append(color_format("{color_title}Dependency on task %s was removed{color_default} with hash %s") % (dep, a[dep]))
         if changed:
             for dep in changed:
                 if not collapsed:
-                    output.append(color_format("{color_title}Hash for dependent task %s changed{color_default} from %s to %s") % (clean_basepath(dep), a[dep], b[dep]))
+                    output.append(color_format("{color_title}Hash for dependent task %s changed{color_default} from %s to %s") % (dep, a[dep], b[dep]))
                 if callable(recursecb):
                     recout = recursecb(dep, a[dep], b[dep])
                     if recout:
-- 
2.30.2


  parent reply	other threads:[~2022-05-09 10:16 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-09 10:15 [PATCH v2 0/7] Sstate maintenance script Adriaan Schmidt
2022-05-09 10:15 ` [PATCH v2 1/7] meta-isar: improve cachability Adriaan Schmidt
2022-05-09 10:15 ` Adriaan Schmidt [this message]
2022-05-09 10:16 ` [PATCH v2 3/7] bitbake-diffsigs: break on first dependent task difference Adriaan Schmidt
2022-05-09 10:16 ` [PATCH v2 4/7] dpkg-base: refactor dependencies of apt_* tasks Adriaan Schmidt
2022-05-09 10:16 ` [PATCH v2 5/7] scripts: add isar-sstate Adriaan Schmidt
2022-05-09 10:16 ` [PATCH v2 6/7] isar-sstate: add tool to check for caching issues Adriaan Schmidt
2022-05-09 10:16 ` [PATCH v2 7/7] testsuite: add cachability analysis to sstate test Adriaan Schmidt
2022-05-18 11:02 ` [PATCH v2 0/7] Sstate maintenance script 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=20220509101604.3249558-3-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