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-08 13:29:54 +0100
commitf85f1ef24e59c0c058f96f0dfa82e50969fd580b (patch)
tree393158876a7874782ab0c630d484ee1142f6f663
parentbca4396106a51c7eba1da5fcbaba5e4e4964ca91 (diff)
downloadpoky-f85f1ef24e59c0c058f96f0dfa82e50969fd580b.tar.gz
bitbake: 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. (Bitbake rev: 0b00f0382780ab5390a5c3f756a9b4efafe0aec8) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--bitbake/lib/bb/cooker.py28
1 files changed, 16 insertions, 12 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index 479dc5a114..dc8f54ca1d 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -1172,12 +1172,14 @@ class BBCooker:
1172 """ 1172 """
1173 Setup any variables needed before starting a build 1173 Setup any variables needed before starting a build
1174 """ 1174 """
1175 t = time.gmtime() 1175 t = time.gmtime()
1176 if not self.data.getVar("BUILDNAME", False): 1176 for mc in self.databuilder.mcdata:
1177 self.data.setVar("BUILDNAME", "${DATE}${TIME}") 1177 ds = self.databuilder.mcdata[mc]
1178 self.data.setVar("BUILDSTART", time.strftime('%m/%d/%Y %H:%M:%S', t)) 1178 if not ds.getVar("BUILDNAME", False):
1179 self.data.setVar("DATE", time.strftime('%Y%m%d', t)) 1179 ds.setVar("BUILDNAME", "${DATE}${TIME}")
1180 self.data.setVar("TIME", time.strftime('%H%M%S', t)) 1180 ds.setVar("BUILDSTART", time.strftime('%m/%d/%Y %H:%M:%S', t))
1181 ds.setVar("DATE", time.strftime('%Y%m%d', t))
1182 ds.setVar("TIME", time.strftime('%H%M%S', t))
1181 1183
1182 def reset_mtime_caches(self): 1184 def reset_mtime_caches(self):
1183 """ 1185 """
@@ -1292,10 +1294,10 @@ class BBCooker:
1292 # Setup taskdata structure 1294 # Setup taskdata structure
1293 taskdata = {} 1295 taskdata = {}
1294 taskdata[mc] = bb.taskdata.TaskData(self.configuration.abort) 1296 taskdata[mc] = bb.taskdata.TaskData(self.configuration.abort)
1295 taskdata[mc].add_provider(self.data, self.recipecaches[mc], item) 1297 taskdata[mc].add_provider(self.databuilder.mcdata[mc], self.recipecaches[mc], item)
1296 1298
1297 buildname = self.data.getVar("BUILDNAME") 1299 buildname = self.databuilder.mcdata[mc].getVar("BUILDNAME")
1298 bb.event.fire(bb.event.BuildStarted(buildname, [item]), self.data) 1300 bb.event.fire(bb.event.BuildStarted(buildname, [item]), self.databuilder.mcdata[mc])
1299 1301
1300 # Execute the runqueue 1302 # Execute the runqueue
1301 runlist = [[mc, item, task, fn]] 1303 runlist = [[mc, item, task, fn]]
@@ -1325,7 +1327,7 @@ class BBCooker:
1325 return False 1327 return False
1326 1328
1327 if not retval: 1329 if not retval:
1328 bb.event.fire(bb.event.BuildCompleted(len(rq.rqdata.runtaskentries), buildname, item, failures, interrupted), self.data) 1330 bb.event.fire(bb.event.BuildCompleted(len(rq.rqdata.runtaskentries), buildname, item, failures, interrupted), self.databuilder.mcdata[mc])
1329 self.command.finishAsyncCommand(msg) 1331 self.command.finishAsyncCommand(msg)
1330 return False 1332 return False
1331 if retval is True: 1333 if retval is True:
@@ -1362,7 +1364,8 @@ class BBCooker:
1362 1364
1363 if not retval: 1365 if not retval:
1364 try: 1366 try:
1365 bb.event.fire(bb.event.BuildCompleted(len(rq.rqdata.runtaskentries), buildname, targets, failures, interrupted), self.data) 1367 for mc in self.multiconfigs:
1368 bb.event.fire(bb.event.BuildCompleted(len(rq.rqdata.runtaskentries), buildname, targets, failures, interrupted), self.databuilder.mcdata[mc])
1366 finally: 1369 finally:
1367 self.command.finishAsyncCommand(msg) 1370 self.command.finishAsyncCommand(msg)
1368 return False 1371 return False
@@ -1395,7 +1398,8 @@ class BBCooker:
1395 ntargets.append("multiconfig:%s:%s:%s" % (target[0], target[1], target[2])) 1398 ntargets.append("multiconfig:%s:%s:%s" % (target[0], target[1], target[2]))
1396 ntargets.append("%s:%s" % (target[1], target[2])) 1399 ntargets.append("%s:%s" % (target[1], target[2]))
1397 1400
1398 bb.event.fire(bb.event.BuildStarted(buildname, ntargets), self.data) 1401 for mc in self.multiconfigs:
1402 bb.event.fire(bb.event.BuildStarted(buildname, ntargets), self.databuilder.mcdata[mc])
1399 1403
1400 rq = bb.runqueue.RunQueue(self, self.data, self.recipecaches, taskdata, runlist) 1404 rq = bb.runqueue.RunQueue(self, self.data, self.recipecaches, taskdata, runlist)
1401 if 'universe' in targets: 1405 if 'universe' in targets: