Hob: Fix bug 2249
Hi Richard,
This is the second pull request that fixes bug 2249. Besides, this adds another commit to simplify the Hob init process.
Please help to review and pull.
Changes from v1:
1) Add a new commit to simplify the Hob init process.
Thanks,
Dongxiao
The following changes since commit 95f4e9dc351f67442844ff52f90fc154fa95ba95:
Hob: reset user recipe selection and package selection after settings are changed (2012-04-14 23:48:36 +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 (2):
Hob: Handle NoProvider event in runningbuild module
Hob: Simplify the init process
lib/bb/ui/crumbs/builder.py | 31 +++++++++++++++++-------------- lib/bb/ui/crumbs/hobeventhandler.py | 32 ++------------------------------ lib/bb/ui/crumbs/runningbuild.py | 17 +++++++++++++++++ 3 files changed, 36 insertions(+), 44 deletions(-)
Signature · 1 line
1.7.4.1
PATCH 1/2 Hob: Handle NoProvider event in runningbuild module
If NoProvider event is received, we will handle it in runningbuild module and send notification to Hob instance, avoiding stepping into the final page with no image built out.
This fixes [YOCTO #2249]
--- lib/bb/ui/crumbs/builder.py | 18 ++++++++++++++---- lib/bb/ui/crumbs/hobeventhandler.py | 21 --------------------- lib/bb/ui/crumbs/runningbuild.py | 17 +++++++++++++++++ 3 files changed, 31 insertions(+), 25 deletions(-)
lib/bb/ui/crumbs/builder.py +14 -4
@@ -349,6 +349,7 @@ class Builder(gtk.Window): 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("log-error", self.handler_build_failure_cb) + self.handler.build.connect("no-provider", self.handler_no_provider_cb) self.handler.connect("generating-data", self.handler_generating_data_cb) self.handler.connect("data-generated", self.handler_data_generated_cb) self.handler.connect("command-succeeded", self.handler_command_succeeded_cb)
@@ -624,10 +625,6 @@ class Builder(gtk.Window): self.rcppkglist_populated() if self.current_step == self.FAST_IMAGE_GENERATING: self.generate_image_async() - elif self.current_step == self.PACKAGE_GENERATING: - self.switch_page(self.PACKAGE_GENERATED) - elif self.current_step == self.IMAGE_GENERATING: - self.switch_page(self.IMAGE_GENERATED) def handler_command_failed_cb(self, handler, msg): if msg:
@@ -755,6 +752,11 @@ class Builder(gtk.Window): self.handler.build_succeeded_async() self.stopping = False + if self.current_step == self.PACKAGE_GENERATING: + self.switch_page(self.PACKAGE_GENERATED) + elif self.current_step == self.IMAGE_GENERATING: + self.switch_page(self.IMAGE_GENERATED) + def build_failed(self): if self.stopping: status = "stop"
@@ -785,6 +787,14 @@ class Builder(gtk.Window): def handler_build_failed_cb(self, running_build): self.build_failed() + def handler_no_provider_cb(self, running_build, msg): + dialog = CrumbsMessageDialog(self, msg, gtk.STOCK_DIALOG_INFO) + button = dialog.add_button("Close", gtk.RESPONSE_OK) + HobButton.style_button(button) + dialog.run() + dialog.destroy() + self.build_failed() + def handler_task_started_cb(self, running_build, message): fraction = message["current"] * 1.0/message["total"] title = "Build packages"
lib/bb/ui/crumbs/hobeventhandler.py +0 -21
@@ -180,27 +180,6 @@ class HobHandler(gobject.GObject): elif isinstance(event, bb.command.CommandCompleted): self.current_phase = None self.run_next_command() - # TODO: Currently there are NoProvider issues when generate - # universe tree dependency for non-x86 architecture. - # Comment the follow code to enable the build of non-x86 - # architectures in Hob. - #elif isinstance(event, bb.event.NoProvider): - # if event._runtime: - # r = "R" - # else: - # r = "" - # if event._dependees: - # self.error_msg += " Nothing %sPROVIDES '%s' (but %s %sDEPENDS on or otherwise requires it)" % (r, event._item, ", ".join(event._dependees), r) - # else: - # self.error_msg += " Nothing %sPROVIDES '%s'" % (r, event._item) - # if event._reasons: - # for reason in event._reasons: - # self.error_msg += " %s" % reason - - # self.commands_async = [] - # self.emit("command-failed", self.error_msg) - # self.error_msg = "" - elif isinstance(event, bb.command.CommandFailed): self.commands_async = [] self.clear_busy()
lib/bb/ui/crumbs/runningbuild.py +17 -0
@@ -82,6 +82,9 @@ class RunningBuild (gobject.GObject): 'log-error' : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, ()), + 'no-provider' : (gobject.SIGNAL_RUN_LAST, + gobject.TYPE_NONE, + (gobject.TYPE_PYOBJECT,)), } pids_to_task = {} tasks_to_iter = {}
@@ -320,6 +323,20 @@ class RunningBuild (gobject.GObject): message["title"] = "" message["task"] = event.taskstring self.emit("task-started", message) + elif isinstance(event, bb.event.NoProvider): + msg = "" + if event._runtime: + r = "R" + else: + r = "" + if event._dependees: + msg = "Nothing %sPROVIDES '%s' (but %s %sDEPENDS on or otherwise requires it)\n" % (r, event._item, ", ".join(event._dependees), r) + else: + msg = "Nothing %sPROVIDES '%s'\n" % (r, event._item) + if event._reasons: + for reason in event._reasons: + msg += ("%s\n" % reason) + self.emit("no-provider", msg) return
Signature · 1 line
1.7.4.1
PATCH 2/2 Hob: Simplify the init process
In reply to Dongxiao XuThis commit merges some functionalities together and avoid unnecessary signal handling. This can help to speed up the Hob startup.
--- lib/bb/ui/crumbs/builder.py | 13 +++---------- lib/bb/ui/crumbs/hobeventhandler.py | 11 ++--------- 2 files changed, 5 insertions(+), 19 deletions(-)
lib/bb/ui/crumbs/builder.py +3 -10
@@ -398,12 +398,12 @@ class Builder(gtk.Window): if self.load_template(TemplateMgr.convert_to_template_pathfilename("default", ".hob/")) == None: self.handler.init_cooker() self.handler.set_extra_inherit("image_types") - self.handler.parse_config() + self.handler.generate_configuration() def update_config_async(self): self.switch_page(self.MACHINE_SELECTION) self.set_user_config() - self.handler.parse_generate_configuration() + self.handler.generate_configuration() def populate_recipe_package_info_async(self): self.switch_page(self.RCPPKGINFO_POPULATING)
@@ -456,9 +456,6 @@ class Builder(gtk.Window): def cancel_build_sync(self, force=False): self.handler.cancel_build(force) - def generate_configuration_async(self): - self.handler.generate_configuration() - def cancel_parse_sync(self): self.handler.cancel_parse()
@@ -604,11 +601,7 @@ class Builder(gtk.Window): self.parameters.all_package_formats = formats def handler_command_succeeded_cb(self, handler, initcmd): - if initcmd == self.handler.PARSE_CONFIG: - # settings - self.update_configuration_parameters(self.get_parameters_sync()) - self.generate_configuration_async() - elif initcmd == self.handler.GENERATE_CONFIGURATION: + if initcmd == self.handler.GENERATE_CONFIGURATION: self.update_configuration_parameters(self.get_parameters_sync()) self.image_configuration_page.switch_machine_combo() elif initcmd in [self.handler.GENERATE_RECIPES,
lib/bb/ui/crumbs/hobeventhandler.py +2 -9
@@ -59,7 +59,7 @@ class HobHandler(gobject.GObject): (gobject.TYPE_PYOBJECT,)), } - (PARSE_CONFIG, GENERATE_CONFIGURATION, GENERATE_RECIPES, GENERATE_PACKAGES, GENERATE_IMAGE, POPULATE_PACKAGEINFO) = range(6) + (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) def __init__(self, server, recipe_model, package_model):
@@ -219,14 +219,6 @@ class HobHandler(gobject.GObject): def init_cooker(self): self.server.runCommand(["initCooker"]) - def parse_config(self): - self.commands_async.append(self.SUB_PARSE_CONFIG) - self.run_next_command(self.PARSE_CONFIG) - - def parse_generate_configuration(self): - self.commands_async.append(self.SUB_PARSE_CONFIG) - self.generate_configuration() - def set_extra_inherit(self, bbclass): inherits = self.server.runCommand(["getVariable", "INHERIT"]) or "" inherits = inherits + " " + bbclass
@@ -312,6 +304,7 @@ class HobHandler(gobject.GObject): self.run_next_command(self.POPULATE_PACKAGEINFO) def generate_configuration(self): + self.commands_async.append(self.SUB_PARSE_CONFIG) self.commands_async.append(self.SUB_PATH_LAYERS) self.commands_async.append(self.SUB_FILES_DISTRO) self.commands_async.append(self.SUB_FILES_MACH)
Signature · 1 line
1.7.4.1