From 5673f731f7a1c028b240ad48ed3661c02cc7f81d Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Wed, 16 Nov 2022 12:27:53 +0000 Subject: bitbake: cache: Drop support for not saving the cache file We don't test not using the cache and I'm not aware of anyone using this, it would be hard to with modern bitbake. Drop the conditional code and simply error if CACHE isn't set. (Bitbake rev: 063ffe699bc5fc23174643dfedb66864cacfcff8) Signed-off-by: Richard Purdie --- bitbake/lib/bb/cache.py | 28 +--------------------------- 1 file changed, 1 insertion(+), 27 deletions(-) (limited to 'bitbake/lib/bb/cache.py') diff --git a/bitbake/lib/bb/cache.py b/bitbake/lib/bb/cache.py index 22ed3e80be..cb6cf21727 100644 --- a/bitbake/lib/bb/cache.py +++ b/bitbake/lib/bb/cache.py @@ -309,20 +309,12 @@ class Cache(object): self.filelist_regex = re.compile(r'(?:(?<=:True)|(?<=:False))\s+') if self.cachedir in [None, '']: - self.has_cache = False - self.logger.info("Not using a cache. " - "Set CACHE = to enable.") - return - - self.has_cache = True + bb.fatal("Please ensure CACHE is set to the cache directory for BitBake to use") def getCacheFile(self, cachefile): return getCacheFile(self.cachedir, cachefile, self.mc, self.data_hash) def prepare_cache(self, progress): - if not self.has_cache: - return 0 - loaded = 0 self.cachefile = self.getCacheFile("bb_cache.dat") @@ -361,9 +353,6 @@ class Cache(object): return loaded def cachesize(self): - if not self.has_cache: - return 0 - cachesize = 0 for cache_class in self.caches_array: cachefile = self.getCacheFile(cache_class.cachefile) @@ -472,10 +461,6 @@ class Cache(object): """ if fn not in self.checked: self.cacheValidUpdate(fn, appends) - - # Is cache enabled? - if not self.has_cache: - return False if fn in self.clean: return True return False @@ -485,10 +470,6 @@ class Cache(object): Is the cache valid for fn? Make thorough (slower) checks including timestamps. """ - # Is cache enabled? - if not self.has_cache: - return False - self.checked.add(fn) # File isn't in depends_cache @@ -595,10 +576,6 @@ class Cache(object): Save the cache Called from the parser when complete (or exiting) """ - - if not self.has_cache: - return - if self.cacheclean: self.logger.debug2("Cache is clean, not saving.") return @@ -641,9 +618,6 @@ class Cache(object): if watcher: watcher(info_array[0].file_depends) - if not self.has_cache: - return - if (info_array[0].skipped or 'SRCREVINACTION' not in info_array[0].pv) and not info_array[0].nocache: if parsed: self.cacheclean = False -- cgit v1.2.3-54-g00ecf