mirror of
https://git.yoctoproject.org/poky
synced 2026-01-29 21:08:42 +01:00
bitbake: bitbake: runqueue: Verify mcdepends are valid
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. [RP: Reworked test case to simplify and improve code] (Bitbake rev: 9f6f049870e0ec829e171fe91ec8f7a092ddd2ab) Signed-off-by: Mark Hatle <mark.hatle@amd.com> Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Chris Laplante <chris.laplante@agilent.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
This commit is contained in:
committed by
Steve Sakoman
parent
e711b2f39a
commit
bfb799ef2a
@@ -729,6 +729,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:
|
||||
|
||||
2
bitbake/lib/bb/tests/runqueue-tests/recipes/g1.bb
Normal file
2
bitbake/lib/bb/tests/runqueue-tests/recipes/g1.bb
Normal file
@@ -0,0 +1,2 @@
|
||||
do_build[mcdepends] = "mc::mc-1:h1:do_invalid"
|
||||
|
||||
0
bitbake/lib/bb/tests/runqueue-tests/recipes/h1.bb
Normal file
0
bitbake/lib/bb/tests/runqueue-tests/recipes/h1.bb
Normal file
@@ -26,7 +26,7 @@ class RunQueueTests(unittest.TestCase):
|
||||
a1_sstatevalid = "a1:do_package a1:do_package_qa a1:do_packagedata a1:do_package_write_ipk a1:do_package_write_rpm a1:do_populate_lic a1:do_populate_sysroot"
|
||||
b1_sstatevalid = "b1:do_package b1:do_package_qa b1:do_packagedata b1:do_package_write_ipk b1:do_package_write_rpm b1:do_populate_lic b1:do_populate_sysroot"
|
||||
|
||||
def run_bitbakecmd(self, cmd, builddir, sstatevalid="", slowtasks="", extraenv=None, cleanup=False):
|
||||
def run_bitbakecmd(self, cmd, builddir, sstatevalid="", slowtasks="", extraenv=None, cleanup=False, allowfailure=False):
|
||||
env = os.environ.copy()
|
||||
env["BBPATH"] = os.path.realpath(os.path.join(os.path.dirname(__file__), "runqueue-tests"))
|
||||
env["BB_ENV_PASSTHROUGH_ADDITIONS"] = "SSTATEVALID SLOWTASKS TOPDIR"
|
||||
@@ -41,6 +41,8 @@ class RunQueueTests(unittest.TestCase):
|
||||
output = subprocess.check_output(cmd, env=env, stderr=subprocess.STDOUT,universal_newlines=True, cwd=builddir)
|
||||
print(output)
|
||||
except subprocess.CalledProcessError as e:
|
||||
if allowfailure:
|
||||
return e.output
|
||||
self.fail("Command %s failed with %s" % (cmd, e.output))
|
||||
tasks = []
|
||||
tasklog = builddir + "/task.log"
|
||||
@@ -314,6 +316,13 @@ class RunQueueTests(unittest.TestCase):
|
||||
["mc_2:a1:%s" % t for t in rerun_tasks]
|
||||
self.assertEqual(set(tasks), set(expected))
|
||||
|
||||
# Check that a multiconfig that doesn't exist rasies a correct error message
|
||||
error_output = self.run_bitbakecmd(["bitbake", "g1"], tempdir, "", extraenv=extraenv, cleanup=True, allowfailure=True)
|
||||
self.assertIn("non-existent task", error_output)
|
||||
# If the word 'Traceback' or 'KeyError' is in the output we've regressed
|
||||
self.assertNotIn("Traceback", error_output)
|
||||
self.assertNotIn("KeyError", error_output)
|
||||
|
||||
self.shutdown(tempdir)
|
||||
|
||||
def test_hashserv_single(self):
|
||||
|
||||
Reference in New Issue
Block a user