From: Mark Hatle <mark.hatle@kernel.crashing.org>
To: bitbake-devel@lists.openembedded.org
Subject: [PATCH 2/2] runqueue: Verify mcdepends are valid
Date: Thu, 23 Jan 2025 20:50:19 -0600 [thread overview]
Message-ID: <1737687019-22232-2-git-send-email-mark.hatle@kernel.crashing.org> (raw)
In-Reply-To: <1737687019-22232-1-git-send-email-mark.hatle@kernel.crashing.org>
From: Mark Hatle <mark.hatle@amd.com>
In order to avoid a potentially confusing backtrace, check that the mcdepend
is valid when we add it.
Add a test case to ensure invalid configurations are caught and trigger an
error.
Signed-off-by: Mark Hatle <mark.hatle@amd.com>
Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
---
bitbake/lib/bb/runqueue.py | 2 ++
bitbake/lib/bb/tests/runqueue-tests/recipes/j1.bb | 2 ++
bitbake/lib/bb/tests/runqueue.py | 9 +++++++++
3 files changed, 13 insertions(+)
create mode 100644 bitbake/lib/bb/tests/runqueue-tests/recipes/j1.bb
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py
index f941749b0d..90f606469b 100644
--- a/bitbake/lib/bb/runqueue.py
+++ b/bitbake/lib/bb/runqueue.py
@@ -734,6 +734,8 @@ class RunQueueData:
if mc == frommc:
fn = taskData[mcdep].build_targets[pn][0]
newdep = '%s:%s' % (fn,deptask)
+ if newdep not in taskData[mcdep].taskentries:
+ bb.fatal("Task mcdepends on non-existent task %s" % (newdep))
taskData[mc].taskentries[tid].tdepends.append(newdep)
for mc in taskData:
diff --git a/bitbake/lib/bb/tests/runqueue-tests/recipes/j1.bb b/bitbake/lib/bb/tests/runqueue-tests/recipes/j1.bb
new file mode 100644
index 0000000000..3c7dca0257
--- /dev/null
+++ b/bitbake/lib/bb/tests/runqueue-tests/recipes/j1.bb
@@ -0,0 +1,2 @@
+do_build[mcdepends] = "mc::mc-1:h1:do_invalid"
+
diff --git a/bitbake/lib/bb/tests/runqueue.py b/bitbake/lib/bb/tests/runqueue.py
index cea2ca13fe..4662efbf55 100644
--- a/bitbake/lib/bb/tests/runqueue.py
+++ b/bitbake/lib/bb/tests/runqueue.py
@@ -321,6 +321,15 @@ class RunQueueTests(unittest.TestCase):
["mc_2:i1:%s" % t for t in self.alltasks]
self.assertEqual(set(tasks), set(expected))
+ # Check what happens with an invalid task depednency
+ passed = False
+ try:
+ self.run_bitbakecmd(["bitbake", "j1"], tempdir, "", extraenv=extraenv, cleanup=True)
+ except AssertionError as e:
+ print("Expected failure: %s" % e)
+ passed = True
+ self.assertEqual(True, passed)
+
self.shutdown(tempdir)
def test_hashserv_single(self):
--
2.34.1
next prev parent reply other threads:[~2025-01-24 2:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-24 2:50 [PATCH 1/2] runqueue: add 'default' mc translation to mcdepends Mark Hatle
2025-01-24 2:50 ` Mark Hatle [this message]
2025-01-25 9:04 ` [bitbake-devel] [PATCH 2/2] runqueue: Verify mcdepends are valid Richard Purdie
2025-01-24 15:59 ` [bitbake-devel] [PATCH 1/2] runqueue: add 'default' mc translation to mcdepends Richard Purdie
2025-01-26 9:24 ` Mathieu Dubois-Briand
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=1737687019-22232-2-git-send-email-mark.hatle@kernel.crashing.org \
--to=mark.hatle@kernel.crashing.org \
--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.