diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-02-16 12:57:02 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-02-25 22:33:05 +0000 |
commit | c67e44b839a09ba1854923b52b00f7e810b3720b (patch) | |
tree | 7f8a572d9daf0dca6a382393dd13867c8d90a972 /bitbake/lib/bb | |
parent | 75c837e2740ddc2dc380178f1afe5f0c882f696b (diff) | |
download | poky-c67e44b839a09ba1854923b52b00f7e810b3720b.tar.gz |
bitbake: runqueue: Fix dependency loop analysis 'hangs'
Currently the mechanism for breaking out of the dependnecy loop analysis
code is broken and doesn't work leading to bitbake appearing to hang.
Add in a custom exception for this purpose and fix the code to exit
as intended, fixing the hang and making the dependency loop code
usable again.
(Bitbake rev: e39dbd72ef44eebae32f9fe3b75a1bf789605558)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb')
-rw-r--r-- | bitbake/lib/bb/runqueue.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py index 4d5d876797..843e468263 100644 --- a/bitbake/lib/bb/runqueue.py +++ b/bitbake/lib/bb/runqueue.py | |||
@@ -405,6 +405,9 @@ class RunQueueData: | |||
405 | explored_deps = {} | 405 | explored_deps = {} |
406 | msgs = [] | 406 | msgs = [] |
407 | 407 | ||
408 | class TooManyLoops(Exception): | ||
409 | pass | ||
410 | |||
408 | def chain_reorder(chain): | 411 | def chain_reorder(chain): |
409 | """ | 412 | """ |
410 | Reorder a dependency chain so the lowest task id is first | 413 | Reorder a dependency chain so the lowest task id is first |
@@ -457,7 +460,7 @@ class RunQueueData: | |||
457 | msgs.append("\n") | 460 | msgs.append("\n") |
458 | if len(valid_chains) > 10: | 461 | if len(valid_chains) > 10: |
459 | msgs.append("Aborted dependency loops search after 10 matches.\n") | 462 | msgs.append("Aborted dependency loops search after 10 matches.\n") |
460 | return msgs | 463 | raise TooManyLoops |
461 | continue | 464 | continue |
462 | scan = False | 465 | scan = False |
463 | if revdep not in explored_deps: | 466 | if revdep not in explored_deps: |
@@ -476,8 +479,11 @@ class RunQueueData: | |||
476 | 479 | ||
477 | explored_deps[tid] = total_deps | 480 | explored_deps[tid] = total_deps |
478 | 481 | ||
479 | for task in tasks: | 482 | try: |
480 | find_chains(task, []) | 483 | for task in tasks: |
484 | find_chains(task, []) | ||
485 | except TooManyLoops: | ||
486 | pass | ||
481 | 487 | ||
482 | return msgs | 488 | return msgs |
483 | 489 | ||