@@ -27,7 +27,7 @@ import shutil
logger = logging.getLogger("BitBake.Cache")
-__cache_version__ = "156"
+__cache_version__ = "157"
def getCacheFile(path, filename, mc, data_hash):
mcspec = ''
@@ -131,6 +131,14 @@ class CoreRecipeInfo(RecipeInfoCommon):
self.fakerootnoenv = self.getvar('FAKEROOTNOENV', metadata)
self.extradepsfunc = self.getvar('calculate_extra_depends', metadata)
+ self.extravars = self.listvar('BB_CACHE_EXTRAVARS', metadata)
+ if self.extravars:
+ for var in self.extravars:
+ val = self.getvar(var, metadata)
+ if val:
+ bb.warn(str(val))
+ setattr(self, var, self.getvar(var, metadata))
+
@classmethod
def init_cacheData(cls, cachedata):
# CacheData in Core RecipeInfo Class
@@ -168,6 +176,8 @@ class CoreRecipeInfo(RecipeInfoCommon):
cachedata.fakerootlogs = {}
cachedata.extradepsfunc = {}
+ cachedata.extravars = {}
+
def add_cacheData(self, cachedata, fn):
cachedata.task_deps[fn] = self.task_deps
cachedata.pkg_fn[fn] = self.pn
@@ -237,6 +247,9 @@ class CoreRecipeInfo(RecipeInfoCommon):
cachedata.fakerootlogs[fn] = self.fakerootlogs
cachedata.extradepsfunc[fn] = self.extradepsfunc
+ cachedata.extravars[fn] = {}
+ for var in self.extravars:
+ cachedata.extravars[fn][var] = getattr(self, var)
class SiggenRecipeInfo(RecipeInfoCommon):
__slots__ = ()
This allows the metadata to specify that some variables should be cached on a per recipe basis. This is useful for example to allow RECIPE_HOSTTOOLS in OE-Core to error up front in a build if tools are missing rather than the build failing part way through. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> --- lib/bb/cache.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-)