summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/siggen.py
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/lib/bb/siggen.py
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/lib/bb/siggen.py')
-rw-r--r--bitbake/lib/bb/siggen.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/bitbake/lib/bb/siggen.py b/bitbake/lib/bb/siggen.py
index 9b2f658a46..0862cff78a 100644
--- a/bitbake/lib/bb/siggen.py
+++ b/bitbake/lib/bb/siggen.py
@@ -144,8 +144,9 @@ class SignatureGeneratorBasic(SignatureGenerator):
144 144
145 def finalise(self, fn, d, variant): 145 def finalise(self, fn, d, variant):
146 146
147 if variant: 147 mc = d.getVar("__BBMULTICONFIG", False) or ""
148 fn = "virtual:" + variant + ":" + fn 148 if variant or mc:
149 fn = bb.cache.realfn2virtual(fn, variant, mc)
149 150
150 try: 151 try:
151 taskdeps = self._build_data(fn, d) 152 taskdeps = self._build_data(fn, d)
@@ -300,16 +301,18 @@ class SignatureGeneratorBasic(SignatureGenerator):
300 bb.error("Taskhash mismatch %s versus %s for %s" % (computed_taskhash, self.taskhash[k], k)) 301 bb.error("Taskhash mismatch %s versus %s for %s" % (computed_taskhash, self.taskhash[k], k))
301 302
302 303
303 def dump_sigs(self, dataCache, options): 304 def dump_sigs(self, dataCaches, options):
304 for fn in self.taskdeps: 305 for fn in self.taskdeps:
305 for task in self.taskdeps[fn]: 306 for task in self.taskdeps[fn]:
307 tid = fn + ":" + task
308 (mc, _, _) = bb.runqueue.split_tid(tid)
306 k = fn + "." + task 309 k = fn + "." + task
307 if k not in self.taskhash: 310 if k not in self.taskhash:
308 continue 311 continue
309 if dataCache.basetaskhash[k] != self.basehash[k]: 312 if dataCaches[mc].basetaskhash[k] != self.basehash[k]:
310 bb.error("Bitbake's cached basehash does not match the one we just generated (%s)!" % k) 313 bb.error("Bitbake's cached basehash does not match the one we just generated (%s)!" % k)
311 bb.error("The mismatched hashes were %s and %s" % (dataCache.basetaskhash[k], self.basehash[k])) 314 bb.error("The mismatched hashes were %s and %s" % (dataCaches[mc].basetaskhash[k], self.basehash[k]))
312 self.dump_sigtask(fn, task, dataCache.stamp[fn], True) 315 self.dump_sigtask(fn, task, dataCaches[mc].stamp[fn], True)
313 316
314class SignatureGeneratorBasicHash(SignatureGeneratorBasic): 317class SignatureGeneratorBasicHash(SignatureGeneratorBasic):
315 name = "basichash" 318 name = "basichash"