[oe-commits] [bitbake] 01/02: cooker: Use multiple BuildStarted events for multiconfig

git at git.openembedded.org git at git.openembedded.org
Fri Jul 7 10:33:57 UTC 2017


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository bitbake.

commit 0b00f0382780ab5390a5c3f756a9b4efafe0aec8
Author: Richard Purdie <richard.purdie at linuxfoundation.org>
AuthorDate: Wed Apr 26 21:03:15 2017 +0100

    cooker: Use multiple BuildStarted events for multiconfig
    
    Currently builds in multiple TMPDIRs with multiconfig can break
    since the BuildStarted event is used to create directory strutures in several
    cases (e.g. buildstats.bbclass) and there is only on BuildStarted event
    generated in a multiconfig build.
    
    We have two options, a) to add a new MultiConfigBuildStarted event which is
    generated once per multiconfig, or b) allow multiple BuildStarted events.
    
    Having reviewed the code and current users of BuildStarted, sending one event
    per multiconfig seems like its the best way forward and the existing code looks
    able to cope with the duplication of events. I did also check toaster and I think
    that can handle this issue too (multiconfig builds may have other issues there).
    
    I'm therefore proposing we send multiple BuildStarted events for multiconfig
    and for consistency, send multiple BuildCompleted events too.
    
    We need to ensure that BUILDNAME, BUILDSTART and DATE/TIME are set consistently
    in all the different multiconfig datastores. These events can write to the
    datastore so copies are not used. buildFile was also cleaned up to ensure it
    uses the right datastore in various places.
    
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 lib/bb/cooker.py | 28 ++++++++++++++++------------
 1 file changed, 16 insertions(+), 12 deletions(-)

diff --git a/lib/bb/cooker.py b/lib/bb/cooker.py
index 479dc5a..dc8f54c 100644
--- a/lib/bb/cooker.py
+++ b/lib/bb/cooker.py
@@ -1172,12 +1172,14 @@ class BBCooker:
         """
         Setup any variables needed before starting a build
         """
-        t = time.gmtime() 
-        if not self.data.getVar("BUILDNAME", False):
-            self.data.setVar("BUILDNAME", "${DATE}${TIME}")
-        self.data.setVar("BUILDSTART", time.strftime('%m/%d/%Y %H:%M:%S', t))
-        self.data.setVar("DATE", time.strftime('%Y%m%d', t))
-        self.data.setVar("TIME", time.strftime('%H%M%S', t))
+        t = time.gmtime()
+        for mc in self.databuilder.mcdata:
+            ds = self.databuilder.mcdata[mc]
+            if not ds.getVar("BUILDNAME", False):
+                ds.setVar("BUILDNAME", "${DATE}${TIME}")
+            ds.setVar("BUILDSTART", time.strftime('%m/%d/%Y %H:%M:%S', t))
+            ds.setVar("DATE", time.strftime('%Y%m%d', t))
+            ds.setVar("TIME", time.strftime('%H%M%S', t))
 
     def reset_mtime_caches(self):
         """
@@ -1292,10 +1294,10 @@ class BBCooker:
         # Setup taskdata structure
         taskdata = {}
         taskdata[mc] = bb.taskdata.TaskData(self.configuration.abort)
-        taskdata[mc].add_provider(self.data, self.recipecaches[mc], item)
+        taskdata[mc].add_provider(self.databuilder.mcdata[mc], self.recipecaches[mc], item)
 
-        buildname = self.data.getVar("BUILDNAME")
-        bb.event.fire(bb.event.BuildStarted(buildname, [item]), self.data)
+        buildname = self.databuilder.mcdata[mc].getVar("BUILDNAME")
+        bb.event.fire(bb.event.BuildStarted(buildname, [item]), self.databuilder.mcdata[mc])
 
         # Execute the runqueue
         runlist = [[mc, item, task, fn]]
@@ -1325,7 +1327,7 @@ class BBCooker:
                 return False
 
             if not retval:
-                bb.event.fire(bb.event.BuildCompleted(len(rq.rqdata.runtaskentries), buildname, item, failures, interrupted), self.data)
+                bb.event.fire(bb.event.BuildCompleted(len(rq.rqdata.runtaskentries), buildname, item, failures, interrupted), self.databuilder.mcdata[mc])
                 self.command.finishAsyncCommand(msg)
                 return False
             if retval is True:
@@ -1362,7 +1364,8 @@ class BBCooker:
 
             if not retval:
                 try:
-                    bb.event.fire(bb.event.BuildCompleted(len(rq.rqdata.runtaskentries), buildname, targets, failures, interrupted), self.data)
+                    for mc in self.multiconfigs:
+                        bb.event.fire(bb.event.BuildCompleted(len(rq.rqdata.runtaskentries), buildname, targets, failures, interrupted), self.databuilder.mcdata[mc])
                 finally:
                     self.command.finishAsyncCommand(msg)
                 return False
@@ -1395,7 +1398,8 @@ class BBCooker:
                 ntargets.append("multiconfig:%s:%s:%s" % (target[0], target[1], target[2]))
             ntargets.append("%s:%s" % (target[1], target[2]))
 
-        bb.event.fire(bb.event.BuildStarted(buildname, ntargets), self.data)
+        for mc in self.multiconfigs:
+            bb.event.fire(bb.event.BuildStarted(buildname, ntargets), self.databuilder.mcdata[mc])
 
         rq = bb.runqueue.RunQueue(self, self.data, self.recipecaches, taskdata, runlist)
         if 'universe' in targets:

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list