diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-12-11 16:37:27 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-12-17 08:52:28 +0000 |
commit | 1a45c29ff13f6e78b9428336f813d0c3e0fd980a (patch) | |
tree | a723108d4783559eb983e94854fc4a0fbd042a94 /bitbake/lib/bb/runqueue.py | |
parent | 878de40a501089048cffdc867b2ae1ad8a2ec9e5 (diff) | |
download | poky-1a45c29ff13f6e78b9428336f813d0c3e0fd980a.tar.gz |
bitbake: build/siggen: Rework stamps functions
The current method of passing either a task's datastore, or
dataCaches and a filename into the stamp functions is rather
horrible.
Due to the different contexts, fixing this is hard but we do control
the bitbake side of the API usage so we can migrate those to use other
functions and then only support a datastore in the public bb.build API
which is only called from task context in OE-Core.
(Bitbake rev: c79ecec580e4c2a141ae483ec0f6448f70593dcf)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/runqueue.py')
-rw-r--r-- | bitbake/lib/bb/runqueue.py | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py index 61cb9f4c95..b9dd830b31 100644 --- a/bitbake/lib/bb/runqueue.py +++ b/bitbake/lib/bb/runqueue.py | |||
@@ -155,7 +155,7 @@ class RunQueueScheduler(object): | |||
155 | self.stamps = {} | 155 | self.stamps = {} |
156 | for tid in self.rqdata.runtaskentries: | 156 | for tid in self.rqdata.runtaskentries: |
157 | (mc, fn, taskname, taskfn) = split_tid_mcfn(tid) | 157 | (mc, fn, taskname, taskfn) = split_tid_mcfn(tid) |
158 | self.stamps[tid] = bb.build.stampfile(taskname, self.rqdata.dataCaches[mc], taskfn, noextra=True) | 158 | self.stamps[tid] = bb.parse.siggen.stampfile_mcfn(taskname, taskfn, extrainfo=False) |
159 | if tid in self.rq.runq_buildable: | 159 | if tid in self.rq.runq_buildable: |
160 | self.buildable.append(tid) | 160 | self.buildable.append(tid) |
161 | 161 | ||
@@ -937,7 +937,7 @@ class RunQueueData: | |||
937 | bb.debug(1, "Task %s is marked nostamp, cannot invalidate this task" % taskname) | 937 | bb.debug(1, "Task %s is marked nostamp, cannot invalidate this task" % taskname) |
938 | else: | 938 | else: |
939 | logger.verbose("Invalidate task %s, %s", taskname, fn) | 939 | logger.verbose("Invalidate task %s, %s", taskname, fn) |
940 | bb.parse.siggen.invalidate_task(taskname, self.dataCaches[mc], taskfn) | 940 | bb.parse.siggen.invalidate_task(taskname, taskfn) |
941 | 941 | ||
942 | self.target_tids = [] | 942 | self.target_tids = [] |
943 | for (mc, target, task, fn) in self.targets: | 943 | for (mc, target, task, fn) in self.targets: |
@@ -1398,7 +1398,7 @@ class RunQueue: | |||
1398 | if taskname is None: | 1398 | if taskname is None: |
1399 | taskname = tn | 1399 | taskname = tn |
1400 | 1400 | ||
1401 | stampfile = bb.build.stampfile(taskname, self.rqdata.dataCaches[mc], taskfn) | 1401 | stampfile = bb.parse.siggen.stampfile_mcfn(taskname, taskfn) |
1402 | 1402 | ||
1403 | # If the stamp is missing, it's not current | 1403 | # If the stamp is missing, it's not current |
1404 | if not os.access(stampfile, os.F_OK): | 1404 | if not os.access(stampfile, os.F_OK): |
@@ -1421,8 +1421,8 @@ class RunQueue: | |||
1421 | for dep in self.rqdata.runtaskentries[tid].depends: | 1421 | for dep in self.rqdata.runtaskentries[tid].depends: |
1422 | if iscurrent: | 1422 | if iscurrent: |
1423 | (mc2, fn2, taskname2, taskfn2) = split_tid_mcfn(dep) | 1423 | (mc2, fn2, taskname2, taskfn2) = split_tid_mcfn(dep) |
1424 | stampfile2 = bb.build.stampfile(taskname2, self.rqdata.dataCaches[mc2], taskfn2) | 1424 | stampfile2 = bb.parse.siggen.stampfile_mcfn(taskname2, taskfn2) |
1425 | stampfile3 = bb.build.stampfile(taskname2 + "_setscene", self.rqdata.dataCaches[mc2], taskfn2) | 1425 | stampfile3 = bb.parse.siggen.stampfile_mcfn(taskname2 + "_setscene", taskfn2) |
1426 | t2 = get_timestamp(stampfile2) | 1426 | t2 = get_timestamp(stampfile2) |
1427 | t3 = get_timestamp(stampfile3) | 1427 | t3 = get_timestamp(stampfile3) |
1428 | if t3 and not t2: | 1428 | if t3 and not t2: |
@@ -2164,7 +2164,7 @@ class RunQueueExecute: | |||
2164 | self.rq.worker[mc].process.stdin.write(b"<runtask>" + pickle.dumps(runtask) + b"</runtask>") | 2164 | self.rq.worker[mc].process.stdin.write(b"<runtask>" + pickle.dumps(runtask) + b"</runtask>") |
2165 | self.rq.worker[mc].process.stdin.flush() | 2165 | self.rq.worker[mc].process.stdin.flush() |
2166 | 2166 | ||
2167 | self.build_stamps[task] = bb.build.stampfile(taskname, self.rqdata.dataCaches[mc], taskfn, noextra=True) | 2167 | self.build_stamps[task] = bb.parse.siggen.stampfile_mcfn(taskname, taskfn, extrainfo=False) |
2168 | self.build_stamps2.append(self.build_stamps[task]) | 2168 | self.build_stamps2.append(self.build_stamps[task]) |
2169 | self.sq_running.add(task) | 2169 | self.sq_running.add(task) |
2170 | self.sq_live.add(task) | 2170 | self.sq_live.add(task) |
@@ -2224,7 +2224,7 @@ class RunQueueExecute: | |||
2224 | self.runq_running.add(task) | 2224 | self.runq_running.add(task) |
2225 | self.stats.taskActive() | 2225 | self.stats.taskActive() |
2226 | if not (self.cooker.configuration.dry_run or self.rqdata.setscene_enforce): | 2226 | if not (self.cooker.configuration.dry_run or self.rqdata.setscene_enforce): |
2227 | bb.build.make_stamp(taskname, self.rqdata.dataCaches[mc], taskfn) | 2227 | bb.build.make_stamp_mcfn(taskname, taskfn) |
2228 | self.task_complete(task) | 2228 | self.task_complete(task) |
2229 | return True | 2229 | return True |
2230 | else: | 2230 | else: |
@@ -2263,7 +2263,7 @@ class RunQueueExecute: | |||
2263 | self.rq.worker[mc].process.stdin.write(b"<runtask>" + pickle.dumps(runtask) + b"</runtask>") | 2263 | self.rq.worker[mc].process.stdin.write(b"<runtask>" + pickle.dumps(runtask) + b"</runtask>") |
2264 | self.rq.worker[mc].process.stdin.flush() | 2264 | self.rq.worker[mc].process.stdin.flush() |
2265 | 2265 | ||
2266 | self.build_stamps[task] = bb.build.stampfile(taskname, self.rqdata.dataCaches[mc], taskfn, noextra=True) | 2266 | self.build_stamps[task] = bb.parse.siggen.stampfile_mcfn(taskname, taskfn, extrainfo=False) |
2267 | self.build_stamps2.append(self.build_stamps[task]) | 2267 | self.build_stamps2.append(self.build_stamps[task]) |
2268 | self.runq_running.add(task) | 2268 | self.runq_running.add(task) |
2269 | self.stats.taskActive() | 2269 | self.stats.taskActive() |
@@ -2520,7 +2520,7 @@ class RunQueueExecute: | |||
2520 | self.scenequeue_notneeded.remove(tid) | 2520 | self.scenequeue_notneeded.remove(tid) |
2521 | 2521 | ||
2522 | (mc, fn, taskname, taskfn) = split_tid_mcfn(tid) | 2522 | (mc, fn, taskname, taskfn) = split_tid_mcfn(tid) |
2523 | self.sqdata.stamps[tid] = bb.build.stampfile(taskname + "_setscene", self.rqdata.dataCaches[mc], taskfn, noextra=True) | 2523 | self.sqdata.stamps[tid] = bb.parse.siggen.stampfile_mcfn(taskname, taskfn, extrainfo=False) |
2524 | 2524 | ||
2525 | if tid in self.stampcache: | 2525 | if tid in self.stampcache: |
2526 | del self.stampcache[tid] | 2526 | del self.stampcache[tid] |
@@ -2836,7 +2836,8 @@ def build_scenequeue_data(sqdata, rqdata, rq, cooker, stampcache, sqrq): | |||
2836 | (mc, fn, taskname, taskfn) = split_tid_mcfn(tid) | 2836 | (mc, fn, taskname, taskfn) = split_tid_mcfn(tid) |
2837 | realtid = tid + "_setscene" | 2837 | realtid = tid + "_setscene" |
2838 | idepends = rqdata.taskData[mc].taskentries[realtid].idepends | 2838 | idepends = rqdata.taskData[mc].taskentries[realtid].idepends |
2839 | sqdata.stamps[tid] = bb.build.stampfile(taskname + "_setscene", rqdata.dataCaches[mc], taskfn, noextra=True) | 2839 | sqdata.stamps[tid] = bb.parse.siggen.stampfile_mcfn(taskname, taskfn, extrainfo=False) |
2840 | |||
2840 | for (depname, idependtask) in idepends: | 2841 | for (depname, idependtask) in idepends: |
2841 | 2842 | ||
2842 | if depname not in rqdata.taskData[mc].build_targets: | 2843 | if depname not in rqdata.taskData[mc].build_targets: |
@@ -2915,7 +2916,7 @@ def build_scenequeue_data(sqdata, rqdata, rq, cooker, stampcache, sqrq): | |||
2915 | found = {} | 2916 | found = {} |
2916 | for tid in rqdata.runq_setscene_tids: | 2917 | for tid in rqdata.runq_setscene_tids: |
2917 | (mc, fn, taskname, taskfn) = split_tid_mcfn(tid) | 2918 | (mc, fn, taskname, taskfn) = split_tid_mcfn(tid) |
2918 | stamps = bb.build.find_stale_stamps(taskname, rqdata.dataCaches[mc], taskfn) | 2919 | stamps = bb.build.find_stale_stamps(taskname, taskfn) |
2919 | if stamps: | 2920 | if stamps: |
2920 | if mc not in found: | 2921 | if mc not in found: |
2921 | found[mc] = {} | 2922 | found[mc] = {} |
@@ -2931,7 +2932,7 @@ def check_setscene_stamps(tid, rqdata, rq, stampcache, noexecstamp=False): | |||
2931 | taskdep = rqdata.dataCaches[mc].task_deps[taskfn] | 2932 | taskdep = rqdata.dataCaches[mc].task_deps[taskfn] |
2932 | 2933 | ||
2933 | if 'noexec' in taskdep and taskname in taskdep['noexec']: | 2934 | if 'noexec' in taskdep and taskname in taskdep['noexec']: |
2934 | bb.build.make_stamp(taskname + "_setscene", rqdata.dataCaches[mc], taskfn) | 2935 | bb.build.make_stamp_mcfn(taskname + "_setscene", taskfn) |
2935 | return True, False | 2936 | return True, False |
2936 | 2937 | ||
2937 | if rq.check_stamp_task(tid, taskname + "_setscene", cache=stampcache): | 2938 | if rq.check_stamp_task(tid, taskname + "_setscene", cache=stampcache): |