All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Anuj Mittal" <anuj.mittal@intel.com>
To: bitbake-devel@lists.openembedded.org
Subject: [1.50][PATCH 5/5] build: Catch and error upon circular task references
Date: Thu, 16 Sep 2021 07:19:38 +0800	[thread overview]
Message-ID: <bbbddfd913012c5d4e1015a4131e894749df9f90.1631747835.git.anuj.mittal@intel.com> (raw)
In-Reply-To: <cover.1631747835.git.anuj.mittal@intel.com>

From: Richard Purdie <richard.purdie@linuxfoundation.org>

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>
(cherry picked from commit 339d4d6be515a71311b81fb9e99742af0d8a5130)
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
---
 lib/bb/build.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/bb/build.py b/lib/bb/build.py
index b2715fc53..24ce327c5 100644
--- a/lib/bb/build.py
+++ b/lib/bb/build.py
@@ -1025,6 +1025,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:
-- 
2.31.1


      parent reply	other threads:[~2021-09-15 23:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-15 23:19 [1.50][PATCH 0/5] Review request Anuj Mittal
2021-09-15 23:19 ` [1.50][PATCH 1/5] runqueue: Avoid deadlock avoidance task graph corruption Anuj Mittal
2021-09-15 23:19 ` [1.50][PATCH 2/5] runqueue: Fix issues with multiconfig deferred task deadlock messages Anuj Mittal
2021-09-15 23:19 ` [1.50][PATCH 3/5] cooker: Allow upstream for local hash equivalence server Anuj Mittal
2021-09-15 23:19 ` [1.50][PATCH 4/5] runqueue: Improve multiconfig deferred task issues Anuj Mittal
2021-09-15 23:19 ` Anuj Mittal [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bbbddfd913012c5d4e1015a4131e894749df9f90.1631747835.git.anuj.mittal@intel.com \
    --to=anuj.mittal@intel.com \
    --cc=bitbake-devel@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.