[bitbake-devel,V2,2/3] bitbake: build.py: check dependendent task for addtask

Submitted by Robert Yang on April 29, 2019, 8:11 a.m. | Patch ID: 160755


Message ID cf3463d86e05376fd8a7f8079a815fce27a8d462.1556525357.git.liezhi.yang@windriver.com
State New
Headers show

Commit Message

Robert Yang April 29, 2019, 8:11 a.m.
The following command is incorrect, but was ignored silently, that may suprise

addtask task after task_not_existed

This patch can check and warn for it. It would be better to also check "before"
tasks, but there is no easier way to do it.

[YOCTO #13282]

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
 bitbake/lib/bb/build.py | 3 +++
 1 file changed, 3 insertions(+)

Patch hide | download patch | download mbox

diff --git a/bitbake/lib/bb/build.py b/bitbake/lib/bb/build.py
index 7571421..a83de8d 100644
--- a/bitbake/lib/bb/build.py
+++ b/bitbake/lib/bb/build.py
@@ -815,6 +815,9 @@  def add_tasks(tasklist, d):
         task_deps['parents'][task] = []
         if 'deps' in flags:
             for dep in flags['deps']:
+                # Check and warn for "addtask task after foo" while foo does not exist
+                if not dep in tasklist:
+                    bb.warn('%s: dependent task %s does not exist' % (d.getVar('PN'), dep))
                 dep = d.expand(dep)