Skip to contentSkip to conversation

Bug fixes for hob

PATCH Applied Joshua Lock 2 participants 7 messages Aug 9, 2011 Arm STM32

lore
Share & tools
lore
#1 lore raw

PATCH 1/4 bb/ui/crumbs/tasklistmodel: prevent hang when removing item

In reply to Joshua Lock

It's possible to trigger an infinite recursion when removing a package where many of the dependencies share their dependencies. Prevent this by keeping a list of removed item names and only removing the item when it's not in the list.

Addresses [YOCTO #1319]

---
 lib/bb/ui/crumbs/tasklistmodel.py |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
lib/bb/ui/crumbs/tasklistmodel.py +3 -1
index 8fb5683..3e09757 100644
@@ -315,6 +315,7 @@ class TaskListModel(gtk.ListStore):
     """
     def mark(self, opath):
         usersel = {}
+        removed = []
         it = self.get_iter_first()
         name = self[opath][self.COL_NAME]
 
@@ -343,8 +344,9 @@ class TaskListModel(gtk.ListStore):
                 usersel[iname] = self[path][self.COL_IMG]
 
             # FIXME: need to ensure partial name matching doesn't happen
-            if inc and deps.count(name):
+            if inc and deps.count(name) and name not in removed:
                 # found a dependency, remove it
+                removed.append(name)
                 self.mark(path)
 
             if inc and binb.count(name):
Signature · 1 line
1.7.6
#2 lore raw

PATCH 2/4 bb/ui/hob: move some code around to avert a race

In reply to Joshua Lock

The data-generated and model-updated signals are different, the model should only be accessed *after* the model-updated signal. Move code setting the image combo's backing model to the model-updated callback to ensure the combo is accurately set when changing the machine with an image selected.

---
 lib/bb/ui/hob.py |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)
lib/bb/ui/hob.py +8 -7
index 5906251..e042765 100644
@@ -183,13 +183,6 @@ class MainWindow (gtk.Window):
 
     def data_generated(self, handler):
         self.generating = False
-        self.image_combo.set_model(self.model.images_model())
-        # Without this the image combo is incorrectly sized on first load of the GUI
-        self.image_combo.set_active(0)
-        self.image_combo.set_active(-1)
-
-        if not self.image_combo_id:
-            self.image_combo_id = self.image_combo.connect("changed", self.image_changed_cb)
         self.enable_widgets()
 
     def machine_combo_changed_cb(self, combo, handler):
@@ -286,6 +279,14 @@ class MainWindow (gtk.Window):
         pkgsaz_model.set_default_sort_func(None)
         self.pkgsaz_tree.set_model(pkgsaz_model)
 
+        self.image_combo.set_model(self.model.images_model())
+        # Without this the image combo is incorrectly sized on first load of the GUI
+        self.image_combo.set_active(0)
+        self.image_combo.set_active(-1)
+
+        if not self.image_combo_id:
+            self.image_combo_id = self.image_combo.connect("changed", self.image_changed_cb)
+
         # We want the contents to be alphabetised so create a TreeModelSort to
         # use in the view
         contents_model = gtk.TreeModelSort(self.model.contents_model())
Signature · 1 line
1.7.6
#0 lore raw

cover Bug fixes for hob

Hi,

Here are some more bug fixes (and more on the way).

Thanks,
Joshua

The following changes since commit 5cacdc4f1641eda1b5707c96f7c40924a9db6174:

bb/cooker: mark parsed conf files as potential cache invalidators (2011-08-04 15:40:51 -0700)

are available in the git repository at:
git://github.com/incandescant/bitbake hob
https://github.com/incandescant/bitbake/tree/hob

Jessica Zhang (1):
bb/ui/hob: Restore toolchain relevant preference settings for build

Joshua Lock (3):
bb/ui/crumbs/tasklistmodel: prevent hang when removing item bb/ui/hob: move some code around to avert a race bb/cooker: only emit ConfigFilePathFound for files which were parsed

 lib/bb/cooker.py                  |   32 ++++++++++++++++++++++++++++++--
 lib/bb/ui/crumbs/tasklistmodel.py |    4 +++-
 lib/bb/ui/hob.py                  |   17 ++++++++++-------
 3 files changed, 43 insertions(+), 10 deletions(-)
Signature · 1 line
1.7.6
#3 lore raw

PATCH 3/4 bb/cooker: only emit ConfigFilePathFound for files which were parsed

When the requested configuration file is found on disk check the against the configuration files in __depends/__base_depends to ensure the file was parsed before emitting the ConfigFilePathFound event. If the requested file wasn't parsed just return (and don't emit).

Fixes [YOCTO #1246]

---
 lib/bb/cooker.py |   32 ++++++++++++++++++++++++++++++--
 1 files changed, 30 insertions(+), 2 deletions(-)
lib/bb/cooker.py +30 -2
index 6022192..337a817 100644
@@ -609,9 +609,37 @@ class BBCooker:
                 collectlog.warn("No bb files matched BBFILE_PATTERN_%s '%s'" % (collection, pattern))
 
     def findConfigFilePath(self, configfile):
+        """
+        Find the location on disk of configfile and if it exists and was parsed by BitBake
+        emit the ConfigFilePathFound event with the path to the file.
+        """
         path = self._findConfigFile(configfile)
-        if path:
-            bb.event.fire(bb.event.ConfigFilePathFound(path), self.configuration.data)
+        if not path:
+            return
+
+        # Generate a list of parsed configuration files by searching the files
+        # listed in the __depends variable with a .conf suffix.
+        # NOTE: We can't know if we've been called before the variable has been
+        # renamed so if depends isn't set try __base_depends (the variable name
+        # after rename).
+        conffiles = []
+        dep_files = bb.data.getVar('__depends', self.configuration.data) or None
+        if not dep_files:
+            dep_files = bb.data.getVar('__base_depends', self.configuration.data) or set()
+
+        for f in dep_files:
+            if f[0].endswith(".conf"):
+                conffiles.append(f[0])
+
+        _, conf, conffile = path.rpartition("conf/")
+        match = os.path.join(conf, conffile)
+        # Try and find matches for conf/conffilename.conf as we don't always
+        # have the full path to the file.
+        for cfg in conffiles:
+            if cfg.endswith(match):
+                bb.event.fire(bb.event.ConfigFilePathFound(path),
+                              self.configuration.data)
+                break
 
     def findFilesMatchingInDir(self, filepattern, directory):
         """
Signature · 1 line
1.7.6
#5 lore raw

PATCH 4/4 bb/ui/hob: Restore toolchain relevant preference settings for build

In reply to Joshua Lock

From: Jessica Zhang <[email protected]>

Fixes [#YOCTO 1354]

---
 lib/bb/ui/hob.py |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
lib/bb/ui/hob.py +2 -0
index e042765..b0a98cb 100644
@@ -980,7 +980,9 @@ def main (server, eventHandler):
         gplv3disabled = True
 
     build_toolchain = bool(server.runCommand(["getVariable", "HOB_BUILD_TOOLCHAIN"]))
+    handler.toggle_toolchain(build_toolchain)
     build_headers = bool(server.runCommand(["getVariable", "HOB_BUILD_TOOLCHAIN_HEADERS"]))
+    handler.toggle_toolchain_headers(build_headers)
 
     prefs = HobPrefs(configurator, handler, sdk_mach, distro, pclass, cpu_cnt,
                      pmake, bbthread, selected_image_types, all_image_types,
Signature · 1 line
1.7.6
#4 lore raw

Re: [PATCH 3/4] bb/cooker: only emit ConfigFilePathFound for files which were parsed

In reply to Joshua Lock
Quoted 29 lines · Joshua Lock

When the requested configuration file is found on disk check the against the configuration files in __depends/__base_depends to ensure the file was parsed before emitting the ConfigFilePathFound event. If the requested file wasn't parsed just return (and don't emit).

Fixes [YOCTO #1246]

---
 lib/bb/cooker.py |   32 ++++++++++++++++++++++++++++++--
 1 files changed, 30 insertions(+), 2 deletions(-)
lib/bb/cooker.py +6 -2
index 6022192..337a817 100644
@@ -609,9 +609,37 @@ class BBCooker:
                 collectlog.warn("No bb files matched BBFILE_PATTERN_%s '%s'" % (collection, pattern))
 
     def findConfigFilePath(self, configfile):
+        """
+        Find the location on disk of configfile and if it exists and was parsed by BitBake
+        emit the ConfigFilePathFound event with the path to the file.
+        """
         path = self._findConfigFile(configfile)
-        if path:
-            bb.event.fire(bb.event.ConfigFilePathFound(path), self.configuration.data)
+        if not path:
+            return

lib/bb/cooker.py class BBCooker: · line 628

Quoted 10 lines
lib/bb/cooker.py +10 -0
+
+        # Generate a list of parsed configuration files by searching the files
+        # listed in the __depends variable with a .conf suffix.
+        # NOTE: We can't know if we've been called before the variable has been
+        # renamed so if depends isn't set try __base_depends (the variable name
+        # after rename).
+        conffiles = []
+        dep_files = bb.data.getVar('__depends', self.configuration.data) or None
+        if not dep_files:
+            dep_files = bb.data.getVar('__base_depends', self.configuration.data) or set()

Nearly. You need to look at the combined array of __depends and __base_depends values here...

Cheers,

Richard

#6 lore raw
In reply to Joshua Lock
Quoted 13 lines · Joshua Lock

Here are some more bug fixes (and more on the way).

Thanks,
Joshua

The following changes since commit 5cacdc4f1641eda1b5707c96f7c40924a9db6174:

bb/cooker: mark parsed conf files as potential cache invalidators (2011-08-04 15:40:51 -0700)

are available in the git repository at:
git://github.com/incandescant/bitbake hob
https://github.com/incandescant/bitbake/tree/hob

Quoted 6 lines

Jessica Zhang (1):
bb/ui/hob: Restore toolchain relevant preference settings for build

Joshua Lock (3):
bb/ui/crumbs/tasklistmodel: prevent hang when removing item bb/ui/hob: move some code around to avert a race

I've merged these three to master.

Quoted 1 line

bb/cooker: only emit ConfigFilePathFound for files which were parsed

This needs a little tweak.

Cheers,

Richard