diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-08-05 23:31:25 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-08-06 11:21:31 +0100 |
commit | d9aafb85072bef3b5baa54408969d54a8425a111 (patch) | |
tree | 3defcf5b790a561fe47a12a393cea8c945030501 /bitbake/lib | |
parent | 7df31ff36892c2f9c65326b06b4c7093b1462f54 (diff) | |
download | poky-d9aafb85072bef3b5baa54408969d54a8425a111.tar.gz |
bitbake: runqueue: Improve determinism
Whilst this isn't strictly necessary, its helpful if the log output is
consistent and its also helpful if bugs either appear or don't appear
for a specific configuration. Ensuring the various iterations we make
are deterministic (sorted) helps with this.
(Bitbake rev: 6a901bb904a97ca90d88be2c6901d3d32346282f)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
-rw-r--r-- | bitbake/lib/bb/runqueue.py | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py index 11b98f698d..05c1200da1 100644 --- a/bitbake/lib/bb/runqueue.py +++ b/bitbake/lib/bb/runqueue.py | |||
@@ -1936,7 +1936,7 @@ class RunQueueExecute: | |||
1936 | task = None | 1936 | task = None |
1937 | if not self.sqdone and self.can_start_task(): | 1937 | if not self.sqdone and self.can_start_task(): |
1938 | # Find the next setscene to run | 1938 | # Find the next setscene to run |
1939 | for nexttask in self.rqdata.runq_setscene_tids: | 1939 | for nexttask in sorted(self.rqdata.runq_setscene_tids): |
1940 | if nexttask in self.sq_buildable and nexttask not in self.sq_running and self.sqdata.stamps[nexttask] not in self.build_stamps.values(): | 1940 | if nexttask in self.sq_buildable and nexttask not in self.sq_running and self.sqdata.stamps[nexttask] not in self.build_stamps.values(): |
1941 | if nexttask not in self.sqdata.unskippable and len(self.sqdata.sq_revdeps[nexttask]) > 0 and self.sqdata.sq_revdeps[nexttask].issubset(self.scenequeue_covered) and self.check_dependencies(nexttask, self.sqdata.sq_revdeps[nexttask]): | 1941 | if nexttask not in self.sqdata.unskippable and len(self.sqdata.sq_revdeps[nexttask]) > 0 and self.sqdata.sq_revdeps[nexttask].issubset(self.scenequeue_covered) and self.check_dependencies(nexttask, self.sqdata.sq_revdeps[nexttask]): |
1942 | if nexttask not in self.rqdata.target_tids: | 1942 | if nexttask not in self.rqdata.target_tids: |
@@ -2305,8 +2305,8 @@ class RunQueueExecute: | |||
2305 | notcovered = set([task]) | 2305 | notcovered = set([task]) |
2306 | while notcovered: | 2306 | while notcovered: |
2307 | new = set() | 2307 | new = set() |
2308 | for t in notcovered: | 2308 | for t in sorted(notcovered): |
2309 | for deptask in self.rqdata.runtaskentries[t].depends: | 2309 | for deptask in sorted(self.rqdata.runtaskentries[t].depends): |
2310 | if deptask in notcovered or deptask in new or deptask in self.rqdata.runq_setscene_tids or deptask in self.tasks_notcovered: | 2310 | if deptask in notcovered or deptask in new or deptask in self.rqdata.runq_setscene_tids or deptask in self.tasks_notcovered: |
2311 | continue | 2311 | continue |
2312 | logger.debug(1, 'Task %s depends on non-setscene task %s so not skipping' % (t, deptask)) | 2312 | logger.debug(1, 'Task %s depends on non-setscene task %s so not skipping' % (t, deptask)) |
@@ -2322,8 +2322,8 @@ class RunQueueExecute: | |||
2322 | ready = set([task]) | 2322 | ready = set([task]) |
2323 | while ready: | 2323 | while ready: |
2324 | new = set() | 2324 | new = set() |
2325 | for t in ready: | 2325 | for t in sorted(ready): |
2326 | for deptask in self.rqdata.runtaskentries[t].revdeps: | 2326 | for deptask in sorted(self.rqdata.runtaskentries[t].revdeps): |
2327 | if deptask in ready or deptask in new or deptask in self.tasks_scenequeue_done or deptask in self.rqdata.runq_setscene_tids: | 2327 | if deptask in ready or deptask in new or deptask in self.tasks_scenequeue_done or deptask in self.rqdata.runq_setscene_tids: |
2328 | continue | 2328 | continue |
2329 | if deptask in self.sqdata.unskippable: | 2329 | if deptask in self.sqdata.unskippable: |
@@ -2334,7 +2334,7 @@ class RunQueueExecute: | |||
2334 | ready = new | 2334 | ready = new |
2335 | 2335 | ||
2336 | def scenequeue_updatecounters(self, task, fail=False): | 2336 | def scenequeue_updatecounters(self, task, fail=False): |
2337 | for dep in self.sqdata.sq_deps[task]: | 2337 | for dep in sorted(self.sqdata.sq_deps[task]): |
2338 | if fail and task in self.sqdata.sq_harddeps and dep in self.sqdata.sq_harddeps[task]: | 2338 | if fail and task in self.sqdata.sq_harddeps and dep in self.sqdata.sq_harddeps[task]: |
2339 | logger.debug(2, "%s was unavailable and is a hard dependency of %s so skipping" % (task, dep)) | 2339 | logger.debug(2, "%s was unavailable and is a hard dependency of %s so skipping" % (task, dep)) |
2340 | self.sq_task_failoutright(dep) | 2340 | self.sq_task_failoutright(dep) |
@@ -2346,7 +2346,7 @@ class RunQueueExecute: | |||
2346 | next = set([task]) | 2346 | next = set([task]) |
2347 | while next: | 2347 | while next: |
2348 | new = set() | 2348 | new = set() |
2349 | for t in next: | 2349 | for t in sorted(next): |
2350 | self.tasks_scenequeue_done.add(t) | 2350 | self.tasks_scenequeue_done.add(t) |
2351 | # Look down the dependency chain for non-setscene things which this task depends on | 2351 | # Look down the dependency chain for non-setscene things which this task depends on |
2352 | # and mark as 'done' | 2352 | # and mark as 'done' |
@@ -2368,7 +2368,7 @@ class RunQueueExecute: | |||
2368 | logger.debug(1, 'Queued setscene task %s', task) | 2368 | logger.debug(1, 'Queued setscene task %s', task) |
2369 | self.coveredtopocess.add(task) | 2369 | self.coveredtopocess.add(task) |
2370 | 2370 | ||
2371 | for task in self.coveredtopocess.copy(): | 2371 | for task in sorted(self.coveredtopocess.copy()): |
2372 | if self.sqdata.sq_covered_tasks[task].issubset(self.tasks_scenequeue_done): | 2372 | if self.sqdata.sq_covered_tasks[task].issubset(self.tasks_scenequeue_done): |
2373 | logger.debug(1, 'Processing setscene task %s', task) | 2373 | logger.debug(1, 'Processing setscene task %s', task) |
2374 | covered = self.sqdata.sq_covered_tasks[task] | 2374 | covered = self.sqdata.sq_covered_tasks[task] |
@@ -2376,7 +2376,7 @@ class RunQueueExecute: | |||
2376 | 2376 | ||
2377 | # If a task is in target_tids and isn't a setscene task, we can't skip it. | 2377 | # If a task is in target_tids and isn't a setscene task, we can't skip it. |
2378 | cantskip = covered.intersection(self.rqdata.target_tids).difference(self.rqdata.runq_setscene_tids) | 2378 | cantskip = covered.intersection(self.rqdata.target_tids).difference(self.rqdata.runq_setscene_tids) |
2379 | for tid in cantskip: | 2379 | for tid in sorted(cantskip): |
2380 | self.tasks_notcovered.add(tid) | 2380 | self.tasks_notcovered.add(tid) |
2381 | self.scenequeue_process_notcovered(tid) | 2381 | self.scenequeue_process_notcovered(tid) |
2382 | covered.difference_update(cantskip) | 2382 | covered.difference_update(cantskip) |
@@ -2385,7 +2385,7 @@ class RunQueueExecute: | |||
2385 | covered.difference_update(self.tasks_notcovered) | 2385 | covered.difference_update(self.tasks_notcovered) |
2386 | self.tasks_covered.update(covered) | 2386 | self.tasks_covered.update(covered) |
2387 | self.coveredtopocess.remove(task) | 2387 | self.coveredtopocess.remove(task) |
2388 | for tid in covered: | 2388 | for tid in sorted(covered): |
2389 | if self.rqdata.runtaskentries[tid].depends.issubset(self.runq_complete): | 2389 | if self.rqdata.runtaskentries[tid].depends.issubset(self.runq_complete): |
2390 | self.setbuildable(tid) | 2390 | self.setbuildable(tid) |
2391 | self.update_holdofftasks() | 2391 | self.update_holdofftasks() |
@@ -2597,7 +2597,7 @@ def build_scenequeue_data(sqdata, rqdata, rq, cooker, stampcache, sqrq): | |||
2597 | while new: | 2597 | while new: |
2598 | new = False | 2598 | new = False |
2599 | orig = sqdata.unskippable.copy() | 2599 | orig = sqdata.unskippable.copy() |
2600 | for tid in orig: | 2600 | for tid in sorted(orig, reverse=True): |
2601 | if tid in rqdata.runq_setscene_tids: | 2601 | if tid in rqdata.runq_setscene_tids: |
2602 | continue | 2602 | continue |
2603 | if len(rqdata.runtaskentries[tid].depends) == 0: | 2603 | if len(rqdata.runtaskentries[tid].depends) == 0: |
@@ -2691,7 +2691,7 @@ def build_scenequeue_data(sqdata, rqdata, rq, cooker, stampcache, sqrq): | |||
2691 | stamppresent = [] | 2691 | stamppresent = [] |
2692 | tocheck = set() | 2692 | tocheck = set() |
2693 | 2693 | ||
2694 | for tid in sqdata.sq_revdeps: | 2694 | for tid in sorted(sqdata.sq_revdeps): |
2695 | (mc, fn, taskname, taskfn) = split_tid_mcfn(tid) | 2695 | (mc, fn, taskname, taskfn) = split_tid_mcfn(tid) |
2696 | 2696 | ||
2697 | taskdep = rqdata.dataCaches[mc].task_deps[taskfn] | 2697 | taskdep = rqdata.dataCaches[mc].task_deps[taskfn] |
@@ -2724,7 +2724,7 @@ def build_scenequeue_data(sqdata, rqdata, rq, cooker, stampcache, sqrq): | |||
2724 | 2724 | ||
2725 | hashes = {} | 2725 | hashes = {} |
2726 | for mc in sorted(multiconfigs): | 2726 | for mc in sorted(multiconfigs): |
2727 | for tid in sqdata.sq_revdeps: | 2727 | for tid in sorted(sqdata.sq_revdeps): |
2728 | if mc_from_tid(tid) != mc: | 2728 | if mc_from_tid(tid) != mc: |
2729 | continue | 2729 | continue |
2730 | if tid not in valid_new and tid not in noexec and tid not in sqrq.scenequeue_notcovered: | 2730 | if tid not in valid_new and tid not in noexec and tid not in sqrq.scenequeue_notcovered: |