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 6/6] runqueue: Ensure deferred tasks are sorted by multiconfig
Date: Wed, 15 Feb 2023 10:43:21 +0000	[thread overview]
Message-ID: <20230215104321.1665505-7-fabio.berton@criticaltechworks.com> (raw)
In-Reply-To: <20230215104321.1665505-1-fabio.berton@criticaltechworks.com>

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

We have to prefer one multiconfig over another when deferring tasks, else
we'll have cross-linked build trees and nothing will be able to build.

In the original population code, we sort like this but we don't after
rehashing. Ensure we have the same sorting after rehashing toa void
deadlocks.

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

diff --git a/lib/bb/runqueue.py b/lib/bb/runqueue.py
index f63a2191..2a1299db 100644
--- a/lib/bb/runqueue.py
+++ b/lib/bb/runqueue.py
@@ -2503,11 +2503,14 @@ class RunQueueExecute:
 
         if update_tasks:
             self.sqdone = False
-            for tid in [t[0] for t in update_tasks]:
-                h = pending_hash_index(tid, self.rqdata)
-                if h in self.sqdata.hashes and tid != self.sqdata.hashes[h]:
-                    self.sq_deferred[tid] = self.sqdata.hashes[h]
-                    bb.note("Deferring %s after %s" % (tid, self.sqdata.hashes[h]))
+            for mc in sorted(self.sqdata.multiconfigs):
+                for tid in sorted([t[0] for t in update_tasks]):
+                    if mc_from_tid(tid) != mc:
+                        continue
+                    h = pending_hash_index(tid, self.rqdata)
+                    if h in self.sqdata.hashes and tid != self.sqdata.hashes[h]:
+                        self.sq_deferred[tid] = self.sqdata.hashes[h]
+                        bb.note("Deferring %s after %s" % (tid, self.sqdata.hashes[h]))
             update_scenequeue_data([t[0] for t in update_tasks], self.sqdata, self.rqdata, self.rq, self.cooker, self.stampcache, self, summary=False)
 
         for (tid, harddepfail, origvalid) in update_tasks:
-- 
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 ` [1.46][PATCH 2/6] runqueue: Handle deferred task rehashing in multiconfig builds Fabio Berton
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 ` Fabio Berton [this message]
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-7-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).