[bitbake-devel] [PATCH] build.py: warn of deprecated use of [noexec] or [nostamp] with value other than '1'

Chris Laplante chris.laplante at agilent.com
Sun Mar 15 16:16:10 UTC 2020


It would be nice for something like the following to work:

    do_task[noexec] = "${@"1" if condition else ""}"

It currently does not, because "noexec" takes effect even when the flag
is present but the value is "".

[YOCTO #13808]

Signed-off-by: Chris Laplante <chris.laplante at agilent.com>
---
 lib/bb/build.py | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/lib/bb/build.py b/lib/bb/build.py
index 23b6ee4..2503515 100644
--- a/lib/bb/build.py
+++ b/lib/bb/build.py
@@ -798,11 +798,14 @@ def add_tasks(tasklist, d):
             task_deps['tasks'].append(task)

         flags = d.getVarFlags(task)
-        def getTask(name):
+        def getTask(name, check_deprecation=False):
             if not name in task_deps:
                 task_deps[name] = {}
             if name in flags:
                 deptask = d.expand(flags[name])
+                # See: https://bugzilla.yoctoproject.org/show_bug.cgi?id=13808
+                if check_deprecation and (deptask != "1"):
+                    bb.warn("Deprecated usage of [{0}] flag with a value other than '1'. In the future, [{0}] will only take effect when set to '1'.".format(name))
                 task_deps[name][task] = deptask
         getTask('mcdepends')
         getTask('depends')
@@ -811,9 +814,9 @@ def add_tasks(tasklist, d):
         getTask('rdeptask')
         getTask('recrdeptask')
         getTask('recideptask')
-        getTask('nostamp')
+        getTask('nostamp', check_deprecation=True)
         getTask('fakeroot')
-        getTask('noexec')
+        getTask('noexec', check_deprecation=True)
         getTask('umask')
         task_deps['parents'][task] = []
         if 'deps' in flags:
--
2.7.4



More information about the bitbake-devel mailing list