Commit Graph

45 Commits

Author SHA1 Message Date
Richard Purdie 518b1f3de5 bitbake: providers: Fix determinism issue
We saw builds where runtime providers were sometimes changing order and the
build result was therefore non-deterministic. For example it could show:

DEBUG: providers for lib32-initd-functions are: ['lib32-lsbinitscripts', 'lib32-initscripts']
or
DEBUG: providers for lib32-initd-functions are: ['lib32-initscripts', 'lib32-lsbinitscripts']

which could cause a test to pass or fail.

This change ensures we don't rely on the random order of dictonaries in
memory and act deterministically.

(Bitbake rev: eddab52a4e7c49bfcdc2c26004d0bc777a1e5c25)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-09 06:12:09 -08:00
Richard Purdie f0d5eb39c3 bitbake: lib: Drop now unneeded update_data calls
Now that the datastore works dynamically we don't need the update_data calls
so we can just remove them. They're not actually done anything at all for
a while.

(Bitbake rev: 2300beb50333bb620013b058a7309e7f2042101d)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-15 20:08:15 -08: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 88df0e4d5d bitbake: cooker/providers: Only add target to world build if task exists
A "bitbake world -c unpack" currently breaks as not all tasks have an
unpack task. This change allows addition of world targets only if the
specified task exists which makes certain commands possible when otherwise
you just get errors which can't easily be avoided.

(Bitbake rev: ca4f5e6d01b5c8cf315f59bc86194d63c0d3d042)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-22 11:18:11 +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
Richard Purdie 9f374c4e85 bitbake: providers: Add PREFERRED_RPROVIDER support
Sometimes you can end up in a situation where you need to specify that
a specific runtime entity should be provided by a specific entry.

An example of this is bluez where you could end up in a situation where
for example:

NOTE: multiple providers are available for runtime libasound-module-bluez (bluez4, bluez5)
NOTE: consider defining a PREFERRED_PROVIDER entry to match libasound-module-bluez
NOTE: multiple providers are available for runtime bluez-hcidump (bluez-hcidump, bluez5)
NOTE: consider defining a PREFERRED_PROVIDER entry to match bluez-hcidump

The only option here is to set something like PREFERRED_PROVIDER_bluez4 = "bluez4"
which is clearly not very informative.

I've actually held off adding RPROVIDER support for a long while as this
does have sigificant potential for misuse. It doesn't for example allow
multiple runtime providers of the same name to coexist, that simply isn't
supported. It therefore doesn't replace some of the name mappings such
as busybox verses coreutils that OE-Core faces as that is a different
problem with different constraints. This mechanism is simply to provide
bitbake with a hint to decide what the dependency tree should look like.

Also, this allows us to stop printing a confusing message telling the user
to set PREFERRED_PROVIDER when the setting needed would be rather ambiguous.

[YOCTO #5044]

(Bitbake rev: 62eb39d1474d024b204634689071700605c6095c)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-15 06:59:44 +01:00
Richard Purdie 4b8b1105a5 bitbake: providers: We don't depend on previous build results
Back in history the code did depend on previous build results. This was
bad for determinism and we no longer do that. Update comments to match
the current behaviour.

(Bitbake rev: c3fa7e561c22786d3ac57d04c367aa50f1b3b820)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-15 06:59:44 +01:00
Richard Purdie 030d920e2d bitbake: providers: Fix PREFERRED_VERSION lookup for '_' in PN
PN can contain '_', e.g. gcc-cross-x86_64 and an override cannot
hence we do this manually rather than use OVERRIDES.

(Bitbake rev: 7a6baf02617d1edced4eaff235e73d746e2a3b68)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-28 11:34:38 +00:00
Paul Eggleton 76a281c870 bitbake: taskdata: add the ability to access world targets list
In certain circumstances it can be useful to get access to the world
targets list from a recipe in order to add dependencies on some or all
of the items in it. If a special function, 'calculate_extra_depends' is
defined in the recipe, and the recipe is to be built, then call it at
the right point before we calculate which tasks should be run. The
function can append items to the "deps" list in order to add
dependencies. This is not as tidy a solution as I would have liked, but
it does at least do the job.

As part of this change, the buildWorldTargets function was moved to
bb.providers to make it possible to call from taskdata.

Part of the implementation of [YOCTO #8600].

(Bitbake rev: aba0dce57c889495ec5c13919991a060aeff65d2)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-22 12:45:44 +00:00
Richard Purdie aadfea6be6 bitbake: providers/runqueue/taskdata: Optimise logger.debug calls
A run of "bitbake bash -c unpack" when the task has already been
completed resulted in about 9000 calls to logger.debug(). With this
patch which comments out some noisy/less usefull logging and moves
other logging calls outside loops, this number is reduced to 1000
calls. This results in cleaner logs and gives a small but
measurable 0.15s speedup. The log size dropped from 900kb to 160kb.

(Bitbake rev: d2677f084fe1d8846db77d89ef5e6ffb18dc171a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-10 11:10:00 -07:00
Robert Yang 0583714a57 bitbake: providers.py: enhance the runtime debug degbug messgae
The runtime provider debug message is the same as the build time debug
message, make them different would be better.

[YOCTO #5067]

(Bitbake rev: 92b624cbc2711d3d859994099fb63918dfd0031a)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-09 16:28:46 +01:00
Robert Yang e605ecfd95 bitbake: providers.py: print a debug message for dynamic pacakge
We can't know the dynamic pacakge's name exactly, there might be a
problem, for example, when we use:

IMAGE_INSTALL_append += "ncurses-lib12344"

The ncurses-lib12344 matches ncurses' dynamic packages pattern:

PACKAGES_DYNAMIC = "^${PN}-lib.*"

so there is no errors before the rootfs creation though there is no
ncurses-lib12344.

We can warn this, but I think that we'd better not since there are many
dynamic packages, or there would be too many warnings, for example, the
perl and kernel modules, maybe we can print a debug message for it.

[YOCTO #4798]

(Bitbake rev: df372ca057f0c8c2152223b3e26ad9a30958bab6)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-07-29 15:25:08 +01:00
Richard Purdie c6c341a555 bitbake: providers: Remove pointless lambda sort function
This lambda function is equivalent to the default sort used by sorted,
so we can simply remove this. The syntax isn't compatible with python 3.

(Bitbake rev: da8550fc884596222daa3f8794dce1abd01e5612)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-09 22:28:04 +01:00
Richard Purdie 2f9328ff32 bitbake: providers.py: Fix PREFERRED_VERSION containing epochs
For some reason the code calls int() on the epoch component of any
PREFERRED_VERSION. Since this is compared against strings, the comparison
would always fail. This removes the stray cast and allows epochs
in preferred_version to work correctly.

[YOCTO #3187]

(Bitbake rev: 117b47553970fc5307374cbf500744b7c302efb4)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-10-03 13:33:26 +01:00
Wenzong Fan 6a210e88b7 bitbake: bitbake: Abort build if runtime dependency conflict
Currently if there are multiple preferred providers available for
a runtime dependency, bitbake will print an Error message and let
the build go on. Anyways the build should abort while any Errors
occured.

[YOCTO #2734]

(Bitbake rev: 5f81a714f4fca785780bef555b419f0250e5ec1c)

Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-11 15:55:25 +01:00
Richard Purdie ff73b02a72 meta/classes: Convert to use appendVar and appendVarFlags
(From OE-Core rev: 3b57de68e70e77dbc03c0616a83a29a2e99e40b4)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-05 10:36:53 -08:00
Paul Eggleton 526264e7d7 bitbake-layers: improve show-overlayed output
Make the following improvements to the show-overlayed subcommand:

* Show recipes that are overlayed when the version is higher or lower,
  not just when it is the same. This gives a much better picture of the
  influence each layer is having over the metadata used for building.
  This can be disabled with the -s option if you just want to see
  recipes with the same version as before.
* Default to showing name (PN), layer and version rather than the full
  path and filename. The old style formatting can be used by specifying
  the -f option.
* Mark skipped recipes as such in the output, and print them in the
  correct sorted place in the list rather than at the end
* Prefix/suffix title line with === so it can be filtered out easily in
  shell scripts if desired

(Bitbake rev: 43b473275d3cb2e60a14e4a52cdc4654b3f4e5e7)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-02-01 15:08:41 +00:00
Richard Purdie a5463088fe bitbake: Add BBHandledException exception class
We have a problem knowing when to show the user debug information and
when not to since the code has already shown the user suitable information
about why a failure is occurring.

This patch adds a bb.BBHandledException exception class which can be used
to identify those exceptions which don't need further explanation to
the user.

This patch uses this class for the bb.providers exceptions and ensures the
command handling code correctly filters the exceptions meaning that

"bitbake invalid"

now shows an simple error message and not a python traceback.

[YOCTO #1141 partial]

(Bitbake rev: eac9249b40ae1e3aa21e016010c862664e59a8d4)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-10 17:40:43 +00:00
Richard Purdie 4cd9671078 bitbake: Update users of getVar/setVar to use the data store functions directly
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-27 10:35:30 +00:00
Denys Dmytriyenko fce0b963b4 lib/bb/providers: make "checking PREFERRED_PROVIDER_%s" a debug message
In verbose mode there are hundreds of these "checking PREFERRED_PROVIDER_%s"
messages, cluttering the output and obscuring the more important resulting
"selecting %s to satisfy runtime %s due to %s" messages. Individual "checking"
lines are more suited for debug mode, similar to "sorted providers for %s
are: %s", hence convert logger.verbose() to logger.debug().

(Bitbake rev: 85dfbec26abb5b944758f5c4749b7df16c0fb2e6)

Signed-off-by: Denys Dmytriyenko <denys@ti.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-08-15 09:13:53 +01:00
Paul Eggleton 5d3538554b bitbake/providers: list PREFERRED_VERSION candidates when unavailable
If the specified PREFERRED_VERSION is not available then list the
available versions in the output. (PR is omitted.)

(Bitbake rev: eea5ff9f34bb9b2e29f5fa43deb80d4aa6ef7ddc)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-27 16:54:05 +01:00
Richard Purdie dc65caa889 providers.py: Correct PREFERRED_VERSION handling
Overrides on the right are the highest priority and in this case, pn-PN
and PN should take priority over any other override so fix the code to
do this.

Also, since overrides will have been processed by bitbake, we shouldn't
then be specifically looking up PREFERRED_VERSION_${PN} but just using
PREFERRED_VERSION.

This patch corrects the behaviours to match what the code is expected
to do.

(Bitbake rev: 606f1acc6fb8ccec45d6a52ed6ae6dc128011402)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-06-01 14:08:25 +01:00
Richard Purdie d4f537965b bitbake/providers.py: Fix runtime providers problems
Take a real world testcase where you have two recipes, each of which
contains PACKAGES_DYNAMIC = "gdk-pixbuf-loaders-*" and recipes which
RDEPEND on some gdk-pixbuf-loaders-xxx package. To select between these
you need to set a PREFERRED_PROVIDER.

These are specified in the PN namespace so the locgical conclusion is
that setting PREFERRED_PROVIDER_gdk-pixbuf = "gtk+" should work. It
doesn't and instead checks crazy things.

The code was correctly finding the two possible providers, gtk+ and
gdk-pixbuf. It was however only accepting PREFERRED_PROVIDER_gtk+
= "gdk-pixbuf" to resolve this problem which reads as the exact
opposite to what was wanted.

This patch changes the code to do something that makes sense. I suspect
that before these changes it was pretty much a null operation rubber
stamping the single provider case. For Poky at least it exposes a few
cases where -nativesdk recipes were providing the same things as their
normal counterparts but these are genuine bugs in the metadata.

I've also attempted to make the multiple provider error message human
readable as I counldn't understand it and I doubt anyone else could
either.

Signed-off-by: Richard  Purdie <richard.purdie@linuxfoundation.org>
2011-01-20 22:44:33 +00:00
Chris Larson ecc68fa4fb Switch bitbake internals to use logging directly rather than bb.msg
We use a custom Logger subclass for our loggers

This logger provides:
- 'debug' method which accepts a debug level
- 'plain' method which bypasses log formatting
- 'verbose' method which is more detail than info, but less than debug

(Bitbake rev: 3b2c1fe5ca56daebb24073a9dd45723d3efd2a8d)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:33 +00:00
Chris Larson 7acc132cac Formatting cleanups
(Bitbake rev: 2caf134b43a44dad30af4fbe33033b3c58deee57)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02 15:41:32 +01:00
Richard Purdie 8a02043265 bitbake: providers.py: Fix typo
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-01 22:24:26 +01:00
Richard Purdie 70141cbcc8 bitbake/providers: Fix merge error
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-22 15:09:07 +00:00
Chris Larson ada2a8494a Avoid unnecessary calls to keys() when iterating over dictionaries.
dict objects provide an __iter__ method for the iteration which gives you the
keys, so calling keys directly is unnecessary, and isn't really a best
practice.  The only time you really need to call the keys is if there's a
danger of the dict changing out from underneith you, either due to external
forces or due to modification of the iterable in the loop.  Iterations over
os.environ are apparently subject to such changes, so they must continue to
use keys().

As an aside, also switches a couple spots to using sorted() rather than
creating a temporary list with keys() and sorting that.

(Bitbake rev: 5b6ccb16c6e71e23dac6920cd2df994d67c2587b)

Signed-off-by: Chris Larson <clarson@mvista.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-22 15:01:59 +00:00
Richard Purdie b694d3c3f9 bitbake: Revert "providers.py: sort eligible providers by DEFAULT_PREFERENCE"
This breaks preferred providers functionality

This reverts commit ee9afccf33b220a21b74fab279925eeb4771249b.

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-16 15:40:12 +00:00
Bernhard Reutner-Fischer e9d8dd2abf bitbake: providers.py: sort eligible providers by DEFAULT_PREFERENCE
(Bitbake rev: ee9afccf33b220a21b74fab279925eeb4771249b)

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-02-15 17:03:50 +00:00
Richard Purdie 22c29d8651 bitbake: Switch to bitbake-dev version (bitbake master upstream)
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-20 18:46:02 +00:00
Richard Purdie cf91cfaaa2 bitbake: Apply modified version of a patch from Martin Jansa <martin.jansa@gmail.com> to allow wildcards at the end of PREFERRED_VERSION strings
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-12 20:31:18 +00:00
Richard Purdie 699ad056d9 bitbake: Make sure regexp patterns are consistent in providers.py
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-07-23 16:20:02 +01:00
Richard Purdie d02379d2df bitbake: Add a cache around PACKAGES_DYNAMIC regexps to help performance a bit
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-07-23 15:59:17 +01:00
Richard Purdie 4d2a3b6a3d bitbake providers.py: Fix message typo and improve debug info
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@5416 311d38ba-8fff-0310-9ca6-ca027cbcb966
2008-10-06 08:19:42 +00:00
Richard Purdie d85997f858 bitbake providers.py: Sync with upstream
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@5125 311d38ba-8fff-0310-9ca6-ca027cbcb966
2008-09-03 11:21:49 +00:00
Richard Purdie e14d7dcbee bitbake: Sync with 1.8 branch
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@4463 311d38ba-8fff-0310-9ca6-ca027cbcb966
2008-05-13 07:53:18 +00:00
Richard Purdie d6addd4969 bitbake: Sync with 1.8 branch upstream for PREFERRED_PROVIDERS message improvements and BB_STAMP_WHITELIST functionality
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@4411 311d38ba-8fff-0310-9ca6-ca027cbcb966
2008-05-04 23:22:24 +00:00
Richard Purdie c033c91c6b bitbake: providers.py: Fix perferred_version variable handling
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@2947 311d38ba-8fff-0310-9ca6-ca027cbcb966
2007-10-21 22:35:46 +00:00
Richard Purdie e223238b1b bitbake: Update to latest bitbake-1.8 branch
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@2651 311d38ba-8fff-0310-9ca6-ca027cbcb966
2007-09-02 14:10:08 +00:00
Richard Purdie 7530674214 bitbake: Sync with upstream 1.8 branch
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@2497 311d38ba-8fff-0310-9ca6-ca027cbcb966
2007-08-15 08:39:19 +00:00
Richard Purdie 029f45e080 providers.py: Also add pn-PN syntax to overrides when evalutating PREFERRED_VERSION
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@2416 311d38ba-8fff-0310-9ca6-ca027cbcb966
2007-08-08 22:28:17 +00:00
Richard Purdie 7371e6323c bitbake: Update to 1.8.1 (inc. various bug fixes, epoch support)
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@1419 311d38ba-8fff-0310-9ca6-ca027cbcb966
2007-04-01 15:04:49 +00:00
Richard Purdie f5665d5bfc bitbake: Sync with upstream.
* File licence headers were sanitised causing most of the diff. 
 * cooker.py was created from bin/bitbake. 
 * cvs fetcher port option was added
 * The -f force option was fixed to work correctly
 * Multiple entries in rrecrdeps are now handled correctly
   (allows adding do_deploy to image depends)
 


git-svn-id: https://svn.o-hand.com/repos/poky/trunk@1129 311d38ba-8fff-0310-9ca6-ca027cbcb966
2007-01-08 23:53:01 +00:00
Richard Purdie 306b7c7a97 bitbake: Upgrade from 1.4 -> 1.7.4ish
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@863 311d38ba-8fff-0310-9ca6-ca027cbcb966
2006-11-16 15:02:15 +00:00