Hob second build fixes
cover Hob second build fixes
The following two patches fix problems running the second build within a single session of the hob UI.
The patches (against Poky, but apply cleanly with -p2 against BitBake master) are available in the git repository at:
git://git.pokylinux.org/poky-contrib paule/hob-fixes
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=paule/hob-fixes
Paul Eggleton (2):
hob: clear out temporary file list after deleting
hob: fix segfault on second build
bitbake/lib/bb/ui/crumbs/runningbuild.py | 5 +++++ bitbake/lib/bb/ui/hob.py | 3 ++- 2 files changed, 7 insertions(+), 1 deletions(-)
Signature · 1 line
1.7.4.1
PATCH 1/2 hob: clear out temporary file list after deleting
If you don't clear out files_to_clean after the files get deleted and then you run a second build, it will try to delete the files from the first build and you will get a "No such file or directory" error.
--- bitbake/lib/bb/ui/hob.py | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
bitbake/lib/bb/ui/hob.py +1 -0
@@ -496,6 +496,7 @@ class MainWindow (gtk.Window): self.cancel.set_sensitive(False) for f in self.files_to_clean: os.remove(f) + self.files_to_clean = [] lbl = "<b>Build completed</b>\n\nClick 'Edit Image' to start another build or 'View Messages' to view the messages output during the build." if self.handler.building == "image" and self.build_succeeded:
Signature · 1 line
1.7.4.1
Re: [PATCH 1/2] hob: clear out temporary file list after deleting
Quoted 5 lines · Paul Eggleton
If you don't clear out
files_to_cleanafter the files get deleted and then you run a second build, it will try to delete the files from the first build and you will get a "No such file or directory" error.Signed-off-by Paul Eggleton <[email protected]>
Quoted 16 lines
--- bitbake/lib/bb/ui/hob.py | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)bitbake/lib/bb/ui/hob.py +1
-0@@ -496,6 +496,7 @@ class MainWindow (gtk.Window): self.cancel.set_sensitive(False) for f in self.files_to_clean: os.remove(f) + self.files_to_clean = [] lbl = "<b>Build completed</b>\n\nClick 'Edit Image' to start another build or 'View Messages' to view the messages output during the build." if self.handler.building == "image" and self.build_succeeded:
Signature · 3 lines
Joshua Lock
Yocto Project "Johannes factotum"
Intel Open Source Technology CentrePATCH 2/2 hob: fix segfault on second build
In reply to Paul EggletonSome internal lists were not being cleared, resulting in incorrect program flow on the second build, causing a structure to be accessed incorrectly which resulted in a segfault.
Fixes [YOCTO #1332]
--- bitbake/lib/bb/ui/crumbs/runningbuild.py | 5 +++++ bitbake/lib/bb/ui/hob.py | 2 +- 2 files changed, 6 insertions(+), 1 deletions(-)
bitbake/lib/bb/ui/crumbs/runningbuild.py +5 -0
@@ -68,6 +68,11 @@ class RunningBuild (gobject.GObject): self.model = RunningBuildModel() self.sequential = sequential + def reset (self): + self.pids_to_task.clear() + self.tasks_to_iter.clear() + self.model.clear() + def handle_event (self, event, pbar=None): # Handle an event from the event queue, this may result in updating # the model and thus the UI. Or it may be to tell us that the build
bitbake/lib/bb/ui/hob.py +1 -1
@@ -484,7 +484,7 @@ class MainWindow (gtk.Window): def toggle_createview(self): self.set_menus_sensitive(True) - self.build.model.clear() + self.build.reset() self.nb.set_current_page(0) def build_complete_cb(self, running_build):
Signature · 1 line
1.7.4.1
Re: [PATCH 2/2] hob: fix segfault on second build
Quoted 7 lines · Paul Eggleton
Some internal lists were not being cleared, resulting in incorrect program flow on the second build, causing a structure to be accessed incorrectly which resulted in a segfault.
Fixes [YOCTO #1332]
Signed-off-by Paul Eggleton <[email protected]>
Excellent find Paul!
Quoted 34 lines
--- bitbake/lib/bb/ui/crumbs/runningbuild.py | 5 +++++ bitbake/lib/bb/ui/hob.py | 2 +- 2 files changed, 6 insertions(+), 1 deletions(-)bitbake/lib/bb/ui/crumbs/runningbuild.py +5
-0@@ -68,6 +68,11 @@ class RunningBuild (gobject.GObject): self.model = RunningBuildModel() self.sequential = sequential + def reset (self): + self.pids_to_task.clear() + self.tasks_to_iter.clear() + self.model.clear() + def handle_event (self, event, pbar=None): # Handle an event from the event queue, this may result in updating # the model and thus the UI. Or it may be to tell us that the buildbitbake/lib/bb/ui/hob.py +1
-1@@ -484,7 +484,7 @@ class MainWindow (gtk.Window): def toggle_createview(self): self.set_menus_sensitive(True) - self.build.model.clear() + self.build.reset() self.nb.set_current_page(0) def build_complete_cb(self, running_build):
Signature · 3 lines
Joshua Lock
Yocto Project "Johannes factotum"
Intel Open Source Technology CentreRichard Purdie
AppliedQuoted 8 lines · Paul Eggleton
The following two patches fix problems running the second build within a single session of the hob UI.
The patches (against Poky, but apply cleanly with -p2 against BitBake master) are available in the git repository at:
git://git.pokylinux.org/poky-contribpaule/hob-fixes
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=paule/hob-fixes
Quoted 7 lines
Paul Eggleton (2):
hob: clear out temporary file list after deleting
hob: fix segfault on second buildbitbake/lib/bb/ui/crumbs/runningbuild.py | 5 +++++ bitbake/lib/bb/ui/hob.py | 3 ++- 2 files changed, 7 insertions(+), 1 deletions(-)
Merged to master, thanks.
Richard