Skip to contentSkip to conversation

Hob: Fix bug 2361

GIT PULL In review Dongxiao Xu 2 participants 6 messages Apr 24, 2012 – Apr 25, 2012

lore
Share & tools
lore
#0 lore raw

Hi Richard,

This pull request is to fix bug 2361, please help to review and pull.

Thanks,
Dongxiao

The following changes since commit 244ce2b900ae6cecbeeccfe2056e61c132476261:

hob: enable sanity checks after launch (2012-04-23 23:03:25 +0100)

are available in the git repository at:
git://git.pokylinux.org/poky-contrib dxu4/hob-bugfix
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=dxu4/hob-bugfix

Dongxiao Xu (3):
event.py: Add SanityCheck and SanityCheckPassed events
Hob: Add proxy setting into setting's md5
Hob: Issue sanity check after parse is completed

 lib/bb/event.py                     |   10 ++++++++++
 lib/bb/ui/crumbs/builder.py         |    7 +++++--
 lib/bb/ui/crumbs/hig.py             |    9 +++++++++
 lib/bb/ui/crumbs/hobeventhandler.py |   16 +++++++++++-----
 4 files changed, 35 insertions(+), 7 deletions(-)
Signature · 1 line
1.7.4.1
#1 lore raw

PATCH 1/3 event.py: Add SanityCheck and SanityCheckPassed events

---
 lib/bb/event.py |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
lib/bb/event.py +10 -0
index bbece58..f3fb521 100644
@@ -517,3 +517,13 @@ class PackageInfo(Event):
     def __init__(self, pkginfolist):
         Event.__init__(self)
         self._pkginfolist = pkginfolist
+
+class SanityCheck(Event):
+    """
+    Event to issue sanity check
+    """
+
+class SanityCheckPassed(Event):
+    """
+    Event to indicate sanity check is passed
+    """
Signature · 1 line
1.7.4.1
#2 lore raw

Re: [PATCH 1/3] event.py: Add SanityCheck and SanityCheckPassed events

Quoted 13 lines · Dongxiao Xu

---
 lib/bb/event.py |   10 ++++++++++

 1 files changed, 10 insertions(+), 0 deletions(-)
lib/bb/event.py +0 -0
index bbece58..f3fb521 100644
@@ -517,3 +517,13 @@ class PackageInfo(Event):

    def __init__(self, pkginfolist):
        Event.__init__(self)
        self._pkginfolist = pkginfolist

lib/bb/event.py class PackageInfo(Event): · line 529

Quoted 10 lines
lib/bb/event.py +10 -0
+
+class SanityCheck(Event):
+    """
+    Event to issue sanity check
+    """
+
+class SanityCheckPassed(Event):
+    """
+    Event to indicate sanity check is passed
+    """

Sanity checking is not part of bitbake, nor does it belong there. I'd say to find another way to do this.

Signature · 1 line
Christopher Larson
#3 lore raw

Re: [PATCH 1/3] event.py: Add SanityCheck and SanityCheckPassed events

Quoted 19 lines · Chris Larson
Quoted 18 lines · Dongxiao Xu

---
 lib/bb/event.py |   10 ++++++++++

 1 files changed, 10 insertions(+), 0 deletions(-)
lib/bb/event.py +0 -0
index bbece58..f3fb521 100644
@@ -517,3 +517,13 @@ class PackageInfo(Event):

    def __init__(self, pkginfolist):
        Event.__init__(self)
        self._pkginfolist = pkginfolist

lib/bb/event.py +5 -0
+
+class SanityCheck(Event):
+    """
+    Event to issue sanity check
+    """
Quoted 8 lines

lib/bb/event.py class PackageInfo(Event): · line 529

Quoted 5 lines
lib/bb/event.py +5 -0
+
+class SanityCheckPassed(Event):
+    """
+    Event to indicate sanity check is passed
+    """

Sanity checking is not part of bitbake, nor does it belong there. I'd say to find another way to do this.

Erm, ignore this, I was obviously mistaken. I had no idea any of this code existed. It does seem pretty questionable, still. 'sanity check' is extremely vague, and unclear about what it does, and further, the terminology overlaps with the various checks in the metadata. At a minimum I'd think we should improve this naming.

Signature · 1 line
Christopher Larson
#4 lore raw

PATCH 2/3 Hob: Add proxy setting into setting's md5

In reply to Dongxiao Xu

If user changed the proxy setting, we will reparse configuration because it may need sanity check.

---
 lib/bb/ui/crumbs/hig.py |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
lib/bb/ui/crumbs/hig.py +9 -0
index 93a4fbc..4baf960 100644
@@ -356,6 +356,15 @@ class AdvancedSettingDialog (CrumbsDialog):
         data += ("SDK_MACHINE: "          + self._get_sorted_value(self.configuration.curr_sdk_machine))
         data += ("TOOLCHAIN_BUILD: "      + self._get_sorted_value(self.configuration.toolchain_build))
         data += ("IMAGE_FSTYPES: "        + self._get_sorted_value(self.configuration.image_fstypes))
+        if self.enable_proxy:
+            data += ("ALL_PROXY: "            + self._get_sorted_value(self.configuration.all_proxy))
+            data += ("HTTP_PROXY: "           + self._get_sorted_value(self.configuration.http_proxy))
+            data += ("HTTPS_PROXY: "          + self._get_sorted_value(self.configuration.https_proxy))
+            data += ("FTP_PROXY: "            + self._get_sorted_value(self.configuration.ftp_proxy))
+            data += ("GIT_PROXY_HOST: "       + self._get_sorted_value(self.configuration.git_proxy_host))
+            data += ("GIT_PROXY_PORT: "       + self._get_sorted_value(self.configuration.git_proxy_port))
+            data += ("CVS_PROXY_HOST: "       + self._get_sorted_value(self.configuration.cvs_proxy_host))
+            data += ("CVS_PROXY_PORT: "       + self._get_sorted_value(self.configuration.cvs_proxy_port))
         for key in self.configuration.extra_setting.keys():
             data += (key + ": " + self._get_sorted_value(self.configuration.extra_setting[key]))
         return hashlib.md5(data).hexdigest()
Signature · 1 line
1.7.4.1
#5 lore raw

PATCH 3/3 Hob: Issue sanity check after parse is completed

In reply to Dongxiao Xu

In original scheme, sanity check is part of the parsing process. If a sanity check fails, it means the parsing is failed and values in Hob GUI may not correct.

With this commit, Hob will actively issue sanity_check() after the parsing is completed.

This fixes [YOCTO #2361]

---
 lib/bb/ui/crumbs/builder.py         |    7 +++++--
 lib/bb/ui/crumbs/hobeventhandler.py |   16 +++++++++++-----
 2 files changed, 16 insertions(+), 7 deletions(-)
lib/bb/ui/crumbs/builder.py +5 -2
index cbcb3f1..4b274a7 100755
@@ -405,6 +405,9 @@ class Builder(gtk.Window):
         self.set_user_config()
         self.handler.generate_configuration()
 
+    def sanity_check(self):
+        self.handler.trigger_sanity_check()
+
     def populate_recipe_package_info_async(self):
         self.switch_page(self.RCPPKGINFO_POPULATING)
         # Parse recipes
@@ -557,8 +560,6 @@ class Builder(gtk.Window):
         self.handler.init_cooker()
         # set bb layers
         self.handler.set_bblayers(self.configuration.layers)
-        # Re-enable sanity checks
-        self.handler.enable_sanity()
         # set local configuration
         self.handler.set_machine(self.configuration.curr_mach)
         self.handler.set_package_format(self.configuration.curr_package_format)
@@ -620,6 +621,8 @@ class Builder(gtk.Window):
     def handler_command_succeeded_cb(self, handler, initcmd):
         if initcmd == self.handler.GENERATE_CONFIGURATION:
             self.update_configuration_parameters(self.get_parameters_sync())
+            self.sanity_check()
+        elif initcmd == self.handler.SANITY_CHECK:
             self.image_configuration_page.switch_machine_combo()
         elif initcmd in [self.handler.GENERATE_RECIPES,
                          self.handler.GENERATE_PACKAGES,
lib/bb/ui/crumbs/hobeventhandler.py +11 -5
index c918aad..a07afdd 100644
@@ -59,8 +59,8 @@ class HobHandler(gobject.GObject):
                                      (gobject.TYPE_PYOBJECT,)),
     }
 
-    (GENERATE_CONFIGURATION, GENERATE_RECIPES, GENERATE_PACKAGES, GENERATE_IMAGE, POPULATE_PACKAGEINFO) = range(5)
-    (SUB_PATH_LAYERS, SUB_FILES_DISTRO, SUB_FILES_MACH, SUB_FILES_SDKMACH, SUB_MATCH_CLASS, SUB_PARSE_CONFIG, SUB_GNERATE_TGTS, SUB_GENERATE_PKGINFO, SUB_BUILD_RECIPES, SUB_BUILD_IMAGE) = range(10)
+    (GENERATE_CONFIGURATION, GENERATE_RECIPES, GENERATE_PACKAGES, GENERATE_IMAGE, POPULATE_PACKAGEINFO, SANITY_CHECK) = range(6)
+    (SUB_PATH_LAYERS, SUB_FILES_DISTRO, SUB_FILES_MACH, SUB_FILES_SDKMACH, SUB_MATCH_CLASS, SUB_PARSE_CONFIG, SUB_SANITY_CHECK, SUB_GNERATE_TGTS, SUB_GENERATE_PKGINFO, SUB_BUILD_RECIPES, SUB_BUILD_IMAGE) = range(11)
 
     def __init__(self, server, recipe_model, package_model):
         super(HobHandler, self).__init__()
@@ -129,6 +129,8 @@ class HobHandler(gobject.GObject):
             self.runCommand(["generateTargetsTree", "classes/image.bbclass", []])
         elif next_command == self.SUB_GENERATE_PKGINFO:
             self.runCommand(["triggerEvent", "bb.event.RequestPackageInfo()"])
+        elif next_command == self.SUB_SANITY_CHECK:
+            self.runCommand(["triggerEvent", "bb.event.SanityCheck()"])
         elif next_command == self.SUB_BUILD_RECIPES:
             self.clear_busy()
             self.building = True
@@ -158,6 +160,9 @@ class HobHandler(gobject.GObject):
             self.package_model.populate(event._pkginfolist)
             self.run_next_command()
 
+        elif isinstance(event, bb.event.SanityCheckPassed):
+            self.run_next_command()
+
         elif isinstance(event, logging.LogRecord):
             if event.levelno >= logging.ERROR:
                 self.error_msg += event.msg + '\n'
@@ -233,9 +238,6 @@ class HobHandler(gobject.GObject):
         inherits = inherits + " " + bbclass
         self.runCommand(["setVariable", "INHERIT", inherits])
 
-    def enable_sanity(self):
-        self.runCommand(["setVariable", "DISABLE_SANITY_CHECKS", "0"])
-
     def set_bblayers(self, bblayers):
         self.runCommand(["setVariable", "BBLAYERS_HOB", " ".join(bblayers)])
 
@@ -315,6 +317,10 @@ class HobHandler(gobject.GObject):
         self.commands_async.append(self.SUB_GENERATE_PKGINFO)
         self.run_next_command(self.POPULATE_PACKAGEINFO)
 
+    def trigger_sanity_check(self):
+        self.commands_async.append(self.SUB_SANITY_CHECK)
+        self.run_next_command(self.SANITY_CHECK)
+
     def generate_configuration(self):
         self.commands_async.append(self.SUB_PARSE_CONFIG)
         self.commands_async.append(self.SUB_PATH_LAYERS)
Signature · 1 line
1.7.4.1