summaryrefslogtreecommitdiffstats
path: root/lib
AgeCommit message (Collapse)Author
2014-06-11bb/utils: fix contains_any()Ross Burton
"set1 in set2" doesn't do what you'd expect, and if it did do a subset test that's not the logic required by contains_any(). Instead get the intersection of checkvalues and val and check if the resulting set is empty or not (by evaluating it in a boolean context), which tells us if there are any elements in common. Based on a patch by Valentin Popa <valentin.popa@intel.com>. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-06-11bb/tests/data.py: add tests for contains() and contains_any()Ross Burton
contains_any is buggy so write a test case to demonstrate this. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-06-11cache.py: print debug info when EXCLUDE_FROM_WORLDRobert Yang
This gives us an easy way to find out which recipes have been excluded from world when there are many layers. Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-06-11toaster: add Project class models to ormAlexandru DAMIAN
This patch adds the Project class models to the toaster GUI data model. There is no specified use, and the link in the Build class is optional. Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-06-06toasterui: fix django settings environment valueAlexandru DAMIAN
Previously, the buildinfohelper only set a django settings module environment variable if none were set. This may lead to problems when the starting the toasterui from an already existing Django environment. As such, we always override the variable to provide the correct name for the local Django settings module. Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-06-06toaster: add project related modelsAlexandru DAMIAN
We introduce the notion of a project in Toaster as the item that holds the specification for triggering a build: the set of layers used, the set of configuration variable values, and the set of targets to be build. Builds triggered through Toaster will be associated with a Project, and they will be configured based on the project settings at the moment when the build is ordered. Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-06-06toaster: update toaster to run in managed modeAlexandru DAMIAN
We disable bitbake self start to prevent race condition. ToasterUI will shutdown the server when the build is done if running in managed mode. We fix usage of kill server flag in the bitbake binary. Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-06-06toaster: read database settings from the environmentAlexandru DAMIAN
We add the capability to read the database settings for Toaster from the environment. The DATABASE_URL is intepreted and used to override the default settings. This capability is essential for easy deployment of Toaster in a managed hosted environment, and for creating build environments with custom database settings. Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-06-06uievent: retry on handler registration failureAlexandru DAMIAN
The registration of a remote UI event handler may fail if the server cooker is currently in some certain states. This may happen, for example, when a remote UI is started very fast after the bitbake server is started, and the server hadn't time to finish initial configuration parsing. Rather than fail outright, we have the remote UI event retry registration for five time at one-second intervals, in the hope it will succeed. Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-06-06xmlrpc: client - remove fatal errorsAlexandru DAMIAN
When we use the XMLRPC client API to connect to a bitbake server, we want to receive errors from the API instead of having the API exiting without warning. Thus the "bb.fatal" calls have been replaced with "bb.warn" calls, and we re-raise the original exception for handling by the original caller. The bitbake starting script has been modified to properly test for failures in calling the client API and handle them. Additional error handling added in the client, as to prevent fatal crashes. Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-06-06bitbake: move configuration reading codeAlexandru DAMIAN
The configuration reading code should live in the main bitbake entry point, and the server modules should be supplied with correct configuration instead of attempting to parse from configuration files. This patch moves the endpoint address reading from XMLRPC to the bitbake main script. Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-06-01siggen: Print warning about tainted tasksRichard Purdie
The big warning printed when people use -f is easily ignored/forgotten. To raise user awareness, print a warning any time we include a tainted stamp file into a build instead. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-05-31build/utils: Fix broken exception handlingRichard Purdie
Checking for explicit exception names is bad, we also want to be able top rely on inheritance. Fix these checks to be part of the real except clauses so SkipPackage is recognised as being inherited from SkipRecipe. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-05-31bb.fatal: Raise a BBHandledException instead of exitingRichard Purdie
With new bitbake UIs having the cooker exit at 'random' points in the codebase is problematic. This patch raises an exception which matches the situation instead. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-05-30event: Add SkipRecipe event to replace SkipPackageRichard Purdie
In the depths of time we were rather confused about naming. bb files are recipes, the event to skip parsing them should be SkipRecipe, not SkipPackage. This changes bitbake to use the better name but leaves the other around for now. We can therefore start removing references to it from the metadata. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-05-30event.py: Allow passthrough of BBHandledException eventsRichard Purdie
We need BBHandledException events to be passed through to the higher layers, they don't need addition of any traceback since they've already been reported to the user. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-05-30cookerdata: Improve error handlingRichard Purdie
If we see errors during parsing, firstly its bad to show a traceback for an expansion error so lets suppress this. Secondly, raise a BBHandledException instead of a SystemExit to show we've informed the user about the condition (printing a traceback in the default unknown case). Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-05-30event: Fix event handlers to raise SkipPackageRichard Purdie
If an event handler triggers a SkipPackage event, we really want that event to be received and processed by the higher code levels. Currently it was getting caught and ignored which was leading to recipes being present when they clearly shouldn't have been. In general this exception catching looks to be doing the wrong thing. It was introduced in http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/bitbake/lib/bb/event.py?id=37cb4cc02b2e2b6c338c5943747e0a1ef15176b3 but we likely want exceptions to pass through to the higher layers. This patch therefore removes that code. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-05-30utils: avoid printing traceback on ExpansionError during parsingPaul Eggleton
If an ExpansionError occurs during better_exec() we should just raise it instead of printing the traceback, so that recipe errors (such as broken URLs in SRC_URI) are more easily comprehensible. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-05-30fetch2: improve handling of two classes of URL parameter mistakesPaul Eggleton
Handle the following situations in a URL (e.g. in SRC_URI): * Trailing semicolon in a URL - this is now ignored. * Parameter specified with no value (no equals sign). This still produces an error, but at least it is MalformedUrl with a proper message rather than "ValueError: need more than 1 value to unpack". Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-05-28fetch2/hg: Fix missing proto param for hg checkout with user and pwVolker Vogelhuber
A fix for the former patch when checking out a repository with username and password using HG Signed-off-by: Volker Vogelhuber <v.vogelhuber@digitalendoscopy.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-05-21data_smart: Fix an unusual variable reference bugRichard Purdie
If you try: Y = "" Y_remove = "X" in OE-Core, bitbake will crash with a KeyError during expansion. The reason is that no expansion of the empty value is attempted but removal from is it and hence no varparse data is present for it in the expand_cache. If the value is empty, there is nothing to remove so the best fix is simply not to check for None but check it has any value. Also add a test for this error so it doesn't get reintroduced. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-05-21toaster: reduce redundant foreign key lookupsDavid Reyna
Replace redundant foreign key lookups with "with" to improve all recipes page load time. Do depends pre-lookup in the view class, and use python itertation instead of filter() all to achieve x16 processing speedup. [YOCTO #6137] Signed-off-by: David Reyna <David.Reyna@windriver.com> Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Conflicts: bitbake/lib/toaster/toastergui/views.py Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-05-21toaster: sort columns properly after edit columnsFarrell Wymore
If a sorted column is made invisible through the edit columns function, resort the table the its default order. [YOCTO 5919] Signed-off-by: Farrell Wymore <farrell.wymore@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-05-19fetch2/gitsm: Documentation improvements for gitsm:// fetcherChris Morgan
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-05-11fetch2/perforce: Ensure command has a defaultRichard Purdie
Ensure there is default command available if FETCHCMD_p4 isn't set. Also clean up the getVar references whilst here. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-05-11parse: Improve file inheritance loggingRichard Purdie
The file inheritance logging has been here since the dawn of time. It duplicates output many times over and logs to debug level 2. When running with the debug option, its understandable the user may want to see the paths of files included in the build. These changes remove pointless/duplicate output and print the include paths clearly at debug level one in a form which users should be able to more easily parse. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-05-11knotty: Fix output printed to the user at debug log levelsRichard Purdie
If a user runs with the -v or -D options, its understandable they'd expect to see log output from the workers yet right now a bug in the log handling does not show this. Fix the conditional to ensure such log output is shown on the terminal when it has been requested. Ideally this data should always flow to the logfiles but that is for another patch. This also fixes the code to do what was always intended in the comments, i.e. if the user specifies -D or -v, output is shown from the tasks, otherwise notes are suppressed. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-05-11parse/ast: Show append logging at lower log levelRichard Purdie
It was reported that bitbake -D made no mention of which append files it was using. bitbake -DD does but it makes sense to increase the log level of this piece of debug information. [YOCTO #6262] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-05-11fix cloning of mercurial repository with username and password specified in urlVolker Vogelhuber
Signed-off-by: Volker Vogelhuber <v.vogelhuber@digitalendoscopy.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-05-08toaster: modify SQL data type constraintsAlexandru DAMIAN
This patch modifies the data type constraints for the SQL fields. The original constraints have been based on guess worked, and they weren't strictly enforced for sqlite. On MySQL, the constraints are strictly enforced, and need to match the real data that we have. After measuring data on sample builds, the new constraints have been validated to work with MySQL, and this patch updates the database schema with the new field types / constraints. Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
2014-05-08toaster: fix migration code for MySQLAlexandru DAMIAN
This is a patch that fixes the 0004, 0005 migrations of the toaster model to get them to properly work with MySQL. These migrations had a conflict around Build.timespent field. The sqlite3 constraits were not enough to detect the conflict, and the migrations worked as expected. MySQL objected to adding the field twice, so I did regenerate the migrations with the correct model listing. The net effect is the same, so the migrations work the same, but now we can use these two migration on the MySQL and other more advanced SQL engines. Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
2014-05-08toaster: fix span2 headings for packagesDave Lerner
[YOCTO 6147] Fix bug in views.py that put 'span2' class id in a 'clclass' key instead of the 'dclass' key. This fix exposed another problem in target.html and the target view function that used 'package_size' instead of 'size' as the 'clclass' which is inconsistent with the model field name, causing table data columns to be shown when the header is hidden. Signed-off-by: Dave Lerner <dave.lerner@windriver.com>
2014-05-08toaster: Make sure layer branch only shows when not emptyBelen Barros Pena
In the recipe details and package details pages, the layer branch definition list elements should only show when the branch field in the database is populated. If the branch field is empty, we don't show them. The patch also removes all unnecessary data-toggle and data-original-title attributes. [YP #6152] Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
2014-05-08toaster: sort outcome and sstate columns by string valueDavid Reyna
Sort the 'outcome' and 'sstate_result' columns by their description string values and not their numerical values. [YOCTO #5921] Signed-off-by: David Reyna <David.Reyna@windriver.com>
2014-05-08Fix refetch of local files when they are read onlyNick Lewis
Signed-off-by: Nick Lewis <nick.lewis@usa.g4s.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-05-07data_smart: Ensure all possible overrides are cached including those with ↵Richard Purdie
'_' in the name Unfortunately we've been neglecting to pay the correct tributes to the cookie monster and hence the datastore is malfunctioning. Currently tributes are only paid on the last part of a variable after the last "_" character. We need to split by *all* "_" characters since an override may contain the character. This fixes the code so the correct number of tributes are made. Paradoxically parsing appears to be faster after this change. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-05-03prserv/db: Avoid fsync() callsRichard Purdie
If the power were to fail, it doesn't matter to us much if the data makes it to disk or not, we'd have other problems. However an fsync() call on a multi build autobuilder is painful so lets avoid them. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-05-03persist_data: Avoid fsync() callsRichard Purdie
If the power were to fail, it doesn't matter to us much if the data makes it to disk or not, we'd have other problems. However an fsync() call on a multi build autobuilder is painful so lets avoid them. This is particularly true in this case if a timeout causes a reconnect during a build. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-05-03codeparser: Fix to better catch all getVar referencesRichard Purdie
Currently if you do localdata.getVar, the code parser simply ignores the references. Change the code to use endswith() to catch more of the references. These names are probably unique enough to get away with this. Bump the cache version to ensure things get updated. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-05-01bitbake: Bump version to 1.23.1Richard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-04-29bb.utils, bb.codeparser: Add bb.utils.contains_anyOtavio Salvador
This includes contains_any in the special handling code for sstate. It does not take into account the equivalence of the values. In current code, considering 'bb.utils.contains_any("A", "foo bar", ...)': A = "foo" A = "bar" A = "foo bar" All those will get different signatures. Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-04-29codeparser: don't interact with the cache for subshellsChristopher Larson
Doing so was causing leakage between the execs of the main value and that of the subshell value, and was causing the cached subshell value to be used for the overall variable. At the least this could cause execs contamination between two variables that while differing, run the same subshell. Beyond that, it's possible we could have been using an incomplete cached value of a subshell for that of the main value. Before this, bb_codeparser.dat would change between parses with differing bbfile parse order. After, it does not change. The codeparser cache version is bumped, to ensure we don't use potentially incorrect cached values from previous runs. This should hopefully resolve the difficult-to-reproduce issues we've seen at Mentor Graphics where bitbake emits a script to run a task and misses dependent functions, resulting in 'command not found' failures. This issue has also been mentioned on the oe devel list, where someone hit a case where oe_runmake was missing from a do_install task (IIRC). Adding debug information showed that bitbake's information about the variable dependencies for this task is inaccurate in the failure cases. Signed-off-by: Christopher Larson <kergoth@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-04-29fetch2: Cleanup file checksum generation, v2Jacob Kroon
The initial version of this patch was reverted in 0a94e568152de550dedc8135a766beb18bf064ab However, it was later agreed upon that it was reverted due to a misunderstanding during code review; the patch is ok. This version of the patch also removes an unneeded initialization of the 'checksum' variable outside the scopes it is being used in. Signed-off-by: Jacob Kroon <jacob.kroon@mikrodidakt.se> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-04-29HG Fetch with username and password in urlVolker Vogelhuber
Following up a previous patch for mercurial fetcher, I just fixed a problem when calling update on a repository with subrepositories enabled. Attached a patch that fixes this problem >From caae519a2bd64bf7c729bb26aff344827def47fb Mon Sep 17 00:00:00 2001 From: Volker Vogelhuber <v.vogelhuber@digitalendoscopy.de> Date: Tue, 29 Apr 2014 15:29:47 +0200 Subject: [PATCH] - fixed authentication issues in case of using sub repositories Signed-off-by: Volker Vogelhuber <v.vogelhuber@digitalendoscopy.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-04-28Revert "fetch2: Cleanup file checksum generation"Richard Purdie
This reverts commit 6dfb33fd7204e09815bde7ba5bf21941a73fe965. It causes an unindeded change in behaviour.
2014-04-27fetch2: Cleanup file checksum generationJacob Kroon
Cleanup the fix done in f9416e76e272ba3249abff099f6f3a47fe82e03e. Instead of adding continue statements we can just move the last statements into the final else-clause. Signed-off-by: Jacob Kroon <jacob.kroon@mikrodidakt.se> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-04-27fetch2/git: Stop git from triggering fsync() callsRichard Purdie
We only ever clone other repositories, if there were a problem such as power failure, we'd blow away data and rebuild. As such we don't need fsync(). With filesystems like ext*, the fsync pushes nearly all the data out to disk which impacts all running processes. We therefore set a configuration parameter to disable the fsync() calls. Also fixup a case where basecmd wasn't being used for no good reason. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-04-21parse/ast: Optimise data finalisationRichard Purdie
The optimisation where only the data we're interested in was finalised was good but it turns out we can do better. In the case where a class-extension is to be targeted, we can skip the other targets. This change does that and speeds up parsing at the bitbake-worker execution time. Specifically, you can see an improvement in the speed of bitbake X -n. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-04-21runqueue: Do not write out stamp files in dry_run modeRichard Purdie
In dry run mode, stamps for noexec tasks are being written out which is incorrect. Avoid this. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>