aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bblayers
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-17 10:23:01 +0100
commit5287991691578825c847bac2368e9b51c0ede3f0 (patch)
tree2db019f4fb79ff5da19a6674f8f2ed454e7cfef0 /lib/bblayers
parent49502685df3e616023df352823156381b1f79cd3 (diff)
downloadbitbake-5287991691578825c847bac2368e9b51c0ede3f0.tar.gz
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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bblayers')
-rw-r--r--lib/bblayers/action.py2
-rw-r--r--lib/bblayers/query.py12
2 files changed, 7 insertions, 7 deletions
diff --git a/lib/bblayers/action.py b/lib/bblayers/action.py
index d4c1792f6..739ae27b9 100644
--- a/lib/bblayers/action.py
+++ b/lib/bblayers/action.py
@@ -173,7 +173,7 @@ build results (as the layer priority order has effectively changed).
# have come from)
first_regex = None
layerdir = layers[0]
- for layername, pattern, regex, _ in self.tinfoil.cooker.recipecache.bbfile_config_priorities:
+ for layername, pattern, regex, _ in self.tinfoil.cooker.bbfile_config_priorities:
if regex.match(os.path.join(layerdir, 'test')):
first_regex = regex
break
diff --git a/lib/bblayers/query.py b/lib/bblayers/query.py
index 6e62082a2..ee1e7c8a1 100644
--- a/lib/bblayers/query.py
+++ b/lib/bblayers/query.py
@@ -23,7 +23,7 @@ class QueryPlugin(LayerPlugin):
"""show current configured layers."""
logger.plain("%s %s %s" % ("layer".ljust(20), "path".ljust(40), "priority"))
logger.plain('=' * 74)
- for layer, _, regex, pri in self.tinfoil.cooker.recipecache.bbfile_config_priorities:
+ for layer, _, regex, pri in self.tinfoil.cooker.bbfile_config_priorities:
layerdir = self.bbfile_collections.get(layer, None)
layername = self.get_layer_name(layerdir)
logger.plain("%s %s %d" % (layername.ljust(20), layerdir.ljust(40), pri))
@@ -121,9 +121,9 @@ skipped recipes will also be listed, with a " (skipped)" suffix.
logger.error('No class named %s found in BBPATH', classfile)
sys.exit(1)
- pkg_pn = self.tinfoil.cooker.recipecache.pkg_pn
- (latest_versions, preferred_versions) = bb.providers.findProviders(self.tinfoil.config_data, self.tinfoil.cooker.recipecache, pkg_pn)
- allproviders = bb.providers.allProviders(self.tinfoil.cooker.recipecache)
+ pkg_pn = self.tinfoil.cooker.recipecaches[''].pkg_pn
+ (latest_versions, preferred_versions) = bb.providers.findProviders(self.tinfoil.config_data, self.tinfoil.cooker.recipecaches[''], pkg_pn)
+ allproviders = bb.providers.allProviders(self.tinfoil.cooker.recipecaches[''])
# Ensure we list skipped recipes
# We are largely guessing about PN, PV and the preferred version here,
@@ -176,7 +176,7 @@ skipped recipes will also be listed, with a " (skipped)" suffix.
# We only display once per recipe, we should prefer non extended versions of the
# recipe if present (so e.g. in OpenEmbedded, openssl rather than nativesdk-openssl
# which would otherwise sort first).
- if realfn[1] and realfn[0] in self.tinfoil.cooker.recipecache.pkg_fn:
+ if realfn[1] and realfn[0] in self.tinfoil.cooker.recipecaches[''].pkg_fn:
continue
if inherits:
@@ -297,7 +297,7 @@ Lists recipes with the bbappends that apply to them as subitems.
def get_appends_for_files(self, filenames):
appended, notappended = [], []
for filename in filenames:
- _, cls = bb.cache.virtualfn2realfn(filename)
+ _, cls, _ = bb.cache.virtualfn2realfn(filename)
if cls:
continue