summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorCristiana Voicu <cristiana.voicu@intel.com>2012-11-20 14:37:46 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-11-25 21:36:44 +0000
commitf26d3e8d5f735c7439bed234d0eb030215cded98 (patch)
tree95f81a5f99d055fed82cb41b30eb21d7ea00c9d2 /bitbake
parent7cbc3cf64bf68138fbbbb8bcae76ecd22d583c98 (diff)
downloadpoky-f26d3e8d5f735c7439bed234d0eb030215cded98.tar.gz
bitbake: hob: showing when build fails because out of disk space
-to enable this in hob, first you have to enable this in bitbake using BB_DISKMON_DIRS and/or BB_DISKMON_WARNINTERVAL vars -created "restart the build" action on the build_fail_top_bar [YOCTO #3357] (Bitbake rev: 964ac25d153ff4da144963289a32066db0e28b89) Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rwxr-xr-xbitbake/lib/bb/ui/crumbs/builddetailspage.py38
-rwxr-xr-xbitbake/lib/bb/ui/crumbs/builder.py4
-rw-r--r--bitbake/lib/bb/ui/crumbs/hobwidget.py3
-rw-r--r--bitbake/lib/bb/ui/crumbs/runningbuild.py5
4 files changed, 43 insertions, 7 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/builddetailspage.py b/bitbake/lib/bb/ui/crumbs/builddetailspage.py
index 1afacf85bd..6d8c38bd67 100755
--- a/bitbake/lib/bb/ui/crumbs/builddetailspage.py
+++ b/bitbake/lib/bb/ui/crumbs/builddetailspage.py
@@ -206,8 +206,6 @@ class BuildDetailsPage (HobPage):
206 def add_build_fail_top_bar(self, actions, log_file=None): 206 def add_build_fail_top_bar(self, actions, log_file=None):
207 primary_action = "Edit %s" % actions 207 primary_action = "Edit %s" % actions
208 208
209 self.notebook.set_page("Issues")
210
211 color = HobColors.ERROR 209 color = HobColors.ERROR
212 build_fail_top = gtk.EventBox() 210 build_fail_top = gtk.EventBox()
213 #build_fail_top.set_size_request(-1, 200) 211 #build_fail_top.set_size_request(-1, 200)
@@ -228,7 +226,17 @@ class BuildDetailsPage (HobPage):
228 226
229 label = gtk.Label() 227 label = gtk.Label()
230 label.set_alignment(0.0, 0.5) 228 label.set_alignment(0.0, 0.5)
231 label.set_markup("<span size='medium'>Check the \"Issues\" information for more details</span>") 229 # Ensure variable disk_full is defined
230 try:
231 self.builder.disk_full
232 except NameError:
233 self.builder.disk_full = False
234 if self.builder.disk_full:
235 markup = "<span size='medium'>There is no disk space left, so Hob cannot finish building your image. Free up some disk space\n"
236 markup += "and restart the build. Check the \"Issues\" tab for more details</span>"
237 label.set_markup(markup)
238 else:
239 label.set_markup("<span size='medium'>Check the \"Issues\" information for more details</span>")
232 build_fail_tab.attach(label, 4, 40, 4, 9) 240 build_fail_tab.attach(label, 4, 40, 4, 9)
233 241
234 # create button 'Edit packages' 242 # create button 'Edit packages'
@@ -236,22 +244,36 @@ class BuildDetailsPage (HobPage):
236 #action_button.set_size_request(-1, 40) 244 #action_button.set_size_request(-1, 40)
237 action_button.set_tooltip_text("Edit the %s parameters" % actions) 245 action_button.set_tooltip_text("Edit the %s parameters" % actions)
238 action_button.connect('clicked', self.failure_primary_action_button_clicked_cb, primary_action) 246 action_button.connect('clicked', self.failure_primary_action_button_clicked_cb, primary_action)
239 build_fail_tab.attach(action_button, 4, 13, 9, 12)
240 247
241 if log_file: 248 if log_file:
242 open_log_button = HobAltButton("Open log") 249 open_log_button = HobAltButton("Open log")
243 open_log_button.set_relief(gtk.RELIEF_HALF) 250 open_log_button.set_relief(gtk.RELIEF_HALF)
244 open_log_button.set_tooltip_text("Open the build's log file") 251 open_log_button.set_tooltip_text("Open the build's log file")
245 open_log_button.connect('clicked', self.open_log_button_clicked_cb, log_file) 252 open_log_button.connect('clicked', self.open_log_button_clicked_cb, log_file)
246 build_fail_tab.attach(open_log_button, 14, 23, 9, 12)
247 253
248 attach_pos = (24 if log_file else 14) 254 attach_pos = (24 if log_file else 14)
249 file_bug_button = HobAltButton('File a bug') 255 file_bug_button = HobAltButton('File a bug')
250 file_bug_button.set_relief(gtk.RELIEF_HALF) 256 file_bug_button.set_relief(gtk.RELIEF_HALF)
251 file_bug_button.set_tooltip_text("Open the Yocto Project bug tracking website") 257 file_bug_button.set_tooltip_text("Open the Yocto Project bug tracking website")
252 file_bug_button.connect('clicked', self.failure_activate_file_bug_link_cb) 258 file_bug_button.connect('clicked', self.failure_activate_file_bug_link_cb)
253 build_fail_tab.attach(file_bug_button, attach_pos, attach_pos + 9, 9, 12)
254 259
260 if not self.builder.disk_full:
261 build_fail_tab.attach(action_button, 4, 13, 9, 12)
262 if log_file:
263 build_fail_tab.attach(open_log_button, 14, 23, 9, 12)
264 build_fail_tab.attach(file_bug_button, attach_pos, attach_pos + 9, 9, 12)
265
266 else:
267 restart_build = HobButton("Restart the build")
268 restart_build.set_tooltip_text("Restart the build")
269 restart_build.connect('clicked', self.restart_build_button_clicked_cb)
270
271 build_fail_tab.attach(restart_build, 4, 13, 9, 12)
272 build_fail_tab.attach(action_button, 14, 23, 9, 12)
273 if log_file:
274 build_fail_tab.attach(open_log_button, attach_pos, attach_pos + 9, 9, 12)
275
276 self.builder.disk_full = False
255 return build_fail_top 277 return build_fail_top
256 278
257 def show_fail_page(self, title): 279 def show_fail_page(self, title):
@@ -266,6 +288,7 @@ class BuildDetailsPage (HobPage):
266 288
267 self.vbox.pack_start(self.notebook, expand=True, fill=True) 289 self.vbox.pack_start(self.notebook, expand=True, fill=True)
268 self.show_all() 290 self.show_all()
291 self.notebook.set_page("Issues")
269 self.back_button.hide() 292 self.back_button.hide()
270 293
271 def add_build_stop_top_bar(self, action, log_file=None): 294 def add_build_stop_top_bar(self, action, log_file=None):
@@ -396,6 +419,9 @@ class BuildDetailsPage (HobPage):
396 elif "Edit image" in action: 419 elif "Edit image" in action:
397 self.builder.show_configuration() 420 self.builder.show_configuration()
398 421
422 def restart_build_button_clicked_cb(self, button):
423 self.builder.just_bake()
424
399 def stop_primary_action_button_clicked_cb(self, button, action): 425 def stop_primary_action_button_clicked_cb(self, button, action):
400 if "recipes" in action: 426 if "recipes" in action:
401 self.builder.show_recipes() 427 self.builder.show_recipes()
diff --git a/bitbake/lib/bb/ui/crumbs/builder.py b/bitbake/lib/bb/ui/crumbs/builder.py
index 25741fe3f4..ec3ff30488 100755
--- a/bitbake/lib/bb/ui/crumbs/builder.py
+++ b/bitbake/lib/bb/ui/crumbs/builder.py
@@ -456,6 +456,7 @@ class Builder(gtk.Window):
456 self.handler.build.connect("build-failed", self.handler_build_failed_cb) 456 self.handler.build.connect("build-failed", self.handler_build_failed_cb)
457 self.handler.build.connect("build-aborted", self.handler_build_aborted_cb) 457 self.handler.build.connect("build-aborted", self.handler_build_aborted_cb)
458 self.handler.build.connect("task-started", self.handler_task_started_cb) 458 self.handler.build.connect("task-started", self.handler_task_started_cb)
459 self.handler.build.connect("disk-full", self.handler_disk_full_cb)
459 self.handler.build.connect("log-error", self.handler_build_failure_cb) 460 self.handler.build.connect("log-error", self.handler_build_failure_cb)
460 self.handler.build.connect("log-warning", self.handler_build_failure_cb) 461 self.handler.build.connect("log-warning", self.handler_build_failure_cb)
461 self.handler.build.connect("log", self.handler_build_log_cb) 462 self.handler.build.connect("log", self.handler_build_log_cb)
@@ -1122,6 +1123,9 @@ class Builder(gtk.Window):
1122 self.build_details_page.update_progress_bar(title + ": ", fraction) 1123 self.build_details_page.update_progress_bar(title + ": ", fraction)
1123 self.build_details_page.update_build_status(message["current"], message["total"], message["task"]) 1124 self.build_details_page.update_build_status(message["current"], message["total"], message["task"])
1124 1125
1126 def handler_disk_full_cb(self, running_build):
1127 self.disk_full = True
1128
1125 def handler_build_failure_cb(self, running_build): 1129 def handler_build_failure_cb(self, running_build):
1126 self.build_details_page.show_issues() 1130 self.build_details_page.show_issues()
1127 1131
diff --git a/bitbake/lib/bb/ui/crumbs/hobwidget.py b/bitbake/lib/bb/ui/crumbs/hobwidget.py
index 65de9df78f..3ca9066227 100644
--- a/bitbake/lib/bb/ui/crumbs/hobwidget.py
+++ b/bitbake/lib/bb/ui/crumbs/hobwidget.py
@@ -521,7 +521,8 @@ class HobNotebook(gtk.Notebook):
521 for child in self.pages: 521 for child in self.pages:
522 if child.lbl.get_label() == title: 522 if child.lbl.get_label() == title:
523 child.grab_focus() 523 child.grab_focus()
524 self.set_current_page(self.page_num(child)) 524 self.set_current_page(self.pages.index(child))
525 return
525 526
526class HobWarpCellRendererText(gtk.CellRendererText): 527class HobWarpCellRendererText(gtk.CellRendererText):
527 def __init__(self, col_number): 528 def __init__(self, col_number):
diff --git a/bitbake/lib/bb/ui/crumbs/runningbuild.py b/bitbake/lib/bb/ui/crumbs/runningbuild.py
index f6848fd8bf..78fa1417f5 100644
--- a/bitbake/lib/bb/ui/crumbs/runningbuild.py
+++ b/bitbake/lib/bb/ui/crumbs/runningbuild.py
@@ -88,6 +88,9 @@ class RunningBuild (gobject.GObject):
88 'log-warning' : (gobject.SIGNAL_RUN_LAST, 88 'log-warning' : (gobject.SIGNAL_RUN_LAST,
89 gobject.TYPE_NONE, 89 gobject.TYPE_NONE,
90 ()), 90 ()),
91 'disk-full' : (gobject.SIGNAL_RUN_LAST,
92 gobject.TYPE_NONE,
93 ()),
91 'no-provider' : (gobject.SIGNAL_RUN_LAST, 94 'no-provider' : (gobject.SIGNAL_RUN_LAST,
92 gobject.TYPE_NONE, 95 gobject.TYPE_NONE,
93 (gobject.TYPE_PYOBJECT,)), 96 (gobject.TYPE_PYOBJECT,)),
@@ -290,6 +293,7 @@ class RunningBuild (gobject.GObject):
290 # Emit the appropriate signal depending on the number of failures 293 # Emit the appropriate signal depending on the number of failures
291 if self.buildaborted: 294 if self.buildaborted:
292 self.emit ("build-aborted") 295 self.emit ("build-aborted")
296 self.buildaborted = False
293 elif (failures >= 1): 297 elif (failures >= 1):
294 self.emit ("build-failed") 298 self.emit ("build-failed")
295 else: 299 else:
@@ -304,6 +308,7 @@ class RunningBuild (gobject.GObject):
304 308
305 elif isinstance(event, bb.event.DiskFull): 309 elif isinstance(event, bb.event.DiskFull):
306 self.buildaborted = True 310 self.buildaborted = True
311 self.emit("disk-full")
307 312
308 elif isinstance(event, bb.command.CommandFailed): 313 elif isinstance(event, bb.command.CommandFailed):
309 self.emit("log", "error", "Command execution failed: %s" % (event.error)) 314 self.emit("log", "error", "Command execution failed: %s" % (event.error))