Skip to contentSkip to conversation

Add sanity check progress screen

PATCH Applied Bogdan Marinescu 2 participants 3 messages Sep 26, 2012 – Sep 28, 2012

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 Add sanity check progress screen

This patch adds a sanity check progress screen to hob. The screen is displayed when Hob executes the sanity check procedure. The screen is displayed for at least 5 seconds. If a network error is detected, a special dialog is displayed which lets the user open the proxy configuration page directly.
Note that currently bitbake triggers the network tests only when the value of its TMPDIR variable changes, which happens fairly rare on my system. This is the subject of another bug (#3026). Version 2 of the patch splits the changes in two parts (sanity.bbclass belongs to oe-core).

[YOCTO #3025]

---
 bitbake/lib/bb/event.py                     |    3 +-
 bitbake/lib/bb/ui/crumbs/builder.py         |  124 ++++++++++++++++++++++++---
 bitbake/lib/bb/ui/crumbs/hig.py             |    5 ++
 bitbake/lib/bb/ui/crumbs/hobeventhandler.py |    5 +-
 bitbake/lib/bb/ui/crumbs/sanitycheckpage.py |   85 ++++++++++++++++++
 5 files changed, 205 insertions(+), 17 deletions(-)
 create mode 100644 bitbake/lib/bb/ui/crumbs/sanitycheckpage.py
bitbake/lib/bb/event.py +2 -1
index deb1c21..1889d09 100644
@@ -562,6 +562,7 @@ class SanityCheckFailed(Event):
     """
     Event to indicate sanity check has failed
     """
-    def __init__(self, msg):
+    def __init__(self, msg, network_error=False):
         Event.__init__(self)
         self._msg = msg
+        self._network_error = network_error
bitbake/lib/bb/ui/crumbs/builder.py +111 -13

233 lines not on this page · raw message

bitbake/lib/bb/ui/crumbs/hig.py +5 -0
index f304a68..f4dd43c 100644
@@ -180,6 +180,9 @@ class CrumbsMessageDialog(CrumbsDialog):
 #
 class SimpleSettingsDialog (CrumbsDialog, SettingsUIHelper):
 
+    (BUILD_ENV_PAGE_ID,
+     PROXIES_PAGE_ID) = range(2)
+
     def __init__(self, title, configuration, all_image_types,
             all_package_formats, all_distros, all_sdk_machines,
             max_threads, parent, flags, buttons=None):
@@ -470,6 +473,8 @@ class SimpleSettingsDialog (CrumbsDialog, SettingsUIHelper):
 
         self.show_all()
 
+    def switch_to_page(self, page_id):
+        self.nb.set_current_page(page_id)
 
 #
 # AdvancedSettings Dialog
bitbake/lib/bb/ui/crumbs/hobeventhandler.py +2 -3
index 49db2de..fcc6f17 100644
@@ -43,7 +43,7 @@ class HobHandler(gobject.GObject):
                                      (gobject.TYPE_STRING,)),
          "sanity-failed"           : (gobject.SIGNAL_RUN_LAST,
                                       gobject.TYPE_NONE,
-                                     (gobject.TYPE_STRING,)),
+                                     (gobject.TYPE_STRING, gobject.TYPE_INT)),
          "generating-data"         : (gobject.SIGNAL_RUN_LAST,
                                       gobject.TYPE_NONE,
                                      ()),
@@ -166,7 +166,6 @@ class HobHandler(gobject.GObject):
     def handle_event(self, event):
         if not event:
             return
-
         if self.building:
             self.current_phase = "building"
             self.build.handle_event(event)
@@ -180,7 +179,7 @@ class HobHandler(gobject.GObject):
             self.run_next_command()
 
         elif isinstance(event, bb.event.SanityCheckFailed):
-            self.emit("sanity-failed", event._msg)
+            self.emit("sanity-failed", event._msg, event._network_error)
 
         elif isinstance(event, logging.LogRecord):
             if not self.building:
bitbake/lib/bb/ui/crumbs/sanitycheckpage.py new file +85 -0

85 lines not on this page · raw message

Signature · 1 line
1.7.9.5
#1 lore raw
Quoted 14 lines · Bogdan Marinescu

This patch adds a sanity check progress screen to hob. The screen is displayed when Hob executes the sanity check procedure. The screen is displayed for at least 5 seconds. If a network error is detected, a special dialog is displayed which lets the user open the proxy configuration page directly.
Note that currently bitbake triggers the network tests only when the value of its TMPDIR variable changes, which happens fairly rare on my system. This is the subject of another bug (#3026). Version 2 of the patch splits the changes in two parts (sanity.bbclass belongs to oe-core).

[YOCTO #3025]

Quoted 8 lines
---
 bitbake/lib/bb/event.py                     |    3 +-
 bitbake/lib/bb/ui/crumbs/builder.py         |  124 ++++++++++++++++++++++++---
 bitbake/lib/bb/ui/crumbs/hig.py             |    5 ++
 bitbake/lib/bb/ui/crumbs/hobeventhandler.py |    5 +-
 bitbake/lib/bb/ui/crumbs/sanitycheckpage.py |   85 ++++++++++++++++++
 5 files changed, 205 insertions(+), 17 deletions(-)
 create mode 100644 bitbake/lib/bb/ui/crumbs/sanitycheckpage.py

Merged to master, thanks.

Richard

#2 lore raw

Hi Richard,

Quoted 19 lines · Richard Purdie
Quoted 11 lines · Bogdan Marinescu

This patch adds a sanity check progress screen to hob. The screen is displayed when Hob executes the sanity check procedure. The screen is displayed for at least 5 seconds. If a network error is detected, a special dialog is displayed which lets the user open the proxy configuration page directly.
Note that currently bitbake triggers the network tests only when the value of its TMPDIR variable changes, which happens fairly rare on my system. This is the subject of another bug (#3026). Version 2 of the patch splits the changes in two parts (sanity.bbclass belongs to oe-core).

Quoted 6 lines

[YOCTO #3025]

---
 bitbake/lib/bb/event.py                     |    3 +-
 bitbake/lib/bb/ui/crumbs/builder.py         |  124

++++++++++++++++++++++++---

Quoted 9 lines
Quoted 5 lines
 bitbake/lib/bb/ui/crumbs/hig.py             |    5 ++
 bitbake/lib/bb/ui/crumbs/hobeventhandler.py |    5 +-
 bitbake/lib/bb/ui/crumbs/sanitycheckpage.py |   85 ++++++++++++++++++
 5 files changed, 205 insertions(+), 17 deletions(-)
 create mode 100644 bitbake/lib/bb/ui/crumbs/sanitycheckpage.py

Merged to master, thanks.

It appears that this page was not merged properly. The new sanitycheckpage.py file didn't get merged. I remember that I needed to use "git add -f" (force) to add this file, since a .gitignore prevented it from being added in the usual way (why does .gitignore mask .py files anyway?) This might be why it didn't get merged in the end.
For all the people that updated the master and can't start hob because of this problem: a temporary solution is to move your HEAD before my commit. In this case:

git reset --hard 6fdff49d9b37a18221f8d5571f757e69b945e533

One more thing for Richard: this patch has a corresponding patch in oe-core ("Added explicit network error status in SanityCheckFailed event"). Please take a look at that one too.

Thanks,
Bogdan

Quoted 3 lines

Richard