bitbake-devel.lists.openembedded.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] build: Catch and error upon circular task references
@ 2021-09-10 14:07 Richard Purdie
  2021-09-10 14:07 ` [PATCH 2/3] data_smart: Improve error display for handled exceptions Richard Purdie
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Richard Purdie @ 2021-09-10 14:07 UTC (permalink / raw)
  To: bitbake-devel

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]

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 lib/bb/build.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/bb/build.py b/lib/bb/build.py
index 1e062adb51..4249c0be2b 100644
--- a/lib/bb/build.py
+++ b/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 itself via the chain %s" % (task, " -> ".join(chain)))
         chain.append(task)
         for othertask in tasks:
             if othertask == task:
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-09-10 14:54 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-10 14:07 [PATCH 1/3] build: Catch and error upon circular task references Richard Purdie
2021-09-10 14:07 ` [PATCH 2/3] data_smart: Improve error display for handled exceptions Richard Purdie
2021-09-10 14:07 ` [PATCH 3/3] fetch2: Add recursion guard Richard Purdie
2021-09-10 14:48   ` [bitbake-devel] " Quentin Schulz
2021-09-10 14:49     ` Richard Purdie
2021-09-10 14:42 ` [bitbake-devel] [PATCH 1/3] build: Catch and error upon circular task references Quentin Schulz
2021-09-10 14:54   ` Richard Purdie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).