diff options
Diffstat (limited to 'bitbake/lib/bb')
| -rw-r--r-- | bitbake/lib/bb/command.py | 21 | ||||
| -rw-r--r-- | bitbake/lib/bb/cooker.py | 11 | ||||
| -rw-r--r-- | bitbake/lib/bb/tinfoil.py | 16 |
3 files changed, 36 insertions, 12 deletions
diff --git a/bitbake/lib/bb/command.py b/bitbake/lib/bb/command.py index 1fcb9bf14c..5e166fe45c 100644 --- a/bitbake/lib/bb/command.py +++ b/bitbake/lib/bb/command.py | |||
| @@ -420,15 +420,30 @@ class CommandsSync: | |||
| 420 | return command.cooker.recipecaches[mc].pkg_dp | 420 | return command.cooker.recipecaches[mc].pkg_dp |
| 421 | getDefaultPreference.readonly = True | 421 | getDefaultPreference.readonly = True |
| 422 | 422 | ||
| 423 | |||
| 423 | def getSkippedRecipes(self, command, params): | 424 | def getSkippedRecipes(self, command, params): |
| 425 | """ | ||
| 426 | Get the map of skipped recipes for the specified multiconfig/mc name (`params[0]`). | ||
| 427 | |||
| 428 | Invoked by `bb.tinfoil.Tinfoil.get_skipped_recipes` | ||
| 429 | |||
| 430 | :param command: Internally used parameter. | ||
| 431 | :param params: Parameter array. params[0] is multiconfig/mc name. If not given, then default mc '' is assumed. | ||
| 432 | :return: Dict whose keys are virtualfns and values are `bb.cooker.SkippedPackage` | ||
| 433 | """ | ||
| 434 | try: | ||
| 435 | mc = params[0] | ||
| 436 | except IndexError: | ||
| 437 | mc = '' | ||
| 438 | |||
| 424 | # Return list sorted by reverse priority order | 439 | # Return list sorted by reverse priority order |
| 425 | import bb.cache | 440 | import bb.cache |
| 426 | def sortkey(x): | 441 | def sortkey(x): |
| 427 | vfn, _ = x | 442 | vfn, _ = x |
| 428 | realfn, _, mc = bb.cache.virtualfn2realfn(vfn) | 443 | realfn, _, item_mc = bb.cache.virtualfn2realfn(vfn) |
| 429 | return (-command.cooker.collections[mc].calc_bbfile_priority(realfn)[0], vfn) | 444 | return -command.cooker.collections[item_mc].calc_bbfile_priority(realfn)[0], vfn |
| 430 | 445 | ||
| 431 | skipdict = OrderedDict(sorted(command.cooker.skiplist.items(), key=sortkey)) | 446 | skipdict = OrderedDict(sorted(command.cooker.skiplist_by_mc[mc].items(), key=sortkey)) |
| 432 | return list(skipdict.items()) | 447 | return list(skipdict.items()) |
| 433 | getSkippedRecipes.readonly = True | 448 | getSkippedRecipes.readonly = True |
| 434 | 449 | ||
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py index 582fc35f24..4aad408d48 100644 --- a/bitbake/lib/bb/cooker.py +++ b/bitbake/lib/bb/cooker.py | |||
| @@ -134,7 +134,8 @@ class BBCooker: | |||
| 134 | self.baseconfig_valid = False | 134 | self.baseconfig_valid = False |
| 135 | self.parsecache_valid = False | 135 | self.parsecache_valid = False |
| 136 | self.eventlog = None | 136 | self.eventlog = None |
| 137 | self.skiplist = {} | 137 | # The skiplists, one per multiconfig |
| 138 | self.skiplist_by_mc = defaultdict(dict) | ||
| 138 | self.featureset = CookerFeatures() | 139 | self.featureset = CookerFeatures() |
| 139 | if featureSet: | 140 | if featureSet: |
| 140 | for f in featureSet: | 141 | for f in featureSet: |
| @@ -616,8 +617,8 @@ class BBCooker: | |||
| 616 | localdata = {} | 617 | localdata = {} |
| 617 | 618 | ||
| 618 | for mc in self.multiconfigs: | 619 | for mc in self.multiconfigs: |
| 619 | taskdata[mc] = bb.taskdata.TaskData(halt, skiplist=self.skiplist, allowincomplete=allowincomplete) | 620 | taskdata[mc] = bb.taskdata.TaskData(halt, skiplist=self.skiplist_by_mc[mc], allowincomplete=allowincomplete) |
| 620 | localdata[mc] = data.createCopy(self.databuilder.mcdata[mc]) | 621 | localdata[mc] = bb.data.createCopy(self.databuilder.mcdata[mc]) |
| 621 | bb.data.expandKeys(localdata[mc]) | 622 | bb.data.expandKeys(localdata[mc]) |
| 622 | 623 | ||
| 623 | current = 0 | 624 | current = 0 |
| @@ -937,7 +938,7 @@ class BBCooker: | |||
| 937 | for mc in self.multiconfigs: | 938 | for mc in self.multiconfigs: |
| 938 | # First get list of recipes, including skipped | 939 | # First get list of recipes, including skipped |
| 939 | recipefns = list(self.recipecaches[mc].pkg_fn.keys()) | 940 | recipefns = list(self.recipecaches[mc].pkg_fn.keys()) |
| 940 | recipefns.extend(self.skiplist.keys()) | 941 | recipefns.extend(self.skiplist_by_mc[mc].keys()) |
| 941 | 942 | ||
| 942 | # Work out list of bbappends that have been applied | 943 | # Work out list of bbappends that have been applied |
| 943 | applied_appends = [] | 944 | applied_appends = [] |
| @@ -2362,7 +2363,7 @@ class CookerParser(object): | |||
| 2362 | for virtualfn, info_array in result: | 2363 | for virtualfn, info_array in result: |
| 2363 | if info_array[0].skipped: | 2364 | if info_array[0].skipped: |
| 2364 | self.skipped += 1 | 2365 | self.skipped += 1 |
| 2365 | self.cooker.skiplist[virtualfn] = SkippedPackage(info_array[0]) | 2366 | self.cooker.skiplist_by_mc[mc][virtualfn] = SkippedPackage(info_array[0]) |
| 2366 | self.bb_caches[mc].add_info(virtualfn, info_array, self.cooker.recipecaches[mc], | 2367 | self.bb_caches[mc].add_info(virtualfn, info_array, self.cooker.recipecaches[mc], |
| 2367 | parsed=parsed, watcher = self.cooker.add_filewatch) | 2368 | parsed=parsed, watcher = self.cooker.add_filewatch) |
| 2368 | return True | 2369 | return True |
diff --git a/bitbake/lib/bb/tinfoil.py b/bitbake/lib/bb/tinfoil.py index dcd3910cc4..4dc4590c31 100644 --- a/bitbake/lib/bb/tinfoil.py +++ b/bitbake/lib/bb/tinfoil.py | |||
| @@ -188,11 +188,19 @@ class TinfoilCookerAdapter: | |||
| 188 | self._cache[name] = attrvalue | 188 | self._cache[name] = attrvalue |
| 189 | return attrvalue | 189 | return attrvalue |
| 190 | 190 | ||
| 191 | class TinfoilSkiplistByMcAdapter: | ||
| 192 | def __init__(self, tinfoil): | ||
| 193 | self.tinfoil = tinfoil | ||
| 194 | |||
| 195 | def __getitem__(self, mc): | ||
| 196 | return self.tinfoil.get_skipped_recipes(mc) | ||
| 197 | |||
| 191 | def __init__(self, tinfoil): | 198 | def __init__(self, tinfoil): |
| 192 | self.tinfoil = tinfoil | 199 | self.tinfoil = tinfoil |
| 193 | self.multiconfigs = [''] + (tinfoil.config_data.getVar('BBMULTICONFIG') or '').split() | 200 | self.multiconfigs = [''] + (tinfoil.config_data.getVar('BBMULTICONFIG') or '').split() |
| 194 | self.collections = {} | 201 | self.collections = {} |
| 195 | self.recipecaches = {} | 202 | self.recipecaches = {} |
| 203 | self.skiplist_by_mc = self.TinfoilSkiplistByMcAdapter(tinfoil) | ||
| 196 | for mc in self.multiconfigs: | 204 | for mc in self.multiconfigs: |
| 197 | self.collections[mc] = self.TinfoilCookerCollectionAdapter(tinfoil, mc) | 205 | self.collections[mc] = self.TinfoilCookerCollectionAdapter(tinfoil, mc) |
| 198 | self.recipecaches[mc] = self.TinfoilRecipeCacheAdapter(tinfoil, mc) | 206 | self.recipecaches[mc] = self.TinfoilRecipeCacheAdapter(tinfoil, mc) |
| @@ -201,8 +209,6 @@ class TinfoilCookerAdapter: | |||
| 201 | # Grab these only when they are requested since they aren't always used | 209 | # Grab these only when they are requested since they aren't always used |
| 202 | if name in self._cache: | 210 | if name in self._cache: |
| 203 | return self._cache[name] | 211 | return self._cache[name] |
| 204 | elif name == 'skiplist': | ||
| 205 | attrvalue = self.tinfoil.get_skipped_recipes() | ||
| 206 | elif name == 'bbfile_config_priorities': | 212 | elif name == 'bbfile_config_priorities': |
| 207 | ret = self.tinfoil.run_command('getLayerPriorities') | 213 | ret = self.tinfoil.run_command('getLayerPriorities') |
| 208 | bbfile_config_priorities = [] | 214 | bbfile_config_priorities = [] |
| @@ -514,12 +520,12 @@ class Tinfoil: | |||
| 514 | """ | 520 | """ |
| 515 | return defaultdict(list, self.run_command('getOverlayedRecipes', mc)) | 521 | return defaultdict(list, self.run_command('getOverlayedRecipes', mc)) |
| 516 | 522 | ||
| 517 | def get_skipped_recipes(self): | 523 | def get_skipped_recipes(self, mc=''): |
| 518 | """ | 524 | """ |
| 519 | Find recipes which were skipped (i.e. SkipRecipe was raised | 525 | Find recipes which were skipped (i.e. SkipRecipe was raised |
| 520 | during parsing). | 526 | during parsing). |
| 521 | """ | 527 | """ |
| 522 | return OrderedDict(self.run_command('getSkippedRecipes')) | 528 | return OrderedDict(self.run_command('getSkippedRecipes', mc)) |
| 523 | 529 | ||
| 524 | def get_all_providers(self, mc=''): | 530 | def get_all_providers(self, mc=''): |
| 525 | return defaultdict(list, self.run_command('allProviders', mc)) | 531 | return defaultdict(list, self.run_command('allProviders', mc)) |
| @@ -533,6 +539,7 @@ class Tinfoil: | |||
| 533 | def get_runtime_providers(self, rdep): | 539 | def get_runtime_providers(self, rdep): |
| 534 | return self.run_command('getRuntimeProviders', rdep) | 540 | return self.run_command('getRuntimeProviders', rdep) |
| 535 | 541 | ||
| 542 | # TODO: teach this method about mc | ||
| 536 | def get_recipe_file(self, pn): | 543 | def get_recipe_file(self, pn): |
| 537 | """ | 544 | """ |
| 538 | Get the file name for the specified recipe/target. Raises | 545 | Get the file name for the specified recipe/target. Raises |
| @@ -541,6 +548,7 @@ class Tinfoil: | |||
| 541 | """ | 548 | """ |
| 542 | best = self.find_best_provider(pn) | 549 | best = self.find_best_provider(pn) |
| 543 | if not best or (len(best) > 3 and not best[3]): | 550 | if not best or (len(best) > 3 and not best[3]): |
| 551 | # TODO: pass down mc | ||
| 544 | skiplist = self.get_skipped_recipes() | 552 | skiplist = self.get_skipped_recipes() |
| 545 | taskdata = bb.taskdata.TaskData(None, skiplist=skiplist) | 553 | taskdata = bb.taskdata.TaskData(None, skiplist=skiplist) |
| 546 | skipreasons = taskdata.get_reasons(pn) | 554 | skipreasons = taskdata.get_reasons(pn) |
