Patchwork [bitbake-devel,2/2] Hob: show (package, task) pair which is being executed on the build details screen

login
register
mail settings
Submitter Shane Wang
Date March 26, 2012, 2:33 p.m.
Message ID <f906c534c2b3a4dd4f3cc88cff189a17cb132a2e.1332772309.git.shane.wang@intel.com>
Download mbox | patch
Permalink /patch/24563/
State New
Headers show

Comments

Shane Wang - March 26, 2012, 2:33 p.m.
This patch is still for bug 2098 to provide clear information about the task and the package in progress.

[Yocto #2098]

Signed-off-by: Shane Wang <shane.wang@intel.com>
---
 bitbake/lib/bb/ui/crumbs/builddetailspage.py |   23 ++++++++++++++++-------
 bitbake/lib/bb/ui/crumbs/builder.py          |   12 +++++++++---
 bitbake/lib/bb/ui/crumbs/runningbuild.py     |    7 +++++++
 3 files changed, 32 insertions(+), 10 deletions(-)
Shane Wang - March 27, 2012, 12:41 a.m.
I saw Josh had a patch pending to show (recipe, task) pair on http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/commit/?h=josh/hob&id=1840c40a77038d3e181830d4aba84a59273eccd1, which hasn't been submitted.
I am OK with his and skip my patch below.

--
Shane

Shane Wang wrote onĀ 2012-03-26:

> This patch is still for bug 2098 to provide clear information about the task
> and the package in progress.
> 
> [Yocto #2098]
> 
> Signed-off-by: Shane Wang <shane.wang@intel.com>
> ---
>  bitbake/lib/bb/ui/crumbs/builddetailspage.py |   23
>  ++++++++++++++++------- bitbake/lib/bb/ui/crumbs/builder.py          | 
>   12 +++++++++--- bitbake/lib/bb/ui/crumbs/runningbuild.py     |    7
>  +++++++ 3 files changed, 32 insertions(+), 10 deletions(-)
> diff --git a/bitbake/lib/bb/ui/crumbs/builddetailspage.py
> b/bitbake/lib/bb/ui/crumbs/builddetailspage.py index c2f980f..1031906
> 100755 --- a/bitbake/lib/bb/ui/crumbs/builddetailspage.py +++
> b/bitbake/lib/bb/ui/crumbs/builddetailspage.py @@ -47,9 +47,12 @@ class
> BuildDetailsPage (HobPage):
>          self.vbox = gtk.VBox(False, 12)
>          
>          self.progress_box = gtk.VBox(False, 12)
> -        self.task_status = gtk.Label() -       
> self.task_status.set_alignment(0.0, 0.5) -       
> self.progress_box.pack_start(self.task_status, expand=False, fill=False)
> +        self.rq_status = gtk.Label() +       
> self.rq_status.set_alignment(0.0, 0.5) +        self.pt_status =
> gtk.Label() +        self.pt_status.set_alignment(0.0, 0.5) +       
> self.progress_box.pack_start(self.rq_status, expand=False, fill=False) +
>        self.progress_box.pack_start(self.pt_status, expand=False,
> fill=False)
>          self.progress_hbox = gtk.HBox(False, 6)
>          self.progress_box.pack_end(self.progress_hbox, expand=True,
>          fill=True) self.progress_bar = HobProgressBar() @@ -89,11
>          +92,17 @@ class BuildDetailsPage (HobPage):
>          self.back_button.connect("clicked",
>          self.back_button_clicked_cb)
>          self.button_box.pack_start(self.back_button, expand=False,
> fill=False)
> 
> -    def update_build_status(self, tsk_msg):
> -        self.task_status.set_markup(tsk_msg)
> +    def update_runqueue_status(self, msg):
> +        self.rq_status.set_markup(msg)
> 
> -    def reset_build_status(self):
> -        self.task_status.set_markup("")
> +    def update_package_task_status(self, msg):
> +        self.pt_status.set_markup(msg)
> +
> +    def reset_runqueue_status(self):
> +        self.rq_status.set_markup("")
> +
> +    def reset_package_task_status(self):
> +        self.pt_status.set_markup("")
> 
>      def show_issues(self):
>          self.num_of_issues += 1
> diff --git a/bitbake/lib/bb/ui/crumbs/builder.py
> b/bitbake/lib/bb/ui/crumbs/builder.py index f32a066..245a747 100755 ---
> a/bitbake/lib/bb/ui/crumbs/builder.py +++
> b/bitbake/lib/bb/ui/crumbs/builder.py @@ -218,6 +218,7 @@ class
> Builder(gtk.Window):
>          self.handler.build.connect("build-succeeded",
>          self.handler_build_succeeded_cb)
>          self.handler.build.connect("build-failed",
>          self.handler_build_failed_cb)
>          self.handler.build.connect("task-started",
> self.handler_task_started_cb)
> +        self.handler.build.connect("task-executing",
> self.handler_task_executing_cb)
>          self.handler.build.connect("log-error",
>          self.handler_build_failure_cb)
>          self.handler.connect("generating-data",
>          self.handler_generating_data_cb)
>          self.handler.connect("data-generated",
> self.handler_data_generated_cb)
> @@ -543,7 +544,8 @@ class Builder(gtk.Window):
>          elif self.current_step == self.PACKAGE_GENERATING:
>              fraction = 0
>          self.build_details_page.update_progress_bar("Build Started: ",
> fraction)
> -        self.build_details_page.reset_build_status()
> +        self.build_details_page.reset_runqueue_status()
> +        self.build_details_page.reset_package_task_status()
>          self.build_details_page.reset_issues()
>      def build_succeeded(self):
> @@ -611,8 +613,12 @@ class Builder(gtk.Window):
>              elif message["eventname"] == "runQueueTaskStarted":
>                  fraction = 0.2 + 0.8 * fraction
>          self.build_details_page.update_progress_bar(title + ": ", fraction)
> -        self.build_details_page.update_build_status( -           
> "<span weight=\'bold\'>Running task %s of %s:</span> %s" %
> (message["current"], message["total"], message["task"])) +       
> self.build_details_page.update_runqueue_status( +            "<span
> weight=\'bold\'>Starting task %s of %s:</span> %s" %
> (message["current"], message["total"], message["task"])) + +    def
> handler_task_executing_cb(self, running_build, message): +       
> self.build_details_page.update_package_task_status( +            "<span
> weight=\'bold\'>Running task</span> %s <span weight=\'bold\'>on
> package</span> %s" % (message["task"], message["package"]))
> 
>      def handler_build_failure_cb(self, running_build):
>          self.build_details_page.show_issues()
> diff --git a/bitbake/lib/bb/ui/crumbs/runningbuild.py
> b/bitbake/lib/bb/ui/crumbs/runningbuild.py index 0f58e4e..e9d8070 100644
> --- a/bitbake/lib/bb/ui/crumbs/runningbuild.py +++
> b/bitbake/lib/bb/ui/crumbs/runningbuild.py @@ -85,6 +85,9 @@ class
> RunningBuild (gobject.GObject):
>            'task-started'    :  (gobject.SIGNAL_RUN_LAST,
>                                  gobject.TYPE_NONE,
>                                 (gobject.TYPE_PYOBJECT,)),
> +          'task-executing'  :  (gobject.SIGNAL_RUN_LAST,
> +                                gobject.TYPE_NONE,
> +                               (gobject.TYPE_PYOBJECT,)),
>            'log-error'       :  (gobject.SIGNAL_RUN_LAST,
>                                  gobject.TYPE_NONE,
>                                 ()),
> @@ -208,6 +211,10 @@ class RunningBuild (gobject.GObject):
>              # Save out the iter so that we can find it when we have a
>              message # that we need to attach to a task.
>              self.tasks_to_iter[(package, task)] = i
> +            message = {}
> +            message["task"] = task
> +            message["package"] = package
> +            self.emit("task-executing", message)
> 
>          elif isinstance(event, bb.build.TaskBase):
>              current = self.tasks_to_iter[(package, task)]

Patch

diff --git a/bitbake/lib/bb/ui/crumbs/builddetailspage.py b/bitbake/lib/bb/ui/crumbs/builddetailspage.py
index c2f980f..1031906 100755
--- a/bitbake/lib/bb/ui/crumbs/builddetailspage.py
+++ b/bitbake/lib/bb/ui/crumbs/builddetailspage.py
@@ -47,9 +47,12 @@  class BuildDetailsPage (HobPage):
         self.vbox = gtk.VBox(False, 12)
 
         self.progress_box = gtk.VBox(False, 12)
-        self.task_status = gtk.Label()
-        self.task_status.set_alignment(0.0, 0.5)
-        self.progress_box.pack_start(self.task_status, expand=False, fill=False)
+        self.rq_status = gtk.Label()
+        self.rq_status.set_alignment(0.0, 0.5)
+        self.pt_status = gtk.Label()
+        self.pt_status.set_alignment(0.0, 0.5)
+        self.progress_box.pack_start(self.rq_status, expand=False, fill=False)
+        self.progress_box.pack_start(self.pt_status, expand=False, fill=False)
         self.progress_hbox = gtk.HBox(False, 6)
         self.progress_box.pack_end(self.progress_hbox, expand=True, fill=True)
         self.progress_bar = HobProgressBar()
@@ -89,11 +92,17 @@  class BuildDetailsPage (HobPage):
         self.back_button.connect("clicked", self.back_button_clicked_cb)
         self.button_box.pack_start(self.back_button, expand=False, fill=False)
 
-    def update_build_status(self, tsk_msg):
-        self.task_status.set_markup(tsk_msg)
+    def update_runqueue_status(self, msg):
+        self.rq_status.set_markup(msg)
 
-    def reset_build_status(self):
-        self.task_status.set_markup("")
+    def update_package_task_status(self, msg):
+        self.pt_status.set_markup(msg)
+
+    def reset_runqueue_status(self):
+        self.rq_status.set_markup("")
+
+    def reset_package_task_status(self):
+        self.pt_status.set_markup("")
 
     def show_issues(self):
         self.num_of_issues += 1
diff --git a/bitbake/lib/bb/ui/crumbs/builder.py b/bitbake/lib/bb/ui/crumbs/builder.py
index f32a066..245a747 100755
--- a/bitbake/lib/bb/ui/crumbs/builder.py
+++ b/bitbake/lib/bb/ui/crumbs/builder.py
@@ -218,6 +218,7 @@  class Builder(gtk.Window):
         self.handler.build.connect("build-succeeded",    self.handler_build_succeeded_cb)
         self.handler.build.connect("build-failed",       self.handler_build_failed_cb)
         self.handler.build.connect("task-started",       self.handler_task_started_cb)
+        self.handler.build.connect("task-executing",     self.handler_task_executing_cb)
         self.handler.build.connect("log-error",          self.handler_build_failure_cb)
         self.handler.connect("generating-data",          self.handler_generating_data_cb)
         self.handler.connect("data-generated",           self.handler_data_generated_cb)
@@ -543,7 +544,8 @@  class Builder(gtk.Window):
         elif self.current_step == self.PACKAGE_GENERATING:
             fraction = 0
         self.build_details_page.update_progress_bar("Build Started: ", fraction)
-        self.build_details_page.reset_build_status()
+        self.build_details_page.reset_runqueue_status()
+        self.build_details_page.reset_package_task_status()
         self.build_details_page.reset_issues()
 
     def build_succeeded(self):
@@ -611,8 +613,12 @@  class Builder(gtk.Window):
             elif message["eventname"] == "runQueueTaskStarted":
                 fraction = 0.2 + 0.8 * fraction
         self.build_details_page.update_progress_bar(title + ": ", fraction)
-        self.build_details_page.update_build_status(
-            "<span weight=\'bold\'>Running task %s of %s:</span> %s" % (message["current"], message["total"], message["task"]))
+        self.build_details_page.update_runqueue_status(
+            "<span weight=\'bold\'>Starting task %s of %s:</span> %s" % (message["current"], message["total"], message["task"]))
+
+    def handler_task_executing_cb(self, running_build, message):
+        self.build_details_page.update_package_task_status(
+            "<span weight=\'bold\'>Running task</span> %s <span weight=\'bold\'>on package</span> %s" % (message["task"], message["package"]))
 
     def handler_build_failure_cb(self, running_build):
         self.build_details_page.show_issues()
diff --git a/bitbake/lib/bb/ui/crumbs/runningbuild.py b/bitbake/lib/bb/ui/crumbs/runningbuild.py
index 0f58e4e..e9d8070 100644
--- a/bitbake/lib/bb/ui/crumbs/runningbuild.py
+++ b/bitbake/lib/bb/ui/crumbs/runningbuild.py
@@ -85,6 +85,9 @@  class RunningBuild (gobject.GObject):
           'task-started'    :  (gobject.SIGNAL_RUN_LAST,
                                 gobject.TYPE_NONE,
                                (gobject.TYPE_PYOBJECT,)),
+          'task-executing'  :  (gobject.SIGNAL_RUN_LAST,
+                                gobject.TYPE_NONE,
+                               (gobject.TYPE_PYOBJECT,)),
           'log-error'       :  (gobject.SIGNAL_RUN_LAST,
                                 gobject.TYPE_NONE,
                                ()),
@@ -208,6 +211,10 @@  class RunningBuild (gobject.GObject):
             # Save out the iter so that we can find it when we have a message
             # that we need to attach to a task.
             self.tasks_to_iter[(package, task)] = i
+            message = {}
+            message["task"] = task
+            message["package"] = package
+            self.emit("task-executing", message)
 
         elif isinstance(event, bb.build.TaskBase):
             current = self.tasks_to_iter[(package, task)]