summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2017-04-26 21:03:15 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-07-07 11:26:59 +0100
commit0b00f0382780ab5390a5c3f756a9b4efafe0aec8 (patch)
tree92725c037f0fc21729f29f35a82d030ceb26bee2
parent160e47f5df90850e64dcb857c81a5039abc9235f (diff)
downloadbitbake-contrib-0b00f0382780ab5390a5c3f756a9b4efafe0aec8.tar.gz
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@linuxfoundation.org>
-rw-r--r--lib/bb/cooker.py28
1 files changed, 16 insertions, 12 deletions
diff --git a/lib/bb/cooker.py b/lib/bb/cooker.py
index 479dc5a11..dc8f54ca1 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: