Skip to contentSkip to conversation

cache/cookerdata: Move recipe parsing functions from cache to databuilder

PATCH New Richard Purdie 1 participant 1 message Nov 16, 2022

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 cache/cookerdata: Move recipe parsing functions from cache to databuilder

When 'NoCache' was written, databuilder/cookerdata didn't exist. It does now and the recipe parsing functionality contained in NoCache clearly belongs there, it isn't a cache function. Move those functions, renaming to match the style in databuilder but otherwise not changing functionality for now. Fix up the callers to match (which make it clear this is the right move).

---
 bin/bitbake-worker   |  3 +-
 lib/bb/cache.py      | 71 ++++----------------------------------------
 lib/bb/command.py    |  3 +-
 lib/bb/cooker.py     |  3 +-
 lib/bb/cookerdata.py | 51 +++++++++++++++++++++++++++++++
 lib/bb/runqueue.py   |  3 +-
 6 files changed, 60 insertions(+), 74 deletions(-)

v2: Fix "bitbake -e <recipe>" reference to loadDataFull() in cooker.py

bin/bitbake-worker +1 -2
index 7be39370b3..d54044f361 100755
@@ -238,7 +238,6 @@ def fork_off_task(cfg, data, databuilder, workerdata, fn, task, taskname, taskha
                 os.umask(umask)
 
             try:
-                bb_cache = bb.cache.NoCache(databuilder)
                 (realfn, virtual, mc) = bb.cache.virtualfn2realfn(fn)
                 the_data = databuilder.mcdata[mc]
                 the_data.setVar("BB_WORKERCONTEXT", "1")
@@ -257,7 +256,7 @@ def fork_off_task(cfg, data, databuilder, workerdata, fn, task, taskname, taskha
                     bb.parse.siggen.set_taskhashes(workerdata["newhashes"])
                 ret = 0
 
-                the_data = bb_cache.loadDataFull(fn, appends)
+                the_data = databuilder.parseRecipe(fn, appends)
                 the_data.setVar('BB_TASKHASH', taskhash)
                 the_data.setVar('BB_UNIHASH', unihash)
 
lib/bb/cache.py +5 -66

94 lines not on this page · raw message

lib/bb/command.py +1 -2
index ec86885220..fa9fd054c2 100644
@@ -567,8 +567,7 @@ class CommandsSync:
             envdata = bb.cache.parse_recipe(config_data, fn, appendfiles, mc)['']
         else:
             # Use the standard path
-            parser = bb.cache.NoCache(command.cooker.databuilder)
-            envdata = parser.loadDataFull(fn, appendfiles)
+            envdata = command.cooker.databuilder.parseRecipe(fn, appendfiles)
         idx = command.remotedatastores.store(envdata)
         return DataStoreConnectionHandle(idx)
     parseRecipeFile.readonly = True
lib/bb/cooker.py +1 -2
index 1da2f03197..1af29f217d 100644
@@ -617,8 +617,7 @@ class BBCooker:
 
         if fn:
             try:
-                bb_caches = bb.cache.MulticonfigCache(self.databuilder, self.data_hash, self.caches_array)
-                envdata = bb_caches[mc].loadDataFull(fn, self.collections[mc].get_file_appends(fn))
+                envdata = self.databuilder.parseRecipe(fn, self.collections[mc].get_file_appends(fn))
             except Exception as e:
                 parselog.exception("Unable to read %s", fn)
                 raise
lib/bb/cookerdata.py +51 -0

54 lines not on this page · raw message

lib/bb/runqueue.py +1 -2
index 338d1fe36f..437f4a185c 100644
@@ -1610,9 +1610,8 @@ class RunQueue:
             self.rqexe.finish()
 
     def rq_dump_sigfn(self, fn, options):
-        bb_cache = bb.cache.NoCache(self.cooker.databuilder)
         mc = bb.runqueue.mc_from_tid(fn)
-        the_data = bb_cache.loadDataFull(fn, self.cooker.collections[mc].get_file_appends(fn))
+        the_data = self.cooker.databuilder.parseRecipe(fn, self.cooker.collections[mc].get_file_appends(fn))
         siggen = bb.parse.siggen
         dataCaches = self.rqdata.dataCaches
         siggen.dump_sigfn(fn, dataCaches, options)
Signature · 1 line
2.34.1