summaryrefslogtreecommitdiffstats
path: root/bitbake/bin/bitbake-worker
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2016-08-16 17:47:06 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-08-18 10:06:27 +0100
commit218b81acb682bf0006afeb1a5c7bc4adf0549796 (patch)
tree4048ec43fa894149678209b9f8ae3f3985341c1f /bitbake/bin/bitbake-worker
parentfac16ff8f7b1090324955e5198996324c6dcdc1d (diff)
downloadpoky-218b81acb682bf0006afeb1a5c7bc4adf0549796.tar.gz
bitbake: bitbake: Initial multi-config support
This patch adds the notion of supporting multiple configurations within a single build. To enable it, set a line in local.conf like: BBMULTICONFIG = "configA configB configC" This would tell bitbake that before it parses the base configuration, it should load conf/configA.conf and so on for each different configuration. These would contain lines like: MACHINE = "A" or other variables which can be set which can be built in the same build directory (or change TMPDIR not to conflict). One downside I've already discovered is that if we want to inherit this file right at the start of parsing, the only place you can put the configurations is in "cwd", since BBPATH isn't constructed until the layers are parsed and therefore using it as a preconf file isn't possible unless its located there. Execution of these targets takes the form "bitbake multiconfig:configA:core-image-minimal core-image-sato" so similar to our virtclass approach for native/nativesdk/multilib using BBCLASSEXTEND. Implementation wise, the implication is that instead of tasks being uniquely referenced with "recipename/fn:task" it now needs to be "configuration:recipename:task". We already started using "virtual" filenames for recipes when we implemented BBCLASSEXTEND and this patch adds a new prefix to these, "multiconfig:<configname>:" and hence avoid changes to a large part of the codebase thanks to this. databuilder has an internal array of data stores and uses the right one depending on the supplied virtual filename. That trick allows us to use the existing parsing code including the multithreading mostly unchanged as well as most of the cache code. For recipecache, we end up with a dict of these accessed by multiconfig (mc). taskdata and runqueue can only cope with one recipecache so for taskdata, we pass in each recipecache and have it compute the result and end up with an array of taskdatas. We can only have one runqueue so there extensive changes there. This initial implementation has some drawbacks: a) There are no inter-multi-configuration dependencies as yet b) There are no sstate optimisations. This means if the build uses the same object twice in say two different TMPDIRs, it will either load from an existing sstate cache at the start or build it twice. We can then in due course look at ways in which it would only build it once and then reuse it. This will likely need significant changes to the way sstate currently works to make that possible. (Bitbake rev: 5287991691578825c847bac2368e9b51c0ede3f0) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/bin/bitbake-worker')
-rwxr-xr-xbitbake/bin/bitbake-worker6
1 files changed, 4 insertions, 2 deletions
diff --git a/bitbake/bin/bitbake-worker b/bitbake/bin/bitbake-worker
index 1926b89882..500f2ad161 100755
--- a/bitbake/bin/bitbake-worker
+++ b/bitbake/bin/bitbake-worker
@@ -195,7 +195,8 @@ def fork_off_task(cfg, data, databuilder, workerdata, fn, task, taskname, append
195 195
196 try: 196 try:
197 bb_cache = bb.cache.NoCache(databuilder) 197 bb_cache = bb.cache.NoCache(databuilder)
198 the_data = databuilder.data 198 (realfn, virtual, mc) = bb.cache.virtualfn2realfn(fn)
199 the_data = databuilder.mcdata[mc]
199 the_data.setVar("BB_WORKERCONTEXT", "1") 200 the_data.setVar("BB_WORKERCONTEXT", "1")
200 the_data.setVar("BB_TASKDEPDATA", taskdepdata) 201 the_data.setVar("BB_TASKDEPDATA", taskdepdata)
201 the_data.setVar("BUILDNAME", workerdata["buildname"]) 202 the_data.setVar("BUILDNAME", workerdata["buildname"])
@@ -374,7 +375,8 @@ class BitbakeWorker(object):
374 bb.msg.loggerDefaultVerbose = self.workerdata["logdefaultverbose"] 375 bb.msg.loggerDefaultVerbose = self.workerdata["logdefaultverbose"]
375 bb.msg.loggerVerboseLogs = self.workerdata["logdefaultverboselogs"] 376 bb.msg.loggerVerboseLogs = self.workerdata["logdefaultverboselogs"]
376 bb.msg.loggerDefaultDomains = self.workerdata["logdefaultdomain"] 377 bb.msg.loggerDefaultDomains = self.workerdata["logdefaultdomain"]
377 self.data.setVar("PRSERV_HOST", self.workerdata["prhost"]) 378 for mc in self.databuilder.mcdata:
379 self.databuilder.mcdata[mc].setVar("PRSERV_HOST", self.workerdata["prhost"])
378 380
379 def handle_ping(self, _): 381 def handle_ping(self, _):
380 workerlog_write("Handling ping\n") 382 workerlog_write("Handling ping\n")