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

Submitted by Nicolas Cornu via bitbake-devel on March 15, 2020, 4:16 p.m. | Patch ID: 171036

Details

Message ID 1584288970-69085-1-git-send-email-chris.laplante@agilent.com
State New
Headers show

Commit Message

Nicolas Cornu via bitbake-devel March 15, 2020, 4:16 p.m.
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@agilent.com>
---
 lib/bb/build.py | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

--
2.7.4

Patch hide | download patch | download mbox

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: