Commit Graph

47 Commits

Author SHA1 Message Date
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 a9223e20d1 bitbake: taskdata: Fix traceback issue with missing provider
If there is a missing provider and we're using "-k" mode alongside "-w",
we could get a traceback since there was no provider. Add tests to avoid this.

(Bitbake rev: 90a4805e4e770a433b4394ea99792731e9a4b546)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-15 16:48:12 +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
Robert Yang 05c17750c3 bitbake: taskdata.py: add RuntimeProviders to close matches
This is useful for newbie, for example:
$ bitbake rpm-build
ERROR: Nothing PROVIDES 'rpm-build'. Close matches:
  pm-utils
  rpm RPROVIDES rpm-build

[YOCTO #8881]

(Bitbake rev: 4b59eb8cc2321fe72f2988b6c9c0fecd4883255b)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-22 12:45:44 +00:00
Ed Bartosh 7e380d460c bitbake: taskdata: refactor get_providermap
Added optional parameter 'prefix' to filter out names that
don't start with specified prefix. Changed existing call
of get_providermap according to changed API.

Optimized the code: got rid of extra loop and temporary
list variable virts.

(Bitbake rev: df5a1392d6f91ccb44a99721c7d847da242121bb)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-11 23:26:32 +00:00
Richard Purdie 0b96e6f1b5 bitbake: taskdata: Add a function to return the virtual/ mapping data
When building an execution task graph, bitbake does resolve virtual/xxx
namespaces into specific providers. This data isn't exported anywhere
however.

This adds a function so that runqueue can at least retrieve this data
which can then be used by the system.

(Bitbake rev: ce51a51482d0900060512b24503714a730d72266)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-01 07:43:38 +01:00
Paul Eggleton 715d857174 bitbake: Fix default function parameter assignment to a list
With python you should not assign a list as the default value of a
function parameter - because a list is mutable, the result will be that
the first time a value is passed it will actually modify the default.
Reference:

http://docs.python-guide.org/en/latest/writing/gotchas/#mutable-default-arguments

(Bitbake rev: 7859f7388f2e3f675d0e1527cfde18625f36f637)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-19 18:05:44 +01:00
Richard Purdie 61fbff2cd4 bitbake: cooker/taskdata: Make NoProvider errors non-fatal to -e/-g options
If you have a situation where you are getting a "Nothing PROVIDES" error
(for example when something you request to build DEPENDS on something
that has been skipped or doesn't exist) it would be useful to be able to
use bitbake -g or bitbake -e to debug it, but currently both of those
are blocked by the error.

This patch adds an "allowincomplete" option to taskdata and uses this
for the -e/-g bitbake options. The NoProvider errors are still
printed and bitbake does return an error exist code but the environment
and task graph files are generated.

[YOCTO #7623]

(Bitbake rev: 2ca36a9f088438a8d1db44119c704f9480b04298)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-12 22:50:41 +01: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
Paul Eggleton 840a427ed2 bitbake: taskdata: report close matches with NoProvider errors
Assuming there is no known reason why an item is not provided, show
close matches on the assumption that it might have been a typo or
other mistake.

(Bitbake rev: ed81b0856b4a3892b53d39871eaaa6273390ea75)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-16 11:21:02 +01:00
Richard Purdie c5ce2878b3 bitbake: taskdata: Don't add dependencies on tasks that don't exist
"bitbake meta-toolchain" with qemu image testing enabled causes problems
since it adds a task after do_rootfs which doesn't exist in this case.

We should simply ignore these extra dependencies rather than adding
them in which is what this patch does (adding a debug message when this
happens).

(Bitbake rev: 843d3d6b0a7eb2e2f7b50c555767f5385df16ede)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-08-30 17:44:07 -07: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 edfb2ba32c bitbake: taskdata: Add gettask_id_fromfnid helper function
This is like gettask_id but doesn't require translation of fnid -> fn
first which the function then translates back. This gives a sizeable
performance improvement since a significant number of lookups are avoided.

(Bitbake rev: 3190cb83e2af195a464f669c5aa8aedbf795160e)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-06-28 16:32:57 +01:00
Richard Purdie 15a31a93ba bitbake: taskdata.py: Add support for rdepends task flag
Currently its not possible to add arbitrary RDEPENDS to a specific task.
This can be useful and this patch adds functionality equivalent to the
'depends' task flag.

(Bitbake rev: db65080a6199baecc5c422294a4c4a9fd12dc29e)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-06-25 14:57:16 +01:00
Christopher Larson 2a09a93cba taskdata: fix string formatting of an error message
(Bitbake rev: 224db31c46f5e91ced0e509c5fc564baaffa7b27)

Signed-off-by: Christopher Larson <kergoth@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-20 22:22:21 +01:00
Richard Purdie a21ff559e7 Fixup remaining bb.msg.domain users
(Bitbake rev: d5abdacaf9ac604ef8d8c1bafb9b30617827cb4f)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-08-15 17:31:52 +01:00
Paul Eggleton 965fbe483b bitbake/taskdata: fix incorrect usage of rdependees instead of dependees
This looked like a copy-paste error - the code around is dealing with
depends and not rdepends.

(Bitbake rev: bb688635c2050da3cbbaa5aa5b00e882887695de)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-27 16:54:04 +01:00
Paul Eggleton daed107ce1 bitbake: show more information for NoProvider errors
"Nothing PROVIDES" errors often come up when a recipe has been skipped
for some reason, and therefore it is useful to print out that reason
information when showing the error so that the user understands why the
error has occurred.

Given that we already feed the reason information into the skiplist for
various situations (COMMERCIAL_LICENSE, COMPATIBLE_MACHINE etc.) this
should now output a useful error message for skipped recipes.

Fixes [YOCTO #846], [YOCTO #1127]

(Bitbake rev: 6765218430e31c165888f26fbc75023c89a6eab2)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-27 16:54:04 +01:00
Chris Larson 72c6953488 cooker: use re match, not search in re_match_strings
We want to match the requested pattern at the beginning of the string,
otherwise things behave in an unintuitive manner wrt ASSUME_PROVIDED (e.g.
ASSUME_PROVIDED += "gtk+" will also assume foo-gtk+ is provided), and the user
can always use '.*gtk+' to get the old behavior.

(Bitbake rev: 5670134ab2eb573d39df3c3231677cdb1a1dfc72)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:47 +00:00
Chris Larson 431160caf1 taskdata: use 'any' in re_match_strings
(Bitbake rev: e48e9a2150ee76aaf151f6d5bc9e86e6ae4de514)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:47 +00:00
Bob Foerster c6328564de Prefer xrange over range for small performance gain.
range() allocates an actual list when called.  xrange() is just an iterator
and creates the next range item on demand.  This provides a slight
performance increase.

In python 3, range will do what xrange does currently, but the upgrade will
be handled by the 2to3 tool.

(Bitbake rev: 73b40f06444cb877a5960b2aa66abf7dacbd88f0)

Signed-off-by: Bob Foerster <robert@erafx.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:42 +00:00
Chris Larson 9c7c18d06f Pre-explode rundeps/runrecs in CacheData
(Bitbake rev: 0c8e0f3191252ccedb83c431c48e5c7d905e2717)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:40 +00:00
Chris Larson 9c2bcae35e Fix providerlog NameError
(Bitbake rev: 992e460f24d4da707c76d6e6d74d3684c9646279)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:34 +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 7e53a3b5cf Move the output of no provider and multiple provider messages into the UI
(Bitbake rev: 36b980c16bf74b3c2066cc120f9f27e11f189a63)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02 15:41:35 +01:00
Chris Larson 1180bab54e Apply some 2to3 transforms that don't cause issues in 2.6
(Bitbake rev: d39ab776e7ceaefc8361150151cf0892dcb70d9c)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02 15:41:33 +01: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
Chris Larson 6028daedcb Fix 7 references to undefined variables, as spotted by pyflakes
(Bitbake rev: e1e4ccf203e38070eeafd31a622671996cff61a1)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-25 17:25:56 +00:00
Bernhard Reutner-Fischer e39d89e934 bitbake: taskdata.py: fix typo in debug message
(Bitbake rev: 457fb59f10ed59269b8bda3ee53bbeded5d33eb5)

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:07 +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 9f5e04a04b taskdata.py: Improve error message if a task dependency has an incorrect format
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-12-18 11:41:44 +00:00
Richard Purdie 483f85802a bitbake: Sync various functions with those from bitbake-dev and bitbake upstream
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:21 +00:00
Richard Purdie ffdec425bf bitbake/bitbake-dev: Sync with upstream 2008-12-06 13:16:13 +00:00
Richard Purdie b296ae263c bitbake: Add tryaltconfigs option to disable the alternative configuration attempts and make the 'continue' more aggresive 2008-10-28 22:15:06 +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 853280f161 bitbake: Update with changes from bitbake 1.8 branch
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@4006 311d38ba-8fff-0310-9ca6-ca027cbcb966
2008-03-14 11:44:34 +00:00
Richard Purdie ab191d21e2 bitbake: Update to bitbake 1.8 branch head
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@3892 311d38ba-8fff-0310-9ca6-ca027cbcb966
2008-03-03 22:01:45 +00:00
Richard Purdie 079e6825aa bitbake: sync with upstream stable branch bugfixes and enhancements
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@3554 311d38ba-8fff-0310-9ca6-ca027cbcb966
2008-01-20 12:09:31 +00:00
Richard Purdie c9be325eb9 bitbake: Sync with upstream
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@3040 311d38ba-8fff-0310-9ca6-ca027cbcb966
2007-10-30 11:46:19 +00:00
Richard Purdie beb3a1be52 bitbake: Fix taskdata whitespace splitting issues
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@2871 311d38ba-8fff-0310-9ca6-ca027cbcb966
2007-10-12 07:51:50 +00:00
Richard Purdie d8bfa5c6ef bitbake: Sync with 1.8.8 release
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@2513 311d38ba-8fff-0310-9ca6-ca027cbcb966
2007-08-20 07:48:43 +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 0f5900dabe bitbake/taskdata: Exit from the providers loop when the first match is found, fixing spurious output and warnings
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@1948 311d38ba-8fff-0310-9ca6-ca027cbcb966
2007-06-14 16:38:18 +00:00
Richard Purdie d05bcee7f2 bitbake: Merge bugfixes from bitbake-1.8 svn
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@1759 311d38ba-8fff-0310-9ca6-ca027cbcb966
2007-05-22 11:50:37 +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