aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bb/cookerdata.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2022-11-30 22:28:56 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-01-26 21:48:33 +0000
commitee89ade5b5a4cf9c53f336d8b800e06fbe436628 (patch)
tree20fbd86b765b04e677a71dc6f49dd26303294709 /lib/bb/cookerdata.py
parentf90c45df5cf4640e0714fde13e311db3327f9fd4 (diff)
downloadbitbake-ee89ade5b5a4cf9c53f336d8b800e06fbe436628.tar.gz
cache/codeparser: Switch to a new BB_CACHEDIR variable for cache location
Currently the codeparser cache is set from CACHE, which is typically in bitbake.conf which means we can't read/write any cache until it is found/read. We may well have python expressions to parse before that happens. The net result is suboptimal functioning of the codeparser cache since it will often be invalidated by data that is never written. This patch changes the codeparser and filechecksum caches to use BB_CACHE as their setting and defaults it to ${TOPDIR}/cache. The patch doesn't change where the "persistent" data such as prserver and hash-equiavalance resides (PERSISTENT_DIR) or where the metadata parsing cache resists (still currently CACHE). I've left those for a later patch. The patch does ensure data parsed by the core datastore parsing calls is written back since this is now much more useful after this change. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/cookerdata.py')
-rw-r--r--lib/bb/cookerdata.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/bb/cookerdata.py b/lib/bb/cookerdata.py
index c6b5658d7..1658bee93 100644
--- a/lib/bb/cookerdata.py
+++ b/lib/bb/cookerdata.py
@@ -271,7 +271,6 @@ class CookerDataBuilder(object):
if self.data.getVar("BB_WORKERCONTEXT", False) is None and not worker:
bb.fetch.fetcher_init(self.data)
bb.parse.init_parser(self.data)
- bb.codeparser.parser_cache_init(self.data)
bb.event.fire(bb.event.ConfigParsed(), self.data)
@@ -370,6 +369,11 @@ class CookerDataBuilder(object):
data.setVar("TOPDIR", os.path.dirname(os.path.dirname(layerconf)))
data = parse_config_file(layerconf, data)
+ if not data.getVar("BB_CACHEDIR"):
+ data.setVar("BB_CACHEDIR", "${TOPDIR}/cache")
+
+ bb.codeparser.parser_cache_init(data.getVar("BB_CACHEDIR"))
+
layers = (data.getVar('BBLAYERS') or "").split()
broken_layers = []
@@ -473,6 +477,9 @@ class CookerDataBuilder(object):
if not data.getVar("TOPDIR"):
data.setVar("TOPDIR", os.path.abspath(os.getcwd()))
+ if not data.getVar("BB_CACHEDIR"):
+ data.setVar("BB_CACHEDIR", "${TOPDIR}/cache")
+ bb.codeparser.parser_cache_init(data.getVar("BB_CACHEDIR"))
data = parse_config_file(os.path.join("conf", "bitbake.conf"), data)