[bitbake-devel] [PATCH 5/8] bitbake: build: add logfile path for all Task events

Alex DAMIAN alexandru.damian at intel.com
Mon Sep 16 11:56:55 UTC 2013


From: Alexandru DAMIAN <alexandru.damian at intel.com>

We add the path to the logfile for all Task events, so
that we can record the logfile locations during the run.

This is needed because the logfile symlinks will point
only to the last build logs, and there is no other link
between a certain build and the log file it produces.

Signed-off-by: Alexandru DAMIAN <alexandru.damian at intel.com>
---
 bitbake/lib/bb/build.py | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/bitbake/lib/bb/build.py b/bitbake/lib/bb/build.py
index 1265bdc..8d001b1 100644
--- a/bitbake/lib/bb/build.py
+++ b/bitbake/lib/bb/build.py
@@ -91,13 +91,18 @@ class TaskBase(event.Event):
 
 class TaskStarted(TaskBase):
     """Task execution started"""
+    def __init__(self, task, logfile, metadata):
+        self.logfile = logfile
+        super(TaskStarted, self).__init__(task, metadata)
 
 class TaskSucceeded(TaskBase):
     """Task execution completed"""
+    def __init__(self, task, logfile, metadata):
+        self.logfile = logfile
+        super(TaskSucceeded, self).__init__(task, metadata)
 
 class TaskFailed(TaskBase):
     """Task execution failed"""
-
     def __init__(self, task, logfile, metadata, errprinted = False):
         self.logfile = logfile
         self.errprinted = errprinted
@@ -114,8 +119,8 @@ class TaskFailedSilent(TaskBase):
         return "Failed"
 
 class TaskInvalid(TaskBase):
-
-    def __init__(self, task, metadata):
+    def __init__(self, task, logfile, metadata):
+        self.logfile = logfile
         super(TaskInvalid, self).__init__(task, metadata)
         self._message = "No such task '%s'" % task
 
@@ -419,7 +424,7 @@ def _exec_task(fn, task, d, quieterr):
     localdata.setVar('BB_LOGFILE', logfn)
     localdata.setVar('BB_RUNTASK', task)
 
-    event.fire(TaskStarted(task, localdata), localdata)
+    event.fire(TaskStarted(task, logfn, localdata), localdata)
     try:
         for func in (prefuncs or '').split():
             exec_func(func, localdata)
@@ -456,7 +461,7 @@ def _exec_task(fn, task, d, quieterr):
             logger.debug(2, "Zero size logfn %s, removing", logfn)
             bb.utils.remove(logfn)
             bb.utils.remove(loglink)
-    event.fire(TaskSucceeded(task, localdata), localdata)
+    event.fire(TaskSucceeded(task, logfn, localdata), localdata)
 
     if not localdata.getVarFlag(task, 'nostamp') and not localdata.getVarFlag(task, 'selfstamp'):
         make_stamp(task, localdata)
-- 
1.8.1.2




More information about the bitbake-devel mailing list