]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
spdx_common: Check for dependent task in task flags
authorJoshua Watt <JPEWhacker@gmail.com>
Wed, 18 Mar 2026 13:44:34 +0000 (07:44 -0600)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 20 Mar 2026 10:55:08 +0000 (10:55 +0000)
Checks that the task being used to detect dependencies is present in at
least one dependency task flag of the current task. This helps prevent
errors where the wrong task is specified and never found.

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oe/spdx_common.py

index 72c24180d51b20a5f7eff667981b881a448812f6..3aaf2a9c8b25486658d09c04c15ef9ee4acce30e 100644 (file)
@@ -96,6 +96,17 @@ def collect_direct_deps(d, dep_task):
 
     taskdepdata = d.getVar("BB_TASKDEPDATA", False)
 
+    # Check that the task is listed one of the task dependency flags of the
+    # current task
+    depflags = (
+        set((d.getVarFlag(current_task, "deptask") or "").split())
+        | set((d.getVarFlag(current_task, "rdeptask") or "").split())
+        | set((d.getVarFlag(current_task, "recrdeptask") or "").split())
+    )
+
+    if not dep_task in depflags:
+        bb.fatal(f"Task {dep_task} was not found in any dependency flag of {pn}:{current_task}")
+
     for this_dep in taskdepdata.values():
         if this_dep[0] == pn and this_dep[1] == current_task:
             break