Commit Graph

5311 Commits

Author SHA1 Message Date
Markus Lehtonen 9cce855f47 bitbake: bitbake-selftest: introduce BB_TMPDIR_NOCLEAN
Set this env variable to 'yes' to preserve temporary directories used by
the fetcher tests. Useful for debugging tests.

(Bitbake rev: 04132b261df9def3a0cff14c93c29b26ff906e8b)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-20 16:08:59 +01:00
Markus Lehtonen 81697a8661 bitbake: bitbake-selftest: add help text for env variable(s)
(Bitbake rev: 94c63a5b1e731e64eb8efbc09f2ab6a0ce11df05)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-20 16:08:58 +01:00
Markus Lehtonen 9139d75736 bitbake: bitbake-selftest: utilize unittest.main better
This simplifies the script, and, gives new features. It is now possible
to run single test functions, for example. This is nice when writing new
test cases.

(Bitbake rev: 8c513580b9406b031674f799117eae7410f8e01c)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-20 16:08:58 +01:00
Richard Purdie 8b35b032ed bitbake: bitbake: Update version to 1.31.1
(Bitbake rev: 3ff1c66e6f336e5de7dcbc983a97fcd19ddc6b81)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-18 10:06:27 +01:00
Richard Purdie 218b81acb6 bitbake: bitbake: Initial multi-config support
This patch adds the notion of supporting multiple configurations within
a single build. To enable it, set a line in local.conf like:

BBMULTICONFIG = "configA configB configC"

This would tell bitbake that before it parses the base configuration,
it should load conf/configA.conf and so on for each different
configuration. These would contain lines like:

MACHINE = "A"

or other variables which can be set which can be built in the same
build directory (or change TMPDIR not to conflict).

One downside I've already discovered is that if we want to inherit this
file right at the start of parsing, the only place you can put the
configurations is in "cwd", since BBPATH isn't constructed until the
layers are parsed and therefore using it as a preconf file isn't
possible unless its located there.

Execution of these targets takes the form "bitbake
multiconfig:configA:core-image-minimal core-image-sato" so similar to
our virtclass approach for native/nativesdk/multilib using BBCLASSEXTEND.

Implementation wise, the implication is that instead of tasks being
uniquely referenced with "recipename/fn:task" it now needs to be
"configuration:recipename:task".

We already started using "virtual" filenames for recipes when we
implemented BBCLASSEXTEND and this patch adds a new prefix to
these, "multiconfig:<configname>:" and hence avoid changes to a large
part of the codebase thanks to this. databuilder has an internal array
of data stores and uses the right one depending on the supplied virtual
filename.

That trick allows us to use the existing parsing code including the
multithreading mostly unchanged as well as most of the cache code.

For recipecache, we end up with a dict of these accessed by
multiconfig (mc). taskdata and runqueue can only cope with one recipecache
so for taskdata, we pass in each recipecache and have it compute the result
and end up with an array of taskdatas. We can only have one runqueue so there
extensive changes there.

This initial implementation has some drawbacks:

a) There are no inter-multi-configuration dependencies as yet

b) There are no sstate optimisations. This means if the build uses the
same object twice in say two different TMPDIRs, it will either load from
an existing sstate cache at the start or build it twice. We can then in
due course look at ways in which it would only build it once and then
reuse it. This will likely need significant changes to the way sstate
currently works to make that possible.

(Bitbake rev: 5287991691578825c847bac2368e9b51c0ede3f0)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-18 10:06:27 +01:00
Paul Eggleton fac16ff8f7 bitbake: siggen: properly close files rather than opening them inline
If you don't do this, with Python 3 you get a warning on exit under some
circumstances.

(Bitbake rev: 49502685df3e616023df352823156381b1f79cd3)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-18 10:06:26 +01:00
Jérémy Rosen 0eb6d709b6 bitbake: ast/ConfHandler: Add a syntax to clear variable
unset VAR
will clear variable VAR
unset VAR[flag]
will clear flag "flag" from var VAR

(Bitbake rev: bedbd46ece8d1285b5cd2ea07dc64b4875b479aa)

Signed-off-by: Jérémy Rosen <jeremy.rosen@openwide.fr>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-18 10:06:26 +01:00
Richard Purdie b50b14e372 bitbake: cache: Build datastores from databuilder object
Rather than passing in a datastore to build on top of, use the data builder
object in the cache and base the parsed recipe from this. This turns
things into proper objects building from one another rather than messy
mixes of static and class functions.

This sets things up so we can support parsing and building multiple
configurations.

(Bitbake rev: fef18b445c0cb6b266cd939b9c78d7cbce38663f)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-18 10:06:26 +01:00
Richard Purdie b176189df1 bitbake: cache: Split Cache() into a NoCache() parent object
There are some cases we want to parse recipes without any cache
setup or involvement. Split out the standalone functions into
a NoCache variant which the Cache is based upon, setting the scene
for further cleanup and restructuring.

(Bitbake rev: 120b64ea6a0c0ecae7af0fd15d989934fa4f1c36)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-18 10:06:26 +01:00
Richard Purdie e79550ea87 bitbake: cache/cooker: Pass databuilder into bb.cache.Cache()
Rather that the current mix of static and class methods, refactor
so that the cache has the databuilder object internally. This becomes
useful for the following patches for multi config support.

It effectively completes some of the object oriented work we've been
working towards in the bitbake core for a while.

(Bitbake rev: 7da062956bf40c1b9ac1aaee222a13f40bba9b19)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-18 10:06:26 +01:00
Richard Purdie 97ce9126a6 bitbake: cache: Make virtualfn2realfn/realfn2virtual standalone functions
Needing to access these static methods through a class doesn't
make sense. Move these to become module level standalone functions.

(Bitbake rev: 6d06e93c6a2204af6d2cf747a4610bd0eeb9f202)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-18 10:06:26 +01:00
Richard Purdie 4cd5647f12 bitbake: cache/ast: Move __VARIANTS handling to parse cache function
Simple refactoring to allow for multiconfig support.

(Bitbake rev: 266b848da40904446eb1d084bbdc5307a9b45197)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-18 10:06:26 +01:00
Richard Purdie 0ef16f083e bitbake: runqueue: Abstract worker functionality to an object/array
With the introduction of multi-config and the possibility of distributed
builds we need arrays of workers rather than the existing two.

This refactors the code to have a dict() of workers and a dict of
fakeworkers, represented by objects. The code can iterate over these.

This is separated out from the multi-config changes since its separable
and clearer this way.

(Bitbake rev: 8181d96e0a4df0aa47287669681116fa65bcae16)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-18 10:06:26 +01:00
Richard Purdie 249686927b bitbake: cookerdata: Simplify prefiles/postfiles
The current codepaths are rather confusing. Stop passing these
as parameters and use the ones from when the object is created.

(Bitbake rev: 8c992c148d9619b10eeae8bbd9376ecf408037a5)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-18 10:06:26 +01:00
Scott Rifenbark 96a861eb02 bitbake: bitbake-user-manual: Re-write "Dependencies Internal to the .bb File"
Fixes [YOCTO #10117]

Applied a re-write to better clarify the behavior of dependencies.

(Bitbake rev: 28bb8ef7f737034055f3485795179cfdcdb9a41f)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-17 10:22:59 +01:00
Scott Rifenbark cbf8516c08 bitbake: bitbake-user-manual: Added setting variable for a single task
Fixes [YOCTO #10095]

I added a third case to the "Conditional Metadata" section to
describe setting a variable for a single task.

(Bitbake rev: 24d648ce62b35f7d2b23fde732703c060579a0d2)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-17 10:22:59 +01:00
Scott Rifenbark 277a5a969f bitbake: bitbake-user-manual: Added more detail to anonymous Python functions.
Fixes [YOCTO #10093]

Provided much more detail on how these functions work.

(Bitbake rev: dbe25523d899850f85acb6986eca98bf1b0ef52a)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-17 10:22:59 +01:00
Scott Rifenbark 3a1ae38966 bitbake: bitbake-user-manual: Formatted all "flags" to be consistent
Fixes [YOCTO #10071]

The use of any flags throughout the manual was very inconsistent.
I changed all references to any named flag in the text to be
formatted as code and to be enclosed in square brackets.

(Bitbake rev: be0fb616e64e54ae3e2420249f21f4edfd97d648)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-17 10:22:59 +01:00
Scott Rifenbark 50d78130fd bitbake: bitbake-user-manual: Added detail to [dirs] and [cleardirs] flags
Fixes [YOCTO #10071]

Provided more clear descriptions for these two flags.

(Bitbake rev: c85c9a468dc3ce606a5f8797e6be8b411a9f3bdb)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-17 10:22:59 +01:00
Francisco Pedraza 500ebdda6b bitbake: bb/utils.py: export_proxies add GIT_PROXY_COMMAND
This was added to enable the usage of git through proxies.

(Bitbake rev: 449fc52e483a3bf1cec1c5d8cf8c3946ec5292ab)

Signed-off-by: Francisco Pedraza <francisco.j.pedraza.gonzalez@intel.com>
Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-17 10:22:58 +01:00
Paul Eggleton 8a45291164 bitbake: knotty: don't show number of running tasks in quiet mode
There's not a whole lot of point showing how many tasks are running when
we're in quiet mode, it just looks a bit strange particularly when it's
not running any tasks.

(Bitbake rev: 5317200d9cd73c6f971bc1b0cfe8692749e27e3a)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-17 10:22:58 +01:00
Paul Eggleton ea0800049d bitbake: knotty: fix task progress bar not starting at 0%
If we have the task number here we need to subtract 1 to get the number
of tasks completed.

(Bitbake rev: 7c78a1cd3f0638ae76f7c7a469b7f667c7c58090)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-17 10:22:58 +01:00
Paul Eggleton 1b6f701cd9 bitbake: runqueue: fix two minor issues with the initialising tasks progress
A couple of fixes for the "Initialising tasks" progress bar behaviour:
* Properly finish the progress bar when using bitbake -S
* Finish the progress bar before calling BB_HASHCHECK_FUNCTION (so that
  in OE when that shows its own "Checking sstate mirror object
  availability"  progress bar it gets shown on the next line as it
  should).

(Bitbake rev: de6759d8e9990e426e6d6464a2e05381cd4c12d6)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-17 10:22:58 +01:00
Ross Burton 407ba77fe2 bitbake: lib/bb/tests/fetch: remove URL that doesn't exist anymore
The CUPS ipptool URL we were checking now redirects to github where the tarball
isn't present, so remove it from the test suite.

(Bitbake rev: 4b50895fb3462b21e3874a2e99c363c8d05e89e6)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-17 10:22:58 +01:00
David Reyna 40b655db22 bitbake: toaster: update web urls for openembedded-core's special case
The layer index update command has a special case for the
updating 'openembedded-core' layer, and it was missing reading
and updating the git web URL fields.

[YOCTO #8037]

(Bitbake rev: ce2f990a366d2d939e93e01f67688f12740c5fee)

Signed-off-by: David Reyna <david.reyna@windriver.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-17 10:22:58 +01:00
Michael Wood e274a5167e bitbake: toaster: buildinfohelper Add handling local layers (i.e. non-git) layers
Adds handling of the non-git layers to create and update the
corresponding layer objects in Toaster.

(Bitbake rev: 0a9b5d7d9655dbb09d458fc6e330e932f0f9dab6)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:30 +01:00
Michael Wood 4ac57fb73e bitbake: toaster: bldcontrol model BRLayer Add corresponding local_source_dir
Sync the BRLayer object with the new field added to the Layer object.
The BRLayer (BuildRequest Layers) are snapshots of the layers in the
project at build time and therefore need to mirror the required fields
of the layer object.

(Bitbake rev: a3112c922f036425977abffa0137b9133f61fcd6)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:29 +01:00
Sujith H cb5ed74e7f bitbake: toaster: adapt xhr_import_layer test locally imported layer
Update xhr_import_layer test to use locally imported
layer in local_source_dir.

[YOCO #9911]

(Bitbake rev: f855490dd04281beb5ae65d82430203d9fd263fc)

Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:29 +01:00
Sujith H 5827ae0a08 bitbake: toaster: update build configuration page
Update layer branch and layer commit section
in the build configuration page for locally
imported layers. For locally imported layers
this secion goes as "Not applicable".

[YOCO #9911]

(Bitbake rev: 4ca3f602a955e01d445fb4789496e925f8d4234b)

Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:29 +01:00
Sujith H f5acb4213b bitbake: toaster: update recipe details page
Update Layer branch and Layer commit
in recipe details page. For local layer
imported from toaster these fields are
not applicable.

[YOCO #9911]

(Bitbake rev: 35f7faabff17ca577fdd2e84bb25125047f66345)

Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:29 +01:00
Sujith H 875770daf7 bitbake: toaster: update package detail page
Update package details pages layer branch
and layer commit section for locally imported
layers. We add Not applicable to them along
with a helper text, which helps user understand
why its not applicable to those layers.

[YOCO #9911]

(Bitbake rev: 6978f65af4eabe91f65a6766799578c84a0988aa)

Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:29 +01:00
Sujith H 3a5039949a bitbake: toaster: updte build tables for locally imported layers
Update the build tables section for locally
imported layers. Here we do not provide informations
such as branch or commit. Because those are locally
imported layer(s).

[YOCO #9911]

(Bitbake rev: 1b0934b45d3704de604405826de9fc1da51ceae1)

Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:29 +01:00
Sujith H 186320fedf bitbake: toaster: update the tables information
Update table informations for pages:
1) Compatible layers
2) Compatible image recipes
Added Not Applicable to the fields of locally
imported layers because they are not git version.

[YOCO #9911]

(Bitbake rev: 7e73f8583a0f92d73b42410e1c960b6f2976a557)

Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:29 +01:00
Sujith H ef617e6f34 bitbake: toaster: collect details for local dir imported from ui
Collect the dir path imported from UI and make
sure that its getting added to bblayers.conf.
This patch exactly does the same job. Any layer
which is imported locally need not be cloned
again to _toaster_clones dir.

[YOCO #9911]

(Bitbake rev: 5669157994fc220a018e37927600988f3fd43271)

Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:29 +01:00
Sujith H 8cad51965d bitbake: toaster: add local_source_dir field to model
Add a new field local_source_dir to model.
This will clearly differentiate us from the
vcs_url which is for git path.
Adding migration file 0010_layer_local_source_dir_path.py
along with this patch.

[YOCO #9911]

(Bitbake rev: 83763d89f9d0bc535e930a2094ba8201675d40be)

Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:28 +01:00
Sujith H 494eae3db0 bitbake: toaster: add local directory to the db
Adding local directory to the database.
The local directory is added to vcs_url,
field of db.

[YOCO #9911]

(Bitbake rev: 2c3d48e7cd21a999ef145081352774f1759cd5e4)

Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:28 +01:00
Sujith H b3fa98d449 bitbake: toaster: improve the display when local dir is added
The helper text gets displayed accordingly when mouse
is hovered above the layers. If its a local directory
then no more branch is mentioned. Only directory path
is mentioned.

[YOCTO #9911]

(Bitbake rev: c1961c7844cab5b9c9144f3b4946197097f53e17)

Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:28 +01:00
Belen Barros Pena 331c1c6f0a bitbake: toaster: update css file for layer import
Update the css file for the layer import.
This changes will improve the UI for the
task.

[YOCO #9911]

(Bitbake rev: a41d0400478186c983334d8f83780639e7361c91)

Signed-off-by: Belen Barros Pena <belen.barros.pena@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:28 +01:00
Sujith H 42d3a414fe bitbake: toaster: add local_source_dir to the needed_fields
This change will help us know if local_source_dir
is null or if there is value associated with this
field. This change will help us display the details
for duplicate layers tryied to import locally.

[YOCOT #9911]

(Bitbake rev: 4350b01f776e6e35745c3eb9440587973de00eec)

Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:28 +01:00
Sujith H 836f332552 bitbake: toaster: control the selection of git and local repo
Changes made in this patch will help user to select
either repo based on git and local. This patch also
improves the help provided to user so that user can
understand them and take necessary action to proceed.

[YOCOT #9911]

(Bitbake rev: 26bee4c2c05dc202857270cd5f56abff79674ca7)

Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:28 +01:00
Sujith H c2c58a1879 bitbake: toaster: add import of local directory to UI
This patch will help to add local directory
to UI. The modification is made in importlayer.html
file. The radio buttons are created to separate
selection of git based repo and local directory.

Co-Author: Belen Barros Pena <belen.barros.pena@linux.intel.com>

[YOCOT #9911]

(Bitbake rev: 78e5edb8ed4bf6c8b0fb87fcf17a82485c145920)

Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:28 +01:00
Ed Bartosh 953ba7a221 bitbake: toaster: fix unhandled exception
manage.py lsupdates throws DataError exception if the recipe can't be
saved to the MySQL database:
    django.db.utils.DataError: (1406, "Data too long for column 'license' at row 1"

Adding DataError exception to the list of exceptions should make
lsupdates to print a warning message and skip the recipe.

(Bitbake rev: 01891c13ae8dcba64e5cf79956f1b64c2afdaae3)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:27 +01:00
Elliot Smith f6261da9c0 bitbake: toasterui: ensure that the Build object is always available
Many of the methods in toasterui and buildinfohelper rely
on the internal state of the buildinfohelper; in particular, they
need a Build object to have been created on the buildinfohelper.

If the creation of this Build object is tied to an event which
may or may not occur, there's no guarantee that it will exist.
This then causes assertion errors in those methods.

To prevent this from happening, add an _ensure_build() method
to buildinfohelper. This ensures that a minimal Build object
is always available whenever it is needed, either by retrieving
it from the BuildRequest or creating it; it also ensures that
the Build object is up to date with whatever data is available
on the bitbake server (DISTRO, MACHINE etc.).

This method is then called by any other method which relies on
a Build object being in the internal state, ensuring that the
object is either available, or creating it.

(Bitbake rev: 0990b4c73f194ec0be1762e4e48b1a525d8349fb)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:27 +01:00
Elliot Smith f17ab95c79 bitbake: toaster-tests: add test for showing self-dependent task
Toaster occasionally records a task which depends on itself.

Add a test which checks that a task which depends on itself
can be displayed in the task page.

[YOCTO #9952]

(Bitbake rev: b7a699e701785b5bd8da97b6e1b760a1c6dd05f5)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:27 +01:00
Elliot Smith 98ef970c8e bitbake: toaster: prevent infinite loop when finding task dependencies
Toaster occasionally records a task which depends on itself.
This causes a problem when trying to display that task if it
is "covered" by itself, as the code does the following: for
task A, find a task B which covers A; then, recursively
find the task which covers B etc. If B == A, this loop becomes
infinite and never terminates.

To prevent this, add the condition that, when finding a task B
which covers A, don't allow B == A.

[YOCTO #9952]

(Bitbake rev: 88c471c7e5995abb5bca62990b91650277b6c926)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:27 +01:00
Elliot Smith 2ff892d87c bitbake: toaster-tests: add tests for reverting to default sort
Add tests for ToasterTable UI table sort reverting, which can
only be exercised via the browser.

Check that if a table is sorted by a column, and that column
is hidden, then the sort reverts to the default for the table.

[YOCTO #9836]

(Bitbake rev: 5b016338478d784fd048ba2baae121c3e558090c)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:27 +01:00
Elliot Smith dd784598cd bitbake: toaster: reset table to default orderby when orderby column is hidden
When a ToasterTable is sorted by a column, and that column is
hidden from view, the sort doesn't revert to the default for the
table.

Modify the JS responsible for reloading the table data so that
it doesn't rely on clicking a table column heading (as this is
inflexible and error-prone). Instead, use a function to apply
the sort to the table; and call that function when column
headings are clicked.

This means that the ordering can be changed programmatically
to a specified default ordering when a column is hidden, without
having to click on a column heading.

Use this function when the current sort column is hidden, to
apply the default sort for the table.

[YOCTO #9836]

(Bitbake rev: a28377067b6f381bbc98db82f5c45fca6620f7ad)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:27 +01:00
Elliot Smith 01c8496d47 bitbake: toaster: show loading spinner after creating custom image
Creating a custom image through the "New custom image" dialog
can sometimes result in a long pause between pressing the button
to create the image, and being transferred to the page showing
details of its content. This can make it appear as though pressing
the button had no effect.

To prevent this from happening, disable the button and text box
in the new custom image dialog after the "Create image" button is
pressed. Also show a loading spinner and "loading..." text on
the button to make it clear that the application is still responding.

[YOCTO #9475]

(Bitbake rev: dd8bede91e08c0b64b949ca98c74e6144da88fd1)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:27 +01:00
Elliot Smith 6172fb1923 bitbake: toaster-tests: fix erroneous message when test fails
When one of the layer details tests fails (as it occasionally
does, if running on a machine under heavy load, due to sync issues),
the error message shown is misleading, as it is something like:

"Expected 'This was imported' in ['This was imported', ...]"

The string 'This was imported' is in the list shown in the message,
but the message suggests it isn't.

This is because the test compares the string with one list, but
then uses a different list in the fail message if the comparison
fails.

Fix the list shown in the message about the test failing.

(Bitbake rev: 34943b2278efe99c6744399e04a47cdda630468e)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:27 +01:00
Elliot Smith cf0b07c96f bitbake: toaster-tests: add tests for most recent builds state changes
Add tests for the state transitions in the "most recent builds"
area of the all builds page.

[YOCTO #9631]

(Bitbake rev: b95681cf38475903ad4f73059313dda8c0dccef6)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:27 +01:00
Elliot Smith 36f71db680 bitbake: toaster-tests: add tests for build dashboard menu and summary visibility
Test that the build dashboard only shows a menu and a build
summary area if a build has properly "started" (i.e. has at least
one Variable object associated with it).

[YOCTO #8443]

(Bitbake rev: 9e16f76fb254ae967ded6c21251243b2af9b16b6)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:27 +01:00
Elliot Smith 504a85822e bitbake: toaster-tests: add tests for build time links in the all builds page
When a build fails, it shouldn't have links on its build time in the
recent builds area or in the all builds table.

[YOCTO #8443]

(Bitbake rev: 3d7b247512eb01607741f5f6ce7cb01d241e49e7)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:26 +01:00
Elliot Smith 2d80b902b8 bitbake: toaster: adjust build dashboard for failed builds
Remove the side bar and build details modules for failed builds.

[YOCTO #8443]

(Bitbake rev: 9d68a5bfdccd399791e1af048fefa73b5df90bcb)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:26 +01:00
Elliot Smith e387a7ab9d bitbake: toaster: add started property to Build
Add a property to the Build model which records whether
the BuildStarted event has occurred for the build.

The proxy for this event is the presence of variables recorded
against the Build: as the buildinfohelper only saves variables
when the BuildStarted event occurs (as the variables aren't
available on the bitbake server before that point), we can
tell whether BuildStarted has happened by counting Variable
objects on the Build.

This can then be used to determine whether a Build "properly"
started, enabling a different dashboard display (left-hand menu
hidden) if the build didn't record any useful information (e.g.
if it had a bad target).

[YOCTO #8443]

(Bitbake rev: aa151a4d2de4a54fe3075a8c56a4935158398a18)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:26 +01:00
Elliot Smith dce5037646 bitbake: toaster: remove links from time field on failed builds
Failed builds don't have any time data recorded for them,
so the time field in the builds table, the time shown
in the recent builds area, and the build time shown in
the build dashboard should not be links for failed builds.

[YOCTO #8443]

(Bitbake rev: 6f9c472d95ee800da079f6b828b956d9f8c67ce6)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:26 +01:00
Elliot Smith 9ed45f7974 bitbake: toaster: tweak styling and typos in recent builds area
Help icons need to have the Bootstrap tooltip() method called on
them so that the popups are correctly styled.

Ensure that the colour of the help/error/warning icons is correct,
depending on the build state.

Fix pluralisation of errors and warnings shown.

Add a div around the build state area so it's easy to pick up
where the state is going to display (e.g. in tests).

[YOCTO #9631]

(Bitbake rev: 98a923ff14188832ac44e0dbafc73bcba10e25da)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:26 +01:00
Elliot Smith 82d998d6c6 bitbake: toaster: show "Tasks starting..." until the first task completes
To prevent showing a "0% of tasks complete" message for a long time,
don't show the progress bar until the first task has finished.

While waiting for that first task, show a message about tasks
starting instead.

[YOCTO #9631]

(Bitbake rev: 5529bcd860d2932b967a064ae28690ac5a725342)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:26 +01:00
Elliot Smith dd99cf957d bitbake: toaster: show progress of recipe parsing in recent builds area
Modify buildinfohelper and toasterui so that they record the
recipe parse progress (from ParseProgress events in bitbake)
on the Build object.

Note that because the Build object is now created at the
point when ParseStarted occurs, it is necessary to set the
build name to the empty string initially (hence the migration).
The build name can be set when the build properly starts,
i.e. at the BuildStarted event.

Then use this additional data to determine whether a Build
is in a "Parsing" state, and report this in the JSON API.
This enables the most recent builds area to show the recipe
parse progress.

Add additional logic to update the progress bar if the progress
for a build object changes.

[YOCTO #9631]

(Bitbake rev: f33d51d46d70e73e04e325807c1bc4eb68462f7b)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:26 +01:00
Elliot Smith 952ffb3e1f bitbake: toaster: move most recent builds templating to client
The most recent builds area of the all builds and project builds
table needs to update as a build progresses. It also needs
additional functionality to show other states (e.g. recipe parsing,
queued) which again needs to update on the client side.

Rather than add to the existing mix of server-side templating
with client-side DOM updating, translate all of the server-side
templates to client-side ones (jsrender), and add logic which
updates the most recent builds area as the state of a build changes.

Add a JSON API for mostrecentbuilds, which returns the state of
all "recent" builds. Fetch this via Ajax from the build dashboard
(rather than fetching the ad hoc API as in the previous version).

Then, as new states for builds are fetched via Ajax, determine
whether the build state has changed completely, or whether the progress
has just updated. If the state completely changed, re-render the
template on the client side for that build. If only the progress
changed, just update the progress bar. (NB this fixes the
task progress bar so it works for the project builds and all builds
pages.)

In cases where the builds table needs to update as the result of
a build finishing, reload the whole page.

This work highlighted a variety of other issues, such as
build requests not being able to change state as necessary. This
was one part of the cause of the "cancelling build..." state
being fragile and disappearing entirely when the page refreshed.
The cancelling state now persists between page reloads, as the
logic for determining whether a build is cancelling is now on
the Build object itself.

Note that jsrender is redistributed as part of Toaster, so
a note was added to LICENSE to that effect.

[YOCTO #9631]

(Bitbake rev: c868ea036aa34b387a72ec5116a66b2cd863995b)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:26 +01:00
Elliot Smith c471740f5b bitbake: cooker: add BuildInit event
In situations where a bitbake run fails before the build
properly starts and BuildStarted is fired, a UI has no way
to get at the targets passed to the build. This makes it
difficult for the UI to report on the targets which failed.

Fire a BuildInit event before running buildTargets() or
buildFile(). This enables a UI to capture targets passed to
buildTargets(), even if the build fails (e.g. the targets
themselves are invalid).

[YOCTO #8440]

(Bitbake rev: ac02fda870965bf7d44ff5688eda54d2d11ab9c7)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:26 +01:00
Michael Wood f4e65d1cd0 bitbake: toaster: fixtures Add README
Add README to explain fixtures directory

(Bitbake rev: 4060776e408ec6baec3bafba79ac5db1bc380f01)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:26 +01:00
Michael Wood 71f553b022 bitbake: toaster: Remove old toaster config loading mechanism
This has been replaced using django's inbuilt loaddata.
Django command documented at:
https://docs.djangoproject.com/en/1.8/ref/django-admin/#django-admin-loaddata

(Bitbake rev: 3edd33aff2b9eef82090dc4f9b5461f901aec8be)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:25 +01:00
Michael Wood 49039829e1 bitbake: toaster: lsupdates Add spinner for parsing/http fetch
Adds a spinner so that you know that the parse and http fetch from the
layerindex is in progress.

(Bitbake rev: e1c1c8827f3892551084bf1c0909c1b33f0dca83)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:25 +01:00
Michael Wood 33a4006529 bitbake: toaster: checksettings call django's loaddata instead of custom command
Call django's inbuilt loaddata command to load the appropriate fixtures.
We also attempt to load a fixture called "custom" and fail silently if
we don't have one. This is where initial customisations can be done to
load particular settings or data into Toaster (for example layers or
default values for variables)

Make sure the value for TEMPLATECONF is available to checksettings so
that we can have a go a working out which default data to load.

(Bitbake rev: 7d14ca8cbabbb893e507a66e4cc6e3e77c1e8c84)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:25 +01:00
Michael Wood 72fa18fb35 bitbake: toaster: Add poky and openembedded configuration fixtures
These fixtures provide a recommended default configuration of toaster for
either using bitbake and oe-core or as part of poky.
They can be used as the sample configuration for writing custom configurations.

(Bitbake rev: d2f4ffbf061e874a7731441f8346fdc568e9f07f)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:25 +01:00
Michael Wood a1629a2b26 bitbake: toaster: tests test_new_project_page Catch button not enabled exception
When using firefox and selenium we get an exception generated when a
disabled button click is attempted. This should happen in the test but
we need to catch the exception to make sure it doesn't cause the test to
fail.

[YOCTO #10056]

(Bitbake rev: 06f74fe91f8e162f49a4e856a62a97093b48262a)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:07:09 +01:00
Randy Witt cae9e6f695 bitbake: toaster: --help now returns 0 instead of 1
If the user explicitly passes in "--help" then it should return 0. This
is the convention follow by the typical application. This allows the
user to check for options without triggering an error.

(Bitbake rev: 1d5102fe6c932dad1c2b975385e10a33a91ba1a4)

Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:07:09 +01:00
Ulrich Ölmann 5d1d1774ec bitbake: siggen: Fix typo
(Bitbake rev: 40f605199fb3ec2549611508b7576c64d735b2b7)

Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:07:09 +01:00
Terry Boese 93817932de bitbake: fetch2/gitannex.py: use 'git annex init' instead of 'git annex sync'
The git annex fetcher needs git annex to be initialized.  Previously
it was using 'git annex sync' to do this, but that has the downside
of moving the checkout to the tip of the default branch.  This means
that tags, SRCREV, etc don't work in the gitannex case.

(Bitbake rev: c1a57e2dd7fc96834643be5591a96f239215481a)

Signed-off-by: Terry Boese <terry.boese@vecima.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:07:08 +01:00
Richard Purdie 82da1e6f6c bitbake: persist_data: Fix py3 update stack overflow
Revision d0f904d407f57998419bd9c305ce53e5eaa36b24 accidentally broke
items() and values() and made them cause stack overflows. Undo that
breakage.

(Bitbake rev: 88c5beca705efa7df4a96fb2aaf3f13c336ac328)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:07:08 +01:00
Mariano Lopez a6630c2310 bitbake: fetch: Fix use of tar's --exclude option for tar >= 1.29
Starting from tar 1.29 the --exclude option won't work
anymore if is not used before the path. There are some
fetch modules that copy the ptest using tar and --exclude
option. This fixes these for bitbake.

[YOCTO #9763]

(Bitbake rev: cc71d5d9da71ea5f21d02f3b2fbf119bd2d794f0)

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10 10:46:34 +01:00
Scott Rifenbark a3cad8f0e0 bitbake: bitbake-user-manual: Applied typo fix to "Override Style Operation Advantages"
Fixes [YOCTO #9985]

Fixed an operator typo from ":=" to "+=" in the note
at the bottom of the section.

(Bitbake rev: 319d3d387161182069e6d1b3db17ccb539d097ed)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-02 15:22:15 +01:00
Scott Rifenbark ae427fb097 bitbake: bitbake-user-manual: Changed bitbake command example.
Fixes [YOCTO #7718]

In the "Executing a List of Task and Recipe Combinations"
section, I changed the improper bitbake command example to
use the correct syntax.  This change was review feedback.

(Bitbake rev: c79fab1be4898ec88bfddd4c4f84e76dc3a3125b)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-02 15:22:15 +01:00
Scott Rifenbark e205789361 bitbake: bitbake-user-manual: Updated the PROVIDES variable
Fixes [YOCTO #10011]

Added paragraphs near the end to describe the role of virtual
targets.

(Bitbake rev: fc47bb99dbc1972dfb3a83c0f4c479963da64bcc)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-02 15:22:15 +01:00
Scott Rifenbark f0e73a4b65 bitbake: bitbake-user-manual: Added non-existant variable expansion
Fixes [YOCTO #10003]

I added a small paragraph explaining what happens when expansion
of a variable that does not exist occurs.

(Bitbake rev: 8006da3f229d0227215ccd59cd273edacf72f9ce)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-02 15:22:15 +01:00
Scott Rifenbark 41b49cadd3 bitbake: bitbake-user-manual: Applied some review comments
Fixes [YOCTO #9985]

Fixed some problems with the changes.  A small typo for an
example and added a clarifying operator in another sentence.

(Bitbake rev: d8ae3775eefe3f7b62fc26cae5b742ae83850c13)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-02 15:22:15 +01:00
Scott Rifenbark a3a7ddf120 bitbake: bitbake-user-manual: Updated the "Inline Python Variable Expansion" section.
Fixes [YOCTO #9984]

Added a small note to the bottom to help clarify.

(Bitbake rev: 64bf49826088c56b739ed971251f05b4564c712e)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-02 15:22:15 +01:00
Scott Rifenbark eb282b797e bitbake: bitbake-user-manual: Fixed override operator syntax.
I had inconsistent usage of the "_append" style operator syntax
in the chaper.  I was using a mix of <filename>_append</filename>
and "_append".  I changed to "_append" for consistency.

(Bitbake rev: 5c5b88e402376268baa15c5d04d2592f28d76751)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-02 15:22:15 +01:00
Scott Rifenbark 6aaf379119 bitbake: bitbake-user-manual: Clarified override-style operators.
Fixes [YOCTO #9985]

Made the following changes:

 * Section Removal (Override Style Syntax):  Added a small
   qualifying sentence at the end to further define behavior

 * Added new section "Override Style Operation Advantages":
   This section provides some rationale behind the "_append"
   style operations.

 * Section "Examples": Changed an example to use the "="
   operator rather than the "+=" operator.

(Bitbake rev: 797d9627baad9ccd3d55e825c0d705311f631f78)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-02 15:22:15 +01:00
Scott Rifenbark d1e3f0bb16 bitbake: bitbake-user-manual: Updated the variable expansion section.
Fixes [YOCTO #9984]

Added more detail to the examples that show the effects of
variable expanison.

(Bitbake rev: 480096ca93c0a649ebfff68dfc7d9bbe8eb2ea2d)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-02 15:22:14 +01:00
Richard Purdie 2652217970 bitbake: Revert "bitbake-user-manual: Added new section on command-line execution"
This reverts commit 6f6cd0674fd1595f4e74b7da692e0c348b2660c6 as it was
a duplicated commit.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-02 15:21:46 +01:00
Richard Purdie aa2d945423 bitbake: lib/toaster: Fix missing new files from previous commits
(Bitbake rev: f77e6f21a2cc57a3fcb5970437e55cfae39849a3)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-01 09:38:35 +01:00
Elliot Smith 5b61fa04a3 bitbake: toaster-tests: fix URL given for Chromedriver download
The link to the Chromedriver downloads page is dead, so
put in the correct URL.

(Bitbake rev: f0e6832bc33df2bb1b2f4b7f436ffbf023e24b13)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-29 09:53:32 +01:00
Elliot Smith 05f82e8f12 bitbake: toaster-tests: define capabilities for latest Firefox driver
For the latest Firefox versions, WebDriver requires a download of a
separate binary and an additional capability to be defined on it.

Modify our tests so that when "marionette" is set as the browser,
this capability is defined on the Firefox driver. Also add a note to the
README about the additional installation steps required.

(Bitbake rev: f6011d986f9a573a39e7b98af0aefe6cc88461ad)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-29 09:53:32 +01:00
Paul Eggleton 2a849e7e9b bitbake: lib/bb/checksum: avoid exception on broken symlinks
If using OE's externalsrc with a source tree that is not tracked by git
and contains broken symlinks, you can receive "TypeError: unorderable
types: NoneType() < str()" within the file checksum code due to:

 checksums.sort(key=operator.itemgetter(1))

Don't add files with no checksum to the checksums list in order to avoid
this.

(Bitbake rev: 484fe5a3f5b840e5422cbdff0eef9aecfe944a19)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-29 09:53:32 +01:00
Ross Burton ea234239f4 bitbake: lib/bb/utils: show subprocess output in stack traces
If better_exec() throws a subprocess.CalledProcessError then show the output to
the user as it likely contains useful information for solving the problem.

(Bitbake rev: 8a6424ed871c3cbacd21cae8bc801197f83d67a6)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-29 09:53:32 +01:00
Maxin B. John c42b5333f0 bitbake: fetch2: fix pickle issues while switching from master to krogoth
While switching from master to krogoth build with a common download directory,
got a large number of warnings like the one listed below:

WARNING: freetype-2.6.3-r0 do_fetch: Couldn't load checksums from
donestamp /home/maxin/downloads/freetype-2.6.3.tar.bz2.done: ValueError
(msg: unsupported pickle protocol: 4)

These warnings are caused by the difference in pickle module
implementation in python3(master) and python2(krogoth). Python2 supports
3 different protocols (0, 1, 2) and pickle.HIGHEST_PROTOCOL is 2 where as
Python3 supports 5 different protocols (0, 1, 2, 3, 4) and
pickle.HIGHEST_PROTOCOL is obviously 4.

My suggestion is to use 2 since it is backward compatible with python2
(all the supported distros for krogoth provides python2 which supports
pickle protocol version 2)

(Bitbake rev: cc67800f279fb211ee3bb4ea7009fdbb82973b02)

Signed-off-by: Maxin B. John <maxin.john@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-29 09:53:32 +01:00
Ross Burton 1393b23f51 bitbake: lib/bb/build: handle incomplete message fragments in log FIFO
It's possible that the logging FIFO doesn't do a complete read (or the sender a
complete write) with the result that an incomplete message is read in bitbake.
This used to result in silently truncated lines but since 42d727 now also
results in a warning as the start of the rest of the message isn't a valid
logging command.

Solve this by storing incoming bytes in a bytearray() across reads, and parsing
complete messages from that.

[ YOCTO #9999 ]

(Bitbake rev: 508112793ee7ace613f07695222997309a2ca58f)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:10:37 +01:00
Elliot Smith 9411e33b88 bitbake: toaster-tests: add tasks and recipes sub-page tests
Add tests for the tasks and recipes sub-pages of the build
dashboard.

[YOCTO #9833]

(Bitbake rev: cecee440a76950f2824ea34b88e84185be493337)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:10:37 +01:00
Elliot Smith 4357d7a296 bitbake: toaster: set non-hideable columns for built recipes table
None of the columns in the built recipes table are marked
as not hideable, so it is possible to remove all the columns
and make the table disappear.

Set the recipe name and version columns as not hideable.

Also rename the "Name" column to "Recipe", for consistency with
the design and with other recipe tables.

[YOCTO #9833]

(Bitbake rev: 3abd0ac300462e6d1335018cf2d0420de7cc8b76)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:10:36 +01:00
Elliot Smith bd2cce00de bitbake: toaster: set non-hideable columns for build tasks table
The task, recipe and order columns in the build tasks table
should not be hideable. If they are, it's possible for the
table to have all of its columns hidden so that it no longer
displays.

Set the hideable property to prevent these columns from being
hidden.

[YOCTO #9833]

(Bitbake rev: dc1781e3783724823fd6b0c2d65f6b2771e8d0be)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:10:36 +01:00
Elliot Smith 83ccef335c bitbake: toaster: fix download URL for task logs
The task display template formatting had split the Django
url template tag across two lines and broken it. This resulted
in a gibberish URL for task logs.

Fix by placing the tag and its arguments on a single line.

[YOCTO #9837]

(Bitbake rev: d6e88b7b410b6b99b47b031111a1126da9fd31b3)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:10:36 +01:00
Mario Domenech Goulart 24905d3c2d bitbake: fetcher2/__init__: Print command in case of ExecutionError in runfetchcmd
(Bitbake rev: df7f4897c463a48c45514e2bcbd44cc7f86c4bb0)

Signed-off-by: Mario Domenech Goulart <mario.goulart@bmw-carit.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:10:36 +01:00
Michael Wood 729d9fcb54 bitbake: toaster: loadconf Partially add back some of the layerSource parsing
Partially add back a revised version of the layersource handling so that
we can continue to support the old toasterconf.json and it's setup of
the local project.

(Bitbake rev: cc1a1bc2ea6ae058278d4ecf483f5ea00502c6cb)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:10:36 +01:00
Michael Wood 04d1ad5fe7 bitbake: toaster: admin Add Layer_Version to the admin-able models
If the migration didn't get the release conversion right for say, a
local or imported layer it would be handy to be able to edit this
in the django admin page.

Also useful for developers to be able to tweak layers on the fly.

(Bitbake rev: 0b23b6919ef1162a0c7fb5b5a961a24653c51eb2)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:10:36 +01:00
Michael Wood 97278fb51c bitbake: toaster: orm Remove the layerindex specific up_branch fields
We don't need to keep track of layerindex data in our database. And
using branch==release is very confusing in the schema. Instead use the
existing Release definition to keep track of which release a
layer_version is for.

Remove the Branch model and all references to it.

Create a migration path to convert from up_branches to their
corresponding releases.

(Bitbake rev: f8f4cffe6fd371f3a7e63690c68f3fcb5dc1f297)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:10:36 +01:00
Michael Wood 8b3146007f bitbake: toaster: lsupdates Add progress information and clean up logging
Adds basic progress % information and provides better description of
what is happening.

(Bitbake rev: 6393dbf97d450d2521c0bc9429da0987bb7720ec)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:10:36 +01:00
Michael Wood bb260e94a6 bitbake: toaster: tests: Remove references to LayerSource model
Remove and replace layersource model references in the tests and test
data. Remove the orm/test as this only tested LayerSource interactions
which have now been removed.

(Bitbake rev: 61a47cbc92c856690cb0e8da7102b2e669eaee0a)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:10:36 +01:00
Michael Wood ef627d0ab8 bitbake: toaster: Replace references to LayerSource models
Replace references to the now deprecated layersource models across
Toaster with the new enums for layer source types.

(Bitbake rev: 48c09c62eb979d840132e58144f0d81ffee675b1)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:10:36 +01:00
Michael Wood ffc78d329d bitbake: toaster: lsupdates Add layerindex fetcher
Move and refactor the layerindex layer source update mechanism so that
we don't have to track the layerindex objects in the toaster database.
Move this out of the orm and into the management command.

Paves the way for future improvement to allow you to specify a layer
index server as an argument to the command.

(Bitbake rev: f83527edc6d52a34cd73a9c3650ee484407e2e0c)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:10:36 +01:00
Michael Wood 853450befc bitbake: toaster: models Remove LayerSource models and replace with enum
We had a lot of complexity around different layer sources to allow for
multiple sources and different priorities for these source. This was
implemented using rigged abstract classes which represented the
different layer sources when in fact just an enum/flag on the
layer_version object is sufficient for our needs.

Remove the LayerSourcePriority object as this is not needed. We no longer
have a problem of multiple layers coming from multiple sources so this
is not needed. Two migrations are added to first remove the child models
which represented layersources. Then a second migration is needed to
remove the LayerSource model it's self as Django can't understand the
non-standard base class dependency. Triggering this issue:
https://docs.djangoproject.com/en/1.8/topics/migrations/#dependencies

Clean up a number of flake8 warnings in classes which were modified.

[YOCTO #9853]

(Bitbake rev: 26624740418de95adb1f4a970a30a5f1149ebb79)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:10:35 +01:00
Michael Wood 20f939f242 bitbake: toaster: bldcollector admin Remove LayerSourceAdmin
Remove the LayerSource admin from django admin interface. LayerSources
are not going to be manageable from the admin interface.

(Bitbake rev: 1c20ffcf88c5b73f6cf5e9b69b81e6bc8cd2493d)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:10:35 +01:00
Michael Wood 1477886deb bitbake: toaster: loadconf remove Loading LayerSources
We don't need to configure layer sources in the initial configuration as
this information is provided by the models.

(Bitbake rev: fd56c152699bc4c2d22b87728d0fefbff5209135)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:10:35 +01:00
Paul Eggleton c27ae255db bitbake: lib/bb/progress: avoid possibility of start event being reported twice
In MultiStageProgressReporter, set a guard when we start the progress
so that it can't happen more than once. This fixes "Initialising
tasks.." being shown twice in succession when running bitbake in
non-interactive terminal mode.

(Bitbake rev: 923e68e069127ee7f6e11b91eb1cfa09d502a110)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:10:35 +01:00
Paul Eggleton 5f4559b2eb bitbake: knotty: don't display ETA for tasks with progress
It turns out that progress information we can extract from a task is
rarely apportioned closely enough to the time taken for the ETA to be
accurate, so showing it is going to be misleading most of the time for
anything but the most basic of examples. Let's just remove it and avoid
misleading (or worse, annoying) the user.

Fixes [YOCTO #9986].

(Bitbake rev: 235db4870b11db97250979e647b54cdb5ce4fbb6)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:10:35 +01:00
Paul Eggleton 23a551bea1 bitbake: knotty: fix some minor bugs in BBProgress
If you specify custom widgets then we don't want to assume where the
"extra" position is - you should have to specify it, and if it isn't
specified it shouldn't just wipe out the last widget or you can start to
see odd behaviour if you're modifying the code.

(Bitbake rev: 19e33c10feb1637589ceb05b5e8d58b1e012ccb8)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:10:35 +01:00
Enrico Scholz 0c3ce68410 bitbake: fetch: copy files with -H
When using a PREMIRROR with plain (non-unpack) files, a SRC_URI like

SRC_URI = "file://devmem2.c"

will cause devmem2.c to be a symlink in the WORKDIR pointing to the
local PREMIRROR.

Trying to apply a patch on this file will either modify the file on
the PREMIRROR or will fail due to sanity checks:

ERROR: devmem2-1.0-r7 do_patch: Command Error: 'quilt --quiltrc /cache/build-ubuntu/sysroots/x86_64-oe-linux/etc/quiltrc push' exited with 1  Output:
Applying patch devmem2-fixups-2.patch
File devmem2.c is not a regular file -- refusing to patch

(Bitbake rev: cfd481fe9799e7a4c6bfac32e56cc91cfcd81088)

Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:10:35 +01:00
Richard Purdie 7f6b6b2ab9 bitbake: cache: Don't interleave pickle cache file writing
For some reason the data written in this way is coming back out the
files out of order. I've not been able to simplify the test case to a
point where this was standalone reproducible. Simplify the code and
write out the cache files sequentially since this seems to avoid the
errors and makes the code more readable.

(Bitbake rev: 14ec47f5f0566dbd280fae8a03160c8500ad3929)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:10:35 +01:00
Richard Purdie 5d41200113 bitbake: cache: Add better cache loading sanity checks
We've seen cache corruption where the pairs come out in a different
order to the way we saved them for unknown reasons. Add better sanity
checking to give a more user friendly error rather than a crash/traceback.

Also allows the system to reparse and recover.

(Bitbake rev: 4be4a15491530bd6dc018033ad3d4b2562ab6e23)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:10:35 +01:00
Richard Purdie 40d45cf7a6 bitbake: cache: Drop/simplify pointless type checking
Since we no longer have random data like version fields in these structures
and we can assume any extra cache data subclasses our class, simplify the
code.

This is mostly reindenting after removal of the pointless type checks.

(Bitbake rev: 5eb36278ac9975de1945f6da8161187320d90ba7)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:10:35 +01:00
Richard Purdie c9e65c5d29 bitbake: cache: Improve versions fields handling
Firstly, don't store the versions fields in memory in the cache objects
data store. This just complicates the code for no good reason.

Secondly, write the version fields to all cache files, not just the
core one. This makes everything consistent and easier.

(Bitbake rev: cb666262b2f986b5d9331dfb30458ef1a151fa4d)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:10:35 +01:00
Richard Purdie 09f6a56aa4 bitbake: cache: Correctly handle missing extra caches
If an "extras" cache file is corrupted, the system would not notice
and later fail with errors about missing entries. Add a test for this
which means we can fall back to re-parsing in those cases.

[YOCTO #9902]

(Bitbake rev: 51843d8f2bbe2e54db7593ca61984abe70423ef6)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:10:34 +01:00
Richard Purdie b2ef908be1 bitbake: cache: Move the parsing message to a more logical place
Otherwise you can look at the log and wonder why parsing isn't happening
when it really is due to other code paths.

(Bitbake rev: b48d95677a4d285a77cda2892179965f7f8f06dd)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:10:34 +01:00
Ed Bartosh 317708235b bitbake: bitbake: implement idle timeout for xmlrpc server
Idle timeout can be specified either by -T/--idle-timeout option or
by sessing BBTIMEOUT environment variable. Bitbake xmlrpc server
will unload itself when timeout exprired, i.e. when server is idle
for more than <idle timeout> seconds.

[YOCTO #5534]

(Bitbake rev: 5fa0b3a19e7d0f40790f737abeddf499d53f1f6a)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-21 07:48:52 +01:00
Ed Bartosh 4cba010529 bitbake: bitbake: implement --foreground command line option
This option makes bitbake xmlrpc server to run in foreground.
It should be useful for debugging purposes.

(Bitbake rev: 9d4254be5853a546a346bf0d19919dcfba12773d)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-21 07:48:52 +01:00
Scott Rifenbark 380b6e80ce bitbake: bitbake-user-manual: Added new section on command-line execution
Needed a section on executing a list of task and recipe combinations.

(Bitbake rev: 6f6cd0674fd1595f4e74b7da692e0c348b2660c6)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-21 07:47:54 +01:00
Scott Rifenbark cb40ae4872 bitbake: bitbake-user-manual: Applied review edits to "Recursive Dependencies"
Added a minor tweak to the third paragraph to be more inclusive
of the topic.

Fixes [YOCTO #9970]

(Bitbake rev: a5d36e8bccf35ffbca41a4facaa041d36f587529)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-21 07:47:54 +01:00
Scott Rifenbark 80b1efb62c bitbake: bitbake-user-manual: Fixed typo in the BBDEBUG variable description.
In the BBDEBUG variable description, the "-d" parameter needed to
be "-D".  Fixed it.

Fixes [YOCTO #9950]

(Bitbake rev: 475e7611f6c5b884d86152cb0b334e9d96849608)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-21 07:47:54 +01:00
Scott Rifenbark 9a9577ed49 bitbake: bitbake-user-manual: Added review changes to BBCLASSEXTEND description
Fixes [YOCTO #9909]

Added some technical clarifications to the existing note to be clear
about what is causing the limitations in this case.  Applied some
formatting fixed to for the use of the include word.

(Bitbake rev: e9ad2e0f6d2681dd793cc39c468eb86e57fd6f48)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-21 07:47:53 +01:00
Scott Rifenbark 4bc1ee5de4 bitbake: bitbake-user-manual: Added review changes to recursive section.
Applied formatting to a "after" word that should be
<filename>after</filename>.  Also added a new clarifying paragraph in
the "Recursive Dependencies" section.

Fixes [YOCTO #9861]

(Bitbake rev: ada90f68afd17cb85cb5957f3f91b537ee3599f6)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-21 07:47:53 +01:00
Andrew Bradford 35081f5518 bitbake: bitbake-user-manual: Addeds support for the Perforce Fetcher
Added a new Perforce Fetcher section in the same spirit as the existing
sections for other supported fetchers.  Changes included the new section,
removal of the bulleted item that mentioned this fetcher as an
"additional" fetcher, and the creation of a new variable in the glossary
named P4DIR.

(Bitbake rev: 47e03b1789ee1c18407dbac33a6c235752019865)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-21 07:47:53 +01:00
Scott Rifenbark a6cffcffc1 bitbake: bitbake-user-manual: Added clarifying note to BBCLASSEXTEND variable.
Fixes [YOCTO #9909]

Added a note that talks about how the BBCLASSEXTEND mechanism
adds recipe variants.

(Bitbake rev: 185c9c5fc205fe9c9daf5238f11b92bd0954f5c6)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-21 07:47:53 +01:00
Scott Rifenbark 8c55a9cf88 bitbake: bitbake-user-manual: Added a note providing examples of task dependencies
Fixes [YOCTO #9861]

In the "Dependencies internal to the .bb File" section, I placed a
note providing more detail on how recipes are built regarding task
dependency.

(Bitbake rev: c2e72928fbd21d622860a54a55f4239ba27c07a2)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-21 07:47:53 +01:00
Scott Rifenbark d918df7e8e bitbake: bitbake-user-manual: Updated dependency section for tasks
Fixes [YOCTO #9861]

I updated the section on dependencies to give a couple of examples
for task dependencies within a single recipe and dependencies for
tasks between two individual recipes.

(Bitbake rev: 231deeb2b0b3847cba971ca30c16e29357100ae6)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-21 07:47:53 +01:00
Scott Rifenbark 6743f12bbf bitbake: bitbake-user-manual: Updated the defaults for getVar and getVarFlag
There is no default.

Fixes [YOCTO #9683]

(Bitbake rev: 886afd6d876c9ae04cf681931db8f1774dc53096)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-21 07:47:53 +01:00
Scott Rifenbark 8321d66696 bitbake: bitbake-user-manual: Added new section on command-line execution
Needed a section on executing a list of task and recipe combinations.

(Bitbake rev: 17f7f366df3a5951ae88e24c43aecf3d65d83c14)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-21 07:47:53 +01:00
Richard Purdie 90436919f8 bitbake: cooker: Fix incorrect dot file generation
In the runqueue cleanup/conversion, "dep" was mistakenly used where "tid" should
be leading to incorrect task-depends.dot files and causing general confusion.
Fix this, its clearly incorrect looking at the code.

(Bitbake rev: 689730dbb068c5ea3593e7b92fe5d5e5c0c3760a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 16:46:12 +01:00
Aníbal Limón 1bf1e2c208 bitbake: toaster-tests: add class SeleniumTestCaseBase for browser tests
In order to reuse the Selenium helper outside a Django
environment (for functional testing), add a new module
containing the base class SeleniumTestCaseBase, which only
inherits unittest.TestCase

Add a class SeleniumTestCase with multiple inheritance of
StaticLiveServerTestCase and SeleniumTestCaseBase to prevent
existing tests from breaking.

(Bitbake rev: 1177b3f368d8b7f8557eb649adb2e327b6df801c)

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:38:52 +01:00
Ed Bartosh 63ff759627 bitbake: bitbake: main: implement server autostart feature
If environment variable BBSERVER == 'autostart' bitbake will
automatically load server if it's not running yet.

If host and port are in bitbake.lock then bitbake tries to check
if server is running and responses to commands and starts new
server only if this check fails.

[YOCTO #5534]

(Bitbake rev: 89c6e625d47303b2aad8e6645762f17aee01b2d4)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:23:46 +01:00
Ed Bartosh b190c08b48 bitbake: bitbake: utils: add BBSERVER to the list of preserved variables
All environment variables that are not in the list returned by
preserved_envvars_exported are cleaned by bb.utils.clean_environment.

Added BBSERVER to the list as we need to access it in bb/main.py
after the call of bb.utils.clean_environment.

(Bitbake rev: 15c4ea679f4fe097a9f21cccfc82907b5f39a4e4)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:23:46 +01:00
Ed Bartosh 6597ba6b43 bitbake: bitbake: xmlrpc: implement check of connection to server
Implemented check_connection function. The purpose of this function
is to check if bitbake server is accessible and functional.
To check this this function tries to connect to bitbake server and
run getVariable command.

This API is going to be used to implement autoloading of bitbake
server.

[YOCTO #5534]

(Bitbake rev: 1a18f5ceb478f766b53850451549333f655621ea)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:23:45 +01:00
Ross Burton dead7b22b4 bitbake: lib/bb/utils: no need to unsetenv when manipulating os.environ
Doing both os.unsetenv(foo) and then del os.environ[foo] is pointless as del
will call unsetenv automatically.

(Bitbake rev: a4463e2ff3c7d234320176d671719243292f1af0)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:23:45 +01:00
Paul Eggleton 45baa90c8c bitbake: fetch2: implement progress support
Implement progress reporting support specifically for the fetchers. For
fetch tasks we don't necessarily know which fetcher will be used (we
might initially be fetching a git:// URI, but if we instead download a
mirror tarball we may fetch that over http using wget). These programs
also have different abilities as far as reporting progress goes (e.g.
wget gives us percentage complete and rate, git gives this some of the
time depending on what stage it's at). Additionally we filter out the
progress output before it makes it to the logs, in order to prevent the
logs filling up with junk.

At the moment this is only implemented for the wget and git fetchers
since they are the most commonly used (and svn doesn't seem to support
any kind of progress output, at least not without doing a relatively
expensive remote file listing first).

Line changes such as the ones you get in git's output as it progresses
don't make it to the log files, you only get the final state of the line
so the logs aren't filled with progress information that's useless after
the fact.

Part of the implementation for [YOCTO #5383].

(Bitbake rev: 4027649f422ee64b1c4e1ad8d48ac295050afbff)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-19 15:04:37 +01:00
Elliot Smith 8d08a73225 bitbake: toaster-tests: package count/size shouldn't show for non-image builds
If a build doesn't produce any image files, the package count
and size shouldn't be shown.

Also add some metadata to build dashboard elements so it is clear
what they're for, and so they can be queried by the tests.

(Bitbake rev: 3d5090af4475b1d0bb56911a8e30abf9097c1b3c)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: bavery <brian.avery@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-19 08:56:52 +01:00
Elliot Smith 8ccf8392aa bitbake: toaster-tests: new custom image button shouldn't show for non-image builds
[YOCTO #9514]

(Bitbake rev: 9bc014d89434400c1493fa9f07ce3a51d37dab51)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: bavery <brian.avery@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-19 08:56:52 +01:00
Elliot Smith db5426b079 bitbake: toaster-tests: add tests for build artifact display on build dashboard
Add tests for display of image, kernel and SDK artifacts on the
build dashboard, checking that the "Images" option in the left-hand
menu and the "Build artifacts" section display correctly for
different types of build.

Also add metadata to elements on the build dashboard so it's clearer
what they represent, and to assist in finding them in the tests.

Add a method to the test helper to make it more convenient to check
whether a single element matching a selector exists.

[YOCTO #8556]
[YOCTO #8563]
[YOCTO #9500]

(Bitbake rev: 644a888ce5a2141f2e6e1c22430e196b65cb1313)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: bavery <brian.avery@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-19 08:56:52 +01:00
Elliot Smith 9475a684c4 bitbake: toaster: the customise image button shouldn't rely on targets
The build dashboard customise image button (for creating a new
custom image based on an image recipe used by a build) shouldn't
rely on targets: whether a new custom image can be created or not
depends on whether any of the recipes used by the build are image
recipes.

Modify the method used to determine whether a build has customisable
images to look at the image recipes used during the build, rather
than whether the targets run by the build refer to image recipes.

(Bitbake rev: 6648876c91134bda8498b4f8d7ace9147ec0d985)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: bavery <brian.avery@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-19 08:56:52 +01:00
Elliot Smith 2db40e3771 bitbake: toaster: add package manifest path to Target objects
Store the path to the *.rootfs.manifest file for targets which
generate images.

A link to the package manifest is displayed in the build dashboard
for targets which produce image files.

Like the license manifest path, if a target would have produced
the package manifest (but didn't, because it already existed), that
path is copied from the target which did produce the package
manifest.

(Bitbake rev: 79b8e349a0da2ea6b97ad82daa5837e6dfffe0af)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: bavery <brian.avery@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-19 08:56:52 +01:00
Elliot Smith 1027e0e313 bitbake: toaster: better display of targets which produced no images
SDK targets (populate_sdk) produce SDK artifacts but no image files.
Currently, these targets appear under the "Images" heading in the
build dashboard, even though they aren't strictly image targets.

Change the heading to "Build artifacts". Also remove the section
which states that a build produced no image files: this is not
correct for populate_sdk targets (those targets don't produce
image files under any circumstances); and other changes mean
that all targets which do produce images will now show those
files.

The check for whether to display the "Build artifacts" section also
needs to change, as we show targets here which didn't produce any
images but did produce SDK artifacts.

[YOCTO #8556]

(Bitbake rev: b4dce68045c4615e7a6a474e952f670721a3b54e)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: bavery <brian.avery@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-19 08:56:52 +01:00
Elliot Smith adbf206526 bitbake: toaster: show manifests in their own section of the build dashboard
In the build dashboard, add a section for manifests to each target,
which will contain the license and package manifests for a target.

As we don't record the package manifest (yet), just move the
license manifest link to that section for now.

(Bitbake rev: 58cb685b567a081834a605530957f165d35fcf5e)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: bavery <brian.avery@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-19 08:56:52 +01:00
Elliot Smith 07a58a8944 bitbake: toaster: only show "New custom image" button for builds with image targets
Add a has_image_targets() method to Build, and use that to hide
the "New custom image" button on the build dashboard if a build
has no targets which build images.

[YOCTO #9514]

(Bitbake rev: 3c4b053e44ea512ef2ced67289a7b0161db6ce9b)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: bavery <brian.avery@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-19 08:56:52 +01:00
Elliot Smith 587275eefd bitbake: toaster: use has_images() methods to display images correctly
In the build dashboard, we had issues with showing images correctly,
as we were using the is_image property of targets to determine
whether a target would have image files. This property can
be set to True if a target refers to an image recipe
(e.g. "core-image-minimal"), even if the task used in the build
didn't produce any image files.

By adding has_images() methods to the Target and Build objects,
which count associated Target_Image_File objects,
we can correctly determine whether a target has image files
associated with it, and if any of the targets for a build has
image files. This means that we can screen out the left-hand
"Images" menu options for builds which contained image-related
targets (e.g. "core-image-minimal") but which didn't produce
any images (e.g. "rootfs" task).

[YOCTO #9500]
[YOCTO #9784]

(Bitbake rev: f6bba0ff254d5ed3163151d4b938f3a43c9acb0a)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: bavery <brian.avery@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-19 08:56:51 +01:00
Elliot Smith 150e5588a0 bitbake: buildinfohelper: only record image files for tasks which make images
If a target is built which is classified as an "image" target
(e.g. "core-image-minimal"), Toaster reads the list of files in
the image (from the files-in-image.txt file).

However, Toaster continues to do this for builds which don't
produce images, if the recipe providing the target is an
image recipe. This can result in a list of files in the image
being attached to a target which didn't produce an image (e.g.
rootfs).

When associating files with an image, ensure that only targets
with a task which produces an image have "files in the image"
associated with them.

[YOCTO #9784]

(Bitbake rev: 44375d0c2a88e0070b8067c9285b89c54eaf3152)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: bavery <brian.avery@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-19 08:56:51 +01:00
Elliot Smith 00c2c0be5e bitbake: toaster: improve scan for SDK artifacts
SDK artifacts were previously picked up by toaster.bbclass and
notified to buildinfohelper (via toasterui). The artifacts
were then added to the Build object, so that it wasn't clear
which artifact went with which target; we were also unable
to attach SDK artifacts to a Build if they had already been
attached to a previous build.

Now, toaster.bbclass just notifies the TOOLCHAIN_OUTPUTNAME when
a populate_sdk* target completes. The scan is moved to buildinfohelper,
where we search the SDK deploy directory for files matching
TOOLCHAIN_OUTPUTNAME and attach them to targets (not builds).

If an SDK file is not produced by a target, we now look for a
similar, previously-run target which did produce artifacts.
If there is one, we clone the SDK artifacts from that target
onto the current one.

This all means that we can show SDK artifacts by target, and should
always get artifacts associated with a target, regardless of whether
it really build them.

This requires an additional model, TargetSDKFile, which tracks
the size and path of SDK artifact files with respect to Target
objects.

[YOCTO #8556]

(Bitbake rev: 5e650c611605507e1e0d1588cd5eb6535c2d34fc)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: bavery <brian.avery@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-19 08:56:51 +01:00
Elliot Smith f39ae146ea bitbake: buildinfohelper: fix retrieval of targets
When buildinfohelper records the targets for a build, it looks
up any existing targets for a build and creates them if they
are not present. This is because in the case of Toaster-triggered
builds, the Target objects have already been created (inside
triggerBuild()) and don't need to be recreated; but in the case
of cli builds, the Target objects have to be created by
buildinfohelper.

The issue is that the code for retrieving an existing target for
a build only looks for Targets with a matching target and build,
e.g. Targets for build X with target "core-image-minimal". But it
is perfectly legitimate to call bitbake with a command like
"bitbake core-image-minimal:do_populate_sdk
core-image-minimal:do_populate_sdk_ext". In such a case, the
code which looks for matching targets finds two objects, as it
doesn't filter by task.

Add the task into the filter for the Target so that only one
Target object is be returned. Note that a command
line like "bitbake recipe:task recipe:task" will still cause an
error as bitbake doesn't de-duplicate the command line arguments
and will run the recipe:task combination twice.

(Bitbake rev: 1c0a689fdaae6469d4afb98583161073d32ea50b)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: bavery <brian.avery@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-19 08:56:51 +01:00
Elliot Smith 4125da7763 bitbake: toaster: attach kernel artifacts to targets
The bzImage and modules files were previously attached to a build,
rather than to the target which produced them. This meant it was
not possible to determine which kernel artifact produced by a
build came from which target; which in turn made it difficult to
associate existing kernel artifact with targets when those
targets didn't produce artifacts (e.g. if the same machine + target
combination was built again and didn't produce a bzImage or modules
file because those files already existed).

By associating kernel artifacts with the target (via a new
TargetArtifactFile model), we make it possible to find all
the artifacts for a given machine + target combination. Then, in
cases where a build is completed but its targets don't produce
any artifacts, we can find a previous Target object with the same
machine + target and copy its artifacts to the targets for a
just-completed build.

Note that this doesn't cover SDK artifacts yet, which are still
retrieved in toaster.bbclass and show up as "Other artifacts",
lumped together for the whole build rather than by target.

[YOCTO #8556]

(Bitbake rev: 9b151416e428c2565a27d89116439f9a8d578e3d)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: bavery <brian.avery@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-19 08:56:51 +01:00
Elliot Smith e9808576da bitbake: toaster: improve image file suffix retrieval
Refactor retrieval of suffix from image file path, making it a
a method on Target_Image_File. This makes it easier to use this
in the build dashboard for individual images, plus reduces the
complexity of the code required to get all of the image file
suffixes for a build.

(Bitbake rev: 9c38de3dec74c122c2060cad37331bdafc6858ec)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: bavery <brian.avery@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-19 08:56:51 +01:00
Elliot Smith 5dfa120a7c bitbake: toaster: do image and artifact scan on BuildCompleted
Move the image and artifact scan code from toaster.bbclass and
consolidate its logic with the existing logic in buildinfohelper.

Remove handler setup for events which used to be fired from
toaster.bbclass but which are now handled directly by buildinfohelper.

[YOCTO #8556]

(Bitbake rev: f0085cd554604cfff4a3f40a34825fbb6878004f)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: bavery <brian.avery@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-19 08:56:51 +01:00
Elliot Smith b0585e6b0c bitbake: toaster: display Target targets in build dashboard
The build dashboard was showing the targets for the build in the page
heading and title as "Target object".

Add a filter which extracts the "target" from each Target object
as a string so that the heading and title display correctly.

Also sort the image file suffixes alphabetically.

[YOCTO #8556]

(Bitbake rev: 33a24992139e7dc05d14bbe1da60299b732945aa)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: bavery <brian.avery@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-19 08:56:51 +01:00
Ed Bartosh 844e1f9e1d bitbake: runqueue: improve exception logging
Runqueue errors direct the user to view the "failure below",
but no additional error message is available.

Log the stacktrace so that the user can see what went wrong.

Also fix a typo in the log message.

(Bitbake rev: e191f401e372ee181bc02250232ad9cb9a0e9477)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: bavery <brian.avery@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-19 08:56:51 +01:00
Robert Yang 7a220aeaae bitbake: lib/bb/utils.py: return sorted OrderedDict in explode_dep_versions2
The OrderedDict's item is sorted by insertion order, there might be a
problem when build the same recipe again, for example:
- First build of acl:
  Depends: libattr1 (>= 2.4.47), libc6 (>= 2.24)
- Second build of acl:
  Depends: libc6 (>= 2.24), libattr1 (>= 2.4.47)

They are exactly the same depends, but tools like "diff" doesn't think
so. Return sorted OrderedDict will fix the problem.

(Bitbake rev: a392f19f16ef8202ce3c12afbeb186a02438da17)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-19 08:56:51 +01:00
Paul Eggleton bc3a206de3 bitbake: knotty: avoid errors when fetching outside of a task
In a few places we use the fetcher code to fetch files outside of a
task, for example uninative in OE. In that case the pid of the event is
0 and that was causing an error in BBUIHelper.eventHandler(). Check the
pid and do nothing if it's 0.

(Bitbake rev: 59cb919e5cd5c653fb4d69b2d6a4320648443e10)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-19 08:56:50 +01:00
Ross Burton 2afcbfef2c bitbake: build: don't use $B as the default cwd for functions
When bitbake executes a shell or Python function it can cd/chdir() into a
directory before executing the task. If no directory is specified then the
default of $B is used.  However $B is an OpenEmbedded variable and BitBake
shouldn't be aware of it.

To solve this change the semantics slightly so that if no directory is
specified, the current working directory isn't changed.  There's also a sanity
check that emits a warning if a Python task does os.chdir() without restoring
the old path, and the previous working directory is restored.

This does change semantics: whereas before a function in OE would have $B as the
working directory unless specified, now the working directory is the top of the
build tree.  Any breakage this causes can be solved by either adding
do_some_task[dirs] = "${B}" or by using absolute paths in the task.

[ YOCTO #4634 ]

(Bitbake rev: 67a7b8b021badc17d8fdf447c250e79d291e75f7)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-19 08:56:50 +01:00
Ross Burton faa726824d bitbake: lib/bb/build.py: decode the command as UTF-8
The messaging FIFO is UTF-8, so decode the command as UTF-8 as well as the value
as otherwise "bberror" != b("bberror") and none of the messages from shell
functions are ever displayed.

Also add an else to the command parser so unhandled commands are noticed.

[ YOCTO #9947 ]

(Bitbake rev: 42d727743fa599e0a3c5ad2c29a1e6ede1a918bb)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-19 08:47:06 +01:00
Ross Burton b7a741cbca bitbake: lib/bb/utils: fix set_process_name
With Python 3 create_string_buffer needs a bytes() not a str() but as we were
catching all exceptions nobody noticed.

[ YOCTO #9910 ]

(Bitbake rev: 6576a9a95486c28a01d4211b4a33cc3e2c55a7cc)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-19 08:47:06 +01:00
Michael Wood 8dc159dd93 bitbake: toaster: tests Add selenium test for layerdetails page
This tests:
 - Adding remove layer from project
 - Deleting layer
 - Editing layer fields

(Bitbake rev: cabe7e2459fcd561bced2d39ba5bd173576153e5)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:29 +01:00
Michael Wood 8813726f1d bitbake: toaster: add Layer delete front end feature to layerdetails
Add the front end feature to delete a layer from the layer details page.

[YOCO #9184]

(Bitbake rev: 91815229f60eb9deba7d299f05c69b52ff1df59c)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:29 +01:00
Michael Wood e1ba2fd331 bitbake: toaster: api Add util function for returning the error response
Also clean up flake8 warnings in XhrBuildRequest

(Bitbake rev: aa0845242eda8650a97180bf6675551c26554cde)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:29 +01:00
Michael Wood 36dec688c7 bitbake: toaster: layerdetails api Fix saving of git revision of a layer
Update, clean up and move the api for updating a layerversion from the
views to api. Also update the layerdetails page to include the
layerversion id in the url getter.

[YOCTO #8952]

(Bitbake rev: 20f4e23bc86290f0a42881a7cac44c41eafa86fc)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:28 +01:00
Elliot Smith 903c3c2ef8 bitbake: buildinfohelper: ensure task datetimes are timezone-aware
When using toaster-eventreplay to run a bitbake event file
through toasterui/buildinfohelper, errors occur when the
tasks are updated with buildstats info:

  RuntimeWarning: DateTimeField Task.started received a naive
  datetime (2016-07-06 09:15:22.070000) while time zone support
  is active.

This is because a method in buildinfohelper returns a naive
datetime, but Django is expecting timezone-aware datetimes.

Ensure that datetimes used to set the started/ended times on
tasks are converted to timezone-aware datetimes.

(Bitbake rev: df9f4337bec87024ea6a43138c6080a755eb7fab)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:28 +01:00
Ed Bartosh 78b3fe6d5b bitbake: eventreplay: rewrite the script
Rewritten toaster-eventreplay to make code working as expected,
more compact and readable.

[YOCTO #9585]

(Bitbake rev: 45370a860b24a761d1b6e08ba752079cc45f54da)

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-07-08 09:57:28 +01:00
Ed Bartosh 2b56c03264 bitbake: eventreplay: reorganize imports
Cleaned up module imports:
- Removed unused imports
- Removed import of print_function
- Removed duplicated imports
- Splitted importing bb.lib to 2 lines

(Bitbake rev: 332f5c9b20149e9f5757433df9458ce582ff32dd)

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-07-08 09:57:28 +01:00
Ed Bartosh 9431a6f318 bitbake: eventreplay: replace MockConfigParameters with namedtuple
class MockConfigParameters has only one attribute and only __init__
method. Replacing it with namedtuple makes code less nested and more
readable.

[YOCTO #9585]

(Bitbake rev: 5d4df14b0d38f6c89ca16de6dada58b4bb015d71)

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-07-08 09:57:28 +01:00
Ed Bartosh 70cc20daef bitbake: eventreplay: fix event loading code
Event objects are represented by base64-encoded strings in
the event file and can't be loaded by existing eventreplay code.

Fixed the code of loading events from file by decoding base64 strings
into the binary form and loading them with pickle.load.

[YOCTO #9585]

(Bitbake rev: a55c280c167f84caed6518119246e5a55f56cfd4)

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-07-08 09:57:28 +01:00
Ed Bartosh 2199ff5ce6 bitbake: eventprelay: implement setEventMask command
Stored event mask list as self.eventmask for future use.
Fixed Exception: Command setEventMask not implemented.

[YOCTO #9585]

(Bitbake rev: 2e09074c70e89402de8f883dd402cd729118fc7e)

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-07-08 09:57:28 +01:00
Ed Bartosh a1ceb0f9cd bitbake: eventreplay: add MockConnection.getEventHandle method
Fixed AttributeError: 'MockConnection' object has no attribute
'getEventHandle'

[YOCTO #9585]

(Bitbake rev: 6deae30480a4288da0c8b3529e61f3495f260f24)

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-07-08 09:57:28 +01:00
Elliot Smith ed9c309e81 bitbake: toaster: fix layout for command-line builds in recent builds area
Command-line builds were displayed incorrectly, so that the
HTML elements for other builds were being "consumed" by the
command-line build elements due to incorrect positioning of
element end tags.

Fix by ensuring end tags close elements in the right places.

As the indentation was all over the place in the most recent
builds section template, it was almost impossible to see what the
problem was. So that was fixed, too.

[YOCTO #9842]

(Bitbake rev: 01659389813ad61d4f75b9f8d71528581322f0b0)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:28 +01:00
Ed Bartosh 7ed76e4c20 bitbake: bitbake-worker: don't reassign sys.stdout
Worker needs input stream in binary mode as it reads binary content
from it. Current code does it by detaching a buffer from sys.stdin
and assigning it back to sys.stdin.

Detached buffer is io.BufferedReader in binary mode. This operation
is implicit as its purpose is not easily understandable from the code.
Replacing it with fdopen(sys.stdin.fileno(), 'rb') should make the
code more understandable.

Assigning the buffer to sys.stdin is not needed as worker doesn't
use sys.stdin. Moreover, it leads to difficult to debug issues down
the stack. For example, devpyshell doesn't work without reopening
sys.stdin in text mode. This is not needed anymore after this fix as
sys.stdin is not changed in worker code and remains in text mode.

(Bitbake rev: b26bcff4c4d72775f1def7e769015464953b955c)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:28 +01:00
Michael Wood dab3b1b454 bitbake: toaster: views Fix most frequently built target in project reporting
Clean up and fix the most frequently built targets for the "Most built
recipes" section for the project configuration page.

[YOCTO #9846]

(Bitbake rev: 860475cfdd35301fb609ab3c89347566b0ca0adc)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:28 +01:00
Michael Wood 5018d5f095 bitbake: toaster: layerBtn avoid connecting handler to other build buttons
Some pages contain other build buttons which may have the same class
attached. Make sure that we only select the buttons in the tables where
layerBtn is used.

[YOCTO #9841]

(Bitbake rev: ec083fd943c6996307beb3be3421403870d2f2b7)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:27 +01:00
Sujith H 9d730f4747 bitbake: bitbake: toaster-tests: tests for project config
Add basic tests to validate the value, user types
in the text box for DL_DIR and SSTATE_DIR. Added
test case to validate the first char and inclusion
of space between the characters.

[YOCTO #9646]

(Bitbake rev: 1531e98c5ae1693d11d692c3589df29dff9364df)

Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:27 +01:00
Sujith H dabb49be86 bitbake: toaster: fix validation checks for DL_DIR and SSTATE_DIR
Validation logic on the project configuration page
prevented a user from adding ${variable} to these paths.

Update validation so a user can see a better message
when they type characters into the text inputs.
Two types of validation are implemented.

Either:

* The value should start with a "/", to allow absolute paths.

or

* The value should start with a "$", to allow bitbake
   variables like ${TOPDIR}.

[YOCTO #9646]

(Bitbake rev: fca50153caef62a473d1812fd59ec7effe09f8c5)

Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:27 +01:00
Sujith H be00eb29f3 bitbake: toaster: remove SSTATE_MIRRORS from projectconf
Remove SSTATE_MIRRORS from getting blacklisted. Hence the SSTATE_MIRRORS
should be removed from projectconf.html file so that users can know that
this variable is no more blacklisted.

[YOCTO #9598]

(Bitbake rev: b060eecae417521d8340748e7ace7a77488bd596)

Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:27 +01:00
Sujith H f433664fa0 bitbake: toaster: remove SSTATE_MIRRORS from blacklists in views
Remove SSTATE_MIRRORS variable from blacklists in views.py
This helps user to point mirrors using SSTATE_MIRRORS with
toaster.

[#YOCTO 9598]

(Bitbake rev: c3dd4fb193c80ed9a6dbddf7f6a1eadd0964ac8c)

Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:27 +01:00
Richard Purdie b301251668 bitbake: progress: Ensure missing start event is fired
The init function of the parent class fires a progress event for 0
progress rather than a start event. UI code was assuming that progress
events should always have a start event first. This change ensures that
the start event is correctly generated.

This fixes crashes that were seen in knotty in some configurations.

(Bitbake rev: 9841651e050a3e9f395ab3c62545c51197734584)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:27 +01:00
Richard Purdie 1b5688e0f0 bitbake: knotty: Handle process indicators more gracefully
Mistakes can happen with the generation of the progress events, change
knotty to be more tolerant of this rather than crashing, reporting to the
user when something unexpected happens. I haven't debugged why multiple
finish events appear to be triggered.

(Bitbake rev: 7dd06b1016b36420a9c55a45ff29dd64ae1dbcda)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:27 +01:00
Paul Eggleton 1b930b41a5 bitbake: runqueue: report progress for "Preparing RunQueue" step
When "Preparing RunQueue" shows up you can expect to wait up to 30
seconds while it works - which is a bit long to leave the user waiting
without any kind of output. Since the work being carried out during this
time is divided into stages such that it's practical to determine
internally how it's progressing, replace the message with a progress
bar.

Actually what happens during this time is two major steps rather than
just one - the runqueue preparation itself, followed by the
initialisation prior to running setscene tasks. I elected to have the
progress bar cover both as one (there doesn't appear to be much point in
doing otherwise from a user perspective). I did however describe it as
"initialising tasks".

(Bitbake rev: 591e9741e108487ff437e77cb439ef2dbca42e03)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:27 +01:00
Paul Eggleton f3b62c1c2e bitbake: runqueue: add ability to enforce that tasks are setscened
Add the ability to enter a mode where only a specified whitelist of
tasks can be executed outright; everything else must be successfully
provided in the form of a setscene task (or covered by a setscene task).
Any setscene failure outside of the whitelist will cause the build to
fail immediately instead of running the real task, and any real tasks
that would execute outside of the whitelist cause an immediate build
failure when it comes to executing the runqueue as well.

The mode is enabled by setting BB_SETSCENE_ENFORCE="1", and the
whitelist is specified through BB_SETSCENE_ENFORCE_WHITELIST, consisting
of pn:taskname pairs. A single % character can be substituted for the pn
value to match any target explicitly specified on the bitbake command
line. Wildcards * and ? can also be used as per standard unix file name
matching for both pn and taskname.

Part of the implementation of [YOCTO #9367].

(Bitbake rev: 624722c067a7fdd0c0f5d8be611e1f6666ecc4a2)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:27 +01:00
Paul Eggleton 76feac37ce bitbake: knotty: add quiet output mode
Quiet output mode disables printing most messages (below warnings) to
the console; however these messages still go to the console log file.
This is primarily for cases where bitbake is being launched
interactively from some other process, but where full console output is
not needed.

Because of the need to keep logging all normal events to the console
log, this functionality was implemented within the knotty UI rather
than in bb.msg (where verbose mode is implemented). We don't currently
have a means of registering command line options from the UI end, thus
the option actually has to be registered in main.py regardless of the
UI, however I didn't feel like it was worth setting up such a mechanism
just for this option.

(Bitbake rev: db95cdef08e339dec7462bfde3ad7d75c1c60dd8)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:27 +01:00
Paul Eggleton 465f93968f bitbake: knotty: show task progress bar
In addition to the "currently running n tasks (x of y)" message, show a
progress bar for another view on how much of the build is left. We have
to take care to reset it when moving from the scenequeue to the
runqueue, and explicitly don't include an ETA since not all tasks take
equal time and thus it isn't possible to estimate the time remaining
with the information available.

(Bitbake rev: de682015a3fefeff36ddc4197641a700f3fb558d)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:27 +01:00
Paul Eggleton 8d56d596bb bitbake: knotty: add code to support showing progress for sstate object querying
Add support code on the BitBake side to allow sstate.bbclass in
OpenEmbedded to report progress when it is checking for availability of
artifacts from shared state mirrors.

Part of the implementation for [YOCTO #5853].

(Bitbake rev: 070ae856da0715dbaf4c560c837ea796ffc29f00)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:26 +01:00
Paul Eggleton 0e3281f68b bitbake: lib/bb/progress: add MultiStageProgressReporter
Add a class to help report progress in a task that consists of multiple
stages, some of which may have internal progress (do_rootfs within
OpenEmbedded is one example). Each stage is weighted to try to give
a reasonable representation of progress over time.

Part of the implementation for [YOCTO #5383].

(Bitbake rev: 751b75602872a89e8b1a7c03269bc0fdaa149c6f)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:26 +01:00
Paul Eggleton ac5e720575 bitbake: lib: implement basic task progress support
For long-running tasks where we have some output from the task that
gives us some idea of the progress of the task (such as a percentage
complete), provide the means to scrape the output for that progress
information and show it to the user in the default knotty terminal
output in the form of a progress bar. This is implemented using a new
TaskProgress event as well as some code we can insert to do output
scanning/filtering.

Any task can fire TaskProgress events; however, if you have a shell task
whose output you wish to scan for progress information, you just need to
set the "progress" varflag on the task. This can be set to:
 * "percent" to just look for a number followed by a % sign
 * "percent:<regex>" to specify your own regex matching a percentage
   value (must have a single group which matches the percentage number)
 * "outof:<regex>" to look for the specified regex matching x out of y
   items completed (must have two groups - first group needs to be x,
   second y).
We can potentially extend this in future but this should be a good
start.

Part of the implementation for [YOCTO #5383].

(Bitbake rev: 0d275fc5b6531957a6189069b04074065bb718a0)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:26 +01:00
Paul Eggleton 1cf6e14a6c bitbake: knotty: import latest python-progressbar
Since we're going to make some minor extensions to it, it makes sense to
bring in the latest version of python-progressbar. Its structure has
changed a little but the API hasn't; however we do need to ensure our
overridden _needs_update() function's signature in BBProgress() matches
properly.

(Bitbake rev: c3e51d71b36cbc9e9ed1b35fb93d0978e24bc98a)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:26 +01:00
Paul Eggleton 481048cd2a bitbake: knotty: provide a symlink to the latest console log
If you're looking to find the latest console log repeatedly it can be a bit
tedious - let's just create a symlink just as we do with other logs to
make it easy to find.

(Bitbake rev: e9f41c0507a6527bf2ed86506813d4d4a89f8ebf)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:26 +01:00
Ross Burton 312f1a5e74 bitbake: fetch2/wget: attempt checkstatus again if it fails
Some services such as SourceForge seem to struggle to keep up under load, with
the result that over half of the autobuilder checkuri runs fail with
sourceforge.net "connection timed out".

Attempt to mitigate this by re-attempting once the network operation on failure.

(Bitbake rev: 54b1961551511948e0cbd2ac39f19b39b9cee568)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:26 +01:00
Robert Yang c6d50b2729 bitbake: lib/bb/build.py: remove task flag in deltask()
Otherwise the function like d.getVarFlag(e, 'task', True) which is used by
do_listtasks will still get it, and list the deleted tasks.

(Bitbake rev: 779d73619daf59f76f5b0313e7fb5409f6e82553)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-23 14:26:33 +01:00
Ed Bartosh 95f6e7bd0f bitbake: cooker: clean up EvertWriter
Restructured EventWriter code to make it more readable:
 - got rid of init_file method as it's called only once
 - renamed exception variable e -> err
 - renamed event variable e -> evt
 - simplified main 'if' structure of send method

(Bitbake rev: 31977e7bb98f676197c6cee66f6ab4c12d4dcbde)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-20 17:23:57 +01:00
Ed Bartosh f6fc25d1df bitbake: cooker: replace EventLogWriteHandler with namedtuple
class EventLogWriteHandler is a simple wrapper class with only one
class member. Replacing it with namedtuple makes code less nested and more
readable.

(Bitbake rev: 7c5b6812d32d173df36e7f9fc1d877329e79f994)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-20 17:23:57 +01:00
Ed Bartosh a158388a51 bitbake: cooker: don't remove event file
There is no need to remove output file as it gets rewritten by
open(self.eventfile, 'w') anyway.

(Bitbake rev: 1fc9957837b7038dfb983217a3fcd880f143e3a4)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-20 17:23:57 +01:00
Ed Bartosh e28b36e1e8 bitbake: cooker: encode event objects to base64
pickle converts python objects into the binary form that can't be
decoded to text and therefore can't be converted to JSON format.

Attempt to convert event objects raises this error:
TypeError:
    b'\x80\x03cbb.runqueue\nrunQueueTaskSkipped\nq\x00)...
    is not JSON serializable

Encoded pickled event objects to base64 to be able to convert data
structure to JSON.

[YOCTO #9803]

(Bitbake rev: f18055237e6084f90f6221442e3ba021dcc59c50)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-20 17:23:57 +01:00
Ed Bartosh 3e7edc303c bitbake: cooker: move EventLogWriteHandler to the top module level
EventLogWriteHandler object was created and used in
BBCooker.initConfigurationData.
This causes creation of multiple EventLogWriteHandler objects
and results in duplicated entries in the output event file
as BBCooker.initConfigurationData is called multiple times.

Added eventlogfile parameter to EventLogWriteHandler to avoid using
global variable DEFAULT_EVENTFILE.
Moved EventLogWriteHandler to the module level.
Created EventLogWriteHandler object in BBCooker.__init__ to ensure that only
one handler object is created.

(Bitbake rev: d3ad8eee850ec2df54aa09fae44cc7e69c12f32a)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-20 17:23:57 +01:00
Jussi Kukkonen 90d7b09af2 bitbake: depexp.py: port to gtk+3
The code is still a bit icky (and should be refactored to not use
Gdk.threads_enter/leave) but it should work about as reliably as
it did with Gtk+2.

Based on earlier patches by Maxin and Joshua.

(Bitbake rev: 8eee64a64144e27b5b8c2aca88e138882c3deab7)

Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-20 17:23:56 +01:00
bavery ce5523bf52 bitbake: toaster: remove last css file with bootstrap v2 license
Remove unused css file that still had the bootstrap v2 license in it.

(Bitbake rev: a8fe4177a6303aa57301c977c1daf7d4ff6ec586)

Signed-off-by: bavery <brian.avery@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-16 23:54:19 +01:00
George McCollister f74ba25c0a bitbake: runqueue: Use tid instead of taskid in find_chains()
In 2c88afb6 find_chains()'s taskid argument was renamed to tid but
taskid is still used as key to explored_deps dictionary. Use tid instead
of taskid.

(Bitbake rev: 29a34ae8f5306d2779bcc761c52f1f9d13a0c0c5)

Signed-off-by: George McCollister <george.mccollister@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-16 22:42:53 +01:00
Andrew Bradford 26447a0d0b bitbake: fetch2/perforce: Rework to support SRCREV and P4CONFIG
In recipes which use the perforce fetcher, enable use of SRCREV to
specify any of: ${AUTOREV}, changelist number, p4date, or label.  This
is more in-line with how the other fetchers work for source control
systems.

Allow p4 to use the P4CONFIG env variable to define the server URL,
username, and password if not provided in a recipe.

This does change existing perforce fetcher usage by recipes and will
likely need those recipes which use the perforce fetcher to be updated.
No recipes in oe-core use the perforce fetcher.

References [YOCTO #6303]

(Bitbake rev: 6298696bb94a127cdec7964315f6891ba92cd026)

Signed-off-by: Andrew Bradford <andrew.bradford@kodakalaris.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-16 17:37:58 +01:00
Stephano Cetola 9f91785cc5 bitbake: fetch2: fix unpacking of deb packages
Python 3 changed the return value of check_output to binary rather than
a string. This fix decodes the binary before calling splitlines, which
requires a string.

(Bitbake rev: 1072beefe172423873a22a10c7171e10d0401e1e)

Signed-off-by: Stephano Cetola <stephano.cetola@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-16 17:37:58 +01:00
Elliot Smith 34dc5b3573 bitbake: toaster: fix typo which causes table searches to fail
The iterator used to create a search query refers to a
variable "x" which isn't set, causing an "'x' is not defined" error
and preventing table searches (on non-ToasterTables) from working.

Use the "field" variable instead, which contains the name of the
field to add to the query.

[YOCTO #9749]

(Bitbake rev: a3ebeb37f7bd4cffe6707c634b4f0a0ea52ccc45)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-16 17:37:58 +01:00
Ed Bartosh 772e9b4eab bitbake: bitbake: fix wrong usage of format_exc
First parameter of traceback.format_exc is a 'limit' - a number
of stracktraces to format.

Passing exception object to format_exc is incorrect, but it works in
Python 2 as this code from traceback module works:
    while tb is not None and (limit is None or n < limit):
Comparing integer counter n with the exception object in Python 2
always results in True. However, in Python 3 it throws exception:
    TypeError: unorderable types: int() < <Exception type>()

As format_exc is used in except block of handling another
exception this can cause hard to find and debug bugs.

(Bitbake rev: a9509949d7e2adba6e3cd89f97daa19a955855b5)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-16 11:51:26 +01:00
Richard Purdie ff6d458f9a bitbake: parse/ast, event: Ensure we reset registered handlers during parsing
When parsing, we should reset the event handlers we registered when
done. If we don't do this, parse order may change the build, depending
on what the parse handlers do to the metadata.

This issue showed up as a basehash change:

ERROR: Bitbake's cached basehash does not match the one we just generated (
/media/build1/poky/meta/recipes-core/meta/nativesdk-buildtools-perl-dummy.bb.do_unpack)!

This is due to the eventhandler in nativesdk.bbclass being run, despite
this .bb file not inheriting nativesdk.bbclass. The parse order was
different between the signature generation and the main multithreaded
parse.

Diffsigs showed:

bitbake-diffsigs 1.0-r2.do_unpack.sigbasedata.*
basehash changed from 887d1c25962156cae859c1542e69a8d7 to cb84fcfafe15fc92fb7ab8c6d97014ca
Variable PN value changed from 'nativesdk-buildtools-perl-dummy' to '${@bb.parse.BBHandler.vars_from_file(d.getVar('FILE', False),d)[0] or 'defaultpkgname'}'

with PN being set by the event handler.

(Bitbake rev: 0219271d4130c1f4cf071c7577a4101c54c04921)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-15 08:35:07 +01:00
Richard Purdie 27fa181897 bitbake: toaster: Remove mismerged files
Another patch added migrations in the correct location (different date) so
these in the wrong directory can be removed.

(Bitbake rev: 8aa84abc952835792db1614b6fe2305ab9dca9e1)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-15 08:35:07 +01:00
Richard Purdie af04a52bf7 bitbake: taskdata/runqueue: Rewrite without use of ID indirection
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.

(Bitbake rev: 2c88afb60da54e58f555411a7bd7b006b0c29306)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-15 08:35:07 +01:00
Richard Purdie 29b4fb1796 bitbake: runqueue: Change buildable/running lists to sets
Using positions in lists for flags is an odd choice and makes the code
hard to maintain. Maintaining a list is slow since list searches are
slow (watch bitbake -n slow massively with it) but we can use a set()
instead.

This patch uses python sets to maintain the lists of tasks in each state
and this prepares for changing the task IDs from being integers.

(Bitbake rev: 8c1ed57f6ea475b714eca6673b48e8e5f5f0f9c3)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-15 08:35:07 +01:00
Michael Wood 7e54da0581 bitbake: toaster: tests browser Fix selenium tests after bootstrap3 breakage
Fix a number of selectors which have changed after the port to
bootstrap3. Also fix the modal wait_until_visible and returning of the
text for the radio buttons in the modals for edit custom image and new
custom image on the build dashboard.

(Bitbake rev: 5f80dac65f419825bd81a734273a2465d5a01bab)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-15 08:35:07 +01:00
Michael Wood 234a625f40 bitbake: toaster: tests Rename test settings to python compliant name and fix import
Use underscore instead of dash in the file name for the test settings.
Also fix the import of the settings module.

(Bitbake rev: 0bdfcafdd1e2ebc10dc0cd343c8bb77f09a71c90)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-15 08:35:06 +01:00
Michael Wood 000d724312 bitbake: toaster: selenium tests Fix all_projects page and sample tests
Fix the selectors after changes made for bootstrap3 and table links being
removed.

(Bitbake rev: fccc8869dc465b49f236c15a9aa14b7d06694b8e)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-15 08:35:06 +01:00
Michael Wood f48feeb76d bitbake: toaster: selenium tests Update unique custom image string and fix import
- Update the string for recognising a duplicate image recipe
- Fix an incorrect relative import

(Bitbake rev: 830743b1aa29a5ac220141e9c24b2592d6cebb29)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-15 08:35:06 +01:00
Michael Wood 5ee6b706b2 bitbake: toaster: js tests Twitter typeahead library object is now ttTypeahead
Get the ttTypeahead object on the input to see if it's been initialised
correctly.

(Bitbake rev: d382b2afb2939ae1b69a80ad083fb4c47303f8d0)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-15 08:35:06 +01:00
Ed Bartosh aa6894a436 bitbake: toaster: fix wrong usage of print_exc and format_exc
First parameter of traceback.print_exc and traceback.format_exc APIs is
a 'limit' - a number of stracktraces to print.

Passing exception object to print_exc or format_exc is incorrect, but
it works in Python 2 and causes printing only one line of traceback.

In Python 3 comparison of integer and exception object throws exception:
TypeError: unorderable types: int() < <Exception type>()

As these APIs are usually used in except block of handling another
exception this can cause hard to find and debug bugs.

(Bitbake rev: c5a48931ac8db9e56f978c50861c19d0d0c808e3)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-15 08:35:06 +01:00
Ed Bartosh eb634f9e13 bitbake: toaster: changed python version in shebang
Changed python to python3 in shebang to ensure that
manage.py is always run by python3.

(Bitbake rev: 3638b8e5390c36076e14c181e955505750031571)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-15 08:35:06 +01:00
Michael Wood 0a7bd539fa bitbake: toaster: toastergui tests Use new BeautifulSoup syntax
Fix deprecation warning specify the parser used for creating the
BeautifulSoup object.

(Bitbake rev: d34546e88881e89588206877ebaea506cda4f6c2)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-15 08:35:06 +01:00
Elliot Smith eba5321786 bitbake: toaster: open image files in binary mode when sending in response
The view code for downloading image files used the "r" flag
to read the file, then used the open file object to form the
HTTP response.

While this worked in Python 2, Python 3 appears to be more strict
about this sort of thing, and Django throws a UnicodeDecodeError
when a file opened this way is used in a response.

Open the file with the "b" flag (binary mode) so that Django can
correctly convert the binary file handle to an HTTP response.

(Bitbake rev: c4d67968d0ec1d5ff53cdc0dccf6a7869c89597b)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-15 08:35:06 +01:00
Elliot Smith 16df75d49d bitbake: toaster-tests: fix tests for latest Selenium version
Previously, we didn't specify a specific version of Selenium.
When upgrading to Python 3 and installing Selenium to work with it,
the JS unit test broke, as the report format produced by Selenium
had changed.

Modify the test so that it works with the latest Selenium report
format.

Add a note to the README that the given Selenium version should
be used to prevent unexpected test failures.

(Bitbake rev: 571c2b70d3c123614618672ce7532bb5f4c36630)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-15 08:35:06 +01:00
Elliot Smith 6eefd9c1e5 bitbake: toaster: fix broken reference to urllib
The code previously imported urllib to make use of querystring
quoting, but was modified to support Python 3. During this
process, the reference to urllib was not fixed, which resulted
in table filters breaking.

Remove the reference to urllib (which is no longer imported)
and instead reference the imported unquote_plus() function.

(Bitbake rev: f66ee686d4e3002a4a38a7424bcc605a6df9db0b)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-15 08:35:06 +01:00
Ed Bartosh 79a3954afc bitbake: toaster: fix test_toaster_tables
Removed unneeded code as it causes the following error in Python 3:
    TypeError: expected bytes, bytearray or buffer compatible object

(Bitbake rev: 1626e986820da626c19aa8c664155a2cb1db8fd9)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-15 08:35:06 +01:00
Ed Bartosh 4422d26dd6 bitbake: toaster: fix incorrect file mode
Python 3 complains about 'wa' mode this way:
 ValueError: must have exactly one of create/read/write/append mode

Fixed by using 'a' mode.

[YOCTO #9584]

(Bitbake rev: eb23a84e079125a08d0c8e910f7035ad9584c432)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-15 08:35:05 +01:00
Ed Bartosh c28f918e5d bitbake: toaster: decode response content
Decoded response content to str to pass it to json.load as it breaks
in Python 3 with this error:
   TypeError: expected bytes, bytearray or buffer compatible object

[YOCTO #9584]

(Bitbake rev: 3566ecc3ae682358d1fc58bdc0bed5cbed5e9608)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-15 08:35:05 +01:00
Ed Bartosh 1fd160016d bitbake: toaster: fix migrations
(Bitbake rev: bfb44886c3bec8320e4f845c9ff24ae2a795aa9f)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-15 08:35:05 +01:00
Ed Bartosh f0740b038f bitbake: toaster: replace viewkeys() -> keys()
Python 3 doesn't have dict.viewkeys method, renaming
to keys().

[YOCTO #9584]

(Bitbake rev: 8ae2fc26fc7c4f42817dece62b9a59fbda27c0b0)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-15 08:35:05 +01:00
Michael Wood 5bebe39a8a bitbake: toaster: bin Use python 3 for our django modules check
Explicitly use python3 so that the modules for python3 are checked.

(Bitbake rev: e7951541c34c5561187110ba0ec69b9c45022747)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-15 08:35:05 +01:00
Belen Barros Pena e23faacd6f bitbake: toaster: BuildTasksTable filters remove outcome NA option
In the 'outcome' filter for tasks, remove the 'not applicable' option,
since it should not be exposed to users.

(Bitbake rev: 4e21817b0d7a91e634bdb2069850627c38fde053)

Signed-off-by: Belen Barros Pena <belen.barros.pena@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-15 08:35:05 +01:00
Belen Barros Pena 0db23ae759 bitbake: toaster: BuiltPackagesTable format empty state in packages table
The explanatory message in the empty state of the packages built table
was missing some spaces.

(Bitbake rev: 70f600f86ec4d536004d968919e86d2afa58d585)

Signed-off-by: Belen Barros Pena <belen.barros.pena@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-15 08:35:05 +01:00
Belen Barros Pena 1a00cdbcb1 bitbake: toaster: build data Fix left navigation
Make sure the current page is always highlighted in the left navigation.

(Bitbake rev: 3d7f5d6ae843bcc3b5af1a9414ab5cb2759d0853)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Belen Barros Pena <belen.barros.pena@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-15 08:35:05 +01:00
Belen Barros Pena a7d498dfd3 bitbake: toaster: port all build analysis pages to bootstrap 3
Port all the pages in the build analysis area to bootstrap version 3.

(Bitbake rev: f963b73f0bf32db2df39dd79d8d85184c280cda0)

Signed-off-by: Belen Barros Pena <belen.barros.pena@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-15 08:35:05 +01:00
Belen Barros Pena 46271833be bitbake: toaster: buildtables Remove links from non name fields
Design change to have no links for non-named fields in BuiltPackagesTable.
BuiltRecipesTables and BuildTasksTable.

Additionally:
- Fix class and elements for Bootstrap3 in help text.
- Change title of InstalledPackages table to Packages Included.
- Change which columns are default shown/hidden columns.

(Bitbake rev: 7c377e161a90184a4786e33951d8c0e30688ba3b)

Signed-off-by: Belen Barros Pena <belen.barros.pena@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-15 08:35:05 +01:00
Elliot Smith de3984ccdb bitbake: toaster: fix typo which prevents filters from working
'k' was replaced by 'key' at some point but not fixed in the
body of the loop. This caused a failure when the the query
was constructed for a filtered queryset, due to the variable
not being defined.

(Bitbake rev: 37fb9a364e645baadda30cc74a18baa565f39857)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-15 08:35:04 +01:00
Elliot Smith ef72321fe4 bitbake: toaster-tests: maximize browser window when running UI tests
In some pages of the UI, the UI tests failed because parts of
the UI which should be visible were being reported as not
visible by the Selenium PhantomJS driver.

On investigation, it turns out that PhantomJS uses a very narrow
default window. This meant that some parts of the UI were being
clipped and were thus not "visible" to the driver, causing test
failures (specifically, on the new custom image page).

Ensure that the window is maximized before running tests to
prevent this happening.

(Bitbake rev: 3f61bef9359926211be7a3177a2071963726ead5)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-15 08:35:04 +01:00
Michael Wood dd764003ea bitbake: toaster: Rework displaying package dependencies across Toaster
After porting the build table to a unified mechanism for showing
dependencies in tables it highlighted that the dependencies selected to
be shown were un-filtered. i.e. all dependencies from all contexts were
shown. The context for a package's dependencies is based on the target
that they were installed onto, or if not installed then a "None" target.

Depending on where the template for the dependencies are show we need to
switch this target which is why a filter and utility function on the
model is added.

Additionally to use the same templates in the build analysis we also
need to optionally add links to the build data for the packages being
displayed as dependencies.

Customising a Custom image recipes may or may not have a target
depending on whether they have been built or not, if not we do a best
effort at getting the dependencies by using the last known target on
that package to get the dependency information.

[YOCTO #9676]

(Bitbake rev: 31e7c26cc31a7c8c78c1464fa01581683bfd2965)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-15 08:35:04 +01:00
Michael Wood 89433a35e6 bitbake: toaster: widgets ToasterTable Catch template rendering exceptions
If a cell template rendering causes an exception catch it and carry on,
this at least allows the table to show the rest of the data if nothing
else. Also improve the error logging so that it's possible what the
offending template snippet was.

(Bitbake rev: 566b4fbe9cfe4c6c0605c4f6444083ee4cf8b958)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-15 08:35:04 +01:00
Michael Wood 82722cb564 bitbake: toaster: tests Add new build tables to tests
- Add new build tables to be tested
- Add required data into the fixture and clean up a few empty fields
- Fix the SoftwareRecipesTable specific test so as not to rely on two
  particular defined recipes

(Bitbake rev: 7cf23671659666b27b5629fecd5f947f9bdb94e0)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-15 08:35:04 +01:00
Michael Wood c42f1cc81d bitbake: toaster: table.js Add the ability to highlight a particular row
As in the old build tables it's useful to jump and highlight a
particular row in the table using the #hash in the URL.

(Bitbake rev: 927bfc26ffcb0eb6c0a5b3c0905b7efc2f19b9a2)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-15 08:35:04 +01:00
Michael Wood caae3b6206 bitbake: toaster: port Installed packages table to ToasterTable
(Bitbake rev: 2418c092abd9a503becf5e786125f8cdddd8652c)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-15 08:35:04 +01:00
Michael Wood b2a68f5511 bitbake: toaster: port Task tables to ToasterTables widget
Port the Task based tables to ToasterTable. This is the Task, Time, CPU
usage and Disk I/O tables.

(Bitbake rev: bebcef7a4bf08b10e472475435ddc7a524364adb)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-15 08:35:04 +01:00
Michael Wood 32d1e2dd25 bitbake: toaster: port Built recipes table to toastertables
(Bitbake rev: 9434d3925bb7768876aae8d649ea00b8d849c6e9)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-15 08:35:04 +01:00
Michael Wood a786ac14f1 bitbake: toaster: port table for Built packages to ToasterTable
This is the table that displays all the packages built in the build.
Build -> Packages. Adds a template snippet for the git revision popover.

(Bitbake rev: df62f38ff4e634544c9b1e97c5f6ca45e84a4f1e)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-15 08:35:04 +01:00
Michael Wood b63f9518e7 bitbake: toaster: ToasterTable widget add an 'a' to Name in Exception class
(Bitbake rev: 4c0e07b8379381cfe887a4c65d2f61af05914082)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-15 08:35:04 +01:00
Belen Barros Pena 0bd6095d92 bitbake: toaster: toaster tables Enable complex empty states
Make sure we can create empty states for toaster tables that include
actions for users to get out of the empty state. Allows a template to be
used as an empty state.

(Bitbake rev: 9f21a1781345a2d2757616a9ab6f34ec48e9e93d)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Belen Barros Pena <belen.barros.pena@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-15 08:35:03 +01:00
Belen Barros Pena 443f7b3915 bitbake: toaster: Migrate project configuration from bootstrap 2 to bootstrap 3
Convert all the HTML templates, JS and CSS in the project parts of
toaster to use bootstrap 3.

(Bitbake rev: 69527a731eada699d3f604ff8f3ae9410981ba9b)

Signed-off-by: Belen Barros Pena <belen.barros.pena@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-15 08:35:03 +01:00
Elliot Smith 79e0eb9e52 bitbake: toaster: work-around our lack of a synchronous fetch for typeaheads
The Twitter typeahead.js library expects the developer to use
a source which does a local search for matching suggestions, then
falls back to a remote search if that doesn't return enough
results.

However, in Toaster, we don't do any caching of the suggestions
for a typeahead, so our source only works in asynchronous mode.

Consequently, we see fewer than the expected number of suggestions
if the typeahead has already shown suggestions matching a query.
For example, searching for "meta-n" in the layers typeahead will
show the results for this query; but when the query changes to
"meta-ne", a new set of results is fetched, which mostly overlaps
with the results for "meta-n". The typeahead assumes that the
overlapping items are locally cached and have been delivered
synchronously, and just appends the new results which don't
overlap with the previous query. But because we don't provide any
results synchronously, we just end up with the single
non-overlapping result in the drop-down.

This can be fixed by hacking typeahead.js so that instead of
appending asynchronous results, we always overwrite and redraw
the whole typeahead menu.

This is a temporary fix, and should be properly fixed (when we
have time), perhaps by using typeahead.js's associated Bloodhound
library.

Added a note about the hack to the license file as an explanation
of why the unminified JS file is included in Toaster.

(Bitbake rev: afbaf326e1123c92952fa71e0e820a4ff83488ca)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-15 08:35:03 +01:00
Elliot Smith cd7b48cd0d bitbake: toaster: migrate typeahead library
Migrate from Bootstrap 2's built-in typeahead to Twitter's
typeahead library.

This is to facilitate moving to Bootstrap 3, which doesn't have
a typeahead.

(Bitbake rev: 0748177b40188a6fb735fe1ba1c17294afa4a3d0)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-15 08:35:03 +01:00
Michael Wood 64622029d7 bitbake: toaster: tests Add a BuildTest helper class
Add a helper class for running build tests. Subclass this and call the
build method to get setup for running tests on the resulting data from a
build.

(Bitbake rev: 2cafb16033b2f38156e6e0a74c02120f87a4fa92)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-15 08:35:03 +01:00
Belen Barros Pena 6f924f394a bitbake: toaster: tweaks to recipe file downloads
* In the custom images table, show the recipe file and download icon
only when the recipe file exists and can be downloaded.

* Also in the custom images table, make sure the download icon tooltip
shows on hover.

* In the custom image details page, show the correct icon (download)
next to the recipe file in the right hand column.

* In the custom image details page, show the recipe file and download
icon in the right hand column only when the recipe file exists and can
be downloaded

* Also in the custom image details page, simplify the help text we show
when the 'download' button is disabled: it gave so much information about
what's actually happening under the hood that it was a bit hard to
follow.

(Bitbake rev: 5d4172bc005efe209de595f6a151ae9ed062d051)

Signed-off-by: Belen Barros Pena <belen.barros.pena@linux.intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-15 08:35:03 +01:00
Michael Wood abfd095a05 bitbake: toaster: testsjs Add call back to append elements on completion of tests
When the tests are complete add some marker elements to the test page
DOM which can then looked at for a selenium browser test.

(Bitbake rev: 81798ab046b0717614e28e0a339172f3803e451b)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-15 08:35:03 +01:00
Robert Yang 71765a90d1 bitbake: cooker.py: fix warn() -> warning()
Fixed:
DeprecationWarning: The 'warn' method is deprecated, use 'warning' instead

(Bitbake rev: a3f464d202dafef4538e66c008cdecb7b8709ed1)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-13 12:16:10 +01:00
Richard Purdie f2e5d88461 bitbake: data_smart/utils: Add 'd' to the context used for better_eval in python expansion
If a line like:

foo=${@' '.join([d.getVar('D', True) + x for x in (' '.join([d.getVar('FILES_bash-' + p, True) or '' for p in ['lib', 'dev', 'staticdev', 'doc', 'locale', 'ptest']])).split()])}

is added to a function like do_install, it fails with Exception name 'd'
is not defined. This is due to a change of behaviour in python 3 compared
to python 2. Generator expressions, dict comprehensions  and set comprehensions
are executed in a new scope but list comprehensions in python 2.x are not. In
python 3 they all use a new scope.

To allow these kinds of expressions to work, the easiest approach is
to add 'd' to the global context. To do this, an extra optional parameter
is added to better_eval and we use that to add 'd'.

(Bitbake rev: 8f74881037bb01013d3d439dc0c269909a198c1c)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-13 12:16:10 +01:00
Mariano Lopez 40e789d1fe bitbake: lib/bb/main.py: Fix use of BBPOSTCONF and BBPRECONF
The functionality of BBPOSTCONF and BBPRECONF was added in
commit 21b314d4d1 but there
was a typo in the variable name that raises an exception
in bitbake.

[YOCTO #9235]

(Bitbake rev: 6d1379c8818400e5cdc442e6142f08a110fd5b95)

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-09 18:00:58 +01:00
Richard Purdie 438ac32628 bitbake: codeparser: Use hashlib for hashing, not hash()
"hash() is randomised by default each time you start a new instance of
recent
versions (Python3.3+) to prevent dictionary insertion DOS attacks"

which means we need to use hashlib.md5 to get consistent values for
the codeparser cache under python 3. Prior to this, the codeparser
cache was effectively useless under python3 as shown by performance
regressions.

(Bitbake rev: 12d43cf45ba48e3587392f15315d92a1a53482ef)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-03 13:48:33 +01:00
Richard Purdie 5f2facfc1d bitbake: codeparser: Small optimisation to stop repeated hash() calls
No functionality change, just avoids function call overhead in a
function which loops heavily.

(Bitbake rev: 633c0c19f87a92497a7e9771811cdc953e1b7047)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-03 13:48:33 +01:00
Paul Eggleton 02ac95ab5d bitbake: fetch2: fix unpacking of deb packages
deb packages in modern Debian versions have the data tarball compressed
with xz rather than gzip, and thus explicitly extracting data.tar.gz
fails. Unfortunately ar doesn't support wildcards matching items to
extract, so we have to find out what the name of the file is first and
then extract it, relying on tar to figure out how to unpack it based on
the filename rather than doing it with pipes and making that
determination ourselves.

(Bitbake rev: 17ff08d225a8fa7faffd683c028369574954fba9)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-03 13:13:31 +01:00
Peter Kjellerstedt 08c6808d01 bitbake: fetch2/git.py: References must match exactly
Previously the code used to match a reference to its SHA-1 in
_latest_revision() used the Python "in" operator, which made it match
if the reference matched the beginning of an existing tag or
branch. This test, however, must be exact. I.e., either the reference
matches a tag or branch exactly, or it does not match at all.

(Bitbake rev: e5986c78a6108fd7578989c20efcbf0b81c97e03)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-03 13:13:30 +01:00
Markus Lehtonen 2660ddeb2d bitbake: cookerdata: print an error if layer dir does not exist
Makes it easier for user to identify problems, e.g. typos, in BBLAYERS.

[YOCTO #9507]

(Bitbake rev: 32c9689e4b492dc5821749e284e397d717af2a6c)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-03 13:13:30 +01:00
Paul Eggleton 0726b2d5cd bitbake: bitbake-layers: show-layers: disable parsing
We don't need to parse all recipes just to show the list of layers,
since that comes straight from the configuration, so save a bit of time
by not doing so. (A minor regression that came in with the the
bitbake-layers refactoring).

(Bitbake rev: a609ad7d560260a8d50dfa197cd960f496c5da73)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02 22:13:38 +01:00
Ed Bartosh 3a76339827 bitbake: toaster: use python3 explicitly
Explicitly used python3 as default python for oe builds
will continue to be python2.

[YOCTO #9584]

(Bitbake rev: fde5c962cb69a11b072d1f238c2371a5137d030d)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02 08:24:05 +01:00
Ed Bartosh 2b362f6342 bitbake: toaster: fix urllib imports
Some functions have been moved from urllib to urllib.parse
in python 3. Modifying the code to import unquote, urlencode and
unquote_plus from urllib.parse if import from urllib fails should
make it working on both python 2 and python 3.

(Bitbake rev: b91aa29fa20befd9841678a727bb91100363518f)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02 08:24:05 +01:00
Ed Bartosh 2de58c97a5 bitbake: toaster: don't use mru.count in the template
mru is a list. It has a count method, but it differs from the
one for the queryset. Using mru.count causes 'Latest project builds'
section to silently disappear when toaster runs on python 3.

(Bitbake rev: c3ff90c9f028bff5733ebac7b5e72a4688addd3e)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02 08:24:05 +01:00
Ed Bartosh ce9cff5b28 bitbake: toaster: use // operator instead of /
Division operator works differently in Python 3. It results in
float unlike in Python 2, where it results in int.

Explicitly used "floor division" operator instead of 'division'
operator. This should make the code to result in integer under
both pythons.

(Bitbake rev: 0c38441ed99b49dae8ef9613e320f0760853d6aa)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02 08:24:04 +01:00
Ed Bartosh 9434eee39a bitbake: Revert "buildinfohelper: work around unicode exceptions"
This commit causes buildinfohelper to crash when run on python 3
as python 3 doesn't have unicode builtin function.

This reverts commit 7a309d964a.

(Bitbake rev: 750ca5c8d5a25fc519b75c56352dec7823c7e240)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02 08:24:04 +01:00
Ed Bartosh 2448df7d11 bitbake: xmlrpc: add parameter use_builtin_types
Added use_builtin_types parameter to XMLRPCProxyServer.__init__
to fix this error:
    ERROR: Could not connect to server 0.0.0.0:37132
    : __init__() got an unexpected keyword argument 'use_builtin_types'

(Bitbake rev: ceb6e5bd33a25c45c2afe1559b9394c466db8a92)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02 08:24:04 +01:00
Ed Bartosh 7cd768061b bitbake: toaster: use knotty when working with bitbake server
Using empty BITBAKE_UI environment variable causes bitbake server
to fail with the error:
    FATAL: Unable to import extension module "" from bb.ui
           Valid extension modules: knotty or toasterui\n'

Used BITBAKE_UI="knotty" when starting and stoping bitbake
server to solve above issue.

(Bitbake rev: b9a9ddfb6f53259be214032fb93812149d0cce19)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02 08:24:04 +01:00
Ed Bartosh 15bb3d4e7f bitbake: toaster: fix migrations
Created two new migrations due to the models changes made
in python3 patchset.

(Bitbake rev: 9a6b211b2e15734379186408995851b50a2e0805)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02 08:24:04 +01:00
Ed Bartosh de21205d3d bitbake: toaster: moved import bb.server.xmlrpc
Moved import xmlrpc module to the place where it's used
to avoid toaster crashes when importing bitbake code.

NOTE: This patch is made to be able to partly test toaster
with bitbake from master. It can be removed as soon as bb.server.xmlrpc
is ported to python 3.

(Bitbake rev: 0c5d691746fb02807568a8a470969a0b68e21915)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02 08:24:04 +01:00
Ed Bartosh 5074c600f3 bitbake: toaster: read timezone files in binary mode
Used 'rb' mode to open files to avoid unicode error when code
runs on python 3:
   UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80
                       in position 44: invalid start byte

[YOCTO #9584]

(Bitbake rev: 1414866b84fe1fd674ea79500cd62eda3aa30b33)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02 08:24:04 +01:00
Ed Bartosh cf454d74a8 bitbake: toaster: use re.sub() instead of translate()
translate has different set of parameters in python 3 and
can't be used the way it's used in toaster api module.

Replacing it with re.sub() should make the code work in
both python 2  and python 3.

[YOCTO #9584]

(Bitbake rev: 7cc3a41139abc5b8d1eef4376fb19aba3910ce0d)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02 08:24:04 +01:00
Ed Bartosh d393fe6cff bitbake: toaster: replace map with list comprehensions
map returns map object in python 3. Replaced calls of
map to equivalent list comprehensions in the code which
requires lists.

[YOCTO #9584]

(Bitbake rev: d41eb6d6c061cb35ec1ecd899f856876f9077167)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02 08:24:04 +01:00
Ed Bartosh 314541f600 bitbake: toaster: use items and range instead of old APIs
Used items() and range() APIs instead of iteritems() and
xrange() as latter don't exist in python 3

[YOCTO #9584]

(Bitbake rev: 372dd3abcb201bd9ac2c3189c5505d3578ce0dd0)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02 08:24:04 +01:00
Ed Bartosh 96ce543150 bitbake: toaster: use decode('utf-8') for binary data
Decoded binary data to utf-8 to fix the following
error when runnign on python 3:
TypeError: Type str doesn't support the buffer API

[YOCTO #9584]

(Bitbake rev: 752ea00919ef054622a51ce097923309934eff2b)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02 08:24:03 +01:00
Ed Bartosh 46ed4fff34 bitbake: toaster: modified list of dependencies
Removed dependency to argparse and wsgiref as they're in
standard python library.

wsgiref crashes during installation with python 3 as it's not
compatible with python 3.

Added dependency to pytz as it's used in the toaster code.

(Bitbake rev: 46f185afaaef74c566eec6d8fc1edc68a3b96b32)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02 08:24:03 +01:00
Ed Bartosh 9a3f2b3912 bitbake: toaster: fix local imports
Replaced local imports with absolute imports.
Used .module for local imports.

This should make the code to work on python 2 and python 3.

[YOCTO #9584]

(Bitbake rev: 3f1e68c783308dcb51242d0fdeef758e581ccc8c)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02 08:24:03 +01:00
Ed Bartosh 0224f75999 bitbake: toaster: fix imports to work for python 3
Some APIs have been moved to other modules in python 3:
 getstatusoutput: moved from commands to subproces
 urlopen: moved from urllib2 to urllib.request
 urlparse: moved from urlparse to urllib.parse

Made the imports work for both python versions by
catching ImportError and importing APIs from different
modules.

[YOCTO #9584]

(Bitbake rev: 1abaa1c6a950b327e6468192dd910549643768bb)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02 08:24:03 +01:00
Ed Bartosh bbc6e754e8 bitbake: toaster: get rid of using reduce
Replaced compicated calls of reduce with more clear code.
As reduce was removed from python 3 this change is mandatory
for the code to work on both pythons.

Here is an example change for illustration purposes:

original code:

  querydict = dict(zip(or_keys, or_values))
  query = reduce(operator.or_, map(lambda x: __get_q_for_val(x, querydict[x]), [k for k in querydict])))

replaced with:

  query = None
  for key, val in zip(or_keys, or_values):
      x = __get_q_for_val(k, val)
      query = query | x if query else x

[YOCTO #9584]

(Bitbake rev: 249d0bc6094ec9f369a02b78d8ed634a239e5ee4)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02 08:24:03 +01:00
Ed Bartosh 7c44d883b4 bitbake: toaster: use force_text instead of force_bytes
Usage of force_bytes in BuildRequest.__str__ method caused
python 3 to throw "__str__ returned non-string (type bytes)"
error.

Replaced force_bytes with force_text to make the code working
on both python 2 and python 3.

[YOCTO #9584]

(Bitbake rev: 9dd9c1393a84d1110c647e84253af8e0bb6acc45)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02 08:24:03 +01:00
Richard Purdie 8a93f5f32e bitbake: goggle/image-writer: Drop since bitrotting and no longer used
The upgrade to python3 is the final nail in the coffin for image-writer
and the goggle UI. Neither seem used or recieve patches and are based
on old versions of GTK+ so drop them, and the remaining crumbs support
pieces.

(Bitbake rev: ee7df1ca00c76f755057c157c093294efb9078d8)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02 08:24:03 +01:00
Richard Purdie 685628ebc4 bitbake: image-writer/goggle: Disable pygtkcompat problems
Disable the problematic gtk usage for use with pygtkcompat. The following
commit removes these tools/UIs entirely but we may as well leave this
piece in the history in case anyone does want a starting point for reusing
them.

(Bitbake rev: c53c7418d392452450352ca2175667dbdbd92401)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02 08:24:03 +01:00
Jeremy Puhlman e80a8c25dc bitbake: lib/bb: Set required python 3 version to 3.4.0
get_context was added to mutliprocessing as part of 3.4.0

(Bitbake rev: 710351610e3ca4a1b61abc67564f84907e9b2f1c)

Signed-off-by: Jeremy Puhlman <jpuhlman@mvista.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02 08:24:03 +01:00
Richard Purdie a15e538d50 bitbake: data_smart: Simplify ExpansionError exception
This seemingly convoluted syntax doesn't work in python3. Instead
use the chained exception handling syntax which appears to make more
sense here.

(Bitbake rev: b19a4c5166303b1fa680582adf63e6a5564bfb4c)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02 08:24:02 +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 ef1df51651 bitbake: bitbake: Drop futures usage since we're python 3
(Bitbake rev: bf25f05ce4db11466e62f134f9a6916f886a93d9)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02 08:24:02 +01:00
Richard Purdie deca147645 bitbake: bitbake/pyinotify.py: Upgrade to py3 version
(Bitbake rev: 5ee80d77bc278758e411048ed09551ab65b9e72d)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02 08:24:02 +01:00
Richard Purdie 822eabf32d bitbake: bitbake/bs4: Upgrade 4.3.2 -> 4.4.1 (python 3 version)
Upgrade to 4.4.1 which has been run through 2to3 as per the maintainers
recommendation for v3 use.

(Bitbake rev: 2f4b98af93c971a8c466ffaf3c09cca0edb6e3ad)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02 08:24:02 +01:00
Richard Purdie 2192a48a5d bitbake: cooker: Fix parse progress for python3
Under python the type conversions can mean there are float values
used for triggering the parse progress events which then fails.
Add an explict int() conversion to ensure the parse events are
generated under python3.

(Bitbake rev: 138329c58e92744c56aae3ab70ceeef09613250c)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-21 12:15:45 +01:00
Michael Wood 409c940533 bitbake: toaster: tests builds Add SSTATE_MISS as a valid condition for tc=833
Task.SSTATE_NA and Task.SSTATE_MISS are both valid conditions for the
condition that a Task.OUTCOME_COVERED and Task.OUTCOME_PREBUILT.

(Bitbake rev: acac9bf660ac5939beb64d7b8d55541dea1c7b4e)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-20 10:09:03 +01:00
Michael Wood 0664a89ef0 bitbake: toaster: tests build Add a test for a build of core-image-minimal
This is a port of the oe self test to the django test framework from
oe-core meta/lib/oeqa/selftest/_toaster.py

(Bitbake rev: 94418b1b2f9466d35461acdb982fd6b130b2331c)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-20 10:09:03 +01:00
Michael Wood 085688c8ed bitbake: toaster: tests Add a BuildTest helper class
Add a helper class for running build tests. Subclass this and call the
build method to get setup for running tests on the resulting data from a
build.

(Bitbake rev: d1882371cae6b9a8296ea739e6e46ca6a6dc9da8)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-20 10:09:03 +01:00
Michael Wood 5ce1adb177 bitbake: toaster: Add a specific test settings file
When running certain tests we want a particular database specified.
When bitbake toaster ui is being tested pass it these test settings so
that it uses the same database as the unit tests running.

(Bitbake rev: c52e34cac4362ba0a3cb3ea1fcb639e1d802aa85)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-20 10:09:02 +01:00
Michael Wood 82dc991f48 bitbake: toaster: runbuilds move the execution sequence out of the poll loop
Move the execution sequence for a build out of the polling loop and into
it's own fuction. This means that we can call the function on it's own
if we just want to trigger one build rather than infinite polling.
This is something needed for the build tests.

(Bitbake rev: e8e059602c31394a4be5293e2ca0b8434fb4a8cf)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-20 10:09:02 +01:00
Michael Wood db84307055 bitbake: toaster: Remove DATABASE_URL being passed around as an environment var
We don't need to pass the DATABASE_URL around and read it back if we
setup the django framework in the correct way.
We make the default sqlite database path a full path so that the
database isn't being assumed to be in CWD.

Also add some more useful comments on the database settings.

This is preparation work to migrate the build tests and be able to
trigger builds on differently configured databases.

(Bitbake rev: 973c740404ca6a09feea250d3433075995067fe0)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-20 10:09:02 +01:00
Sujith H 8fba59ce45 bitbake: toaster-tests: tests for project config
Add basic tests to validate the value user types
in the text box for IMAGEFS_TYPES. Added a test
case to show the checkbox get automatically selected
when user types value available in the check list.
Added a test case to verify if the check box is enabled
then the text box should also get updated accordingly.

[YOCTO #7828]

(Bitbake rev: 62c74eb38f44d98b40427edf56e40785b076a938)

Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-20 10:09:02 +01:00
Belen Barros Pena 1aab29ed8d bitbake: toaster: projectconf Small tweaks to IMAGE_FSTYPES form
Add a label to clarify the purpose of the first input field, replace <p>
with <label> for the second set of controls, and give some top margin to
the validation message.

(Bitbake rev: 99b1b52fe4f2b593d7835d2db64eb028ed42600a)

Signed-off-by: Belen Barros Pena <belen.barros.pena@linux.intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-20 10:09:02 +01:00
Sujith H c81d03e8a3 bitbake: toaster: handle multiple imagefs types
This functionality helps users to add custom
image fs types available other than the checkboxes
in the UI. User can add imagefs types in the text
box and use them in the build.

[YOCTO #7828]

(Bitbake rev: c14cbb026598be064f08f46bb513456c7a3089f5)

Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-20 10:09:02 +01:00
Richard Purdie c9867c4624 bitbake: cooker: Improve taskgraph file handling
Use open() instead of file() and close files when finished with them.

(Bitbake rev: 033c5a16ff19781ed793c2d97d285884017a2a4e)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-19 15:19:11 +01:00
Richard Purdie 2970800a09 bitbake: codeparser: Increase cache version after code parser dependency changes
(Bitbake rev: 4d880f1d5794f569b6eb5f6e7e3001dd671633c0)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-19 09:05:21 +01:00
Christopher Larson 1fb330bea6 bitbake: bb.codeparser: track variable flag references
Previously we only tracked the flags (minus excluded) of variables we depend
on, but not the flags we use explicitly.

(Bitbake rev: bdeb3dcd7c92e62a7c079e7b27048c4114f24a3a)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-19 09:05:21 +01:00
Christopher Larson 32ee30a46d bitbake: Provide LAYERDIR_RE for layer.conf
This variable is a regex-escaped version of LAYERDIR, for safer use in
BBFILE_PATTERN, so as to avoid issues with regex special characters in the
layer path.

[YOCTO #8402]

(Bitbake rev: 72900522778b6ff08b135bf8bb97dff3f1a20bd9)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-19 09:05:21 +01:00
Richard Purdie 90bc9b4f33 bitbake: cache: Increase cache version after task checksum calculation changes
(Bitbake rev: 6df0425a9d5c4c520eb7845d8f6175d9641779a7)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-19 09:05:21 +01:00
Christopher Larson 692b87497e bitbake: Implement support for per-task exports
(Bitbake rev: 4506ccf1495c6ed6e8ed678f4baa166bc94d1761)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-19 09:05:20 +01:00
Christopher Larson a809f1c6af bitbake: bb.cooker: show limited traceback for parsing ExpansionError
It's useful to see tracebacks for ExpansionErrors, but only if we skip the
leading bitbake-internal elements, otherwise we see elements of the expansion
process.

As one example:

Before:

    ERROR: ExpansionError during parsing /scratch/yocto-new/external-as-needed/poky/meta/recipes-core/glibc/glibc-locale_2.23.bb: Failure expanding variable PV[:=], expression was ${@get_external_libc_version(d)} which triggered exception AttributeError: 'module' object has no attribute 'external'

After:

    ERROR: ExpansionError during parsing /scratch/yocto-new/external-as-needed/poky/meta/recipes-core/glibc/glibc-locale_2.23.bb
    Traceback (most recent call last):
      File "PV[:=]", line 1, in <module>
      File "/scratch/yocto-new/external-as-needed/meta-sourcery/recipes-external/glibc/glibc-external-version.inc", line 3, in get_external_libc_version(d=<bb.data_smart.DataSmart
    object at 0x7f05d2566950>):
             sopattern = os.path.join(d.getVar('base_libdir', True), 'libc-*.so')
        >    found_paths = oe.external.find_sysroot_files([sopattern], d)
             if found_paths:
    ExpansionError: Failure expanding variable PV[:=], expression was ${@get_external_libc_version(d)} which triggered exception AttributeError: 'module' object has no attribute 'external'

(Bitbake rev: 7ff5b9eed82b7f4fd138fc6d746a0b79efbea98a)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-19 09:05:20 +01:00
Christopher Larson 6bbe4fe48c bitbake: bitbake-layers: convert to plugin-based
This uses bb.utils.load_plugins, based on the plugin handling in recipetool
and devtool in oe-core.

(Bitbake rev: 5e542df9b966a99b5a5b8aa7cf6100174aff54b2)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-17 21:16:35 +01:00
Richard Purdie 07eebc6689 bitbake: knotty: Fix output buffering issues
We need to flush the footer removal, else it may not be outputted until
the buffer is flushed as part of StreamHandler and this would lead to
it removing the ERROR output just printed which is extremely confusing.

Also ensure the footer is cleared before printing a summary as in
some cases it wasn't being removed, also leading to user confusion.

(Bitbake rev: 0e030c4d074c41859608dab5f3ad26b05f56b306)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-17 14:43:31 +01:00
Richard Purdie 62384f5467 bitbake: siggen: Fixes to handle sigdata/siginfo files only containing basehash data
The signature data file comparison functions are meant to be able to
handle data files containing just the base hash data. This had regressed
in some places so add fixes to allow these comparisons to be made. The
runtime components in the data files are optional.

(Bitbake rev: 2a6659fd748e255a02c2f9d047829d6edfe65317)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-17 14:43:31 +01:00
Elliot Smith 74ae91e0bd bitbake: toaster: don't show "Rebuild" button for cancelled cli builds
[YOCTO #8515]

(Bitbake rev: 71a45c600e47af5a19412bc3c5a9ba242bfb4638)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-17 14:43:30 +01:00
Elliot Smith d9d715b9f9 bitbake: toasterui: capture keyboard interrupts the same way as knotty
knotty captures two levels of keyboard interrupt: a single interrupt
or two interrupts in a row. These then trigger stateShutdown
and stateForceShutdown respectively.

toasterui doesn't have an equivalent way of capturing interrupts and
using them to shut down bitbake. Now that we are no longer using
knotty + XMLRPCServer for our command line builds (since switching to
per-project build directories), we see some odd side effects of this,
such as builds continuing after they have been interrupted on the
command line.

Bring toasterui in line with knotty (copy-paste most of the code
in knotty.py which deals with interrupts) so that a keyboard
interrupt actually shuts down the bitbake server (if not in
observe only mode).

Additionally use the cancel_cli_build() method to set the Build
status to CANCELLED in Toaster's db when we get keyboard interrupts.
This means that builds interrupted on the command line show as
cancelled (same as if they'd been cancelled from the Toaster UI),
as specified in the UI designs.

[YOCTO #8515]

(Bitbake rev: d39d2edca95900da433074ee95a192d7bfe7090d)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-17 14:43:30 +01:00
Elliot Smith df0fc2d908 bitbake: buildinfohelper: add method to set current build as CANCELLED
This will be used from toasterui to cancel the current command-line
build when a keyboard interrupt is captured.

[YOCTO #8515]

(Bitbake rev: 1486c770327b53bb5e04baa5f3ea26d8154aed63)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-17 14:43:30 +01:00
Michael Wood 3718f8d90c bitbake: toaster: toastergui tests Fix toastertable tests
After clean ups remove api assumptions. Our table data often contains
html snippets to display certain things such as dependency pop overs or
simply links to other parts of the UI. Take these into account when
testing the values of the table data.

(Bitbake rev: 7f61a68f2caba538e302ca9c2727bb43a6c77c64)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-17 14:43:30 +01:00
Michael Wood 54bf7cce48 bitbake: toaster: toastertables: Clean up and fix up a number of items
- Remove the unused 'computation' field
 - Remove the code to try to make the tables behave like an api
 - Remove custom JSON encoder in favour of DjangoJSONEncoder
 - Simplify get_data and add comments
 - Add exception type instead of using generic Exception
 - Clean up python style warnings

(Bitbake rev: 16d8198e8f6668c5fa5467ff4bda86c5d66a6cad)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-17 14:43:30 +01:00
Ed Bartosh 0854035d9c bitbake: toaster: use new syntax of except statement
Used except 'except (<exception1>, <exception2>):' syntax as it's
supported by python 2 and pythone 3.

Old syntax 'except <exception1>, <exception2>:' is not supported
by python 3.

[YOCTO #9584]

(Bitbake rev: d19e305ffa44a848b02ede63dc5de8d2640089e6)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-14 23:05:15 +01:00
Ed Bartosh 519a85ef25 bitbake: toaster: use print function in toaster script
Used print() function instead of print statement
to make toaster script to work with both python 2 and python 3

[YOCTO #9584]

(Bitbake rev: 09d37ee51219edcd0be6fd24c82fce392533b39b)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-14 23:05:15 +01:00
Ed Bartosh 3249e33251 bitbake: toaster: use 'in' instead of has_key
Dictionary method has_key is deprecated in python 2 and absent
in python 3.

Used '<key> in <dict>' statement to make the code working on
both python 2 and python 3.

[YOCTO #9584]

(Bitbake rev: 3d7ad7ba0d1a6f688ae885817c049f2a8ced11b5)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-14 23:05:15 +01:00
Richard Purdie bfc21fd9b2 bitbake: server/process: Fix missing log messages issue
Currently if the server dies, its possible that log messages are never
displayed which is particularly problematic if one of those messages
is the exception and backtrace the server died with.

Rather than having the event queue exit as soon as the server disappears,
we should pop events from the queue until its empty before exiting.

This patch tweaks that code so that even if the server is dead and we're
going to exit, we return any events left in the pipe. This makes
debugging certain failures much easier.

(Bitbake rev: 29f6ade68fb2b506a23a7eb3a00cdcffa291b362)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-14 23:05:15 +01:00
Richard Purdie 471310e5e7 bitbake: cooker/toasterui: Drop SEND_DEPENDS_TREE UI feature
Now the event is sent unconditionally we can drop this feature
as its no longer needed.

(Bitbake rev: 473deeb0fc6065693e1fcfcbb8b79753103db537)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-14 23:05:14 +01:00
Patrick Ohly da467519c2 bitbake: runqueue.py: always emit bb.event.DepTreeGenerated
The data included in the event is useful for implementing a pre-build
check that warns about unexpected components, for example because of
an incorrect configuration or changed dependencies.

Such a check can be done in a .bbclass that gets inherited
globally. But in contrast to a UI, such a class cannot request that
the event shall be emitted, and thus the event has to be emitted
whether there is a consumer or not.

This was done conditionally earlier out of concerns about the
performance impact. But now events are handled more efficiently, so
that concern no longer seems valid: in some simple testing (admittedly
on a fast build workstation), the two lines (generating the data and
emitting the event with it) only took about 0.05 seconds (measured
with timeit). That was for a build with roughly 500 recipes (from
pn-buildlist aka depgraph['pn']), triggered via the command line. That
was even with a consumer of the data active and doing some work, so it
should be even faster when there is no consumer.

(Bitbake rev: 5ddaf5b7ed1001d2dd3f67e7a6d704afa85479d2)

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-14 23:05:14 +01:00
Elliot Smith 3d11229aa1 bitbake: toaster: fix progress bar in MySQL environment
When using MySQL, the project builds info delivered by MySQL
differs from that delivered by SQLite: the former returns text
values from the enumeration for Build outcomes, while the latter
returns the integer value. This causes the progress bar JS to
break, as it is expecting outcome strings.

Modify the recent_build() method to include an outcomeText property
for each Build object, then use this in the conditionals in the
progress bar JS.

[YOCTO #9498]

(Bitbake rev: 7ac374adf1cc70173ff6cc492bc078bba1cf500b)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-13 17:45:49 +01:00
Richard Purdie c0db739f35 bitbake: main: Ensure exceptions are correctly displayed
If the cooker fails to start, ensure a correct exception is displayed to the
user. After handling any queued events simply re-raise the original exception
else the output can be unclear.

(Bitbake rev: 9a4db1aa608c17d31bf5ea1cab5a99beb565dd83)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-13 13:41:33 +01:00
Richard Purdie 2fc5d5da6f bitbake: cookerdata: Fix log messages and ensure we exit
The string formatting wasn't correct and we should exit if we hit
errors here similar to the other exception handlers.

(Bitbake rev: b90a16408a5c45ce5312384f278e19d09f8dda4d)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-13 13:41:32 +01:00
Richard Purdie a46d485856 bitbake: event/msg: Pass formatted exceptions
python3 can't cope with the previous approach we were using to pass
exceptions through the RPC. Avoid this by creating a formatted exception
on the sender side.

(Bitbake rev: d7db75020ed727677afbad07a90fb3eac0bf2c45)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-13 13:41:32 +01:00
Richard Purdie ca824a976a bitbake: fetch: Use OrderedDict for url parameters
Without this, the dict can reorder causing sanity test failures.

(Bitbake rev: ca8c91acc9396385834b266d4e8b84d917e5e298)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-13 13:41:32 +01:00
Richard Purdie ef4a7c30ca bitbake: main: Change warn() -> warning()
This avoids a deprecation warning in python 3.

(Bitbake rev: bf1a92d0c002d73e8a34472dced1343dc4a4251a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-13 13:41:32 +01:00
Richard Purdie 7c0a219d29 bitbake: cooker: Fix log message syntax
Ensure we pass the string parameter correctly.

(Bitbake rev: 7ed82bd1fe7bdd93b0614119c42eb218dc5d83e6)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-13 13:41:32 +01:00
Richard Purdie a0db1211ca bitbake: utils: Force bitbake to en_US.UTF-8 locale setting everywhere
Under python 3, if we spawn python processes, we need to have a UTF-8
locale, else python's file access methods will use ascii. You can't
change that mode once the interpreter is started so we have to ensure
a locale is set. Ideally we'd use C.UTF-8 since OE already forces the
C locale but not all distros support that and we need to set something.
Was tempted to choose en_GB so colour gets spelt correctly :).

This is in some ways pretty nasty, forcing it into the environment
everywhere however we only have a limited number of ways of making
everything work correctly and this beats having to add utf-8 encoding
to every file access command.

A similar change will be needed to bitbake.conf in OE.

(Bitbake rev: 8902c29638411d312e6fc4a197707e5742652e15)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-13 13:41:32 +01:00
Richard Purdie 221705a03b bitbake: bin/bitbake-worker: Fix invalid bb.msg.fatal usage
The logging domain specified to bb.msg.fatal was invalid. Replace with
a logger.critical() call instead.

(Bitbake rev: 1ffd8737e065a3cd634c74cd67e634d785ea93a5)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-13 13:41:32 +01:00
Richard Purdie df1546952b bitbake: contrib/dump_cache.py, cache: Fix to use python 3 syntax
Some tweaks to use python 3 syntax in a python 2 compatible way.

(Bitbake rev: 322949c77dbaa4db01b5a43d85b39a2af67ba7b2)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-13 13:41:32 +01:00
Richard Purdie 7d06ec193e bitbake: knotty: Ensure consolelog file handle is closed
If we don't close the console log file handle, python prints a warning
about unclosed file handles upon exit which is annoying.

(Bitbake rev: 624dd92952b2fc736fd86abe5f2390b87b3a7dd3)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-13 13:41:32 +01:00
Richard Purdie 6cc6818068 bitbake: runqueue: Improve timestamp comparisons
python3 cares more about invalid type comparisons. Add break statements
and better tests to make the code paths clearer and avoid type issues
in python3. No code functionality change.

(Bitbake rev: 2c39ebdd2762d027f007a6a769fdf023cdf3da2b)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-13 13:41:32 +01:00
Richard Purdie fce8da957f bitbake: daemonize/prserv/tests/fetch: Convert file() -> open()
Use python3 compatible functions.

(Bitbake rev: e6a0296ba29c3fbc8417d1df7a01d50562668a41)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-13 13:41:32 +01:00
Michael Wood 28433319ad bitbake: toaster: tests browser Add test for creating a project
Add browser tests for creating a project and test validation of
duplicate project names.

(Bitbake rev: 8055fbe840db426d6859ee2248f86abd44244b30)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-11 11:32:58 +01:00
Michael Wood cd4f0b3a83 bitbake: toaster: models Add missing import sys
(Bitbake rev: b2fba7a0820d77e1076c05b8ffcd960d4fc883a5)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-11 11:32:58 +01:00
Sujith H 7e2d5017be bitbake: toaster: ui handles duplicate project name in project page
When already existing project name is typed by user,
the ui pops up message regarding the existance of the
project name. When an existing project is typed the save
button will be disabled. Else user can proceed ahead by
modifying the project name.

[YOCTO #7005]

(Bitbake rev: 05ddf48cda6690adab4c097b16387578523e751b)

Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-11 11:32:58 +01:00
Sujith H dc57476d0b bitbake: toaster: ui handles duplicate project name in new project page
When already existing project name is typed by user,
the ui pops up message regarding the existance of the
project name.

[YOCTO #7005]

(Bitbake rev: 83e5be7e74850f1bb019668de07f3f745063fe38)

Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-11 11:32:58 +01:00
Sujith H 9bdfed856b bitbake: toaster: projectNameValidation API added
The projectNameValidation API would help users
to validate if a project name exists or not. This
API is added to libtoaster.

[YOCTO #7005]

(Bitbake rev: 3b1843553f23d78f1ddfec9f7865895ee42356a3)

Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-11 11:32:58 +01:00
Richard Purdie cc2f1368dc bitbake: runqueue: Fix missing fakeworker under dry run
We shouldn't try and use fakeworker when performing a dry_run. This
makes the core match the other fakeworker execution points.

(Bitbake rev: 49bea821a2edad5e19c3a566d1a80c23718dede9)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-11 10:34:30 +01:00
Richard Purdie 442acd2ea9 bitbake: lib/bb/utils.py: Fix explode_dep_versions2() determinism issue
When we pass data into explode_dep_versions2(), we need to result to be
able to be processed in a deterministic way so that we end up with
consistent hash values. This means we need an ordered structure rather
than an unordered one.

To do this, return an OrderedDict() rather than a dict().

(Bitbake rev: 0737e003ca549d08a7dfe13452ae982f2e11fecd)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-11 10:34:30 +01:00
Richard Purdie 3795f4d6a6 bitbake: bin, toaster: Fix print and exception syntax
This updates the print "" syntax to print() and fixes some exception
handling syntax such that its compatible with python v2 and v3.

(Bitbake rev: 58304fcce9727fd89564436771356c033ecd22a3)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-11 10:34:30 +01:00
Richard Purdie a9d90f7405 bitbake: tests: assertEquals -> assertEqual
The preferred form is assertEqual, assertEquals is deprecated and
not present in python v3.

This is v2.7 safe.

(Bitbake rev: b60261bf8ade14aca31238b50c243c01adcabc59)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-11 10:34:30 +01:00
Richard Purdie 654eadfa30 bitbake: bitbake: Update logger.warn() -> logger.warning()
python deprecated logger.warn() in favour of logger.warning(). This is only
used in bitbake code so we may as well just translate everything to avoid
warnings under python 3. Its safe for python 2.7.

(Bitbake rev: 676a5f592e8507e81b8f748d58acfea7572f8796)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-11 10:34:30 +01:00
Christopher Larson c6394a56f7 bitbake: bb.{cooker, data}: only emit a var as python if 'func' is set
This avoids a common issue where PACKAGECONFIG is emitted as a function in
bitbake -e when the 'python' flag exists. It isn't a python function unless
both 'func' and 'python' are set. This aligns with the behavior of
emit_func_python.

(Bitbake rev: c5e45063cb3ae17bbe3304ea5e712bd76e686c4a)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-06 10:22:18 +01:00
Christopher Larson 94655584cb bitbake: bb.utils: let loaded plugins provide a plugin object
This lets us avoid treating the module like an object, so no globals are
needed, if one chooses to do so.

(Bitbake rev: 71bfd5beb0d0ed88c7c14bbfd5ca1a1b56122bc1)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-06 10:20:03 +01:00
Christopher Larson 19e6fd5b7b bitbake: bb.utils: use imp.get_suffixes for load_plugins
Rather than hardcoding .py, use python's knowledge of its file extensions.

(Bitbake rev: 09f838dbaefdaedc01a1f4818ed38280b38db744)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-06 10:20:03 +01:00
Christopher Larson 7dc12110d4 bitbake: bb.utils: add load_plugins from scriptutils
Imported as of oe-core 184a256.

(Bitbake rev: 99db61bf816d9c735032caa762aae8e6a0803402)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-06 10:20:03 +01:00
Christopher Larson 39b79efc7e bitbake: bb.data_smart: use iter() for __len__
It seems the frozenset constructor in pypy runs len(), so we can't pass the
DataSmart instance directly to it, instead pass the iterator. Fixes pypy
support.

(Bitbake rev: b492836e08745e04bd9ba2fb0b56a680a5fdce79)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-06 10:18:12 +01:00
Christopher Larson cd20dd057b bitbake: bb.event: handle __builtins__ as a module
Fixes pypy support.

(Bitbake rev: a3e5d9337f5400aab13df63f261e750178f8a661)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-06 10:18:12 +01:00
Christopher Larson 2d2d312188 bitbake: bb.build: handle __builtins__ as a module
Fixes pypy support.

(Bitbake rev: e90cfc655affeec8f5519f7078dad5f99db3c461)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-06 10:18:12 +01:00
Leonardo Sandoval 4f4f1c1fdb bitbake: bitbake: fetch2: Safer check for BB_ORIGENV datastore
BB_ORIGENV value on the datastore can be NoneType thus raising an AttributeError
exception when calling the getVar method. To avoid this, a check is done before
accesing it.

[YOCTO #9567]

(Bitbake rev: f368f5ae64a1681873f3d81f3cb8fb38650367b0)

Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-06 10:12:17 +01:00
Michael Wood f00b4e4c3d bitbake: toaster: bin/toaster Fix noweb command
For the noweb command we don't need to check if a socket is in use or
not as we're not starting the django development server. We're just
setting up the environment and running the runbuilds scheduler.

(Bitbake rev: f62d9a3e86e384f928fc8ad077d7cf3a75d1591e)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-06 10:12:17 +01:00
Michael Wood 93853e06fb bitbake: toaster: bin/toaster Add ability to specify port and address to bind to
Allow binding to a specified address and port to start the django
development server on.
Remove the assumption that you want to bind to 0.0.0.0 and set the
default to localhost.
Add some additional help text after Toaster webserver has started

(Bitbake rev: ef3c88a57313947feb5ef08c4fea6fd110cde1e7)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-06 10:12:17 +01:00
Michael Wood 4446b35138 bitbake: toaster: bin/toaster Add help text for unrecognised command
Add help text for unrecognised or missing command for toaster script
Remove assumption that no command is 'start' as the default.

(Bitbake rev: 4c0b1b9c2af70838dbcf5a676ec679f9f0c488a5)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-06 10:12:17 +01:00
Ed Bartosh be49d0ad57 bitbake: bitake: main: fix line-too-long pytling warnings
Wrapped long lines to fix "Line too long" pylint warnings.

(Bitbake rev: e329a932e14d002a561245b5026f974897f64598)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-06 10:12:16 +01:00
Ed Bartosh b5af50e024 bitbake: bitbake: main: fix bad-continuation warnings
Fixed pylint warning 'Wrong continued indentation'.

(Bitbake rev: 5bfc8c0dc70abd6462a6df4ce905173d9f2cdc07)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-06 10:12:16 +01:00
Ed Bartosh 3437266a08 bitbake: bitbake: main: fix bad-witespace pylint warnings
Fixed pylint warnings:
 No space allowed around keyword argument assignment
 No space allowed after bracket
 No space allowed before bracket

(Bitbake rev: c39770239f7b61217501782b9c5e9d3211355d42)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-06 10:12:16 +01:00
Ed Bartosh 24f5c32b80 bitbake: bitbake: main: set defaults from env variables
Environment variables BBSERVER, BBTOKEN and BBEVENTLOG silently
overwrite bitbake command line arguments. This is confusing and
can cause issues that are difficult to debug. It's better to use
them as default values instead.

Used environment variables BBSERVER, BBTOKEN and BBEVENTLOG to set
default values for command line arguments.

Changed setting default value of --ui command line argument from
BITBAKE_UI to look similar way.

(Bitbake rev: 87040be4ff54cd460961318224deef8f2ea4c85a)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-06 10:12:16 +01:00
Ed Bartosh 21b314d4d1 bitbake: bitbake: main: add 2 environment variables
Bitbake uses set of environment variables to set command line
options, e.g. seeting BBTOKEN variable has the same effect
as using --token command line option.

Added new environment variables BBPRECONF and BBPOSTCONF that
are equivalents of --read and --postread command line options.
They can be used by high level scripts to append or prepend
configuration files to conf/local.conf

[YOCTO #9235]

(Bitbake rev: bf604ec1ca4eb4d0b22bcc72249963e6d7445f34)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-06 10:12:16 +01:00
Michael Wood fce42a28cc bitbake: toaster: customrecipe Only show download icon or button if it's possible
If the based on recipe has not yet been checked out/cloned we cannot
generate the custom image recipe file that uses it. So disable/remove
the option to download it.

[YOCTO #9425]

(Bitbake rev: f08651a954358e9c6ce4d69de285e4cd9e1408ae)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-06 10:12:16 +01:00
Michael Wood d3b5b0b4bb bitbake: toaster: orm Add get_base_recipe_file to CustomImageRecipe
This function returns the base recipe file path only if it currently
exists. This allows us to know whether we can proceed at this point with
generating a custom image recipe. It also enables us to call this
function from the templates to enable visual indication of this state.

Some whitespace fixes also added in generate_recipe_file_contents

(Bitbake rev: bc30d1b235b9ecacef5b2eaa851b9247d857f317)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-06 10:12:16 +01:00
Richard Purdie a4cf8bc200 bitbake: bitbake: Switch to post release version
(Bitbake rev: 309f5907a3661821e041ed14645b5d165007b058)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-29 07:58:45 +01:00
Ross Burton f9c623ddbf bitbake: fetch2: export DBUS_SESSION_BUS_ADDRESS to support authentication agents
Some users may want to use authenticated SSH connections with credentials stored
in a keyring, such as gnome-keyring.  These typically need a DBus session bus
connection, so pass DBUS_SESSION_BUS_ADDRESS into the fetcher environment.

To avoid the user needing to set it in their local.conf (which wouldn't be
usable) or adding it to the environment-cleansing whitelist (which would
potentially impact builds) allow the variables being passed to the fetchers to
come from the data store (first) or the original environment (second).

(Bitbake rev: 20ad1ea87712d042bd5d89ce1957793f7ff71da0)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-29 07:58:45 +01:00
Elliot Smith d9dd864c68 bitbake: toaster-tests: tests for build dashboard
Convert existing tests to Selenium.

Add basic tests to check that the modal contains radio buttons to select
a custom image to edit when a build built multiple custom images, and
to create a new custom image from one of the images built during
the build.

[YOCTO #9123]

(Bitbake rev: c07f65feaba50b13a38635bd8149804c823d446a)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-19 21:11:26 +01:00
Elliot Smith 1cf8f215b3 bitbake: toaster: add modal to select custom image for editing
Add functionality to the placeholder button on the build dashboard
to open a modal dialog displaying editable custom images, in cases
where multiple custom images were built by the build. Where there
is only one editable custom image, go direct to its edit page.

The images shown in the modal are custom recipes for the project
which were built during the build shown in the dashboard.

This also affects the new custom image dialog, as that also has
to show custom image recipes as well as image recipes built during
the build. Modify the API on the Build object to support both.

Also modify and rename the queryset_to_list template filter so that
it can deal with lists as well as querysets, as the new custom image
modal has to show a list of image recipes which is an amalgam of two
querysets.

[YOCTO #9123]

(Bitbake rev: 8c2aea3fa8e1071de60390e86e2536904fa9b7c0)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-19 21:11:26 +01:00
Elliot Smith a40a3e6def bitbake: toaster: add build dashboard buttons to edit/create custom images
When a build is viewed in the dashboard, enable users to edit
a custom image which was built during that build, and/or create
a new custom image based on one of the image recipes built during
the build.

Add methods to the Build model to enable querying for the
set of image recipes built during a build.

Add buttons to the dashboard, with the "Edit custom image"
button opening a basic modal for now. The "New custom image"
button opens the existing new custom image modal, but is modified
to show a list of images available as a base for a new custom image.

Add a new function to the new custom image modal's script which
enables multiple potential custom images to be shown as radio
buttons in the dialog (if there is more than 1). Modify existing
code to use this new function.

Add a template filter which allows the queryset of recipes for
a build to be available to client-side scripts, and from there
be used to populate the new custom image modal.

[YOCTO #9123]

(Bitbake rev: 4c49ffd28e41c4597bdac34d5e54c125571a4b95)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-19 21:11:26 +01:00
Elliot Smith e65c9808e9 bitbake: toaster-tests: make helper click on input before entering text
The Selenium helper's enter_text() method doesn't cause
keyup events to trigger unless the element where text is
being entered has been clicked.

Prefix all text entry with a click() on the element to ensure
that keyup events fire.

(Bitbake rev: cea34880ad3847bd0e24c9b650eb816e1757cf2b)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-19 21:11:26 +01:00
Elliot Smith 484cbf81cf bitbake: toaster-tests: add tests for new custom image page
Test adding a new custom image when:

1. No custom images are in the project yet.
2. User tries to add custom image which duplicates the name of
an existing custom image.
3. User tries to add custom image which duplicates the name
of a non-image recipe.

[YOCTO #9209]

(Bitbake rev: 21c1f8f8e30ef868ea6fd861eea1389f149f1049)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-19 21:11:25 +01:00
Elliot Smith 437b728a9f bitbake: toaster: prevent exception when Project.release is null
Project.release can be null. This causes an exception when calling
get_all_compatible_layer_versions(), as the query to fetch
the layer versions references release.branch_name.

Add a guard to the function so that an empty queryset is returned
if the release isn't set for a project.

(Bitbake rev: 6919a2b2e412a9e7b652a6bc191e7c1bed035222)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-19 21:11:25 +01:00
Elliot Smith cfc22d3a9e bitbake: toaster: only prevent duplicate custom image names within a project
We currently prevent the same name being used for multiple custom
images, but make the check across all projects. This means that
custom image names have to be unique across all projects in
the Toaster installation.

Modify how we validate the name of a custom image so that we
only prevent duplication of custom image names within a project,
while ensuring that the name of a custom image doesn't duplicate
the name of a recipe which is not a custom image recipe.

[YOCTO #9209]

(Bitbake rev: 9abbb46e799c06757e03addd54e3f5d3c0fe2886)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-19 21:11:25 +01:00
Elliot Smith 3036413000 bitbake: toaster: disable/enable "Add layer" button according to input's content
In the import layer page, the "Add layer" button in the layer dependencies
section doesn't accurately reflect whether the layer name in the
corresponding input can be added. A partial or empty layer name can
leave the button active, such that when it is clicked, a
previously-selected layer can be accidentally added.

Fix by keeping track of the items currently available in the typeahead,
only activating the "Add layer" button when the input matches the name
of one of those items.

[YOCTO #8511]

(Bitbake rev: dbb4f0282ded361baf9e5a0346e134bece5314b9)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-19 21:11:25 +01:00
Elliot Smith 040dbf6988 bitbake: toaster: fix sorting after hiding a column in build tables
When hiding a column in the build tasks or build packages included
table, if the column is set as the current order by for the table, the
order by is not reset to the default. The result is that the table
stays sorted by the hidden column.

Set the default_orderby for these two tables correctly to ensure the
corresponding table is re-sorted when a column is hidden, if that column
was being used as the order by.

[YOCTO #9011]

(Bitbake rev: b99e1012f0ad1dc82a769df15a232280c8e57b9e)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-19 21:11:25 +01:00
Michael Wood 1b11b79f50 bitbake: toaster: ensure ToasterTable headings are reset when order by changes
If a ToasterTable is ordered by an optional column and that
column is subsequently hidden, the table ordering switches back
to the default ordering for the table. However, the table headings
don't update to reflect the new ordering. This is because the
code which sets the heading weight and hides/shows the caret symbols
only runs when the table is first loaded.

Store the default order by and re-apply it when the data is updated.

[YOCTO #9011]

(Bitbake rev: 820761e664cd2d62cc6c333a0e59580b0c4a034d)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-19 21:11:25 +01:00
Ed Bartosh c7980b6089 bitbake: main: fix processing of BBEVENTLOG
Fixed typo that caused incorrect processing of BBEVENTLOG
environment variable. Even if variable is set it was ignored
by bitbake.

(Bitbake rev: 2705b5f59aef4a070e2df2752d27bd04ea747057)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-19 17:31:01 +01:00
Ross Burton 004b939d1b bitbake: lib/bb/utils: add docstring for contains()
(Bitbake rev: e9174723ea6d0dff5f7f3042009761cf42284947)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-18 16:28:23 +01:00
Scott Rifenbark 0262bc51cd bitbake: bitbake-user-manual: Updated the 'bitbake -h' output example.
(Bitbake rev: 4ca651d32d9e5fbf7f932b4167804905969f4c3a)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-18 16:20:50 +01:00
Scott Rifenbark 890ccd34b1 bitbake: bitbake-user-manual: Updated "Conditional Metadata" section
Added information about using lower-case characters and no
underscore characters when using OVERRIDES.

(Bitbake rev: 4397a023f8bf738913d71a38b3e06503207311e2)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-18 16:20:50 +01:00
Scott Rifenbark 20a0121b55 bitbake: bitbake-user-manual: Updated discussion about using "inherit"
Fixes [YOCTO #9343]

I updated the inherit directive section to note that you can
inherit multiple classes using a single line.

(Bitbake rev: 3f29ebec593f20894f7a2a0b6d50ee22474aee75)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-15 06:59:44 +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 8e7282c032 bitbake: cooker/knotty: Prefix parse logs with filename being parsed
We now prefix log messages coming from worker task context with the
PF and task info, however parsing messages all have to be manually
prefixed which is ugly and error prone. This change modifies the log
handler filter so this happens automatically, meaning we don't have
to change every message to include that information. This makes error
messages longer but more usable.

(Bitbake rev: 1af0ccaac81e182c4ca520037dda362d180e5605)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-15 06:59:44 +01:00
Richard Purdie 1131303ec4 bitbake: cooker: pass exception to finishAsyncCommand
An invalid task causes bitbake to exit incorrectly, firing a
CommandCompleted event rather than a CommandFailed one. This
means that clients listening for CommandFailed events are
unable to detect the build failure even though one occurred.

Passing an exception string to finishAsyncCommand when a task
fails causes the CommandFailed event to be fired correctly.

[YOCTO #9087]

(Bitbake rev: 98a2c37e077b16e3bc8bb102bd18b293130d15a4)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-15 06:59:44 +01:00
Richard Purdie e0e5426659 bitbake: runqueue: Improve 'mulitiple .bb files are due to be built' message
When multiple recipes which both provide something are being built, bitbake
informs us that most likely one of them provides something the other doesn't,
which is usually correct, but unfortunately it's rather painful to figure out
exactly what that is.

This patch dumps two sets of information, one is the provides information for
each recipe, filtered so only common components are removed. The other is a list
of dependees on the recipe, since sometimes this can easily identify why something
is being built.

Its not straightforward for bitbake to obtain the information but since the
warning/error code path isn't the normal one, we can afford to go through some
less than optimal processing to aid debugging.

Also provide the same information even if we're showing a warning since its still
useful.

[YOCTO #8032]

(Bitbake rev: 96fc889b8e62ba4463c71158c4b7286c48d68cd8)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-12 22:50:21 +01:00
Dave Lerner 52cfdb6a88 bitbake: toaster: fixes for customimage package not found
For a custom image, if a search for a package results in no packages
found, then additional information should be presented to the user.
This is different than a 'no results' found for a search in other
contexts, for example, a search for a package in a non-customised build.
For a custom image, a package search failure can happen because the
package was not added to the custom image. This commit presents more
information to the user, suggesting why the package was not found in the
custom image.
The generic table view handling js changes to handle a new div
element no-results-special-... such that, if present, that template
section is shown rather than the default no-results-... section.

[YOCTO #9154]

(Bitbake rev: 66b7c7ef61058b52031d71b10effcfe69afbd57b)

Signed-off-by: Dave Lerner <dave.lerner@windriver.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-09 23:00:46 +01:00
Richard Purdie dae4ffb553 bitbake: data_smart: Restrict expansion regexp to not include : characters
Bitbake variables don't include ":" characters so exclude these from the variable
expansion regexp.

This assists when parsing shell code which does A=${B:-C} as we don't want a
dependency on a variable called "B:-C".

(Bitbake rev: 14ed41a292123374d94f5c786a619881f2ddea42)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-09 23:00:46 +01:00
Randy Witt 7e739acfa7 bitbake: tests/utils.py: test origvalue in a callback matches what is expected
There were no tests that verified the value of origvalue in the callback
routines used by edit_metadata(). This patch adds one for a simple
multiline variable.

(Bitbake rev: ece3a4d02d8162dee78c2062c10291b5fd625c36)

Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-09 23:00:46 +01:00
Randy Witt e1e459e480 bitbake: lib/bb/utils.py: Fix a bug in edit_metadata() that could corrupt vars
edit_metadata() would corrupt a variable that was multiline, but
had the ending quotes on the same line as the last value. For example:

    TEST_VAR = " foo \
    bar"

would become " foo ba" because the code would always delete the last
character on the line and then do it again if the line ended in the
quote. This however doesn't show up if you have:

    TEST_VAR = " foo \
    bar \
    "

which is how all the test cases were written.

This patch fixes that bug and adds and fixes a test that matched the bugs
behavior rather than the expected behavior.

(Bitbake rev: 14f05cbdc2ad8d59a94af1c8816567d93c39c88c)

Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-09 23:00:46 +01:00
Richard Purdie e955b5dd76 bitbake: Update version to 1.30.0
(Bitbake rev: 292bffc8412cd0ddc0c6d16e872c7801e1a67890)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-06 23:33:17 +01:00
Elliot Smith 4f3dfa808c bitbake: bitbake: update LICENSE file with QUnit details
QUnit is now included in Toaster's test suite and distributed
with its source code.

(Bitbake rev: 540c0c8d6aeec5391aa4f76614db6905afabba2c)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-06 23:10:31 +01:00
Michael Wood 013984dc45 bitbake: tests: browser Add test to run the js unit tests
(Bitbake rev: 81ccbf243050a5a9245d2de4c1de342771c09a59)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-06 23:10:31 +01:00
Michael Wood 7609888b6a bitbake: toaster: views jsunittest Add MACHINE and an extra layer to test project
Add set a MACHINE if needed and add a layer. When we're running in the
context of the django unit tests we don't have these defaults setup for
the project so add them.

(Bitbake rev: a0c1432f32930a17e10d50c08c2aa84a0659514b)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-06 23:10:31 +01:00
Michael Wood fbc2c5dcd4 bitbake: toaster: tests Set MACHINE for the test projects
(Bitbake rev: 6288a3bd6678ed1c7863cfde6eb33b7c28207777)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-06 23:10:31 +01:00
Michael Wood cb6b4eb479 bitbake: toaster: Add quint to project so that it can be used offline
Currently we're using a hosted version of quint however this means that the
testing has to be online or have a cached version of quint. Add the
files to Toaster to be able to use offline.

(Bitbake rev: fc5024e2ed0e4ec2ee234a42fd0403c70c3f819e)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-06 23:10:31 +01:00
Dave Lerner 18cb7fe426 bitbake: toaster: add rev dep column to image detail pages
Add a column to the custom image pages that shows the reverse
dependencies in a format matching the dependencies column:
  - either blank or a button showing the count of reverse dependencies,
  - when the button is clicked, a popover appears showing the list
    of reverse dependencies, with each package's size, and the total
    size of all of the reverse dependencies.

The implementation adds a packages table method to retreive the reverse
dependency total size, and adds a separate 'popover' html template. Both
of these changes follow the pattern for the dependencies column.

[YOCTO #9163]

(Bitbake rev: 2f978dccaa1ec82c7ad350bdc1cd9500000984eb)

Signed-off-by: Dave Lerner <dave.lerner@windriver.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-06 23:10:31 +01:00
Joshua Lock 7a309d964a bitbake: buildinfohelper: work around unicode exceptions
We have been seeing UnicodeDecodeErrors when handling the
ImagePkgList MetadataEvent in ORMWrapper's
save_target_file_information() if the event includes filenames
that include non-ASCII characters.

In the short term work around this by converting paths to the
unicode type when passing them to Django's ORM. This is a bit of
a hack but it's too late in the cycle to do anything more invasive.

[YOCTO #9142]

(Bitbake rev: f50fff03b3de02e73a3cc2eb9935f7c345dbddc4)

Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-06 23:10:30 +01:00
Ed Bartosh 860cba85cf bitbake: toasterui: update build in internal state
buildinfohelper stores current Build object in its internal
state. Any changes to Build object will be lost if internal
state is not updated as current buildinfohelper code
saves Build object from internal state when build is
completed.

This bug causes incorrect build state when build is cancelled.
Updating internal state should fix it.

Note, that this commit updates internal state after status of
the build is changed to Build.CANCELLED. There are several other
places in the code where Build object is updated without updating
internal state. They should be carefully analyzed and fixed.

(Bitbake rev: d056cf40fc55530cb1736aedfb9a3c355884991e)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-06 23:10:30 +01:00
Ed Bartosh acb94078c4 bitbake: buildinfohelper: fix KeyError
When bitbake doesn't need to build anything it still sends
ImagePkgList event with empty 'pkgdata', 'imgdata' and 'filedata'
fields. This causes crash in buildinfohelper code as it's assumed
that above mentioned fields always have data keyed by build target:

ERROR: u'core-image-minimal'
Traceback (most recent call last):
  File "toasterui.py", line 423, in main
    buildinfohelper.store_target_package_data(event)
  File "buildinfohelper.py", line 1218, in store_target_package_data
    imgdata = BuildInfoHelper._get_data_from_event(event)['imgdata'][target.target]
KeyError: u'core-image-minimal'

Fixed this by using dict.get method with empty dictionary as default
return value instead of trying to get value without checking if target
key is in the data.

(Bitbake rev: c39cc463e6d9594bf2c5ac8bb74e834f6f2cf7c8)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-06 23:10:30 +01:00
Ed Bartosh 52c8740e1b bitbake: toaster: get bitbake location from BBBASEDIR
It was incorrectly assumed in the current code that bitbake is in
../bitbake/bin/ directory. It's not always the case.
Using bitbake from $BBBASEDIR should be .

(Bitbake rev: 6c9e3375d278bee712c41f07428bc82108b9aaae)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-06 23:10:30 +01:00
Ed Bartosh f5d3ef6c89 bitbake: toaster: export BBBASEDIR variable
This variable will be used in localhost controller code
to determine correct bitbake location, so it has to be
exported.

(Bitbake rev: 429d47325aadb74d476e5b7f4738f2dfe26cde95)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-06 23:10:30 +01:00
Sujith H 71ff9b9e0e bitbake: toaster: update projectconf.html for DL_DIR and SSTATE_DIR
Modified the projectconf.html to include DL_DIR and
SSTATE_DIR. Updated the script section in the html
to handle the changes made by the user on DL_DIR
and SSTATE_DIR. Included validation check for the
folder names.

[YOCTO #8422]

(Bitbake rev: bd9f8973d4c9c0722874a058466b1b911112500e)

Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-06 23:10:30 +01:00
Sujith H 705d44fc0d bitbake: toaster: update view to support DL_DIR and SSTATE_DIR
Update toaster's views.py to support DL_DIR and SSTATE_DIR for
page projectconf.html. Removed DL_DIR and SSTATE_DIR from
blacklist. Initial value of DL_DIR and SSTATE_DIR comes from
BuildEnvironment.

[YOCTO #8422]

(Bitbake rev: 9f672d7ba503d17175eef37ec03a5779e4c9f792)

Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-06 23:10:30 +01:00
Ed Bartosh 4aafcae5e4 bitbake: toaster: use empty token
If client xmlrpc token is not provided in the command line, bitbake
generates random token. Server token in --server-only mode is always
empty. This doesn't allow clients with non-empty tokens to connect
to the server. Specifying empty token should stop generation of
random token and make it possible for clients to communicate with
the server.

(Bitbake rev: b54ec2d7cb9f2fb4ff1e8af11b6ecf97d181272c)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-06 23:10:30 +01:00
Michael Wood 5ce4665f26 bitbake: toaster: runbuilds Clean up runbuilds
- Organise the imports into logical groups
- Fix 80 col wrapping
- Remove catch all exceptions
- Log to the toaster log
- Use QuerySet functions such as .first() and Q()

(Bitbake rev: c382f550c62437954205c7dd9c7e1891d5d03945)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-06 23:10:30 +01:00
Michael Wood 55b6fabd75 bitbake: toaster: runbuilds Make runbuilds aware of the build CANCELLED state
Add handlers to make sure we remove the BuildEnvironment LOCK when we
have cancelled a build.

(Bitbake rev: 23d0a7f9664450a09c2610631b38590a09b33744)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-06 23:10:30 +01:00
Michael Wood f4cee8840e bitbake: toaster: models Exclude the CANCELLED builds from get_number_of_builds
Don't count CANCELLED builds when returning the number of builds.

(Bitbake rev: c3c29fd4eb5116b771e8e16281d4e3cdf4fae165)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-06 23:10:29 +01:00
Michael Wood 296d3733df bitbake: toaster: mrb_section template Add build cancel button
Add the cancel build button to the mrb section template and add the event
handlers to cancelABuild.
Also clean up the calls to startABuild to use the updated libtoaster methods
and to make the code consistent with it's cancelABuild counterpart.

Co-Author: Sujith H <sujith.h@gmail.com>

(Bitbake rev: 6b82ffca1aa9ca2d0feec64b15466bc8ba160011)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-06 23:10:29 +01:00
Sujith H f1b49dc4b6 bitbake: toaster: tables BuildsTable exclude cancelled builds
Exclude cancelled builds from showing in the builds table

[YOCTO #6787]

(Bitbake rev: a724d6aa7515e712a1d656e46e1d0f3bf7d4cea9)

Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-06 23:10:29 +01:00
Michael Wood 22242ae221 bitbake: buildinfohelper: Add handler for cancelling a build
When a build is cancelled the build (action) is complete if it has been
caused the request being cancelled then update the build outcome
accordingly.

(Bitbake rev: d94d12914d351bf560b06d6f4e45c294b04ecaa3)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-06 23:10:29 +01:00
Michael Wood 9dcb9cb2cc bitbake: toaster: bldcontrol models Add a cancelling state the BuildRequest
To accurately reflect the state of a build request we also need a
cancelling state. This is set when we've started a build and then for
whatever reason cancel it, cancelling is not instantaneous so we have
this state to indicate that a cancel is in progress.

Also add a state transition guard. As the state of a BuildRequest can
currently be modified by three processes; Toastergui,
Runbuilds/bldcontrol and the buildinofhelper we cannot say for sure
which process will be running at the time of cancellation so in order to
avoid one of these processes making an incorrect transition only allow
transitions of state to increase.

e.g. CREATED -> QUEUED -> INPROGRESS
And to ignore such requested changes such as
INPROGRESS -> CREATED

(Bitbake rev: 449598c8e6be75bd0c9d59e7bdf859d1d6f83858)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-06 23:10:29 +01:00
Sujith H dfa85109d6 bitbake: toaster: models Add cancelled state to build outcome
A new state CANCELLED is introduced to, distinguish
the state of build.

[YOCTO #6787]

(Bitbake rev: 404f406fecae879703bcfe96f3b65086b115fa8a)

Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-06 23:10:29 +01:00
Sujith H 5f862bb567 bitbake: toaster: update BuildEnvironmentController and BitbakeController
Remove getBBController function from BuildEnvironmentController.
The constructor of BitbakeController is updated appropriately so that
call can be made to connect to running server.
The call to startBBServer is removed from bbcontroller and  handledin
localhostbecontroller.

[YOCTO #6787]

(Bitbake rev: e15151106aae21d3b164ca868be42bd63905f0a1)

Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-06 23:10:29 +01:00
Michael Wood 0db62c54a4 bitbake: toaster: libtoaster Update implementation of startABuild and cancelABuild
Update the implementation of startABuild and cancelAbuild to reflect
changes to the backend api. We now have a dedicated endpoint to make
calls into so add this url to libtoaster.ctx and allow passing null in
as a url value to indicate that we want to use the current project

Also:
 - Fix some documentation comments
 - Add the convenience of passing in an array of targets to startABuild

(Bitbake rev: 61a21d96abab113cbd13376cdb8b08a426b50538)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-06 23:10:29 +01:00
Michael Wood afab95c649 bitbake: toaster: xhr Update the implementation of the build cancellation request
Update the implementation of the backend api for cancelling builds with
the new cancelling BuildRequest state and cancelled Build state.
Also added some docstring about general usage.

Co-Author: Sujith H <sujith.h@gmail.com>

(Bitbake rev: 0d76084f5d896e4199e1446e2d6d43190a4fcc3a)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-06 23:10:29 +01:00
Michael Wood eead032aca bitbake: toaster: Move xhr calls for starting and stopping builds
Move the backend xhr implementation of the build request changes
into it's own file and out of the ToasterTable definition.
It used to live in the views.py but in a hope of starting to collate logical
groups of views move this to a new file called api.

(Bitbake rev: 29572f0e6bd3b5e8315f3b93d55bdb8967b86bc3)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-06 23:10:29 +01:00
Sujith H f5aa97067f bitbake: toaster: bldcontrol Add forceShutDown function to BitbakeController
Add forceShutDown function to BitbakeController class. This function
provides a mechanism to cancel the build from toaster. An API which
can be used safely to cancel build and hence shutdown running bitbake
server.

[YOCTO #6787]

(Bitbake rev: 89dc2ee8f5b7255538082ce4f6cb5277839875a8)

Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-06 23:10:28 +01:00
Ed Bartosh d6992a8d69 bitbake: toasterui: shutdown on BuildCompleted event
toasterui exits event loop on one of the following events:
CommandCompleted, CommandFailed or CommandExit.
Unfortunately none of them come from bitbake when build fails.
This is normai if toasterui runs in observer mode. However, if it's
in build mode this causes toasterui to stuck in the infinite loop
waiting for new events.

The only event we can rely on is BuildCompleted as it always
comes from bitbake unlike 3 above mentioned events.

Modified the code to always shutdown toasterui in build mode
on BuildCompleted event.

(Bitbake rev: 9cd60f98b13cf7b1c518851a51e1cbaa596d8f81)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-06 23:10:28 +01:00
Ed Bartosh c4ae028209 bitbake: toaster: use bash explicitly
Toaster can't run builds on Ubuntu as default /bin/sh points
to dash there. The reason is that oe-init-build-env can't
be sourced under dash for various reasons. It can be fixed
or work arounded, but it wouldn't fix builds for older releases.
Explicitly using bash to start builds should fix the issue.

(Bitbake rev: e4352603b21d43a8b5d9ee417c036fff0a263d40)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-06 23:10:28 +01:00
Ed Bartosh 4adddfde44 bitbake: toaster: fix jethro build
The keys 'started', 'ended', 'cpu_time_user', 'disk_io_read' and
'disk_io_write' were added to the event recently, so they don't
exist in the events generated by bitbake server from older releases.

Checking if task_to_update structure has these keys before using
them should fix build of older releases.

(Bitbake rev: 79611d0ea742263074fbb0bf5f1e39df75fd9f55)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-06 23:10:28 +01:00
Ed Bartosh b1a919a92a bitbake: toaster: update conf/local.conf
Added 'INHERIT+="toaster buildhistory"' line to the conf/local conf
when Toaster starts. It should make commandline builds to provide
all required information to Toaster backend.

(Bitbake rev: 1271cf430087c66f87c46689b37b8a3538c35739)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-06 23:10:28 +01:00
Ed Bartosh 590a8159aa bitbake: toaster: stop bitbake server after the build
Bitbake server is used only during the build. There is no need
in keeping server running after the build.

Running bitbake -m in the subshell after the build should stop
the server.

(Bitbake rev: 062c68e3e7d00834118fe07ceb0899874be714ae)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-06 23:10:28 +01:00
Ed Bartosh a8f6001e0f bitbake: toaster: add new parameter to _shellcmd
Added 'nowait' parameter to _shellcmd method to support
running chain of commands in a subshell.

This is going to be used to stop bitbake server after
the build.

(Bitbake rev: 89fae3c8712bfaac48686c58b480e40c1abdcfdc)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-06 23:10:28 +01:00
Ed Bartosh a43a16b9fd bitbake: toaster: reimplement triggerBuild
Reimplemented triggerBuild method to support one build directory
per project:
 - start bitbake server from the cloned repository
 - don't run observer
 - run bitbake build directly instead of triggering it
   through xmlrpc

[YOCTO #7880]
[YOCTO #9058]
[YOCTO #8958]

(Bitbake rev: aba8e19bf609196f749e185d43571f706707e408)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-06 23:10:28 +01:00
Ed Bartosh ab18c208b2 bitbake: toaster: modified setLayers API
Removed updating of bblayers.conf. It will be done in runBuild method.
Changed return value: return list of layers.
Removed _updateBBLayers method.

(Bitbake rev: 198bf7e6b8d7f847f2619b71c6bd86a9a76156c9)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-06 23:10:28 +01:00
Ed Bartosh 22fba9b2b7 bitbake: toaster: add brbe parameter to triggerBuild
Called triggerBuild with brbe parameter instead of adding TOASTER_BRBE
variable to the database and fetching it in triggerBuild.

(Bitbake rev: 669bb3f6865d8bb89cd94ef9d0eba3346c47d7b2)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-06 23:10:28 +01:00
Ed Bartosh 829a0bdb48 bitbake: toaster: remove release API
This API is quite dangerous as it removes build directory.
It's not used anywhere and most probably will not be used in future
as toaster is going to have one build directory per project.

(Bitbake rev: ef9e126227d3bdee86c1592e2baa43d21e6a32df)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-06 23:10:27 +01:00
Ed Bartosh 7068e8a056 bitbake: toaster: remove startBBServer API
We still will have to run bitbake server, but it will be done
different way and the code will be in triggerBuild function.

Removed startBBServer API from BuildEnvironmentController and
LocalhostBEController classes.

(Bitbake rev: a8f986d73a84f28fa8b116b91fb30c5d2cd4edbe)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-06 23:10:27 +01:00
Ed Bartosh 9d4c62d33e bitbake: toasterui: fix brbe reporting
buildinfohelper.brbe is lost when buildinfohelper is closed.
This causes incorrect report of brbe when build is done.

Saved brbe attribute before closing buildinfohelper and used
it to report correct brbe.

Got rid of useless and confusing 'ToasterUI build done 1'
log message.

(Bitbake rev: 5d7cce0d0ed70f6b3ebd6cbad300d86964a13398)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-06 23:10:27 +01:00
Ed Bartosh 5bcce68ea3 bitbake: buildinfohelper: improve handling of providermap
DepTreeGenerated event doesn't contain 'providermap' data in jethro.
Modified buildinfohelper to handle events without this data. This
should make it possible to handle jethro events coming from jethro
bitbake server by the latest buildinfohelper.

(Bitbake rev: f6dcb1c9967f042beae024146781cb8235a9e1f2)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-06 23:10:27 +01:00
Ed Bartosh 61b6b98f40 bitbake: uievent: improve BBUIEventQueue code
Return value of self.BBServer.registerEventHandler differs between
jethro and master. To be able to build jethro toaster should be
able to communicate with jethro bitbake server i.e. it must work
with both old and new registerEventHandler call.

(Bitbake rev: f356c154016c428a3b53af61a075de6f14d9d1d9)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-06 23:10:27 +01:00
Ed Bartosh 0b0d754950 bitbake: toasterui: add brbe parameter to buildinfohelper
In current toaster code BRBE(build request:build environment) value
is passed from toaster to buildinfohelper through the 'SetBRBE' event.

Passing it through environment variable is easier as it doesn't
involve rpc communication between toaster and bitbake server.
It also eliminates the need in running bitbake observer process.

Added parameter 'brbe' to BuildInfoHelper.__init__
Used environment variable TOASTER_BRBE to set brbe for
buildinfohelper object.

(Bitbake rev: a0c8e2b309055e5927a8ff729d292ccaa69d0575)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-06 23:10:27 +01:00
Ed Bartosh 94ac3f0ed0 bitbake: toaster: set BITBAKE_UI environment variable
Set BITBAKE_UI variable to 'toastergui' for command line builds
to use toasterui as a default ui module for bitbake.

(Bitbake rev: 9ad6393d30cb6196cf7c9a5adcf33febd724d294)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-06 23:10:27 +01:00
Ed Bartosh e23a23b35b bitbake: toaster: get rid of noui option
noui command line option doesn't makes sense anymore as toaster doesn't
run bitbake. It should be safe to to remove it.

The purpose of this option was to skip running bitbake observer process.
This was never used before as it's not possible to run toaster build
without running observer.

(Bitbake rev: 7506719090e8bb39231cf389c4a5b47f1b37a01f)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-06 23:10:27 +01:00
Ed Bartosh f77baec6de bitbake: toaster: don't start bitbake server
>From now on toaster script will not run bitbake server.
It will be started by runbuilds and stopped after the build.

(Bitbake rev: 3fbd8534149e87c5a5d1bc1691711cfca05cafd1)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-06 23:10:27 +01:00
Robert Yang c1157400ab bitbake: fetch2/git.py: remove .indirectiondir workaround
It was used for workaround git 1.7.9.2 which was released in 2012 which
should not be existed on nowadays host, so remove it to avoid
confusions.

(Bitbake rev: 6140d0cc9aecf1029ca16fed47071dfcc92f4269)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-06 10:29:47 +01:00
Klauer, Daniel 4f07c2220b bitbake: persist_data: Return str instead of unicode for sqlite3 text queries
Python 2's sqlite3 module defaults to returning Unicode strings for SQL
text queries, which could trickle down to other parts of bitbake code and
cause unexpected Unicode conversions. Using byte strings avoids this issue.

For example, the git fetcher's AUTOREV support caches HEAD SHA1's using
bb.persist_data, so sometimes the git command strings passed to fetch2's
runfetchcmd() were unicode, potentially causing UnicodeDecodeErrors when
it appended the values of environment variables containing non-ASCII chars.

[YOCTO #9382]

(Bitbake rev: 09623a0811c613a47a01ae465b822d8156faca30)

Signed-off-by: Daniel Klauer <daniel.klauer@gin.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-06 10:29:47 +01:00
Richard Purdie af5f423887 bitbake: siggen: Ensure tainted stamps are accounted for with writing custom stamps
sstate.bbclass for example writes siginfo files to a separate location
but we need to read taint data from the standard path.

(Bitbake rev: da444c9761ee15a59ea8880e3f812a5d3f1a1aaa)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-03 22:50:17 +01:00
Richard Purdie 47e9e125d7 bitbake: siggen: Fix nostamp taint handling
The taint values need to be passed from the server to the workers to
ensure they see the same stamp values. Also ensure that the "nostamp:"
prefix isn't included in the checksum value to match the server
calculation. This ensures the checksums are all consistent.

(Bitbake rev: f80ba20e90f3746f7faee3e0ff7f249025fec8ee)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-03 22:50:17 +01:00
Richard Purdie 80336270f3 bitbake: siggen: Add checksum recalculation/checking code
In theory all the information to recalcuate the task signatures was written
into the siginfo/sigdata files. In reality, some of the information was
written into the filename.

Firstly this patch duplicates that info into the file itself just for easy
of use since its small.

Secondly, we abstract out the existing "calculate the checksum" code for
the taskhash, and add a function to calculate the bashhash based on the
informaiton within the file.

Finally, we call these functions when we're writing out the data to check
that the data we're writing is consistent. I've found a couple of places
it wasn't and its good to know about these in advance, rather than having
a siginfo/sigdata file which a given hash in its filename but a contents
which give a different result.

This should all combine to avoid a certain class of checksum bugs making
it into world, and identifying problems in advance.

(Bitbake rev: 0f50a18d7a0ea0d68edd8e5217e29111f4b1ea0b)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-03 22:50:17 +01:00
Richard Purdie 3e1b5e0685 bitbake: siggen: Fix check calculation problem with file_checksums
When I enabled debugging of the checksum code, I found the value calculated
from siginfo/sigdata files for do_fetch tasks never matched. This was due
to an error in the way the data was being stored for these, it wasn't ordered
correctly. This patch fixes things so the checksums calculated from
siginfo/sigdata files is correct when file checksums are present.

(Bitbake rev: 046c1be7594fae2eec3d1f242ba3e9a85f1a1880)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-03 15:53:44 +01:00
Richard Purdie 39b637ccd3 bitbake: siggen: Drop misleading duplicate method
The real method is a few lines later, this one is incorrect and
just causing confusion. Remove it.

(Bitbake rev: a896f263300f069400eae533be0daf5dedf41c95)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-03 15:53:44 +01:00
Olof Johansson 2c722e227f bitbake: tests/fetch.py: Improve unit tests for trusted network check
The tests were skipped when running without network even though they
didn't require network. This commit also adds a test case for URLs with
ports in them (the ports should not be considered when doing trusted
network checks).

(Bitbake rev: 77747de6b20538063eef3b188489a35bef225359)

Signed-off-by: Olof Johansson <olof.johansson@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-03 15:53:44 +01:00
Olof Johansson cf6d12d191 bitbake: fetch2: BB_ALLOWED_NETWORKS should not care about port numbers
Bitbake would fail to classify the following URL as belonging to a
allowed network, because of the port number in the url.

 BB_ALLOWED_NETWORKS = "*.example.com"
 SRC_URI = "http://git.example.com:8080/foo.tar.gz"

Since protocols aren't specified in the BB_ALLOWED_NETWORKS variable,
it's reasonable to believe that this should work regardless of protocol
being used.

(Bitbake rev: ff603df23037e10fb2cfdf150429cba3f65072cd)

Signed-off-by: Olof Johansson <olof.johansson@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-03 15:53:44 +01:00
Joshua Lock 158575c738 bitbake: toaster: orm better detect requires during CustomImageRecipe generation
We were doing a string search for the literal string "require" and
assuming that a match meant the recipe uses the require keyword to
include the contents of another recipe. This test isn't very smart (it
should at least have matched on "require ") and triggers on the word
require anywhere in the recipe, i.e. the word "required" in the
DESCRIPTION of core-image-lsb.bb, and then breaks as the much smarter
regex fails to match anything.

Instead always run the regex search and only try to update the
require entry when the regex matches.

(Bitbake rev: a6add0e95d3d1e9a6a9fcabd73543bc5c278915f)

Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-03 15:53:44 +01:00
Belen Barros Pena c634473ed3 bitbake: toaster: Correct typo on build form help text
The help text said to append a semicolon and a task name to a target to
run a task other than do_build. What you need to append is a colon.

[YOCTO #9326]

(Bitbake rev: 691419e23a94a94129b177e71d2c728b12689139)

Signed-off-by: Belen Barros Pena <belen.barros.pena@linux.intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-03 15:53:43 +01:00
Michael Wood c9ad1e6703 bitbake: toaster: buildinfohelper Add additional metadata to the built layer
Add additional metadata to the layer created for build history to be
able to identify the layer and recipe later on. Specifically this is the
branch and release to which the recipe and layer are associated with
enabling differentiation of two recipes which are local release and
master and 'master' release.

[YOCTO #8528]
[YOCTO #8545]

(Bitbake rev: 3deebd887bddbbd02fd9829a180aab494b1af7c4)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-03 15:53:43 +01:00
Elliot Smith 7dcb4c4127 bitbake: toaster: tests Migrate landing page tests to Selenium
(Bitbake rev: 20ce1e1b39a9b602eb51ca0ba3954ea3e999c874)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-01 07:14:59 +01:00
Elliot Smith 5b848fa727 bitbake: toaster: tests Migrate all projects page tests to Selenium
(Bitbake rev: 0e5f45d68e423f8462937879eed3253db31b2bb5)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-01 07:14:59 +01:00
Elliot Smith f2a38ea4a1 bitbake: toaster: tests Migrate project builds page tests to Selenium
(Bitbake rev: 31204937f71a7e0aa08361c3e20d02d063788a86)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-01 07:14:59 +01:00
Elliot Smith 961cd90375 bitbake: toaster: tests Migrate all builds page and project page tests to Selenium
(Bitbake rev: 4fda6be831d10e6d266b11975a0e9a35a7f35a77)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-01 07:14:58 +01:00
Elliot Smith f859a3d40e bitbake: toaster: tests Migrate to Selenium for UI tests
Create a new folder for Selenium tests.

Add a new base Selenium testcase class and a helper which
instantiates a webdriver for a given browser.

Add a sample Selenium test case which can be used as a template
for creating new tests.

(Bitbake rev: b7a377aa2ab36390d619e2a0436ccb4b8d186c23)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-01 07:14:58 +01:00
Richard Purdie 31681346a7 bitbake: bitbake: Don't limit traceback lengths to arbitrary values
There appears to have been a lot of copy and pasting of the code
which prints tracebacks upon failure and limits the stack trace to
5 entries. This obscures the real error and is very confusing to the user
it look me an age to work out why some tracebacks weren't useful.

This patch removes the limit, making tracebacks much more useful for
debugging.

[YOCTO #9230]

(Bitbake rev: 5549748a200b5df259fc7352477ec59471b87b2f)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-31 23:01:38 +01:00
Robert Yang f719386841 bitbake: cookerdata.py: remove slash in the end
It's very possible that we added layer as:
BBLAYERS += "/path/to/meta/"

then there would be warning:
WARNING: No bb files matched BBFILE_PATTERN_core '^/path/to/meta//'

This patch can fix the problem.

(Bitbake rev: 2b1cb21d18fb18399e682021b866babeced9a4aa)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-31 09:13:04 +01:00
Richard Purdie e26087f091 bitbake: Bump version to 1.29.1
(Bitbake rev: 2f6be16c274974be5eb07641374d691ef049fe76)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-31 09:13:04 +01:00
Richard Purdie d73da22b0e bitbake: build/utils: Allow python functions to execute with real exception handling
With the code as it stands today it not possible to execute a python function
and get "normal" python exception handling behaviour. If a python function
raises an exception, it forces a traceback to be printed and the exception
becomes a FuncFailed exception.

This adds in a parameter 'pythonexception' which allows standard python
exceptions to be passed unchanged with no traceback. Ultimately we may want
to change to this convention in various places but at least it means we can
start to add sane functions now.

(Bitbake rev: 85cf22fd0ed26bb7dc7738ef2a10441891f38ae2)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-31 09:13:04 +01:00
Richard Purdie 672c07de4a bitbake: fetch2: Ensure that incorrect checksumed files are always renamed
There are some codepaths where the file checksum is verified and can
be found to mismatch but the 'rename' logic doesn't kick in. If code
relies on the presence of a file for the checksum having been checked
(e.g. uninative.bbclass) then it can be used when the checksum hasn't
matched.

Therefore rename the file whenever an invalid checksum is encountered.

(Bitbake rev: 69ef6c8a9db02bfa0e3fac72481ec26586a29a01)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-31 09:13:04 +01:00
Markus Lehtonen 2554be49f2 bitbake: cooker: fix CookerParser.shutdown()
Prevent a hang when shutdown() is called during parsing (e.g. after
SIGINT). We must not append 'None' to the jobs queue. Otherwise the
worker loop inside Parser.realrun() may break out at the wrong point,
causing the results queue thread blocking bitbake indefinitely.

[YOCTO #9319]

(Bitbake rev: 7ebea3e9a60232222efa8a546a0ff28a53029949)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-31 09:13:04 +01:00
Richard Purdie 1ca71e5178 bitbake: cooker: Ensure bbappend order is deterministic
Currently bbappend files in a layer are applied in the order they're
found on disk (as reported by glob) which means things are not
deterministic.

By sorting the glob results, the order becomes deterministic, the parsing
order for .bb files also should be deterministic as a result of this change.

[YOCTO #9138]

(Bitbake rev: 3f8febc4212fbd3485ac9bdd4ac71b8fb0a05693)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-30 12:01:29 +01:00
Markus Lehtonen 292c3e82e3 bitbake: checksum: In FileChecksumCache don't follow directory symlinks
Before this patch, directory symlinks mathcing filename pattern (either
a file name or a glob pattern) were followed. However, directory
symlinks deeper in the search chain were omitted by os.walk(). Now
directory traversal behaves consistently, ignoring syminks on all
levels.

One reason for choosing not to "walk into" directory symlinks is that
dir symlinks in externalsrc.bbclass in oe-core are causing problems in
source tree checksumming.

[YOCTO #8853]

(Bitbake rev: 66dff37ebcd1dd14ebd6933d727df9cf0a641866)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-30 12:01:29 +01:00
Richard Purdie ddbeb56f4f bitbake: cookerdata: Improve handling of ParseError
If local.conf contains an invalid line, e.g.:

 APPEND += " igor"

(note the leading space) then nasty tracebacks are shown which confuse the
user. Change so the parse error is simply shown without a traceback, improving
the user experience.

[YOCTO #9332]

(Bitbake rev: 148aa1fb45dcb37a756a08301a7daf270e753180)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-29 23:21:52 +01:00
Aníbal Limón 60656d07ea bitbake: fetch2/wget.py: _check_latest_version_by_dir fix prefix detection
When prefix is part of the version directory it need to ensure that
only version directory is used so remove previous directories if exists.

Example: pfx = '/dir1/dir2/v' and version = '2.5' the expected result
is 'v2.5' instead of '/dir1/dir2/v2.5'.

[YOCTO #8778]

(Bitbake rev: c760531c6dbf88135ab9f8e6f0784ccbf2cce1e4)

Signed-off-by: Aníbal Limón <limon.anibal@gmail.com>
Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-28 15:55:51 +01:00