mirror of
https://git.yoctoproject.org/poky
synced 2026-06-01 13:09:50 +00:00
bitbake: bitbake: cache: Cache size optimization
Now that there is a cache object per multiconfig, it is not necessary for each cache object to parse all other multiconfigs. Instead, each cache now only parses the files for it's multiconfig. (Bitbake rev: 3c5c7346adf4ca7ec761c08738f12401ba75b7c8) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
3ec9d5774c
commit
59fb65f742
+18
-4
@@ -328,7 +328,7 @@ class NoCache(object):
|
|||||||
bb_data = self.load_bbfile(virtualfn, appends, virtonly=True)
|
bb_data = self.load_bbfile(virtualfn, appends, virtonly=True)
|
||||||
return bb_data[virtual]
|
return bb_data[virtual]
|
||||||
|
|
||||||
def load_bbfile(self, bbfile, appends, virtonly = False):
|
def load_bbfile(self, bbfile, appends, virtonly = False, mc=None):
|
||||||
"""
|
"""
|
||||||
Load and parse one .bb build file
|
Load and parse one .bb build file
|
||||||
Return the data and whether parsing resulted in the file being skipped
|
Return the data and whether parsing resulted in the file being skipped
|
||||||
@@ -341,6 +341,10 @@ class NoCache(object):
|
|||||||
datastores = parse_recipe(bb_data, bbfile, appends, mc)
|
datastores = parse_recipe(bb_data, bbfile, appends, mc)
|
||||||
return datastores
|
return datastores
|
||||||
|
|
||||||
|
if mc is not None:
|
||||||
|
bb_data = self.databuilder.mcdata[mc].createCopy()
|
||||||
|
return parse_recipe(bb_data, bbfile, appends, mc)
|
||||||
|
|
||||||
bb_data = self.data.createCopy()
|
bb_data = self.data.createCopy()
|
||||||
datastores = parse_recipe(bb_data, bbfile, appends)
|
datastores = parse_recipe(bb_data, bbfile, appends)
|
||||||
|
|
||||||
@@ -500,7 +504,7 @@ class Cache(NoCache):
|
|||||||
"""Parse the specified filename, returning the recipe information"""
|
"""Parse the specified filename, returning the recipe information"""
|
||||||
self.logger.debug(1, "Parsing %s", filename)
|
self.logger.debug(1, "Parsing %s", filename)
|
||||||
infos = []
|
infos = []
|
||||||
datastores = self.load_bbfile(filename, appends)
|
datastores = self.load_bbfile(filename, appends, mc=self.mc)
|
||||||
depends = []
|
depends = []
|
||||||
variants = []
|
variants = []
|
||||||
# Process the "real" fn last so we can store variants list
|
# Process the "real" fn last so we can store variants list
|
||||||
@@ -720,8 +724,18 @@ class Cache(NoCache):
|
|||||||
return bb.parse.cached_mtime_noerror(cachefile)
|
return bb.parse.cached_mtime_noerror(cachefile)
|
||||||
|
|
||||||
def add_info(self, filename, info_array, cacheData, parsed=None, watcher=None):
|
def add_info(self, filename, info_array, cacheData, parsed=None, watcher=None):
|
||||||
if cacheData is not None and isinstance(info_array[0], CoreRecipeInfo) and (not info_array[0].skipped):
|
if self.mc is not None:
|
||||||
cacheData.add_from_recipeinfo(filename, info_array)
|
(fn, cls, mc) = virtualfn2realfn(filename)
|
||||||
|
if mc:
|
||||||
|
self.logger.error("Unexpected multiconfig %s", virtualfn)
|
||||||
|
return
|
||||||
|
|
||||||
|
vfn = realfn2virtual(fn, cls, self.mc)
|
||||||
|
else:
|
||||||
|
vfn = filename
|
||||||
|
|
||||||
|
if isinstance(info_array[0], CoreRecipeInfo) and (not info_array[0].skipped):
|
||||||
|
cacheData.add_from_recipeinfo(vfn, info_array)
|
||||||
|
|
||||||
if watcher:
|
if watcher:
|
||||||
watcher(info_array[0].file_depends)
|
watcher(info_array[0].file_depends)
|
||||||
|
|||||||
@@ -2199,13 +2199,7 @@ class CookerParser(object):
|
|||||||
if info_array[0].skipped:
|
if info_array[0].skipped:
|
||||||
self.skipped += 1
|
self.skipped += 1
|
||||||
self.cooker.skiplist[virtualfn] = SkippedPackage(info_array[0])
|
self.cooker.skiplist[virtualfn] = SkippedPackage(info_array[0])
|
||||||
(fn, cls, fnmc) = bb.cache.virtualfn2realfn(virtualfn)
|
self.bb_caches[mc].add_info(virtualfn, info_array, self.cooker.recipecaches[mc],
|
||||||
|
|
||||||
if fnmc == mc:
|
|
||||||
cache = self.cooker.recipecaches[mc]
|
|
||||||
else:
|
|
||||||
cache = None
|
|
||||||
self.bb_caches[mc].add_info(virtualfn, info_array, cache,
|
|
||||||
parsed=parsed, watcher = self.cooker.add_filewatch)
|
parsed=parsed, watcher = self.cooker.add_filewatch)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user