diff options
author | Chris Laplante <chris.laplante@agilent.com> | 2024-12-11 12:41:27 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-12-17 11:48:25 +0000 |
commit | 9d1b31d2542e50afe8d832588a4858054278e66c (patch) | |
tree | cddda097c6a8a297ae05afdafb64ee0be23ed171 /bitbake/lib/bb/tinfoil.py | |
parent | 2333609ac20698877cde5baa65e7540ca5d4fd65 (diff) | |
download | poky-9d1b31d2542e50afe8d832588a4858054278e66c.tar.gz |
bitbake: cooker: Make cooker 'skiplist' per-multiconfig/mc
Previously, the cooker skiplist was shared across multiconfigs
(including default ''). If you had a recipe that was incompatible with
several multiconfigs for different reasons, then the displayed reason
(i.e. the "ERROR: Nothing PROVIDES" and "* was skipped" messages) might
vary across invocations of bitbake. This was caused by the random order
in which recipes are parsed under different multiconfig contexts, with
each skip reason overwriting the previously assigned reason.
I hit this specificially when using COMPATIBLE_MACHINE, but
COMPATIBLE_HOST (or anything using bb.parse.SkipRecipe) would have done it too.
(Bitbake rev: c51f01a35ed9a928402eab0899598b5c59602eef)
Signed-off-by: Chris Laplante <chris.laplante@agilent.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/tinfoil.py')
-rw-r--r-- | bitbake/lib/bb/tinfoil.py | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/bitbake/lib/bb/tinfoil.py b/bitbake/lib/bb/tinfoil.py index 0e937fba36..13b05cec2d 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) |