diff options
Diffstat (limited to 'poky/bitbake/lib')
-rw-r--r-- | poky/bitbake/lib/bb/cooker.py | 53 | ||||
-rw-r--r-- | poky/bitbake/lib/bb/runqueue.py | 31 | ||||
-rw-r--r-- | poky/bitbake/lib/bb/siggen.py | 2 |
3 files changed, 54 insertions, 32 deletions
diff --git a/poky/bitbake/lib/bb/cooker.py b/poky/bitbake/lib/bb/cooker.py index db52964c3..adc41014e 100644 --- a/poky/bitbake/lib/bb/cooker.py +++ b/poky/bitbake/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]) diff --git a/poky/bitbake/lib/bb/runqueue.py b/poky/bitbake/lib/bb/runqueue.py index 4d5d87679..383c18323 100644 --- a/poky/bitbake/lib/bb/runqueue.py +++ b/poky/bitbake/lib/bb/runqueue.py @@ -49,6 +49,11 @@ def fn_from_tid(tid): def taskname_from_tid(tid): return tid.rsplit(":", 1)[1] +def mc_from_tid(tid): + if tid.startswith('multiconfig:'): + return tid.split(':')[1] + return "" + def split_tid(tid): (mc, fn, taskname, _) = split_tid_mcfn(tid) return (mc, fn, taskname) @@ -405,6 +410,9 @@ class RunQueueData: explored_deps = {} msgs = [] + class TooManyLoops(Exception): + pass + def chain_reorder(chain): """ Reorder a dependency chain so the lowest task id is first @@ -457,7 +465,7 @@ class RunQueueData: msgs.append("\n") if len(valid_chains) > 10: msgs.append("Aborted dependency loops search after 10 matches.\n") - return msgs + raise TooManyLoops continue scan = False if revdep not in explored_deps: @@ -476,8 +484,11 @@ class RunQueueData: explored_deps[tid] = total_deps - for task in tasks: - find_chains(task, []) + try: + for task in tasks: + find_chains(task, []) + except TooManyLoops: + pass return msgs @@ -2073,10 +2084,23 @@ class RunQueueExecuteTasks(RunQueueExecute): return True + def filtermcdeps(self, task, deps): + ret = set() + mainmc = mc_from_tid(task) + for dep in deps: + mc = mc_from_tid(dep) + if mc != mainmc: + continue + ret.add(dep) + return ret + + # We filter out multiconfig dependencies from taskdepdata we pass to the tasks + # as most code can't handle them def build_taskdepdata(self, task): taskdepdata = {} next = self.rqdata.runtaskentries[task].depends next.add(task) + next = self.filtermcdeps(task, next) while next: additional = [] for revdep in next: @@ -2086,6 +2110,7 @@ class RunQueueExecuteTasks(RunQueueExecute): provides = self.rqdata.dataCaches[mc].fn_provides[taskfn] taskhash = self.rqdata.runtaskentries[revdep].hash taskdepdata[revdep] = [pn, taskname, fn, deps, provides, taskhash] + deps = self.filtermcdeps(task, deps) for revdep2 in deps: if revdep2 not in taskdepdata: additional.append(revdep2) diff --git a/poky/bitbake/lib/bb/siggen.py b/poky/bitbake/lib/bb/siggen.py index fdbb2a399..352dcab85 100644 --- a/poky/bitbake/lib/bb/siggen.py +++ b/poky/bitbake/lib/bb/siggen.py @@ -181,6 +181,8 @@ class SignatureGeneratorBasic(SignatureGenerator): depmc = pkgname.split(':')[1] if mc != depmc: continue + if dep.startswith("multiconfig:") and not mc: + continue depname = dataCache.pkg_fn[pkgname] if not self.rundep_check(fn, recipename, task, dep, depname, dataCache): continue |