Openembedded Bitbake Development
 help / color / mirror / Atom feed
* [RFC] Respect force flag in runall and runonly
@ 2018-03-27 18:34 Joshua Watt
  2018-03-27 18:34 ` [RFC] bitbake: respect " Joshua Watt
  0 siblings, 1 reply; 2+ messages in thread
From: Joshua Watt @ 2018-03-27 18:34 UTC (permalink / raw)
  To: bitbake-devel

Implements the ability to run bitbake commands like:

 $ bitbake -f --runall fetch core-image-mimimal
 $ bitbake -f --runonly fetch core-image-minimal

which will invalidate the stamps for all affected tasks forcing them to
run even if they have already.

I've found this useful in a few circumstances. Most recently, I was
attempting to do A/B performance comparison of so package QA checks, so
it was pretty easy to figure out the impact of various QA checks with:

 $ time bitbake -f --runall package_qa core-image-minimal

Additionally, I currently do a number of actions like this (because we
don't have runall):

 $ bitbake -g <image>
 $ xargs -a pn-buildlist bitbake -f -c <action>

And I would like to replace them with

 $ bitbake -f --runall <action> <image>

Is this something that is even necessary/wanted?



^ permalink raw reply	[flat|nested] 2+ messages in thread

* [RFC] bitbake: respect force flag in runall and runonly
  2018-03-27 18:34 [RFC] Respect force flag in runall and runonly Joshua Watt
@ 2018-03-27 18:34 ` Joshua Watt
  0 siblings, 0 replies; 2+ messages in thread
From: Joshua Watt @ 2018-03-27 18:34 UTC (permalink / raw)
  To: bitbake-devel

Specifying the force flag will now cause runall and runonly to
invalidate the tasks before running them.

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
---
 bitbake/lib/bb/runqueue.py | 35 ++++++++++++++++++++---------------
 1 file changed, 20 insertions(+), 15 deletions(-)

diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py
index f2e52cf758c..9ae5c9cb177 100644
--- a/bitbake/lib/bb/runqueue.py
+++ b/bitbake/lib/bb/runqueue.py
@@ -795,6 +795,21 @@ class RunQueueData:
             for depend in depends:
                 mark_active(depend, depth+1)
 
+        def invalidate_task(tid, error_nostamp):
+            (mc, fn, taskname, taskfn) = split_tid_mcfn(tid)
+            taskdep = self.dataCaches[mc].task_deps[taskfn]
+            if fn + ":" + taskname not in taskData[mc].taskentries:
+                logger.warning("Task %s does not exist, invalidating this task will have no effect" % taskname)
+            if 'nostamp' in taskdep and taskname in taskdep['nostamp']:
+                if error_nostamp:
+                    bb.fatal("Task %s is marked nostamp, cannot invalidate this task" % taskname)
+                else:
+                    bb.debug(1, "Task %s is marked nostamp, cannot invalidate this task" % taskname)
+            else:
+                logger.verbose("Invalidate task %s, %s", taskname, fn)
+                bb.parse.siggen.invalidate_task(taskname, self.dataCaches[mc], fn)
+
+
         self.target_tids = []
         for (mc, target, task, fn) in self.targets:
 
@@ -863,6 +878,8 @@ class RunQueueData:
 
                 for tid in list(runall_tids):
                     mark_active(tid,1)
+                    if self.cooker.configuration.force:
+                        invalidate_task(tid, False)
 
             for tid in list(self.runtaskentries.keys()):
                 if tid not in runq_build:
@@ -884,6 +901,8 @@ class RunQueueData:
 
                 for tid in list(runonly_tids):
                     mark_active(tid,1)
+                    if self.cooker.configuration.force:
+                        invalidate_task(tid, False)
 
             for tid in list(self.runtaskentries.keys()):
                 if tid not in runq_build:
@@ -1040,7 +1059,7 @@ class RunQueueData:
 
         # Create a whitelist usable by the stamp checks
         self.stampfnwhitelist = {}
-        for mc in self.taskData: 
+        for mc in self.taskData:
             self.stampfnwhitelist[mc] = []
             for entry in self.stampwhitelist.split():
                 if entry not in self.taskData[mc].build_targets:
@@ -1060,20 +1079,6 @@ class RunQueueData:
                     continue
                 self.runq_setscene_tids.append(tid)
 
-        def invalidate_task(tid, error_nostamp):
-            (mc, fn, taskname, taskfn) = split_tid_mcfn(tid)
-            taskdep = self.dataCaches[mc].task_deps[taskfn]
-            if fn + ":" + taskname not in taskData[mc].taskentries:
-                logger.warning("Task %s does not exist, invalidating this task will have no effect" % taskname)
-            if 'nostamp' in taskdep and taskname in taskdep['nostamp']:
-                if error_nostamp:
-                    bb.fatal("Task %s is marked nostamp, cannot invalidate this task" % taskname)
-                else:
-                    bb.debug(1, "Task %s is marked nostamp, cannot invalidate this task" % taskname)
-            else:
-                logger.verbose("Invalidate task %s, %s", taskname, fn)
-                bb.parse.siggen.invalidate_task(taskname, self.dataCaches[mc], fn)
-
         self.init_progress_reporter.next_stage()
 
         # Invalidate task if force mode active
-- 
2.14.3



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-03-27 18:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-27 18:34 [RFC] Respect force flag in runall and runonly Joshua Watt
2018-03-27 18:34 ` [RFC] bitbake: respect " Joshua Watt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox