[bitbake-devel] [PATCH 3/3] cooker: Tweak multiconfig dependency resolution

Richard Purdie richard.purdie at linuxfoundation.org
Sat Feb 23 10:41:04 UTC 2019


There were a couple of problems with the multiconfig dependency resolution:

- the "if mc" condition triggering this code wasn't correct, it needs
  to be "if more than one multiconfig" configured
- after adding providers we need to call add_unresolved again
  and rebuild mcdeps within the "while new" loop

By fixing these issues we allow various other combinations of multiconfig
builds to work which previously didn't.

[YOCTO #13090]
[YOCTO #13130]

Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 lib/bb/cooker.py | 53 ++++++++++++++++++++++--------------------------
 1 file changed, 24 insertions(+), 29 deletions(-)

diff --git a/lib/bb/cooker.py b/lib/bb/cooker.py
index e6b8d880ae..1982e880ba 100644
--- a/lib/bb/cooker.py
+++ b/lib/bb/cooker.py
@@ -641,35 +641,30 @@ class BBCooker:
 
 
         # No need to do check providers if there are no mcdeps or not an mc build
-        if mc:
-            # Add unresolved first, so we can get multiconfig indirect dependencies on time
-            for mcavailable in self.multiconfigs:
-                # The first element is empty
-                if mcavailable:
-                    taskdata[mcavailable].add_unresolved(localdata[mcavailable], self.recipecaches[mcavailable])
-
-
-            mcdeps = taskdata[mc].get_mcdepends()
-
-            if mcdeps:
-                # Make sure we can provide the multiconfig dependency
-                seen = set()
-                new = True
-                while new:
-                    new = False
-                    for mc in self.multiconfigs:
-                        for k in mcdeps:
-                            if k in seen:
-                                continue
-                            l = k.split(':')
-                            depmc = l[2]
-                            if depmc not in self.multiconfigs:
-                                bb.fatal("Multiconfig dependency %s depends on nonexistent mc configuration %s" % (k,depmc))
-                            else:
-                                logger.debug(1, "Adding providers for multiconfig dependency %s" % l[3])
-                                taskdata[depmc].add_provider(localdata[depmc], self.recipecaches[depmc], l[3])
-                                seen.add(k)
-                                new = True
+        if len(self.multiconfigs) > 1:
+            seen = set()
+            new = True
+            # Make sure we can provide the multiconfig dependency
+            while new:
+                mcdeps = set()
+                # Add unresolved first, so we can get multiconfig indirect dependencies on time
+                for mc in self.multiconfigs:
+                    taskdata[mc].add_unresolved(localdata[mc], self.recipecaches[mc])
+                    mcdeps |= set(taskdata[mc].get_mcdepends())
+                new = False
+                for mc in self.multiconfigs:
+                    for k in mcdeps:
+                        if k in seen:
+                            continue
+                        l = k.split(':')
+                        depmc = l[2]
+                        if depmc not in self.multiconfigs:
+                            bb.fatal("Multiconfig dependency %s depends on nonexistent mc configuration %s" % (k,depmc))
+                        else:
+                            logger.debug(1, "Adding providers for multiconfig dependency %s" % l[3])
+                            taskdata[depmc].add_provider(localdata[depmc], self.recipecaches[depmc], l[3])
+                            seen.add(k)
+                            new = True
 
         for mc in self.multiconfigs:
             taskdata[mc].add_unresolved(localdata[mc], self.recipecaches[mc])
-- 
2.20.1



More information about the bitbake-devel mailing list