From 3a8cb949a9c11d7fcab55c2036f8be306beb4e37 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Fri, 10 Sep 2021 14:47:37 +0100 Subject: bitbake: build: Catch and error upon circular task references If there are circular task references, error on them rather than show a recursion error. A simple reproducer is: """ do_packageswu () { : } addtask do_packageswu after do_image_complete before do_image_qa """ into image_types.bbclass. There is code in runqueue to detect these but we never get that far with the current codebase. [YOCTO #13140] (Bitbake rev: 339d4d6be515a71311b81fb9e99742af0d8a5130) Signed-off-by: Richard Purdie --- bitbake/lib/bb/build.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bitbake/lib/bb/build.py b/bitbake/lib/bb/build.py index 1e062adb51..c2479dd167 100644 --- a/bitbake/lib/bb/build.py +++ b/bitbake/lib/bb/build.py @@ -1034,6 +1034,8 @@ def tasksbetween(task_start, task_end, d): def follow_chain(task, endtask, chain=None): if not chain: chain = [] + if task in chain: + bb.fatal("Circular task dependencies as %s depends on itself via the chain %s" % (task, " -> ".join(chain))) chain.append(task) for othertask in tasks: if othertask == task: -- cgit v1.2.3-54-g00ecf