bitbake-devel.lists.openembedded.org archive mirror
 help / color / mirror / Atom feed
From: "Fabio Berton" <Fabio.Berton@criticaltechworks.com>
To: bitbake-devel@lists.openembedded.org
Subject: [1.46][PATCH 2/6] runqueue: Handle deferred task rehashing in multiconfig builds
Date: Wed, 15 Feb 2023 10:43:17 +0000	[thread overview]
Message-ID: <20230215104321.1665505-3-fabio.berton@criticaltechworks.com> (raw)
In-Reply-To: <20230215104321.1665505-1-fabio.berton@criticaltechworks.com>

From: Richard Purdie <richard.purdie@linuxfoundation.org>

If the hash of a task changes and that hash is a deferred task (e.g. a multiconfig
build), we need to ensure that the hash change propagates through to all the tasks
else the build will run multiple copies of the task, sometimes with oddly differing
results as the outhashes of native tasks built in differing locations can confuse
things.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 2db571324f755edc4981deecbcfdf0aaa5a97627)
Signed-off-by: Fabio Berton <fabio.berton@criticaltechworks.com>
---
 lib/bb/runqueue.py | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/lib/bb/runqueue.py b/lib/bb/runqueue.py
index f82bc413..a437aeef 100644
--- a/lib/bb/runqueue.py
+++ b/lib/bb/runqueue.py
@@ -2348,10 +2348,16 @@ class RunQueueExecute:
             self.updated_taskhash_queue.remove((tid, unihash))
 
             if unihash != self.rqdata.runtaskentries[tid].unihash:
-                hashequiv_logger.verbose("Task %s unihash changed to %s" % (tid, unihash))
-                self.rqdata.runtaskentries[tid].unihash = unihash
-                bb.parse.siggen.set_unihash(tid, unihash)
-                toprocess.add(tid)
+                # Make sure we rehash any other tasks with the same task hash that we're deferred against.
+                torehash = [tid]
+                for deftid in self.sq_deferred:
+                    if self.sq_deferred[deftid] == tid:
+                        torehash.append(deftid)
+                for hashtid in torehash:
+                    hashequiv_logger.verbose("Task %s unihash changed to %s" % (hashtid, unihash))
+                    self.rqdata.runtaskentries[hashtid].unihash = unihash
+                    bb.parse.siggen.set_unihash(hashtid, unihash)
+                    toprocess.add(hashtid)
 
         # Work out all tasks which depend upon these
         total = set()
-- 
2.25.1



  parent reply	other threads:[~2023-02-15 10:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-15 10:43 [1.46][PATCH 0/6] Backport multiconfig deferred fixes Fabio Berton
2023-02-15 10:43 ` [1.46][PATCH 1/6] runqueue: Fix multiconfig deferred task sstate validity caching issue Fabio Berton
2023-02-15 10:43 ` Fabio Berton [this message]
2023-02-15 10:43 ` [1.46][PATCH 3/6] runqueue: Improve multiconfig deferred task issues Fabio Berton
2023-02-15 10:43 ` [1.46][PATCH 4/6] runqueue: Avoid deadlock avoidance task graph corruption Fabio Berton
2023-02-15 10:43 ` [1.46][PATCH 5/6] runqueue: Fix issues with multiconfig deferred task deadlock messages Fabio Berton
2023-02-15 10:43 ` [1.46][PATCH 6/6] runqueue: Ensure deferred tasks are sorted by multiconfig Fabio Berton
2023-02-17 15:08 ` [bitbake-devel] [1.46][PATCH 0/6] Backport multiconfig deferred fixes Richard Purdie

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=20230215104321.1665505-3-fabio.berton@criticaltechworks.com \
    --to=fabio.berton@criticaltechworks.com \
    --cc=bitbake-devel@lists.openembedded.org \
    /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;
as well as URLs for NNTP newsgroup(s).