diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-11-16 12:27:53 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-11-20 08:31:28 +0000 |
commit | 5673f731f7a1c028b240ad48ed3661c02cc7f81d (patch) | |
tree | b29ce40845eeefb104d401f4bba0019380c716e9 /bitbake/lib/bb/cache.py | |
parent | 228f9a3a2d1991af2f2775af63e795b8b65e0805 (diff) | |
download | poky-5673f731f7a1c028b240ad48ed3661c02cc7f81d.tar.gz |
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 <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/cache.py')
-rw-r--r-- | bitbake/lib/bb/cache.py | 28 |
1 files changed, 1 insertions, 27 deletions
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): | |||
309 | self.filelist_regex = re.compile(r'(?:(?<=:True)|(?<=:False))\s+') | 309 | self.filelist_regex = re.compile(r'(?:(?<=:True)|(?<=:False))\s+') |
310 | 310 | ||
311 | if self.cachedir in [None, '']: | 311 | if self.cachedir in [None, '']: |
312 | self.has_cache = False | 312 | bb.fatal("Please ensure CACHE is set to the cache directory for BitBake to use") |
313 | self.logger.info("Not using a cache. " | ||
314 | "Set CACHE = <directory> to enable.") | ||
315 | return | ||
316 | |||
317 | self.has_cache = True | ||
318 | 313 | ||
319 | def getCacheFile(self, cachefile): | 314 | def getCacheFile(self, cachefile): |
320 | return getCacheFile(self.cachedir, cachefile, self.mc, self.data_hash) | 315 | return getCacheFile(self.cachedir, cachefile, self.mc, self.data_hash) |
321 | 316 | ||
322 | def prepare_cache(self, progress): | 317 | def prepare_cache(self, progress): |
323 | if not self.has_cache: | ||
324 | return 0 | ||
325 | |||
326 | loaded = 0 | 318 | loaded = 0 |
327 | 319 | ||
328 | self.cachefile = self.getCacheFile("bb_cache.dat") | 320 | self.cachefile = self.getCacheFile("bb_cache.dat") |
@@ -361,9 +353,6 @@ class Cache(object): | |||
361 | return loaded | 353 | return loaded |
362 | 354 | ||
363 | def cachesize(self): | 355 | def cachesize(self): |
364 | if not self.has_cache: | ||
365 | return 0 | ||
366 | |||
367 | cachesize = 0 | 356 | cachesize = 0 |
368 | for cache_class in self.caches_array: | 357 | for cache_class in self.caches_array: |
369 | cachefile = self.getCacheFile(cache_class.cachefile) | 358 | cachefile = self.getCacheFile(cache_class.cachefile) |
@@ -472,10 +461,6 @@ class Cache(object): | |||
472 | """ | 461 | """ |
473 | if fn not in self.checked: | 462 | if fn not in self.checked: |
474 | self.cacheValidUpdate(fn, appends) | 463 | self.cacheValidUpdate(fn, appends) |
475 | |||
476 | # Is cache enabled? | ||
477 | if not self.has_cache: | ||
478 | return False | ||
479 | if fn in self.clean: | 464 | if fn in self.clean: |
480 | return True | 465 | return True |
481 | return False | 466 | return False |
@@ -485,10 +470,6 @@ class Cache(object): | |||
485 | Is the cache valid for fn? | 470 | Is the cache valid for fn? |
486 | Make thorough (slower) checks including timestamps. | 471 | Make thorough (slower) checks including timestamps. |
487 | """ | 472 | """ |
488 | # Is cache enabled? | ||
489 | if not self.has_cache: | ||
490 | return False | ||
491 | |||
492 | self.checked.add(fn) | 473 | self.checked.add(fn) |
493 | 474 | ||
494 | # File isn't in depends_cache | 475 | # File isn't in depends_cache |
@@ -595,10 +576,6 @@ class Cache(object): | |||
595 | Save the cache | 576 | Save the cache |
596 | Called from the parser when complete (or exiting) | 577 | Called from the parser when complete (or exiting) |
597 | """ | 578 | """ |
598 | |||
599 | if not self.has_cache: | ||
600 | return | ||
601 | |||
602 | if self.cacheclean: | 579 | if self.cacheclean: |
603 | self.logger.debug2("Cache is clean, not saving.") | 580 | self.logger.debug2("Cache is clean, not saving.") |
604 | return | 581 | return |
@@ -641,9 +618,6 @@ class Cache(object): | |||
641 | if watcher: | 618 | if watcher: |
642 | watcher(info_array[0].file_depends) | 619 | watcher(info_array[0].file_depends) |
643 | 620 | ||
644 | if not self.has_cache: | ||
645 | return | ||
646 | |||
647 | if (info_array[0].skipped or 'SRCREVINACTION' not in info_array[0].pv) and not info_array[0].nocache: | 621 | if (info_array[0].skipped or 'SRCREVINACTION' not in info_array[0].pv) and not info_array[0].nocache: |
648 | if parsed: | 622 | if parsed: |
649 | self.cacheclean = False | 623 | self.cacheclean = False |