diff options
| author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-08-09 16:27:25 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-08-13 15:47:55 +0100 |
| commit | 36f98fc1f27015a1724f1677495227927341b0ff (patch) | |
| tree | 0a23de00ea8b0b4acbc4537eda913d1fc345ee10 /bitbake/lib/bb/cooker.py | |
| parent | 4eedb58a285bdb6d3620f6ca15396dee14fad354 (diff) | |
| download | poky-36f98fc1f27015a1724f1677495227927341b0ff.tar.gz | |
bitbake: cookerdata: Separate out data_hash and hook to tinfoil
Within tinfoil, the user can write to the configuration data but it won't
cause the data_hash checksum to be re-written, meaning cached parsing
data can be reused when it would now be incorrect.
Abstract out the data_hash code and add it to the invalidateCaches
command, called by tinfoil.modified_files() meaning that tinfoil can
instruct bitbake to update the caches and re-parse if necessary.
Also move the data_hash entirely into databuilder and drop the copy
in cooker as obsolete and not needed.
(Bitbake rev: d9ee77829f693ce75348fa64f406fcecfe4989aa)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/cooker.py')
| -rw-r--r-- | bitbake/lib/bb/cooker.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py index 6754f986bf..2e80986640 100644 --- a/bitbake/lib/bb/cooker.py +++ b/bitbake/lib/bb/cooker.py | |||
| @@ -281,7 +281,6 @@ class BBCooker: | |||
| 281 | self.databuilder = bb.cookerdata.CookerDataBuilder(self.configuration, False) | 281 | self.databuilder = bb.cookerdata.CookerDataBuilder(self.configuration, False) |
| 282 | self.databuilder.parseBaseConfiguration() | 282 | self.databuilder.parseBaseConfiguration() |
| 283 | self.data = self.databuilder.data | 283 | self.data = self.databuilder.data |
| 284 | self.data_hash = self.databuilder.data_hash | ||
| 285 | self.extraconfigdata = {} | 284 | self.extraconfigdata = {} |
| 286 | 285 | ||
| 287 | eventlog = self.data.getVar("BB_DEFAULT_EVENTLOG") | 286 | eventlog = self.data.getVar("BB_DEFAULT_EVENTLOG") |
| @@ -370,6 +369,11 @@ class BBCooker: | |||
| 370 | if not clean: | 369 | if not clean: |
| 371 | bb.parse.BBHandler.cached_statements = {} | 370 | bb.parse.BBHandler.cached_statements = {} |
| 372 | 371 | ||
| 372 | # If writes were made to any of the data stores, we need to recalculate the data | ||
| 373 | # store cache | ||
| 374 | if hasattr(self, "databuilder"): | ||
| 375 | self.databuilder.calc_datastore_hashes() | ||
| 376 | |||
| 373 | def parseConfiguration(self): | 377 | def parseConfiguration(self): |
| 374 | self.updateCacheSync() | 378 | self.updateCacheSync() |
| 375 | 379 | ||
| @@ -1338,7 +1342,7 @@ class BBCooker: | |||
| 1338 | self.buildSetVars() | 1342 | self.buildSetVars() |
| 1339 | self.reset_mtime_caches() | 1343 | self.reset_mtime_caches() |
| 1340 | 1344 | ||
| 1341 | bb_caches = bb.cache.MulticonfigCache(self.databuilder, self.data_hash, self.caches_array) | 1345 | bb_caches = bb.cache.MulticonfigCache(self.databuilder, self.databuilder.data_hash, self.caches_array) |
| 1342 | 1346 | ||
| 1343 | layername = self.collections[mc].calc_bbfile_priority(fn)[2] | 1347 | layername = self.collections[mc].calc_bbfile_priority(fn)[2] |
| 1344 | infos = bb_caches[mc].parse(fn, self.collections[mc].get_file_appends(fn), layername) | 1348 | infos = bb_caches[mc].parse(fn, self.collections[mc].get_file_appends(fn), layername) |
| @@ -2112,7 +2116,7 @@ class CookerParser(object): | |||
| 2112 | self.mcfilelist = mcfilelist | 2116 | self.mcfilelist = mcfilelist |
| 2113 | self.cooker = cooker | 2117 | self.cooker = cooker |
| 2114 | self.cfgdata = cooker.data | 2118 | self.cfgdata = cooker.data |
| 2115 | self.cfghash = cooker.data_hash | 2119 | self.cfghash = cooker.databuilder.data_hash |
| 2116 | self.cfgbuilder = cooker.databuilder | 2120 | self.cfgbuilder = cooker.databuilder |
| 2117 | 2121 | ||
| 2118 | # Accounting statistics | 2122 | # Accounting statistics |
