summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2019-07-06 14:18:23 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-07-15 10:28:12 +0100
commitb051b819bd263c3b754f76b07bba3f89ced2093c (patch)
treed8c1ddf3d7479eec5ad1ef9747baaac6fa074e02 /bitbake
parent376aa786cde14a8d7a29a4a569f19a0f211e5d52 (diff)
downloadpoky-b051b819bd263c3b754f76b07bba3f89ced2093c.tar.gz
bitbake: runqueue: Simplify scenequeue unskippable calculation
The existing code to compute the 'unskippable' setscene task list is overcomlicated, so replace it with something functionally equivalent but simpler and more efficient. We don't need to process all chains, just the 'top' ones to the first setscene tasks. This also makes the code more readable. (Bitbake rev: 06982c82f10cbdbea0b601e5cf0450a2a99c14c2) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/runqueue.py45
1 files changed, 13 insertions, 32 deletions
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py
index c06e4199d9..ec98411fc3 100644
--- a/bitbake/lib/bb/runqueue.py
+++ b/bitbake/lib/bb/runqueue.py
@@ -2280,7 +2280,7 @@ class SQData(object):
2280 # Cache of stamp files so duplicates can't run in parallel 2280 # Cache of stamp files so duplicates can't run in parallel
2281 self.stamps = {} 2281 self.stamps = {}
2282 # Setscene tasks directly depended upon by the build 2282 # Setscene tasks directly depended upon by the build
2283 self.unskippable = [] 2283 self.unskippable = set()
2284 # List of setscene tasks which aren't present 2284 # List of setscene tasks which aren't present
2285 self.outrightfail = [] 2285 self.outrightfail = []
2286 # A list of normal tasks a setscene task covers 2286 # A list of normal tasks a setscene task covers
@@ -2357,38 +2357,19 @@ def build_scenequeue_data(sqdata, rqdata, rq, cooker, stampcache, sqrq):
2357 2357
2358 # Build a list of setscene tasks which are "unskippable" 2358 # Build a list of setscene tasks which are "unskippable"
2359 # These are direct endpoints referenced by the build 2359 # These are direct endpoints referenced by the build
2360 endpoints2 = {} 2360 # Take the build endpoints (no revdeps) and find the sstate tasks they depend upon
2361 sq_revdeps2 = {} 2361 new = True
2362 sq_revdeps_new2 = {}
2363 def process_endpoints2(endpoints):
2364 newendpoints = {}
2365 for point, task in endpoints.items():
2366 tasks = set([point])
2367 if task:
2368 tasks |= task
2369 if sq_revdeps_new2[point]:
2370 tasks |= sq_revdeps_new2[point]
2371 sq_revdeps_new2[point] = set()
2372 if point in rqdata.runq_setscene_tids:
2373 sq_revdeps_new2[point] = tasks
2374 for dep in rqdata.runtaskentries[point].depends:
2375 if point in sq_revdeps2[dep]:
2376 sq_revdeps2[dep].remove(point)
2377 if tasks:
2378 sq_revdeps_new2[dep] |= tasks
2379 if (len(sq_revdeps2[dep]) == 0 or len(sq_revdeps_new2[dep]) != 0) and dep not in rqdata.runq_setscene_tids:
2380 newendpoints[dep] = tasks
2381 if len(newendpoints) != 0:
2382 process_endpoints2(newendpoints)
2383 for tid in rqdata.runtaskentries: 2362 for tid in rqdata.runtaskentries:
2384 sq_revdeps2[tid] = copy.copy(rqdata.runtaskentries[tid].revdeps) 2363 if len(rqdata.runtaskentries[tid].revdeps) == 0:
2385 sq_revdeps_new2[tid] = set() 2364 sqdata.unskippable.add(tid)
2386 if (len(sq_revdeps2[tid]) == 0) and tid not in rqdata.runq_setscene_tids: 2365 while new:
2387 endpoints2[tid] = set() 2366 new = False
2388 process_endpoints2(endpoints2) 2367 for tid in sqdata.unskippable.copy():
2389 for tid in rqdata.runq_setscene_tids: 2368 if tid in rqdata.runq_setscene_tids:
2390 if sq_revdeps_new2[tid]: 2369 continue
2391 sqdata.unskippable.append(tid) 2370 sqdata.unskippable.remove(tid)
2371 sqdata.unskippable |= rqdata.runtaskentries[tid].depends
2372 new = True
2392 2373
2393 rqdata.init_progress_reporter.next_stage(len(rqdata.runtaskentries)) 2374 rqdata.init_progress_reporter.next_stage(len(rqdata.runtaskentries))
2394 2375