bitbake: cooker: Tweak multiconfig dependency resolution

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]

(Bitbake rev: b59cb2bc63940b9ebd8288de7ca4b1d9e96e026c)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie
2019-02-23 10:28:57 +00:00
parent 50b9800631
commit 7c76c5d78b

View File

@@ -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])