summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/runqueue.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2023-11-09 22:49:12 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-11-16 14:49:00 +0000
commit4817f0f1e22453b50a659be60e357edf1527cd35 (patch)
tree03dd8e267f10f54ce85190e798c2cb05772f462e /bitbake/lib/bb/runqueue.py
parentb6e49784eac40a13b894839d17e89ef69a777a5d (diff)
downloadpoky-4817f0f1e22453b50a659be60e357edf1527cd35.tar.gz
bitbake: runqueue: Refactor StaleSetSceneTasks event out of build_scenequeue_data
The event at the end of the function doesn't really belong there, move it out so the function becomes cleaner. It also avoids having to pass a number of parameters around, another sign this is the correct thing to do. This continues refactoring started a while ago to improve and modularise the code. (Bitbake rev: f712b927a84e8b8deaa8c907e8f9bcdec681f2aa) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/runqueue.py')
-rw-r--r--bitbake/lib/bb/runqueue.py36
1 files changed, 18 insertions, 18 deletions
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py
index 2a8b89b264..02d7ff9768 100644
--- a/bitbake/lib/bb/runqueue.py
+++ b/bitbake/lib/bb/runqueue.py
@@ -1874,7 +1874,23 @@ class RunQueueExecute:
1874 1874
1875 #if self.rqdata.runq_setscene_tids: 1875 #if self.rqdata.runq_setscene_tids:
1876 self.sqdata = SQData() 1876 self.sqdata = SQData()
1877 build_scenequeue_data(self.sqdata, self.rqdata, self.rq, self.cooker, self.stampcache, self) 1877 build_scenequeue_data(self.sqdata, self.rqdata, self)
1878
1879 update_scenequeue_data(self.sqdata.sq_revdeps, self.sqdata, self.rqdata, self.rq, self.cooker, self.stampcache, self, summary=True)
1880
1881 # Compute a list of 'stale' sstate tasks where the current hash does not match the one
1882 # in any stamp files. Pass the list out to metadata as an event.
1883 found = {}
1884 for tid in self.rqdata.runq_setscene_tids:
1885 (mc, fn, taskname, taskfn) = split_tid_mcfn(tid)
1886 stamps = bb.build.find_stale_stamps(taskname, taskfn)
1887 if stamps:
1888 if mc not in found:
1889 found[mc] = {}
1890 found[mc][tid] = stamps
1891 for mc in found:
1892 event = bb.event.StaleSetSceneTasks(found[mc])
1893 bb.event.fire(event, self.cooker.databuilder.mcdata[mc])
1878 1894
1879 def runqueue_process_waitpid(self, task, status, fakerootlog=None): 1895 def runqueue_process_waitpid(self, task, status, fakerootlog=None):
1880 1896
@@ -2773,7 +2789,7 @@ class SQData(object):
2773 # A list of normal tasks a setscene task covers 2789 # A list of normal tasks a setscene task covers
2774 self.sq_covered_tasks = {} 2790 self.sq_covered_tasks = {}
2775 2791
2776def build_scenequeue_data(sqdata, rqdata, rq, cooker, stampcache, sqrq): 2792def build_scenequeue_data(sqdata, rqdata, sqrq):
2777 2793
2778 sq_revdeps = {} 2794 sq_revdeps = {}
2779 sq_revdeps_squash = {} 2795 sq_revdeps_squash = {}
@@ -2962,22 +2978,6 @@ def build_scenequeue_data(sqdata, rqdata, rq, cooker, stampcache, sqrq):
2962 sqrq.sq_deferred[tid] = sqdata.hashes[h] 2978 sqrq.sq_deferred[tid] = sqdata.hashes[h]
2963 bb.debug(1, "Deferring %s after %s" % (tid, sqdata.hashes[h])) 2979 bb.debug(1, "Deferring %s after %s" % (tid, sqdata.hashes[h]))
2964 2980
2965 update_scenequeue_data(sqdata.sq_revdeps, sqdata, rqdata, rq, cooker, stampcache, sqrq, summary=True)
2966
2967 # Compute a list of 'stale' sstate tasks where the current hash does not match the one
2968 # in any stamp files. Pass the list out to metadata as an event.
2969 found = {}
2970 for tid in rqdata.runq_setscene_tids:
2971 (mc, fn, taskname, taskfn) = split_tid_mcfn(tid)
2972 stamps = bb.build.find_stale_stamps(taskname, taskfn)
2973 if stamps:
2974 if mc not in found:
2975 found[mc] = {}
2976 found[mc][tid] = stamps
2977 for mc in found:
2978 event = bb.event.StaleSetSceneTasks(found[mc])
2979 bb.event.fire(event, cooker.databuilder.mcdata[mc])
2980
2981def check_setscene_stamps(tid, rqdata, rq, stampcache, noexecstamp=False): 2981def check_setscene_stamps(tid, rqdata, rq, stampcache, noexecstamp=False):
2982 2982
2983 (mc, fn, taskname, taskfn) = split_tid_mcfn(tid) 2983 (mc, fn, taskname, taskfn) = split_tid_mcfn(tid)