Commit Graph

39 Commits

Author SHA1 Message Date
Richard Purdie
0ac71c5480 bitbake: bitbake: Add copyright headers where missing
Where copyright headers were not present, add them to make things
clear.

(Bitbake rev: e591325b2bd901c381003deb96a7b32a7148e93e)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 1aa338a216350a2751fff52f866039343e9ac013)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-10-11 21:57:28 +01:00
Scott Murray
f7fccbe289 bitbake: bitbake: Replace remaining "abort" usage
In line with the inclusive language migration defined at:

https://wiki.yoctoproject.org/wiki/Inclusive_language

replace the remaining usage of "abort" in documentation, error
messages, and comments with halt/fail/exit as appropriate.
A couple of external Javascript API calls in Toaster remain, as
they cannot currently be changed.

(Bitbake rev: bc27762bf3ffb4a20b58eace5302438c4a526626)

Signed-off-by: Scott Murray <scott.murray@konsulko.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-02-21 23:37:26 +00:00
Alexander Kanavin
cee517568b bitbake: bitbake: fix regexp deprecation warnings
See here for details:
https://docs.python.org/3/library/re.html

(Bitbake rev: 660e6ad4abb77c6f3c1d48bd64777dd76c05d7e2)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-09-17 07:26:23 +01:00
Marco Felsch
f113446f41 bitbake: bitbake: bitbake-layers: add skip reason to output
Currently we inform the user that some package/layer is skipped but we
don't print the reason albeit bitbake knows the reason. So currently it
looks like:

gtk+:
  meta-oe              2.24.32 (skipped)

With this change the output prints the skip reason which is very helpful
for debugging:

gtk+:
  meta-oe              2.24.32 (skipped: one of 'x11 directfb' needs to be in DISTRO_FEATURES)

(Bitbake rev: d43e72db4f7c8b47d91d99ed54ce30e9ee898de1)

Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-08-23 08:30:54 +01:00
Diego Sueiro
cda69e0166 bitbake: layerindex: Add --fetchdir parameter to layerindex-fetch
Introduce --fetchdir parameter to layerindex-fetch enabling users to choose
the directory to fetch the layers different from BBLAYERS_FETCH_DIR.

[YOCTO #14347]

(Bitbake rev: 784a904faffac723ddf58ba765b9dd11ac068de5)

Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-04-23 10:13:13 +01:00
Diego Sueiro
9fae310dd2 bitbake: layerindex: Fix bitbake-layers layerindex-show-depends command
Running 'bitbake-layers layerindex-show-depends meta-filesystems' fails with:
```
Traceback (most recent call last):
  File "<...>/poky/bitbake/bin/bitbake-layers", line 93, in <module>
    ret = main()
  File "<...>/poky/bitbake/bin/bitbake-layers", line 86, in main
    return args.func(args)
  File "<...>/poky/bitbake/lib/bblayers/layerindex.py", line 209, in do_layerindex_show_depends
    self.do_layerindex_fetch(args)
  File "<...>/poky/bitbake/lib/bblayers/layerindex.py", line 182, in do_layerindex_fetch
    args.shallow)
AttributeError: 'Namespace' object has no attribute 'shallow'
```

Initialize the shallow attribute to fix it.

(Bitbake rev: 71f095c147fe6aa7b5e6272002e0498cf9494256)

Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-04-23 10:13:13 +01:00
Richard Purdie
ddacd8c66f bitbake: bblayers/query: Update to handle REQUIRED_VERSION
Ii is unclear whether any changes are needed to bblayers are
needed to handle the extra data from REQUIRED_VERSION. Update
to at match the new API, at present it doesn't look necessary
to handle the required version data.

(Bitbake rev: 53c30efec4099035d19e6717059dfceff8ff88fd)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-03-15 14:36:52 +00:00
Joshua Watt
75f87db413 bitbake: logging: Make bitbake logger compatible with python logger
The bitbake logger overrode the definition of the debug() logging call
to include a debug level, but this causes problems with code that may
be using standard python logging, since the extra argument is
interpreted differently.

Instead, change the bitbake loggers debug() call to match the python
logger call and add a debug2() and debug3() API to replace calls that
were logging to a different debug level.

[RP: Small fix to ensure bb.debug calls bbdebug()]
(Bitbake rev: f68682a79d83e6399eb403f30a1f113516575f51)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-02-10 23:48:16 +00:00
Richard Purdie
7283a0b3b6 bitbake: bblayers/action: When adding layers, catch BBHandledException
When adding a layer, parse error can occur, raising BBHandledException.
Catch this and error, aborting the layer add to meet user expectations.

[YOCTO #14054]

(Bitbake rev: ceddb5b3d229b83c172656053cd29aeb521fcce0)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-02-10 23:48:16 +00:00
Robert Yang
f738ed43e9 bitbake: utils.py: get_file_layer(): Improve performance
The following code costs a lot of time when there are lot of layers and recipes:

     for collection in collections:
         collection_res[collection] = d.getVar('BBFILE_PATTERN_%s' % collection) or ''

My build has more than 100 layers and 3000 recipes, which calls d.getVar() 300K
(3000 * 100) times and makes 'bitbake-layers show-recipes' very slow, add a
keyword argument to get_file_layer() can fix the problem, it can save about 90%
time in my build (6min -> 40s).

(Bitbake rev: f08a6601c9bb09622855d62e1cedb92fafd2f71d)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-09-10 13:49:21 +01:00
Joshua Watt
b9fdb6a426 bitbake: bitbake: cooker: Split file collections per multiconfig
Splits the cooker to track a collection per multiconfig instead of a
single collection for all multiconfigs. Practically speaking, this
allows each multiconfigs to each have different BBMASKs that apply to it
instead of each one using the mask specified in the base configuration.

(Bitbake rev: dd6d8eca2027f8d9be8a734a493227b440075e49)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-06-10 12:30:01 +01:00
Richard Purdie
89705a60f3 bitbake: data_smart: Don't pass unneeded datastore
The datastore is already available to this function internally so don't
also try and pass the datastore as a parameter. This is clearly broken
API when you look at the existing calls to it.

This then doesn't break the planned tinfoil data connector changes.

(Bitbake rev: af1654498ee5b47368a41dad2d2b7b6abc19ff15)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-03-24 22:01:03 +00:00
Joshua Watt
cc1ab55c14 bitbake: bblayers: query: Add multiconfig option
Adds an option to the show-recipes subcommand that allows the user to
specify which multiconfig should be shown.

(Bitbake rev: 83256115c7b1fdf3fa5129cfba6b9e7cba2ae0da)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-03-07 16:07:00 +00:00
Jan-Simon Moeller
273f78efb5 bitbake: layerindex: allow clones to be shallow
When bitbake-layers fetch-layerindex clones the repositories, these are
full clones. Allow the user to specify '-s' and do shallow clones
instead for faster downloads.

(Bitbake rev: a0c8b27675a590d9deeb3cbc462c0eb0e113cf3b)

Signed-off-by: Jan-Simon Moeller <dl9pf@gmx.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-02-19 11:26:12 +00:00
Jon Mason
eae875dae7 bitbake: bitbake: layerindex: use branch when specified
When currently specified, the branch is used to verify the versioning of
the meta layer, but the master branch is checked out.  This change
allows for the branch to be specified.  Now it is easy to specify all
of the meta layers being added are of the same version, without having
to do it in each individual git tree.  Also, it will error if there are
branches without a matching version.  Finally, this allows for meta
layer git trees without a master branch.

(Bitbake rev: 4ec49f42f327068890e7aad8553d7f282e2ffaa1)

Signed-off-by: Jon Mason <jdmason@kudzu.us>

Minor rework of the patch to use the layerBranch actual_branch since
the layerindex referenced branch may be different then the overall
release branch.

Also adjust the patch to use the default git checkout branch instead of
master if no branch was specified.  (Some repositories don't have a
master branch.)

Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-02-15 10:27:45 +00:00
Yeoh Ee Peng
0a46b9dd9c bitbake: bitbake-layers: show-recipes: Enable bare output
Currently, show-recipes will append "(skipped)" marker to recipes which
were skipped due these recipes does not satisfied the configurations.

Example: $ bitbake-layers show-recipes -r
   ace
   backport-iwlwifi
   core-image-rt (skipped)
   core-image-rt-sdk (skipped)
   core-image-tiny

Add -b/--bare to enable output names without "(skipped)" marker.

Example: $ bitbake-layers show-recipes -r -b
   ace
   backport-iwlwifi
   core-image-rt
   core-image-rt-sdk
   core-image-tiny

(Bitbake rev: 87796e580cd160a535eb5fb9e31846a7cf1a249e)

Signed-off-by: Yeoh Ee Peng <ee.peng.yeoh@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-09-19 20:30:35 +01:00
Yeoh Ee Peng
7f2803d1aa bitbake: bitbake-layers: show-recipes: Select recipes from selected layer
Currently, show-recipes will show recipes from all configured layers.
Assume, meta-intel layer was added to conf/bblayers.conf.

Example of default $ bitbake-layers show-recipes:
core-image-rt:
  meta-intel           unknown (skipped)
  meta                 unknown (skipped)

Add -l/--layer to enable showing recipes from user selected layer.

Example: $ bitbake-layers show-recipes -l meta-intel
core-image-rt:
  meta-intel           unknown (skipped)

(Bitbake rev: 8c38d95c4474ea171cb55b0e336d9090451e89ce)

Signed-off-by: Yeoh Ee Peng <ee.peng.yeoh@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-09-19 20:30:35 +01:00
Yeoh Ee Peng
5808f455f0 bitbake: bitbake-layers: show-recipes: Show recipes only
Currently, show-recipes will show all recipes available (both
recipes with different version and recipes provided by more
than one layer).

Example of default $ bitbake-layers show-recipes:
core-image-rt:
  meta-intel           unknown (skipped)
  meta                 unknown (skipped)

yajl:
  meta-oe              2.1.0
  meta-oe              1.0.12

Add -r/--recipes-only to enable showing recipes only. This
provide a focus view on unique recipes available.

Example of $ bitbake-layers show-recipes -r:
core-image-rt (skipped)
yajl

(Bitbake rev: 048bd051a9b422a38c181f57bb5090a05684a5c3)

Signed-off-by: Yeoh Ee Peng <ee.peng.yeoh@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-09-19 20:30:35 +01:00
Richard Purdie
79834a7144 bitbake: bitbake: Add initial pass of SPDX license headers to source code
This adds the SPDX-License-Identifier license headers to the majority of
our source files to make it clearer exactly which license files are under.

The bulk of the files are under GPL v2.0 with one found to be under V2.0
or later, some under MIT and some have dual license. There are some files
which are potentially harder to classify where we've imported upstream code
and those can be handled specifically in later commits.

The COPYING file is replaced with LICENSE.X files which contain the full
license texts.

(Bitbake rev: ff237c33337f4da2ca06c3a2c49699bc26608a6b)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-05-04 10:44:04 +01:00
Ross Burton
9c032d3dd9 bitbake: layerindex: don't use shell=True when cloning
(Bitbake rev: cb4aab7406dc8aefb646b37330b722cf9060ad73)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-11-23 16:10:37 +00:00
Mark Hatle
cbf41cbe55 bitbake: bitbake-layers: disable parsing for layerindex commands
These don't need to access recipe information, so let's not waste the
user's time parsing all recipes.

(Bitbake rev: 6a242a399ae93393c3fc60eda541c1f8f77fed57)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-08-02 10:18:27 +01:00
Mark Hatle
ddfcda7ec3 bitbake: bblayers/layerindex.py: Switch to use the new layerindexlib class
Display changes:
The output will now include references to the layers that the user already
has on their system.  It does this by querying the cooker derived index.

The code that enables this behavior is labeled as 'TODO' currently.  As
part of the work we need to make a final determination if this is the
desired output.

Also changed the default branch to no longer define itself as 'master'.

When the user does NOT set a branch, the default is now the
'LAYERSERIES_CORENAMES', and if that doesn't exist 'master'.  This is
subtly different in behavior, but more consistent with user expectations.

(Bitbake rev: 478c4b5489943f756ae03d6b6d3b5d665cedbce0)

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-08-02 10:18:27 +01:00
Mark Hatle
0dea950931 bitbake: bblayers/layerindex.py: Fix addition of layers
When a layer is added it needs to be in a list, otherwise the system will
error such as:

    Specified layer directory / doesn't contain a conf/layer.conf file

Additionally, instead of calling the add layer function over and over, it
is better to add all of the new content in one command.  Otherwise the
order is important as the system now checks if the layer can be added.  For
instance, trying to add meta-python:

   Layer                Required by          Git repository                                          Subdirectory
   ===================================================================================================================
   meta-python          -                    git://git.openembedded.org/meta-openembedded            meta-python
   meta-oe              meta-python          git://git.openembedded.org/meta-openembedded            meta-oe
   openembedded-core    meta-python          git://git.openembedded.org/openembedded-core            meta
   Adding layer "meta-python" (.../oe-core/meta-openembedded/meta-python) to conf/bblayers.conf
   ERROR: Layer 'meta-python' depends on layer 'openembedded-layer', but this layer is not enabled in your configuration

The system would try to add meta-python before the dependent meta-oe.  Adding
them both at the same time resolves this issue.

(Bitbake rev: 8aeaabf13db645f33495e00b82117327e153d70a)

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-08-02 10:18:27 +01:00
Richard Purdie
9571101105 bitbake: bblayers: Don't parse all recipes when calling add-layer
When adding multiple layers in a chain of commands, reparsing all recipes
each time can be painfully slow. Instead just parse the base configuration
which gives some confidence things worked out correctly without as much
overhead.

(Bitbake rev: cfd1302031f3cca96300a0e445a47b1614ecd00c)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-08-01 10:07:22 +01:00
Paul Eggleton
62113c4fbb bitbake: bitbake-layers: show-recipes: fix help to mention -i supports multiple classes
The -i option supports more than one class, but the help didn't mention
that.

(Bitbake rev: 1060955c4aa2ef66cdb4f0549f9bd8c1c332673c)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-11-21 13:06:45 +00:00
Paul Eggleton
8afaa56313 bitbake: bitbake-layers: remove-layer: support removing multiple layers at a time
If you can add multiple layers at once, it stands to reason that you
should also be able to remove more than one at a time.

(Bitbake rev: 2f2033836a5ce4064d9e4f263788a563001bc008)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-11-21 13:06:45 +00:00
Paul Eggleton
2a9a6465ba bitbake: bitbake-layers: add-layer: enable adding multiple layers at once
Allow specifying multiple layers with bitbake-layers add-layer so that
you can add more than one in a single command. This is not just useful,
it's actually pretty important if you need to add a layer and its
dependencies at the same time - since we now go through a parse process
when the layer is added, without this you have to add them all in just
the right order and wait for the parse each time which is somewhat
painful.

(Bitbake rev: ad6b14f01aa326a1c6baa31bfac33be238bce805)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-11-21 13:06:45 +00:00
Mark Hatle
bd87dd5a8d bitbake: bitbake-layers: Add support for multiple recipes at once
bitbake-layers show-recipes and show-appends supported listing all recipes
or one recipe.  Adjust the system to permit specifying more then one recipe.

Also update show-appends to match the --help description and support file
style wildcards for selecting the recipe to display.

(Bitbake rev: d72c1a91c261d78004d80e2fe5634f0e5f1ef947)

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-11-07 13:32:13 +00:00
Jeremy A. Puhlman
801188bbd9 bitbake: Add args.force to localargs before do_add_layer
Adding layer "meta-signing-key" to conf/bblayers.conf
Traceback (most recent call last):
  File "/local/build/project/build/poky/bitbake/bin/bitbake-layers",
line 103, in <module>
    ret = main()
  File "/local/build/project/build/poky/bitbake/bin/bitbake-layers",
line 96, in main
    return args.func(args)
  File
"/local/build/project/build/poky/bitbake/lib/bblayers/layerindex.py",
line 250, in do_layerindex_fetch
    self.do_add_layer(localargs)
  File
"/local/build/project/build/poky/bitbake/lib/bblayers/action.py", line
44, in do_add_layer
    if not (args.force or notadded):
AttributeError: 'Namespace' object has no attribute 'force'

(Bitbake rev: 4325f7a7df67eaf4b51af03b453e84bf88fae408)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-10-07 23:20:41 +01:00
Chang Rebecca Swee Fun
576821ea0a bitbake: bitbake-layers: check layer dependencies before adding
In the original implementation, "bitbake-layers add-layers <layer>"
succeeded without error checking. This will further introduce
failures in recipe parsing only when "bitbake" command is executed.
Adding a meta layer without its dependency layer(s) should failed
and exit the process gracefully.

Added extra argument "-F" to force add a layer without checking
layer dependency.

[YOCTO #10913]

(Bitbake rev: 705ab252e631903e6d2e46202b419a9e8adcd861)

Signed-off-by: Phoong Stanley Cheong Kwan <stanley.cheong.kwan.phoong@intel.com>
Signed-off-by: Chang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-06-06 19:52:51 +01:00
Paul Eggleton
1485a5517a bitbake: bitbake-layers: fix layerindex-fetch for Python 3
The data we read from an HTTPConnection comes in the form of bytes, but
we need it as a string, so in Python 3 we need to decode it (missed in
the Python 3 migration).

(Bitbake rev: 7e6a3cd1472e1a1c8304b46611e1676914a68b59)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-22 11:35:22 +00:00
Matthew McClintock
a5a51304d1 bitbake: bitbake-layers: show-appends: add optional argument to limit package list
Add ability to limit output per package:

$ bitbake-layers show-appends m4
=== Matched appended recipes ===
m4_1.4.17.bb:
  /home/mattsm/git/openembedded-core/meta-selftest/recipes-test/m4/m4_1.4.17.bbappend

Useful for writing tools to process the output, and debugging
bbappends for specific packages

(Bitbake rev: 43668657a8a679acc957e26e6fd8f47ab4cb3da8)

Signed-off-by: Matthew McClintock <msm-oss@mcclintock.net>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-23 22:38:49 +00:00
Paul Eggleton
7d5c9860de bitbake: tinfoil: rewrite as a wrapper around the UI
Rewrite tinfoil as a wrapper around the UI, instead of the earlier
approach of starting up just enough of cooker to do what we want. This
has several advantages:

* It now works when bitbake is memory-resident instead of failing with
  "ERROR: Only one copy of bitbake should be run against a build
  directory".

* We can now connect an actual UI, thus you get things like the recipe
  parsing / cache loading progress bar and parse error handling for free

* We can now handle events generated by the server if we wish to do so

* We can potentially extend this to do more stuff, e.g. actually running
  build operations - this needs to be made more practical before we can
  use it though (since you effectively have to become the UI yourself
  for this at the moment.)

The downside is that tinfoil no longer has direct access to cooker, the
global datastore, or the cache. To mitigate this I have extended
data_smart to provide remote access capability for the datastore, and
created "fake" cooker and cooker.recipecache / cooker.collection adapter
objects in order to avoid breaking too many tinfoil-using scripts that
might be out there (we've never officially documented tinfoil or
BitBake's internal code, but we can still make accommodations where
practical). I've at least gone far enough to support all of the
utilities that use tinfoil in OE-Core with some changes, but I know
there are scripts such as Chris Larson's "bb" out there that do make
other calls into BitBake code that I'm not currently providing access to
through the adapters.

Part of the fix for [YOCTO #5470].

(Bitbake rev: 3bbf8d611c859f74d563778115677a04f5c4ab43)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-14 12:25:07 +00:00
Joshua Lock
1fce7ecbbb bitbake: bitbake: remove True option to getVar calls
getVar() now defaults to expanding by default, thus remove the True
option from getVar() calls with a regex search and replace.

Search made with the following regex: getVar ?\(( ?[^,()]*), True\)

(Bitbake rev: 3b45c479de8640f92dd1d9f147b02e1eecfaadc8)

Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-30 15:48:09 +00:00
Richard Purdie
218b81acb6 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>
2016-08-18 10:06:27 +01:00
Richard Purdie
97ce9126a6 bitbake: cache: Make virtualfn2realfn/realfn2virtual standalone functions
Needing to access these static methods through a class doesn't
make sense. Move these to become module level standalone functions.

(Bitbake rev: 6d06e93c6a2204af6d2cf747a4610bd0eeb9f202)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-18 10:06:26 +01:00
Paul Eggleton
0726b2d5cd bitbake: bitbake-layers: show-layers: disable parsing
We don't need to parse all recipes just to show the list of layers,
since that comes straight from the configuration, so save a bit of time
by not doing so. (A minor regression that came in with the the
bitbake-layers refactoring).

(Bitbake rev: a609ad7d560260a8d50dfa197cd960f496c5da73)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02 22:13:38 +01:00
Richard Purdie
0f2c59367a bitbake: bitbake: Convert to python 3
Various misc changes to convert bitbake to python3 which don't warrant
separation into separate commits.

(Bitbake rev: d0f904d407f57998419bd9c305ce53e5eaa36b24)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02 08:24:02 +01:00
Christopher Larson
6bbe4fe48c bitbake: bitbake-layers: convert to plugin-based
This uses bb.utils.load_plugins, based on the plugin handling in recipetool
and devtool in oe-core.

(Bitbake rev: 5e542df9b966a99b5a5b8aa7cf6100174aff54b2)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-17 21:16:35 +01:00