[oe-commits] [bitbake] 23/31: runqueue: Alter setscenewhitelist handling

git at git.openembedded.org git at git.openembedded.org
Mon Jul 15 08:33:34 UTC 2019


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository bitbake.

commit a08d8ba5f5194a09391b1904ee31c04c5f0b1e28
Author: Richard Purdie <richard.purdie at linuxfoundation.org>
AuthorDate: Sat Jul 6 16:16:54 2019 +0100

    runqueue: Alter setscenewhitelist handling
    
    Since there is now parallel execution of setscene and normal tasks, the way
    setscenewhitelist handling worked can't function the way it did. Paul and I
    never liked its error output anyway.
    
    This code tries a different approach, checking the task at execution time
    but printing the uncovered task list.
    
    This code may need improvement after real world usage but can
    work with the new task flows.
    
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 lib/bb/runqueue.py | 79 +++++++++++++++++++++---------------------------------
 1 file changed, 30 insertions(+), 49 deletions(-)

diff --git a/lib/bb/runqueue.py b/lib/bb/runqueue.py
index aafb6ff..d995e4c 100644
--- a/lib/bb/runqueue.py
+++ b/lib/bb/runqueue.py
@@ -25,6 +25,7 @@ import subprocess
 import pickle
 from multiprocessing import Process
 import shlex
+import pprint
 
 bblogger = logging.getLogger("BitBake")
 logger = logging.getLogger("BitBake.RunQueue")
@@ -1681,49 +1682,6 @@ class RunQueue:
                 output = bb.siggen.compare_sigfiles(latestmatch, match, recursecb)
                 bb.plain("\nTask %s:%s couldn't be used from the cache because:\n  We need hash %s, closest matching task was %s\n  " % (pn, taskname, h, prevh) + '\n  '.join(output))
 
-def process_setscene_whitelist(rq, rqdata, stampcache, sched, rqex):
-    # Check tasks that are going to run against the whitelist
-    def check_norun_task(tid, showerror=False):
-        (mc, fn, taskname, taskfn) = split_tid_mcfn(tid)
-        # Ignore covered tasks
-        if tid in rqex.tasks_covered:
-            return False
-        # Ignore stamped tasks
-        if rq.check_stamp_task(tid, taskname, cache=stampcache):
-            return False
-        # Ignore noexec tasks
-        taskdep = rqdata.dataCaches[mc].task_deps[taskfn]
-        if 'noexec' in taskdep and taskname in taskdep['noexec']:
-            return False
-
-        pn = rqdata.dataCaches[mc].pkg_fn[taskfn]
-        if not check_setscene_enforce_whitelist(pn, taskname, rqdata.setscenewhitelist):
-            if showerror:
-                if tid in rqdata.runq_setscene_tids:
-                    logger.error('Task %s.%s attempted to execute unexpectedly and should have been setscened' % (pn, taskname))
-                else:
-                    logger.error('Task %s.%s attempted to execute unexpectedly' % (pn, taskname))
-            return True
-        return False
-    # Look to see if any tasks that we think shouldn't run are going to
-    unexpected = False
-    for tid in rqdata.runtaskentries:
-        if check_norun_task(tid):
-            unexpected = True
-            break
-    if unexpected:
-        # Run through the tasks in the rough order they'd have executed and print errors
-        # (since the order can be useful - usually missing sstate for the last few tasks
-        # is the cause of the problem)
-        task = sched.next()
-        while task is not None:
-            check_norun_task(task, showerror=True)
-            rqex.task_skip(task, 'Setscene enforcement check')
-            task = sched.next()
-
-        rq.state = runQueueCleanUp
-        return True
-
 
 class RunQueueExecute:
 
@@ -1944,12 +1902,6 @@ class RunQueueExecute:
         Run the tasks in a queue prepared by rqdata.prepare()
         """
 
-        if self.rqdata.setscenewhitelist is not None and not self.rqdata.setscenewhitelist_checked:
-            self.rqdata.setscenewhitelist_checked = True
-
-            if process_setscenewhitelist(self.rq, self.rqdata, self.stampcache, self.sched, self):
-                return True
-
         if self.cooker.configuration.setsceneonly:
             return True
 
@@ -1963,6 +1915,11 @@ class RunQueueExecute:
         if task is not None:
             (mc, fn, taskname, taskfn) = split_tid_mcfn(task)
 
+            if self.rqdata.setscenewhitelist is not None:
+                if self.check_setscenewhitelist(task):
+                    self.task_fail(task, "setscene whitelist")
+                    return True
+
             if task in self.tasks_covered:
                 logger.debug(2, "Setscene covered task %s", task)
                 self.task_skip(task, "covered")
@@ -2348,6 +2305,30 @@ class RunQueueExecute:
         #bb.note("Task %s: " % task + str(taskdepdata).replace("], ", "],\n"))
         return taskdepdata
 
+    def check_setscenewhitelist(self, tid):
+        # Check task that is going to run against the whitelist
+        (mc, fn, taskname, taskfn) = split_tid_mcfn(tid)
+        # Ignore covered tasks
+        if tid in self.tasks_covered:
+            return False
+        # Ignore stamped tasks
+        if self.rq.check_stamp_task(tid, taskname, cache=self.stampcache):
+            return False
+        # Ignore noexec tasks
+        taskdep = self.rqdata.dataCaches[mc].task_deps[taskfn]
+        if 'noexec' in taskdep and taskname in taskdep['noexec']:
+            return False
+
+        pn = self.rqdata.dataCaches[mc].pkg_fn[taskfn]
+        if not check_setscene_enforce_whitelist(pn, taskname, self.rqdata.setscenewhitelist):
+            if tid in self.rqdata.runq_setscene_tids:
+                msg = 'Task %s.%s attempted to execute unexpectedly and should have been setscened' % (pn, taskname)
+            else:
+                msg = 'Task %s.%s attempted to execute unexpectedly' % (pn, taskname)
+            logger.error(msg + '\nThis is usually due to missing setscene tasks. Those missing in this build were: %s' % pprint.pformat(self.scenequeue_notcovered))
+            return True
+        return False
+
 class SQData(object):
     def __init__(self):
         # SceneQueue dependencies

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list