summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2017-04-11bitbake-diffsigs: fix traceback with no argumentspaule/bb-sigstuff-fixPaul Eggleton
In the move over to argparse we've made the two signature file arguments optional and thus if -t is not in use we need to explicitly check if at least one signature file has been specified - and if not, show an error and the command-line help. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2017-04-07bitbake-diffsigs: colourise outputPaul Eggleton
If the output is a TTY, add colour to the output in order to make it easier to read. At the moment this is fairly basic, just add colour to the "titles" of each change and to the diff output. I tried to introduce this without changing the code too much - rather than moving everything over to the new python formatting style, I've introduced a color_format() function which takes care of the colour formatting, either accepting additional format arguments or alternatively leaving the caller to use the old-style formatting (%) to insert values. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-04-07lib/bb/siggen: show word-diff for single-line values containing spacesPaul Eggleton
If a variable value has changed and either the new or old value contains spaces, a word diff should be appropriate and may be a bit more readable. Import the "simplediff" module and use it to show a word diff (in the style of GNU wdiff and git diff --word-diff). Also use a similar style diff to show changes in the runtaskhashes list. I didn't use an actual word-diff here since it's a little different - we can be sure that the list is a list and not simply a free-format string. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-04-07lib/bb/siggen: add collapsed mode to compare_sigfiles()Paul Eggleton
If we just want to drill down to the actual differences then we don't need to see certain things in the output, e.g. basehash changing or the signature of dependent tasks. This will be used for comparing signatures within buildhistory-diff in OE-Core; the default mode as used by bitbake-diffsigs and bitbake -S printdiff remains unchanged for the moment. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-04-07bitbake-diffsigs: add an option to find and compare specific signaturesPaul Eggleton
With the -t option which recurses to find the ultimate cause of a signature change, it was hardcoded to take the last two executions of the specified task. On the other hand, if you have two specific task hashes (say from bitbake output, or some other tool) then you'll want to pick those, so provide an option to specify those as well. (Note, the new -s option needs to be specified alongside -t rather than instead of it.) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-04-07bitbake-diffsigs: change to use argparsePaul Eggleton
Argparse is a bit easier to deal with than optparse, and since we're about to add some options, migrate this script over. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-04-07lib/bb/siggen: don't show unchanged runtaskdeps listPaul Eggleton
If the runtaskdeps list hasn't actually changed (but the signatures of some of the tasks did) then it doesn't make sense to print out the old and new lists as they are both the same and may be very long, e.g. for do_rootfs in OE. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-04-07lib/bb/siggen: show a diff when dumping changes to multi-line valuesPaul Eggleton
When dumping changes to signatures e.g. output of bitbake -s printdiff, if for example a function has changed, it's much more readable to see a unified diff of the changes rather than just printing the old function followed by the new function, so use difflib to do that. Note: I elected to keep to one item in the returned list per change, rather than one line per line of output, so that the caller can still look at changes individually if needed. Thus I've added some handling to bitbake-diffsigs to split the change into lines so that each line is displayed indented. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-04-07bitbake-diffsigs: drop naive logic for removing duplicate filesPaul Eggleton
This logic doesn't work in practice, certainly not with current versions where sigdata files are preserved in the stamps directory and therefore there will often be multiple sigdata files - you can now easily get files for the same signature from sstate and the stamps directory with the result that bitbake-diffsigs reports nothing has changed. Instead, let's change the find_siginfo function in OE-Core to simply not return duplicates so we don't have to filter them out here. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-04-07bitbake-diffsigs: properly report which signature is missingPaul Eggleton
If just one of the two signatures we want to compare aren't available, report that one rather than misleadingly claiming both are missing. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-04-07lib/bb/siggen: add missing path separator to cleaned pathsPaul Eggleton
Printing "pbzip2pbzip2_1.1.13.bb" is ugly, we need to add a separating slash so that we get "pbzip2/pbzip2_1.1.13.bb" instead. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-04-07bitbake-diffsigs: fix -t picking wrong files to comparePaul Eggleton
We weren't picking the right files to compare here - according to the order in which the list is sorted (by mtime), we need to be taking the last two items and not the first two. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-04-06toaster:test:Create selenium tests for project dashboard pageDavid Reyna
Added 7 new testcases that verify the UI interface and elements of the project detail page. This testcases can be found on testopia in the links: Verifies that the project is created and that you get redirected to the configuration page https://bugzilla.yoctoproject.org/tr_show_case.cgi?case_id=1514 Verifies that the left side bar menu, all links are clickable and they show on the UI https://bugzilla.yoctoproject.org/tr_show_case.cgi?case_id=1515 Verifies that after creating a project the default project configuration is created https://bugzilla.yoctoproject.org/tr_show_case.cgi?case_id=1516 Verifies that the default machine is set, once creating the project https://bugzilla.yoctoproject.org/tr_show_case.cgi?case_id=1517 Verifies the built recipes information of the project detail page https://bugzilla.yoctoproject.org/tr_show_case.cgi?case_id=1518 Verifies the default release information of the project https://bugzilla.yoctoproject.org/tr_show_case.cgi?case_id=1519 Verifies that the default layers are assigned to the project https://bugzilla.yoctoproject.org/tr_show_case.cgi?case_id=1520 Verifies that the links to the Configuration, Builds, Import layer and New Custom Image are present and work. [YOCTO #9808] Signed-off-by: Libertad Cruz <libertad.cruz@intel.com> Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: David Reyna <David.Reyna@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-04-06toaster: toastergui: implement machine name validationBelal, Awais
Valid machine names cannot include spaces anywhere in the name and doing so will result in a build failure. This implements a mechanism to alert the user against such a misconfiguration and does not allow input of such machine names. [YOCTO #8721] Signed-off-by: Awais Belal <awais_belal@mentor.com> Signed-off-by: David Reyna <David.Reyna@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-04-06Bump version to 1.33.4Richard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-04-06runqueue: Allow recrdeptask not to exist for all recipesRichard Purdie
Currently if you specify a recrdeptask, it must exist for all recipes or you get a python traceback. This is a bug and it should be possible to have recipes which don't have the specified task. As well as preventing such a traceback (which shouldn't happen, it should be a user readable error), this allows us to fix issues in OE-Core which would otherwise trigger the traceback. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-04-05fetch/local: Drop FILESDIRRichard Purdie
This has long since been deprecated and is no longer used anywhere, FILESPATH is the commonly used varaible which offers much more flexibility. Remove the FILESDIR code and references from bitbake. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-04-05codeparser: add some commentsPaul Eggleton
Add a few comments at the top of the file explaining what it's for, and a comment pointing out that you need to increment the cache version when changing any code that changes the output. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-04-05bitbake-selftest: add contains testsPaul Eggleton
Add some tests to verify that we are extracting "contains" information from python expressions in the code in the bb.data and bb.codeparser modules. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-04-05codeparser: improve handling of contains_any() and filter()Paul Eggleton
Ensure we handle bb.utils.contains_any() as separate items, rather than how we handle contains() where every item must be in the list. Additionally, enable handling bb.utils.filter() which for the purposes of looking at dependencies is the same as contains_any(). Additionally bump the codeparser cache and recipe cache versions to invalidate the user's existing caches (ensuring that the changes take effect and avoiding "taskhash mismatch" errors respectively). Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-04-05lib/bb/data: fix dependency handling for contains and multiple valuesPaul Eggleton
The code that determines variable dependencies uses the codeparser to find references to "contains" type operations e.g. bb.utils.contains(). That function can take multiple items to check, and all specified items have to be present. However this code didn't handle that - it assumed that only one item would be specified and thus it was treating the multiple items as a single item with spaces in between. Split the value and check if all words are present in order to determine whether the check is "set" or "unset". Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-04-03bitbake-user-manual: Fixed special character in -D outputScott Rifenbark
Fixes [YOCTO #9962] The new output for -D was copied into the manual and merged by the engineering team before checking to see if the manual would make properly. The next output for -D introduced an error through the string "<task>". The angled bracket characters are illegal in docbook and must be replaced by "&lt;" and "&gt;", respectively. I made this fix. Signed-off-by: Scott Rifenbark <srifenbark@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-04-01fetch2: Do not fail to create symbolic links if they already existPeter Kjellerstedt
When the fetcher retrieves file:// URLs, there is no lock file being used. This means that in case two separate tasks (typically from two concurrent invocations of bitbake) want to download the same file:// URL at the same time, there is a very small chance that they also end up wanting to create a symbolic link to the file at the same time. This would previously lead to one of the tasks failing as the other task would have created the link. Signed-off-by: Peter Kjellerstedt <pkj@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-30bitbake: Bump version to 1.33.3Richard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-30bb/utils: extend which() so it can look for just executablesRoss Burton
Normally bb.utils.which() is used by the unpack code to find a file in a variety of places, but it is useful as a slightly more powerful version of os.which(). Support this by allowing it to only return matches which are executable files, instead of just the first filename that matches. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-30wget: Fix handling of urls with user/passwordRichard Purdie
URL decoding was improved in the core a while ago and this looks like a leftover from those times which caused urls needing a user/password to fail. Use the parameters from the core instead of the broken split implementation. [YOCTO #11262] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-30tinfoil: improve get_recipe_file() exception textPaul Eggleton
* Turn reasons from a list into a string (usually there will be only one reason, but the interface provides for more than one) and state up front that the recipe is unavailable for clarity * Use quotes around invalid recipe name Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-30tinfoil: fix get_recipe_file() to return an error on invalid recipePaul Eggleton
This function calls cooker.findBestProvider() but didn't handle the fact that that function returns a tuple (None, None, None, None) when there is no matching recipe. (This fixes devtool in OpenEmbedded showing a traceback when an invalid recipe is specified instead of a proper error message.) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-30s3.py: Remove hardcoded awsElizabeth 'pidge' Flanagan
This commit looks to see if FETCHCMD_s3 is set and if not, sets it. This is needed because I've use cases where I don't use aws, but s3cmd (due to license). Signed-off-by: Elizabeth 'pidge' Flanagan <pidge@toganlabs.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-28lib/bb/codeparser: ensure BufferedLogger respects target logging levelPaul Eggleton
BufferedLogger was sending log records to the target logger without checking if the logger is enabled for the level of the record - and handle() doesn't check this either (it's normally checked earlier when the relevant log function is called e.g. logger.debug()), leading for example to debug messages from codeparser getting printed when the log level for the main BitBake logger was set to logging.WARNING. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-28fetch2: Ensure we don't have file downloads overwriting each otherRichard Purdie
Imagine you have an sstate mirror accessed over http and an SSTATE_MIRRORS which maps file:// urls to http:// urls. File urls set donestampneeded = False, http urls don't. This can result in races in the try_mirror_url() code since it will trigger new downloads after aquiring the lockfile as verify_donestamp() doesn't look at origud and there is no donestamp. verify_donestamp() already has code to look at origud, we're just missing some code at the start of the function to do this. Fix it to avoid these races. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-27main: Improve -v and -D option documentationDiana Thayer
Expanded and clarify documentation for the -v, --verbose and -D, --debug options. [YOCTO #9962] Signed-off-by: Diana Thayer <garbados@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-27tinfoil: enable client-side logger handling by defaultPaul Eggleton
If you had a script that uses tinfoil and it failed to connect to the BitBake server, you did't see any of the expected messages - this was because client-side logging wasn't being handled at all. Since you'll almost always want this when using tinfoil, have it use the new bb.msg.logger_create() function to enable client-side logging by default. Relates to [YOCTO #11185]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-27lib/bb/msg: introduce logger_create() functionPaul Eggleton
We use this code to set up a logger with colour in a number of different places, so create one function that does this and make some of bitbake's utility scripts use it. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-27fetch2/git: prevent recursion on getting latest revisionPaul Eggleton
We call git ls-remote to get the latest revision from a git repository, however by calling runfetchcmd() we can end up recursively running git ls-remote a number of times with OE e.g. if ${SRCPV} is in PV, ${PV} is in WORKDIR, and ${WORKDIR} is in PATH (as a result of recipe-specific sysroots), our call to runfetchcmd() exports PATH so _lsremote() will get called again - with the end result that we run git ls-remote 30 times in quick succession (!). Prevent that from happening by using a guard variable and returning a dummy value if it's called recursively. Fixes [YOCTO #11185]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-22bitbake-diffsigs: Add debug supportPeter Kjellerstedt
Currently shows the name of the signature files that were found when --task is used. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-22bitbake-dumpsig: Add debug supportPeter Kjellerstedt
Currently shows the name of the signature file that was found when --task is used. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-22bitbake-dumpsig: Allow recipe and task to be specifiedPeter Kjellerstedt
Use --task <recipe> <task> to dump the signature info for a given recipe and task. This is similar to the --task option of bitbake-diffsigs. Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-22cooker.py: use correct multiconfig prefix in dependency graphPatrick Ohly
The dependency graph in the bb.event.DepTreeGenerated and the corresponding pn-buildlist and task-depends.dot from "bitbake -g" contained entries like multiconfig:qemuarm.gcc (dot as last separator) instead of the correct multiconfig:qemuarm:gcc (colon as separator). Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-21data/cooker: Sort output data shown by -eRichard Purdie
Displaying the environment data in a sorted manner makes it easier to compare data between different setups and means you can know where to find specific entries. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-21fetch/git: fix FetchError referenceChristopher Larson
FetchError isn't defined, use bb.fetch2.FetchError in this context. Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-21fetch/git: drop pointless os.path.join, workdir=Christopher Larson
The touch of .done explicitly specifies the path, so there's no need for workdir=, and "os.path.join('.')" is identical to just '.'. Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-21fetch/git: kill pointless quotes around single % argsChristopher Larson
Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-21fetch/git: use enumerate for ud.namesChristopher Larson
list.index() isn't a particularly efficient operation, so keep track of our position via enumerate() instead, which is more pythonic as well. Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-21data.py: sort exported variablesJuro Bystricky
Various run.do_xxx files export dozens of variables. Presently they are in random order. Among other things, this makes it difficult to compare two files for relevant changes. This patch ensures they are enumerated/printed in a sorted (alphabetical) order. Signed-off-by: Juro Bystricky <juro.bystricky@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-21lib/bb/tests/codeparser: update expand syntax in commentJoshua Lock
bb.data.expand(x, d) is deprecated API Signed-off-by: Joshua Lock <joshua.g.lock@intel.com> 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>
2017-03-21bitbake-layers: fix layerindex-fetch for Python 3Paul Eggleton
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). Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-21data_smart: implement missing remote datastore operationsPaul Eggleton
Enable the following operations from a remote datastore to affect the other end: * setVarFlag() * delVar() * delVarFlag() * renameVar() In practice I don't expect these to be used much, but they should be present so that the implementation is at least reasonably filled out and that the tests pass. Also add tests for the interface, mostly by subclassing the existing local test classes so that they are using a remote datastore. (These don't actually test remote usage via tinfoil, just that the datastore's interface can be used.) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-21tinfoil: fix override handling in remote datastoresPaul Eggleton
There was a huge gap in the remote datastore code introduced in the tinfoil2 rework - we weren't handling overrides at all, since these are stored separately from the actual data in the DataSmart object. Thus, when a datastore actually represents a remote datastore we need to go back to that remote datastore to get the override data as well, so introduce code to do that. To avoid a second round-trip I had to modify the _findVar() function to return the override data as well. This will increase the overhead a little when that data is superfluous, but without making the function even uglier I don't think there's a way to avoid that. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>