summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/cooker.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2023-05-10 21:34:59 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-05-25 10:33:15 +0100
commit8f728e33837842d32f6f00a32a8ff651eec9eb83 (patch)
tree9acb5fb5a302548af9524f398d5fbece51928b6b /bitbake/lib/bb/cooker.py
parent5b4c7dc600f33f784618c98330d075a38f944fb1 (diff)
downloadpoky-8f728e33837842d32f6f00a32a8ff651eec9eb83.tar.gz
bitbake: cooker: Fix/improve collections handling
Code changes for FILE_LAYERNAME exposed lifecycle issues around the collections object in Cooker which only appeared in devtool usage in eSDK. Move the collections setup to an earlier stage after parsing completes to avoid any kind of race around it. Also stop overwriting the code variable in MatchFiles. Ultimately we need to combine these codepaths but that is for another patch. (Bitbake rev: 27b872ed4fbe73b3b61e14cb885bb7c16c039cdb) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/cooker.py')
-rw-r--r--bitbake/lib/bb/cooker.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index 554c7f10a5..2a0ef28755 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -504,6 +504,9 @@ class BBCooker:
504 self.recipecaches[mc] = bb.cache.CacheData(self.caches_array) 504 self.recipecaches[mc] = bb.cache.CacheData(self.caches_array)
505 505
506 self.handleCollections(self.data.getVar("BBFILE_COLLECTIONS")) 506 self.handleCollections(self.data.getVar("BBFILE_COLLECTIONS"))
507 self.collections = {}
508 for mc in self.multiconfigs:
509 self.collections[mc] = CookerCollectFiles(self.bbfile_config_priorities, mc)
507 510
508 self._parsecache_set(False) 511 self._parsecache_set(False)
509 512
@@ -1378,8 +1381,8 @@ class BBCooker:
1378 if bf.startswith("/") or bf.startswith("../"): 1381 if bf.startswith("/") or bf.startswith("../"):
1379 bf = os.path.abspath(bf) 1382 bf = os.path.abspath(bf)
1380 1383
1381 self.collections = {mc: CookerCollectFiles(self.bbfile_config_priorities, mc)} 1384 collections = {mc: CookerCollectFiles(self.bbfile_config_priorities, mc)}
1382 filelist, masked, searchdirs = self.collections[mc].collect_bbfiles(self.databuilder.mcdata[mc], self.databuilder.mcdata[mc]) 1385 filelist, masked, searchdirs = collections[mc].collect_bbfiles(self.databuilder.mcdata[mc], self.databuilder.mcdata[mc])
1383 try: 1386 try:
1384 os.stat(bf) 1387 os.stat(bf)
1385 bf = os.path.abspath(bf) 1388 bf = os.path.abspath(bf)
@@ -1676,13 +1679,10 @@ class BBCooker:
1676 for dep in self.configuration.extra_assume_provided: 1679 for dep in self.configuration.extra_assume_provided:
1677 self.recipecaches[mc].ignored_dependencies.add(dep) 1680 self.recipecaches[mc].ignored_dependencies.add(dep)
1678 1681
1679 self.collections = {}
1680
1681 mcfilelist = {} 1682 mcfilelist = {}
1682 total_masked = 0 1683 total_masked = 0
1683 searchdirs = set() 1684 searchdirs = set()
1684 for mc in self.multiconfigs: 1685 for mc in self.multiconfigs:
1685 self.collections[mc] = CookerCollectFiles(self.bbfile_config_priorities, mc)
1686 (filelist, masked, search) = self.collections[mc].collect_bbfiles(self.databuilder.mcdata[mc], self.databuilder.mcdata[mc]) 1686 (filelist, masked, search) = self.collections[mc].collect_bbfiles(self.databuilder.mcdata[mc], self.databuilder.mcdata[mc])
1687 1687
1688 mcfilelist[mc] = filelist 1688 mcfilelist[mc] = filelist