aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bb/taskdata.py
AgeCommit message (Collapse)Author
2021-02-10logging: Make bitbake logger compatible with python loggerJoshua Watt
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()] Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-06-25taskdata: Improve handling of regex in ASSUME_PROVIDEDRichard Purdie
ASSUME_PROVIDED can take regexs however the current way of handling this in code is suboptimal. It means that you can add something like: DEPENDS += "texinfo-nativejunk-that-does-not-exist" and if texinfo-native is in ASSUME_PROVIDED, no error will occur. Update the code to only treat something as a regex if a start or end anchor character is present (which wouldn't be valid in a recipe name). [YOCTO #13893] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-01-19lib: amend code to use proper singleton comparisons where possibleFrazer Clews
amend the code to handle singleton comparisons properly so it only checks if they only refer to the same object or not, and not bother comparing the values. Signed-off-by: Frazer Clews <frazer.clews@codethink.co.uk> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-06-27bitbake: lib: Cleanup /usr/bin/env pythonRobert Yang
Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-06-10multiconfig: Switch from 'multiconfig' -> 'mc'Richard Purdie
After real world use its clear the "multiconfig:" prefix to multiconfig tasks, whilst clear, is also clumbersome. Switch to use the short version instead. mcdepends will continue to work with "multiconfig:" for now as well. The commandline will only accept mc: going forward. [YOCTO #11168] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-05-04bitbake: Strip old editor directives from file headersRichard Purdie
There are much better ways to handle this and most editors shouldn't need this in modern times, drop the noise from the files. Its not consitently applied anyway. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-05-04bitbake: Drop duplicate license boilerplace textRichard Purdie
With the introduction of SPDX-License-Identifier headers, we don't need a ton of header boilerplate in every file. Simplify the files and rely on the top level for the full licence text. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-05-04bitbake: Add initial pass of SPDX license headers to source codeRichard Purdie
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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-08-01bitbake: Add support for multiconfig dependenciesAlejandro Enedino Hernandez Samaniego
This patch adds the capability for tasks from different multiconfigs to depend on one another. These dependencies can be enabled using the following format: task[mcdepends] = "multiconfig:FROM-MC:TO-MC:PN:task-to-depend-on" For the sake of simplicity consider the following example: Assuming we have set up multiconfig builds, one for qemux86 and one for qemuarm, named x86 and arm respectively. Adding the following line to an image recipe (core-image-sato): do_image[mcdepends] = "multiconfig:x86:arm:core-image-minimal:do_rootfs" Would state that core-image-sato:do_image from x86 will depend on core-image-minimal:do_rootfs from arm so it can be executed. This patch makes modifications to: - cooker: To glue both multiconfigs in one place and make sure the dependencies can be provided. - taskdata: To parse and add a new kind of dependency (mcdepends) to the taskdata object. - runqueue: To differentiate tasks from different multiconfigs, add the specified dependencies to the corresponding tasks, and create a working runqueue that contains tasks from both multiconfigs. - siggen: To avoid looking for tasks from different multiconfigs on objects where they dont belong. The taskdata objects are still not aware of the concept of multiconfig, so each object doesnt know which multiconfig its building, hence why the mcdepends are added to all taskdata objects equally (we really dont expect many of these), but the actual dependencies are added only to the required tasks by the runqueue. Signed-off-by: Alejandro Enedino Hernandez Samaniego <alejandr@xilinx.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-31cookerdata/taskdata/runqueue: Drop remaining tryaltconfigs code and ↵Richard Purdie
commandline option I can't actually see how this was working, nothing connected the commandline option to the data in TaskData(). Drop the remaining pieces of this option, it was a relic from a decade ago and we want deterministic builds, not random tries until something might work. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-21taskdata.py: include more information in error message about broken task dependsPatrick Ohly
This is what was reported when variable expansion in the 'depends' varflag of a task was broken: ERROR: Error for .../refkit-image-common.bb, dependency ${@ does not contain exactly one ':' character. Task 'depends' should be specified in the form 'packagename:task' It's not clear which task had this broken 'depends' and while one can guess that variable expansion failed, the full expression isn't printed either. This is more useful: ERROR: Error for .../refkit-image-common.bb:do_stage_swupd_inputs[depends], dependency ${@ in ' virtual/fakeroot-native:do_populate_sysroot ${@ ' '.join(['bundle-refkit-image-common-%s:do_swupd_list_bundle' % x for x in '${SWUPD_BUNDLES}'.split()]) } ' does not contain exactly one ':' character. Task 'depends' should be specified in the form 'packagename:task' The 'depends' part gets repeated intentionally, to ensure that it doesn't get overlooked. Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-23taskdata.py: improve handling of depends/rdependsPatrick Ohly
Error handling only caught the cause where a dependency did not have any colon, but ignored the case where more than one was given. Now "pn:task:garbage" will raise an error instead of ignoring ":garbage". The error message had a misplaced line break (?) with the full stop on the next line. Indenting the explanation with a space might have been intended and is kept. split() was called three times instead of just once. Instead of improving the two instances of the code (one for 'depends', one for 'rdepends'), the common code is now in a helper function. Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-14taskdata/runqueue: Rewrite without use of ID indirectionRichard Purdie
I'm not sure what possesed me when I wrote this code originally but its indirection of everyting to use numeric IDs and position dependent lists is horrific. Given the way python internals work, its completely and utterly pointless from performance perspective. It also makes the code hard to understand and debug since any numeric ID has to be translated into something human readable. The hard part is that the IDs are infectous and spread from taskdata into runqueue and even partly into cooker for the dependency graph processing. The only real way to deal with this is to convert everything to use a more sane data structure. This patch: * Uses "<fn>:<taskname>" as the ID for tasks rather than a number * Changes to dict() based structures rather than position dependent lists * Drops the build name, runtime name and filename ID indexes On the most part there shouldn't be user visible changes. Sadly we did leak datastructures to the setscene verify function which has to be rewritten. To handle this, the variable name used to specifiy the version changes from BB_SETSCENE_VERIFY_FUNCTION to BB_SETSCENE_VERIFY_FUNCTION2 allowing multiple versions of bitbake to work with suitably written metadata. Anyone with custom schedulers may also need to change them. I believe the benefits in code readability and easier debugging far outweigh those issues though. It also means we have a saner codebase to add multiconfig support on top of. During development, I did have some of the original code coexisting with the new data stores to allow comparision of the data and check it was working correcty, particuarly for taskdata. I have also compared task-depends.dot files before and after the change. There should be no functionality changes in this patch, its purely a data structure change and that is visible in the patch. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-01bitbake: Convert to python 3Richard Purdie
Various misc changes to convert bitbake to python3 which don't warrant separation into separate commits. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-15taskdata: Fix traceback issue with missing providerRichard Purdie
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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-22taskdata: add the ability to access world targets listPaul Eggleton
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]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-22taskdata.py: add RuntimeProviders to close matchesRobert Yang
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] Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-08taskdata: refactor get_providermapEd Bartosh
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. 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>
2015-09-30taskdata: Add a function to return the virtual/ mapping dataRichard Purdie
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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-17Fix default function parameter assignment to a listPaul Eggleton
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 Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-12cooker/taskdata: Make NoProvider errors non-fatal to -e/-g optionsRichard Purdie
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] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-09providers/runqueue/taskdata: Optimise logger.debug callsRichard Purdie
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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-16taskdata: report close matches with NoProvider errorsPaul Eggleton
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. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-08-30taskdata: Don't add dependencies on tasks that don't existRichard Purdie
"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). Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-11bitbake: Abort build if runtime dependency conflictWenzong Fan
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] Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-06-28taskdata: Add gettask_id_fromfnid helper functionRichard Purdie
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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-06-25taskdata.py: Add support for rdepends task flagRichard Purdie
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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-14taskdata: fix string formatting of an error messageChristopher Larson
Signed-off-by: Christopher Larson <kergoth@gmail.com>
2011-08-15Fixup remaining bb.msg.domain usersRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-27bitbake/taskdata: fix incorrect usage of rdependees instead of dependeesPaul Eggleton
This looked like a copy-paste error - the code around is dealing with depends and not rdepends. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-27bitbake: show more information for NoProvider errorsPaul Eggleton
"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] Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2010-12-08cooker: use re match, not search in re_match_stringsChris Larson
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. Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-12-08taskdata: use 'any' in re_match_stringsChris Larson
Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-11-21Prefer xrange over range for small performance gain.Bob Foerster
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. Signed-off-by: Bob Foerster <robert@erafx.com>
2010-11-18Pre-explode rundeps/runrecs in CacheDataChris Larson
Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-09-07Fix providerlog NameErrorChris Larson
Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-09-03Switch bitbake internals to use logging directly rather than bb.msgChris Larson
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 Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-06-08Move the output of no provider and multiple provider messages into the UIChris Larson
Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-04-11Apply some 2to3 transforms that don't cause issues in 2.6Chris Larson
Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-04-09Formatting cleanupsChris Larson
Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-03-24Fix 7 references to undefined variables, as spotted by pyflakesChris Larson
Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-02-10taskdata.py: fix typo in debug messageBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2010-01-19taskdata: Improve error message if incorrectly formatted tasks are found ↵Richard Purdie
(from poky) Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-19event.py: Pass the datastore to the fire command, don't build it into eventsRichard Purdie
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-12-24Enable --ignore-deps options to access regular expression stringGuo Hongruan
1. Add a function named re_match_strings(target,strings), to match target using the string in strings which can be regular expression
2009-07-21taskdata: fix a possible infinite loop when multiple eligible providers ↵Chris Larson
aren't buildable The code which removes providers which aren't buildable from the eligible list modifies the list while iterating it, resulting in skipping some entries. If the list contained two failed providers in sequence, it left the second behind in the eligible list. Fixed by replacing the block with a list comprehension that constructs a new eligible list without the failed entries. Signed-off-by: Chris Larson <clarson@mvista.com>
2009-05-11[bb] Remove unused imports reported by pyflakesHolger Hans Peter Freyther
2008-12-06Add tryaltconfigs option to control whether bitbake trys using alternative ↵Richard Purdie
providers to fulfil failed dependencies. It defaults to off, changing the default since this behaviour confuses many users and isn't often useful (from Poky).
2008-10-27taskdata: improved error message when BitBake is called with not existing targetMarcin Juszkiewicz
2008-05-09runqueue/taskdata.py: Make sure recrdeps tasks include all inter-task ↵Richard Purdie
dependencies of a given fn