diff options
Diffstat (limited to 'yocto-poky/bitbake/lib/bb/runqueue.py')
-rw-r--r-- | yocto-poky/bitbake/lib/bb/runqueue.py | 119 |
1 files changed, 100 insertions, 19 deletions
diff --git a/yocto-poky/bitbake/lib/bb/runqueue.py b/yocto-poky/bitbake/lib/bb/runqueue.py index 878028aa9..e1b9b2e66 100644 --- a/yocto-poky/bitbake/lib/bb/runqueue.py +++ b/yocto-poky/bitbake/lib/bb/runqueue.py @@ -261,6 +261,13 @@ class RunQueueData: taskname = self.runq_task[task] + task_name_suffix return "%s, %s" % (fn, taskname) + def get_short_user_idstring(self, task, task_name_suffix = ""): + fn = self.taskData.fn_index[self.runq_fnid[task]] + pn = self.dataCache.pkg_fn[fn] + taskname = self.runq_task[task] + task_name_suffix + return "%s:%s" % (pn, taskname) + + def get_task_id(self, fnid, taskname): for listid in xrange(len(self.runq_fnid)): if self.runq_fnid[listid] == fnid and self.runq_task[listid] == taskname: @@ -634,23 +641,33 @@ class RunQueueData: fnid = taskData.build_targets[targetid][0] fn = taskData.fn_index[fnid] - self.target_pairs.append((fn, target[1])) + task = target[1] + parents = False + if task.endswith('-'): + parents = True + task = task[:-1] + + self.target_pairs.append((fn, task)) if fnid in taskData.failed_fnids: continue - if target[1] not in taskData.tasks_lookup[fnid]: + if task not in taskData.tasks_lookup[fnid]: import difflib - close_matches = difflib.get_close_matches(target[1], taskData.tasks_lookup[fnid], cutoff=0.7) + close_matches = difflib.get_close_matches(task, taskData.tasks_lookup[fnid], cutoff=0.7) if close_matches: extra = ". Close matches:\n %s" % "\n ".join(close_matches) else: extra = "" - bb.msg.fatal("RunQueue", "Task %s does not exist for target %s%s" % (target[1], target[0], extra)) - - listid = taskData.tasks_lookup[fnid][target[1]] - - mark_active(listid, 1) + bb.msg.fatal("RunQueue", "Task %s does not exist for target %s%s" % (task, target[0], extra)) + + # For tasks called "XXXX-", ony run their dependencies + listid = taskData.tasks_lookup[fnid][task] + if parents: + for i in self.runq_depends[listid]: + mark_active(i, 1) + else: + mark_active(listid, 1) # Step C - Prune all inactive tasks # @@ -743,11 +760,72 @@ class RunQueueData: seen_pn.append(pn) else: bb.fatal("Multiple versions of %s are due to be built (%s). Only one version of a given PN should be built in any given build. You likely need to set PREFERRED_VERSION_%s to select the correct version or don't depend on multiple versions." % (pn, " ".join(prov_list[prov]), pn)) - msg = "Multiple .bb files are due to be built which each provide %s (%s)." % (prov, " ".join(prov_list[prov])) + msg = "Multiple .bb files are due to be built which each provide %s:\n %s" % (prov, "\n ".join(prov_list[prov])) + # + # Construct a list of things which uniquely depend on each provider + # since this may help the user figure out which dependency is triggering this warning + # + msg += "\nA list of tasks depending on these providers is shown and may help explain where the dependency comes from." + deplist = {} + commondeps = None + for provfn in prov_list[prov]: + deps = set() + for task, fnid in enumerate(self.runq_fnid): + fn = taskData.fn_index[fnid] + if fn != provfn: + continue + for dep in self.runq_revdeps[task]: + fn = taskData.fn_index[self.runq_fnid[dep]] + if fn == provfn: + continue + deps.add(self.get_short_user_idstring(dep)) + if not commondeps: + commondeps = set(deps) + else: + commondeps &= deps + deplist[provfn] = deps + for provfn in deplist: + msg += "\n%s has unique dependees:\n %s" % (provfn, "\n ".join(deplist[provfn] - commondeps)) + # + # Construct a list of provides and runtime providers for each recipe + # (rprovides has to cover RPROVIDES, PACKAGES, PACKAGES_DYNAMIC) + # + msg += "\nIt could be that one recipe provides something the other doesn't and should. The following provider and runtime provider differences may be helpful." + provide_results = {} + rprovide_results = {} + commonprovs = None + commonrprovs = None + for provfn in prov_list[prov]: + provides = set(self.dataCache.fn_provides[provfn]) + rprovides = set() + for rprovide in self.dataCache.rproviders: + if provfn in self.dataCache.rproviders[rprovide]: + rprovides.add(rprovide) + for package in self.dataCache.packages: + if provfn in self.dataCache.packages[package]: + rprovides.add(package) + for package in self.dataCache.packages_dynamic: + if provfn in self.dataCache.packages_dynamic[package]: + rprovides.add(package) + if not commonprovs: + commonprovs = set(provides) + else: + commonprovs &= provides + provide_results[provfn] = provides + if not commonrprovs: + commonrprovs = set(rprovides) + else: + commonrprovs &= rprovides + rprovide_results[provfn] = rprovides + #msg += "\nCommon provides:\n %s" % ("\n ".join(commonprovs)) + #msg += "\nCommon rprovides:\n %s" % ("\n ".join(commonrprovs)) + for provfn in prov_list[prov]: + msg += "\n%s has unique provides:\n %s" % (provfn, "\n ".join(provide_results[provfn] - commonprovs)) + msg += "\n%s has unique rprovides:\n %s" % (provfn, "\n ".join(rprovide_results[provfn] - commonrprovs)) + if self.warn_multi_bb: logger.warn(msg) else: - msg += "\n This usually means one provides something the other doesn't and should." logger.error(msg) # Create a whitelist usable by the stamp checks @@ -798,7 +876,7 @@ class RunQueueData: invalidate_task(fn, st, True) # Create and print to the logs a virtual/xxxx -> PN (fn) table - virtmap = taskData.get_providermap() + virtmap = taskData.get_providermap(prefix="virtual/") virtpnmap = {} for v in virtmap: virtpnmap[v] = self.dataCache.pkg_fn[virtmap[v]] @@ -819,6 +897,7 @@ class RunQueueData: procdep.append(self.taskData.fn_index[self.runq_fnid[dep]] + "." + self.runq_task[dep]) self.runq_hash[task] = bb.parse.siggen.get_taskhash(self.taskData.fn_index[self.runq_fnid[task]], self.runq_task[task], procdep, self.dataCache) + bb.parse.siggen.writeout_file_checksum_cache() return len(self.runq_fnid) def dump_data(self, taskQueue): @@ -874,6 +953,7 @@ class RunQueue: if self.cooker.configuration.profile: magic = "decafbadbad" if fakeroot: + magic = magic + "beef" fakerootcmd = self.cfgData.getVar("FAKEROOTCMD", True) fakerootenv = (self.cfgData.getVar("FAKEROOTBASEENV", True) or "").split() env = os.environ.copy() @@ -1067,9 +1147,12 @@ class RunQueue: retval = self.rqexe.execute() if self.state is runQueueRunInit: - logger.info("Executing RunQueue Tasks") - self.rqexe = RunQueueExecuteTasks(self) - self.state = runQueueRunning + if self.cooker.configuration.setsceneonly: + self.state = runQueueComplete + else: + logger.info("Executing RunQueue Tasks") + self.rqexe = RunQueueExecuteTasks(self) + self.state = runQueueRunning if self.state is runQueueRunning: retval = self.rqexe.execute() @@ -1388,7 +1471,7 @@ class RunQueueExecuteTasks(RunQueueExecute): self.runq_buildable.append(1) else: self.runq_buildable.append(0) - if len(self.rqdata.runq_revdeps[task]) > 0 and self.rqdata.runq_revdeps[task].issubset(self.rq.scenequeue_covered) and task not in self.rq.scenequeue_notcovered: + if len(self.rqdata.runq_revdeps[task]) > 0 and self.rqdata.runq_revdeps[task].issubset(self.rq.scenequeue_covered): self.rq.scenequeue_covered.add(task) found = True @@ -1399,7 +1482,7 @@ class RunQueueExecuteTasks(RunQueueExecute): continue logger.debug(1, 'Considering %s (%s): %s' % (task, self.rqdata.get_user_idstring(task), str(self.rqdata.runq_revdeps[task]))) - if len(self.rqdata.runq_revdeps[task]) > 0 and self.rqdata.runq_revdeps[task].issubset(self.rq.scenequeue_covered) and task not in self.rq.scenequeue_notcovered: + if len(self.rqdata.runq_revdeps[task]) > 0 and self.rqdata.runq_revdeps[task].issubset(self.rq.scenequeue_covered): found = True self.rq.scenequeue_covered.add(task) @@ -1708,6 +1791,7 @@ class RunQueueExecuteScenequeue(RunQueueExecute): sq_revdeps_new[point] = set() if point in self.rqdata.runq_setscene: sq_revdeps_new[point] = tasks + tasks = set() for dep in self.rqdata.runq_depends[point]: if point in sq_revdeps[dep]: sq_revdeps[dep].remove(point) @@ -2014,9 +2098,6 @@ class RunQueueExecuteScenequeue(RunQueueExecute): self.rq.scenequeue_covered = set() for task in oldcovered: self.rq.scenequeue_covered.add(self.rqdata.runq_setscene[task]) - self.rq.scenequeue_notcovered = set() - for task in self.scenequeue_notcovered: - self.rq.scenequeue_notcovered.add(self.rqdata.runq_setscene[task]) logger.debug(1, 'We can skip tasks %s', sorted(self.rq.scenequeue_covered)) |