During build whenever a new task starts bitbake says Running task "N of M" to 
show the progress so far (M is total number of tasks to run)

A bug was causing three problems in displaying build progress.

1) If you clean a package and there is only one task, some times it says 
"Running task 2 of 1"

2) Sometimes it just skipps a number N even though the task is not being skipped

3) Sometimes it repeats the same number N for two different tasks which is 
obviously wrong

We were not updating count of active tasks before sending the 
runQueueTaskStarted to ui instead ui was adding 1 to the count passed to it to 
compensate it. But right after sending the event we were updating the active 
count and that was the problem as sometimes the event is not yet dispatched to 
ui hence its count of active tasks gets this increment and ui also adds 1 which 
casues wrong counter to be displayed.

Signed-off-by: Imran Mehmood <[email protected]>
---
 lib/bb/runqueue.py  |    5 ++---
 lib/bb/ui/knotty.py |    2 +-
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/lib/bb/runqueue.py b/lib/bb/runqueue.py
index db626e9..893b465 100644
--- a/lib/bb/runqueue.py
+++ b/lib/bb/runqueue.py
@@ -1250,9 +1250,6 @@ class RunQueueExecuteTasks(RunQueueExecute):
                 bb.build.make_stamp(taskname, self.rqdata.dataCache, fn)
                 self.task_complete(task)
                 return True
-            else:
-                startevent = runQueueTaskStarted(task, self.stats, self.rq)
-                bb.event.fire(startevent, self.cfgData)
 
             pid, pipein, pipeout = self.fork_off_task(fn, task, taskname)
 
@@ -1260,6 +1257,8 @@ class RunQueueExecuteTasks(RunQueueExecute):
             self.build_pipes[pid] = runQueuePipe(pipein, pipeout, self.cfgData)
             self.runq_running[task] = 1
             self.stats.taskActive()
+            startevent = runQueueTaskStarted(task, self.stats, self.rq)
+            bb.event.fire(startevent, self.cfgData)
 
         for pipe in self.build_pipes:
             self.build_pipes[pipe].read()
diff --git a/lib/bb/ui/knotty.py b/lib/bb/ui/knotty.py
index 9f2b787..c0b0a6e 100644
--- a/lib/bb/ui/knotty.py
+++ b/lib/bb/ui/knotty.py
@@ -208,7 +208,7 @@ def main(server, eventHandler):
                 logger.info("Running %s %s of %s (ID: %s, %s)",
                             tasktype,
                             event.stats.completed + event.stats.active +
-                                event.stats.failed + 1,
+                                event.stats.failed,
                             event.stats.total, event.taskid, event.taskstring)
                 continue
 
-- 
1.6.3.3

_______________________________________________
Bitbake-dev mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/bitbake-dev

Reply via email to