diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-08-16 17:47:06 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-08-18 10:06:27 +0100 |
commit | 218b81acb682bf0006afeb1a5c7bc4adf0549796 (patch) | |
tree | 4048ec43fa894149678209b9f8ae3f3985341c1f /bitbake/lib/bblayers | |
parent | fac16ff8f7b1090324955e5198996324c6dcdc1d (diff) | |
download | poky-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/bblayers')
-rw-r--r-- | bitbake/lib/bblayers/action.py | 2 | ||||
-rw-r--r-- | bitbake/lib/bblayers/query.py | 12 |
2 files changed, 7 insertions, 7 deletions
diff --git a/bitbake/lib/bblayers/action.py b/bitbake/lib/bblayers/action.py index d4c1792f60..739ae27b97 100644 --- a/bitbake/lib/bblayers/action.py +++ b/bitbake/lib/bblayers/action.py | |||
@@ -173,7 +173,7 @@ build results (as the layer priority order has effectively changed). | |||
173 | # have come from) | 173 | # have come from) |
174 | first_regex = None | 174 | first_regex = None |
175 | layerdir = layers[0] | 175 | layerdir = layers[0] |
176 | for layername, pattern, regex, _ in self.tinfoil.cooker.recipecache.bbfile_config_priorities: | 176 | for layername, pattern, regex, _ in self.tinfoil.cooker.bbfile_config_priorities: |
177 | if regex.match(os.path.join(layerdir, 'test')): | 177 | if regex.match(os.path.join(layerdir, 'test')): |
178 | first_regex = regex | 178 | first_regex = regex |
179 | break | 179 | break |
diff --git a/bitbake/lib/bblayers/query.py b/bitbake/lib/bblayers/query.py index 6e62082a2e..ee1e7c8a1c 100644 --- a/bitbake/lib/bblayers/query.py +++ b/bitbake/lib/bblayers/query.py | |||
@@ -23,7 +23,7 @@ class QueryPlugin(LayerPlugin): | |||
23 | """show current configured layers.""" | 23 | """show current configured layers.""" |
24 | logger.plain("%s %s %s" % ("layer".ljust(20), "path".ljust(40), "priority")) | 24 | logger.plain("%s %s %s" % ("layer".ljust(20), "path".ljust(40), "priority")) |
25 | logger.plain('=' * 74) | 25 | logger.plain('=' * 74) |
26 | for layer, _, regex, pri in self.tinfoil.cooker.recipecache.bbfile_config_priorities: | 26 | for layer, _, regex, pri in self.tinfoil.cooker.bbfile_config_priorities: |
27 | layerdir = self.bbfile_collections.get(layer, None) | 27 | layerdir = self.bbfile_collections.get(layer, None) |
28 | layername = self.get_layer_name(layerdir) | 28 | layername = self.get_layer_name(layerdir) |
29 | logger.plain("%s %s %d" % (layername.ljust(20), layerdir.ljust(40), pri)) | 29 | 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. | |||
121 | logger.error('No class named %s found in BBPATH', classfile) | 121 | logger.error('No class named %s found in BBPATH', classfile) |
122 | sys.exit(1) | 122 | sys.exit(1) |
123 | 123 | ||
124 | pkg_pn = self.tinfoil.cooker.recipecache.pkg_pn | 124 | pkg_pn = self.tinfoil.cooker.recipecaches[''].pkg_pn |
125 | (latest_versions, preferred_versions) = bb.providers.findProviders(self.tinfoil.config_data, self.tinfoil.cooker.recipecache, pkg_pn) | 125 | (latest_versions, preferred_versions) = bb.providers.findProviders(self.tinfoil.config_data, self.tinfoil.cooker.recipecaches[''], pkg_pn) |
126 | allproviders = bb.providers.allProviders(self.tinfoil.cooker.recipecache) | 126 | allproviders = bb.providers.allProviders(self.tinfoil.cooker.recipecaches['']) |
127 | 127 | ||
128 | # Ensure we list skipped recipes | 128 | # Ensure we list skipped recipes |
129 | # We are largely guessing about PN, PV and the preferred version here, | 129 | # 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. | |||
176 | # We only display once per recipe, we should prefer non extended versions of the | 176 | # We only display once per recipe, we should prefer non extended versions of the |
177 | # recipe if present (so e.g. in OpenEmbedded, openssl rather than nativesdk-openssl | 177 | # recipe if present (so e.g. in OpenEmbedded, openssl rather than nativesdk-openssl |
178 | # which would otherwise sort first). | 178 | # which would otherwise sort first). |
179 | if realfn[1] and realfn[0] in self.tinfoil.cooker.recipecache.pkg_fn: | 179 | if realfn[1] and realfn[0] in self.tinfoil.cooker.recipecaches[''].pkg_fn: |
180 | continue | 180 | continue |
181 | 181 | ||
182 | if inherits: | 182 | if inherits: |
@@ -297,7 +297,7 @@ Lists recipes with the bbappends that apply to them as subitems. | |||
297 | def get_appends_for_files(self, filenames): | 297 | def get_appends_for_files(self, filenames): |
298 | appended, notappended = [], [] | 298 | appended, notappended = [], [] |
299 | for filename in filenames: | 299 | for filename in filenames: |
300 | _, cls = bb.cache.virtualfn2realfn(filename) | 300 | _, cls, _ = bb.cache.virtualfn2realfn(filename) |
301 | if cls: | 301 | if cls: |
302 | continue | 302 | continue |
303 | 303 | ||