diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-11-11 14:23:54 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-11-14 16:22:00 +0000 |
commit | d8e9ee8fd53b7620e72b2dfebb2e8d464b737dbb (patch) | |
tree | d815af2cb816524186a52c3f031dca5374e733d0 /bitbake | |
parent | de98b12ee17717bf4c18a02833e7a5260c7cb75d (diff) | |
download | poky-d8e9ee8fd53b7620e72b2dfebb2e8d464b737dbb.tar.gz |
bitbake: data/data_smart/build: Clean up datastore finalize/update_data references
We dropped the update_data calls a while ago. Clean up the code
to match the reality and drop the remaining no-op pieces. Update
the comments to reflect the slowest operations and let the cookie
monster's spirit live on!
(Bitbake rev: 584989ed2b5af4e8799571dece0cf94f995ef14e)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r-- | bitbake/lib/bb/build.py | 1 | ||||
-rw-r--r-- | bitbake/lib/bb/data.py | 12 | ||||
-rw-r--r-- | bitbake/lib/bb/data_smart.py | 9 |
3 files changed, 6 insertions, 16 deletions
diff --git a/bitbake/lib/bb/build.py b/bitbake/lib/bb/build.py index b8c1099ef5..db706d0a3a 100644 --- a/bitbake/lib/bb/build.py +++ b/bitbake/lib/bb/build.py | |||
@@ -572,7 +572,6 @@ def _task_data(fn, task, d): | |||
572 | localdata.setVar('BB_FILENAME', fn) | 572 | localdata.setVar('BB_FILENAME', fn) |
573 | localdata.setVar('OVERRIDES', 'task-%s:%s' % | 573 | localdata.setVar('OVERRIDES', 'task-%s:%s' % |
574 | (task[3:].replace('_', '-'), d.getVar('OVERRIDES', False))) | 574 | (task[3:].replace('_', '-'), d.getVar('OVERRIDES', False))) |
575 | localdata.finalize() | ||
576 | bb.data.expandKeys(localdata) | 575 | bb.data.expandKeys(localdata) |
577 | return localdata | 576 | return localdata |
578 | 577 | ||
diff --git a/bitbake/lib/bb/data.py b/bitbake/lib/bb/data.py index 4be26367d2..3a6af325f4 100644 --- a/bitbake/lib/bb/data.py +++ b/bitbake/lib/bb/data.py | |||
@@ -4,14 +4,16 @@ BitBake 'Data' implementations | |||
4 | Functions for interacting with the data structure used by the | 4 | Functions for interacting with the data structure used by the |
5 | BitBake build tools. | 5 | BitBake build tools. |
6 | 6 | ||
7 | The expandKeys and update_data are the most expensive | 7 | expandKeys and datastore iteration are the most expensive |
8 | operations. At night the cookie monster came by and | 8 | operations. Updating overrides is now "on the fly" but still based |
9 | on the idea of the cookie monster introduced by zecke: | ||
10 | "At night the cookie monster came by and | ||
9 | suggested 'give me cookies on setting the variables and | 11 | suggested 'give me cookies on setting the variables and |
10 | things will work out'. Taking this suggestion into account | 12 | things will work out'. Taking this suggestion into account |
11 | applying the skills from the not yet passed 'Entwurf und | 13 | applying the skills from the not yet passed 'Entwurf und |
12 | Analyse von Algorithmen' lecture and the cookie | 14 | Analyse von Algorithmen' lecture and the cookie |
13 | monster seems to be right. We will track setVar more carefully | 15 | monster seems to be right. We will track setVar more carefully |
14 | to have faster update_data and expandKeys operations. | 16 | to have faster datastore operations." |
15 | 17 | ||
16 | This is a trade-off between speed and memory again but | 18 | This is a trade-off between speed and memory again but |
17 | the speed is more critical here. | 19 | the speed is more critical here. |
@@ -264,10 +266,6 @@ def emit_func_python(func, o=sys.__stdout__, d = init()): | |||
264 | newdeps |= set((d.getVarFlag(dep, "vardeps") or "").split()) | 266 | newdeps |= set((d.getVarFlag(dep, "vardeps") or "").split()) |
265 | newdeps -= seen | 267 | newdeps -= seen |
266 | 268 | ||
267 | def update_data(d): | ||
268 | """Performs final steps upon the datastore, including application of overrides""" | ||
269 | d.finalize(parent = True) | ||
270 | |||
271 | def build_dependencies(key, keys, shelldeps, varflagsexcl, ignored_vars, d): | 269 | def build_dependencies(key, keys, shelldeps, varflagsexcl, ignored_vars, d): |
272 | deps = set() | 270 | deps = set() |
273 | try: | 271 | try: |
diff --git a/bitbake/lib/bb/data_smart.py b/bitbake/lib/bb/data_smart.py index 62d0c01c41..5415f2fccf 100644 --- a/bitbake/lib/bb/data_smart.py +++ b/bitbake/lib/bb/data_smart.py | |||
@@ -481,13 +481,6 @@ class DataSmart(MutableMapping): | |||
481 | def expand(self, s, varname = None): | 481 | def expand(self, s, varname = None): |
482 | return self.expandWithRefs(s, varname).value | 482 | return self.expandWithRefs(s, varname).value |
483 | 483 | ||
484 | def finalize(self, parent = False): | ||
485 | return | ||
486 | |||
487 | def internal_finalize(self, parent = False): | ||
488 | """Performs final steps upon the datastore, including application of overrides""" | ||
489 | self.overrides = None | ||
490 | |||
491 | def need_overrides(self): | 484 | def need_overrides(self): |
492 | if self.overrides is not None: | 485 | if self.overrides is not None: |
493 | return | 486 | return |
@@ -638,7 +631,7 @@ class DataSmart(MutableMapping): | |||
638 | nextnew.update(vardata.references) | 631 | nextnew.update(vardata.references) |
639 | nextnew.update(vardata.contains.keys()) | 632 | nextnew.update(vardata.contains.keys()) |
640 | new = nextnew | 633 | new = nextnew |
641 | self.internal_finalize(True) | 634 | self.overrides = None |
642 | 635 | ||
643 | def _setvar_update_overrides(self, var, **loginfo): | 636 | def _setvar_update_overrides(self, var, **loginfo): |
644 | # aka pay the cookie monster | 637 | # aka pay the cookie monster |