* [PATCH 1/6] event: add new property to BuildBase class
2015-09-28 15:44 [PATCH v2 0/6] Fixes for toastergui Ed Bartosh
@ 2015-09-28 15:44 ` Ed Bartosh
2015-09-28 15:44 ` [PATCH 2/6] event: add new parameter to Build* event APIs Ed Bartosh
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Ed Bartosh @ 2015-09-28 15:44 UTC (permalink / raw)
To: toaster
Added 'task' property to the base class of BuildStarted and
BuildCompleted classes to store bitbake task if it's specified.
This is done as without task Build* events can't fully represent
bitbake build. Task information is needed by UI classes to properly
show or process Build* events.
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
---
bitbake/lib/bb/event.py | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/bitbake/lib/bb/event.py b/bitbake/lib/bb/event.py
index 366bc41..68496e5 100644
--- a/bitbake/lib/bb/event.py
+++ b/bitbake/lib/bb/event.py
@@ -331,6 +331,7 @@ class BuildBase(Event):
def __init__(self, n, p, failures = 0):
self._name = n
self._pkgs = p
+ self._task = None
Event.__init__(self)
self._failures = failures
@@ -352,6 +353,12 @@ class BuildBase(Event):
def setCfg(self, cfg):
self.data = cfg
+ def getTask(self):
+ return self._task
+
+ def setTask(self, task):
+ self._task = task
+
def getFailures(self):
"""
Return the number of failed packages
@@ -361,6 +368,7 @@ class BuildBase(Event):
pkgs = property(getPkgs, setPkgs, None, "pkgs property")
name = property(getName, setName, None, "name property")
cfg = property(getCfg, setCfg, None, "cfg property")
+ task = property(getTask, setTask, None, "task property")
--
2.1.4
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCH 2/6] event: add new parameter to Build* event APIs
2015-09-28 15:44 [PATCH v2 0/6] Fixes for toastergui Ed Bartosh
2015-09-28 15:44 ` [PATCH 1/6] event: add new property to BuildBase class Ed Bartosh
@ 2015-09-28 15:44 ` Ed Bartosh
2015-09-28 15:44 ` [PATCH 3/6] toaster: add task to the target_information Ed Bartosh
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Ed Bartosh @ 2015-09-28 15:44 UTC (permalink / raw)
To: toaster
Added 't'(task) parameter to BuildStarted and BuildCompleted
event APIs. Modified existing calls of above mentioned APIs:
passed bitbake task name as a parameter.
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
---
bitbake/lib/bb/cooker.py | 8 ++++----
bitbake/lib/bb/event.py | 12 ++++++------
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index a0d7d59..ef81c3a 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -1313,7 +1313,7 @@ class BBCooker:
taskdata.add_provider(self.data, self.recipecache, item)
buildname = self.data.getVar("BUILDNAME", True)
- bb.event.fire(bb.event.BuildStarted(buildname, [item]), self.expanded_data)
+ bb.event.fire(bb.event.BuildStarted(buildname, [item], task), self.expanded_data)
# Execute the runqueue
if not task.startswith("do_"):
@@ -1345,7 +1345,7 @@ class BBCooker:
return False
if not retval:
- bb.event.fire(bb.event.BuildCompleted(len(rq.rqdata.runq_fnid), buildname, item, failures, interrupted), self.expanded_data)
+ bb.event.fire(bb.event.BuildCompleted(len(rq.rqdata.runq_fnid), buildname, item, task, failures, interrupted), self.expanded_data)
self.command.finishAsyncCommand(msg)
return False
if retval is True:
@@ -1381,7 +1381,7 @@ class BBCooker:
return False
if not retval:
- bb.event.fire(bb.event.BuildCompleted(len(rq.rqdata.runq_fnid), buildname, targets, failures, interrupted), self.data)
+ bb.event.fire(bb.event.BuildCompleted(len(rq.rqdata.runq_fnid), buildname, targets, task, failures, interrupted), self.data)
self.command.finishAsyncCommand(msg)
return False
if retval is True:
@@ -1394,7 +1394,7 @@ class BBCooker:
taskdata, runlist, fulltargetlist = self.buildTaskData(targets, task, self.configuration.abort)
buildname = self.data.getVar("BUILDNAME", False)
- bb.event.fire(bb.event.BuildStarted(buildname, fulltargetlist), self.data)
+ bb.event.fire(bb.event.BuildStarted(buildname, fulltargetlist, task), self.data)
rq = bb.runqueue.RunQueue(self, self.data, self.recipecache, taskdata, runlist)
if 'universe' in targets:
diff --git a/bitbake/lib/bb/event.py b/bitbake/lib/bb/event.py
index 68496e5..bf67ee9 100644
--- a/bitbake/lib/bb/event.py
+++ b/bitbake/lib/bb/event.py
@@ -328,10 +328,10 @@ class StampUpdate(Event):
class BuildBase(Event):
"""Base class for bbmake run events"""
- def __init__(self, n, p, failures = 0):
+ def __init__(self, n, p, t, failures = 0):
self._name = n
self._pkgs = p
- self._task = None
+ self._task = t
Event.__init__(self)
self._failures = failures
@@ -376,19 +376,19 @@ class BuildBase(Event):
class BuildStarted(BuildBase, OperationStarted):
"""bbmake build run started"""
- def __init__(self, n, p, failures = 0):
+ def __init__(self, n, p, t, failures = 0):
OperationStarted.__init__(self, "Building Started")
- BuildBase.__init__(self, n, p, failures)
+ BuildBase.__init__(self, n, p, t, failures)
class BuildCompleted(BuildBase, OperationCompleted):
"""bbmake build run completed"""
- def __init__(self, total, n, p, failures=0, interrupted=0):
+ def __init__(self, total, n, p, t, failures=0, interrupted=0):
if not failures:
OperationCompleted.__init__(self, total, "Building Succeeded")
else:
OperationCompleted.__init__(self, total, "Building Failed")
self._interrupted = interrupted
- BuildBase.__init__(self, n, p, failures)
+ BuildBase.__init__(self, n, p, t, failures)
class DiskFull(Event):
"""Disk full case build aborted"""
--
2.1.4
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCH 6/6] toaster: use meaningful logging levels
2015-09-28 15:44 [PATCH v2 0/6] Fixes for toastergui Ed Bartosh
` (4 preceding siblings ...)
2015-09-28 15:44 ` [PATCH 5/6] toaster: ignore ReachableStamps event Ed Bartosh
@ 2015-09-28 15:44 ` Ed Bartosh
5 siblings, 0 replies; 7+ messages in thread
From: Ed Bartosh @ 2015-09-28 15:44 UTC (permalink / raw)
To: toaster
Changed logging levels to more appropriate ones.
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
---
bitbake/lib/bb/ui/toasterui.py | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/bitbake/lib/bb/ui/toasterui.py b/bitbake/lib/bb/ui/toasterui.py
index 3891e63..dbe0d09 100644
--- a/bitbake/lib/bb/ui/toasterui.py
+++ b/bitbake/lib/bb/ui/toasterui.py
@@ -130,14 +130,14 @@ def main(server, eventHandler, params ):
if isinstance(event, (bb.build.TaskStarted, bb.build.TaskSucceeded, bb.build.TaskFailedSilent)):
buildinfohelper.update_and_store_task(event)
- logger.warn("Logfile for task %s", event.logfile)
+ logger.info("Logfile for task %s", event.logfile)
continue
if isinstance(event, bb.build.TaskBase):
logger.info(event._message)
if isinstance(event, bb.event.LogExecTTY):
- logger.warn(event.msg)
+ logger.info(event.msg)
continue
if isinstance(event, logging.LogRecord):
@@ -316,7 +316,7 @@ def main(server, eventHandler, params ):
buildinfohelper.store_dependency_information(event)
continue
- logger.error("Unknown event: %s", event)
+ logger.warn("Unknown event: %s", event)
return_value += 1
except EnvironmentError as ioerror:
@@ -336,7 +336,7 @@ def main(server, eventHandler, params ):
if tb is not None:
curr = tb
while curr is not None:
- logger.warn("Error data dump %s\n%s\n" , traceback.format_tb(curr,1), pformat(curr.tb_frame.f_locals))
+ logger.error("Error data dump %s\n%s\n" , traceback.format_tb(curr,1), pformat(curr.tb_frame.f_locals))
curr = curr.tb_next
# save them to database, if possible; if it fails, we already logged to console.
--
2.1.4
^ permalink raw reply related [flat|nested] 7+ messages in thread