Commit Graph

4769 Commits

Author SHA1 Message Date
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
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
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
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
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
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 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
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 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 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 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 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 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
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
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
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
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 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
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
Aníbal Limón 45ee2b1079 bitbake: fetch2/wget.py: _check_latest_version_by_dir use group names
Little improvement for reference tokens by names instead of index.

(Bitbake rev: e8ea15eeb1857ed4bb6337836bd2fb1f5dbb1bdf)

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
Richard Purdie 84d5924012 bitbake: fetch2: Handle lockfiles for file:// urls redirected to mirrors
We recently dropped lockfiles for file:// urls which in itself makes
sense.

If a file url redirects to something like an http:// mirror, we'd have
no lock taken for the original file and could race against others
trying to download the file. We therefore need to ensure there is a
lock taken in the mirror handling code.

This adds code to take such a lock, assuming it isn't the same lock
as the parent url.

(Bitbake rev: 913b6ce22cd50eac96e8937c5ffc704bfce2c023)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-26 07:34:58 +00:00
Dave Lerner b036afb537 bitbake: toaster: get all dependents for pkg for removal
For customised image package removal change behavior.
From:
    Only display the immediate dependents of the requested package
    to remove, not the full dependent list, that is dependents of
    dependents ...
    Do not remove the displayed dependents, just notify the user
    of the list.
To:
    Display the complete dependent tree, traversing all reverse
    dependencies starting from the package to be removed and then it's
    dependents.
    Change the modal dialog to note that all of these dependents will
    be removed automatically.

[YOCTO #9121]

(Bitbake rev: 1185a5bfe1b05a1b63a927c9583dfc031fdac8a9)

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-03-26 07:34:58 +00:00
Dave Lerner 9bf98a9351 bitbake: toaster: new customise package-remove modal dlg
For customised image package removal, show a different modal dialog that
lists ALL of the packages dependent on this package, with a Remove All
button - implying that all of the dependents will be removed.

[YOCTO #9121]

(Bitbake rev: 768e6bb90c433687b0d52f256b7115499ca3418b)

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-03-26 07:34:58 +00:00
Dave Lerner d5a419d628 bitbake: toaster: show full list of dependents to remove
When a package is to be removed, show the full list of packages that are
dependent on that package, telling user that these packages will also be
removed.

[YOCTO #9121]

(Bitbake rev: f5cb59b6b10a714b18b1c00b9a8598dd855c84b5)

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-03-26 07:34:58 +00:00
Derek Straka fda94f4e2d bitbake: bitbake: fetch2/gitsm: Fix fetch when the repository contains nested submodules
This fixes a problem when the repository contains multiple levels of submodules via a resursive submodule init.

(Bitbake rev: dbafbe229360ffe5908b106a9c10e274712b9b17)

Signed-off-by: Derek Straka <derek@asterius.io>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-26 07:34:58 +00:00
Ed Bartosh b58e5b1fb3 bitbake: bitbake: xmlrpc: set single use mode differently
Currently xmlrpc server implicitly sets itself into single use mode
when bitbake server is started with anonymous port (0) or no port is
provided in command line. In this mode bitbake shuts down xmlrpc server
after build is done. This assumption is incorrect in some cases.
For example Toaster uses bitbake in this mode and expects xmlrpc server
to stay in memory.

Till recent changes single use mode was always unset due to the bug.
When the bug was fixed it broke toaster builds as Toaster couldn't
communicate with bitbake server in single use mode.

Reimplemented logic of setting single use mode. The mode is explicity
set when --server-only command line parameter is not provided to bitbake.
It doesn't depend on the port number anymore.

[YOCTO #9275]
[YOCTO #9240]
[YOCTO #9252]

(Bitbake rev: afc0dd5c532684f6201b1e12bbf4c226ea19062d)

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-03-24 12:31:50 +00:00
Ed Bartosh 2918b50361 bitbake: toasterui: remove ParseStarted from the event list
bb.event.ParseStarted event is not processed by toasterui, but
present in event list. This causes the following error:
   WARNING: Unknown event: <bb.event.ParseStarted object at ...
and non-zero return code:
   WARNING: Return value is 1

(Bitbake rev: 1cc102f3d83d9467a3a3c422254333796ba95605)

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-03-23 17:56:16 +00:00
Michael Wood ab2abd46f6 bitbake: toasterui: Remove the excessive exception logging
Remove the very verbose log dump from toasterui. This generates several
megabytes of not that useful debug information and actually hinders
finding the original exception.

(Bitbake rev: a21dc134bdce2c9eb5e47c770094660f0c45c398)

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-03-23 17:56:15 +00:00
Markus Lehtonen d8137be4de bitbake: cache: Make BB_DONT_CACHE variable external
This makes it possible to prevent a recipe to be cached, and thus,
parsed every time.

Use with care.

[YOCTO #8853]

(Bitbake rev: 78335c1fbe5266116700c2413aac28b00423a75b)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-23 17:54:41 +00:00
Michael Wood 1d1aaa2f56 bitbake: toaster: orm generate CustomImageRecipe contents try secondary path
Try a secondary file path if the first does not exist. When we get the
recipe paths and layer information from the layer index it is not a
complete path but we are usually able to reconstruct it. If the complete
real path has been discovered by building then use this instead.

[YOCTO #9206]

(Bitbake rev: 238db2e03405d259d48dfc477a276191e6a47698)

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-03-23 17:53:56 +00:00
Michael Wood 5c49230deb bitbake: toaster: localhostbecontroller put generated layer in the builddir
Move the generated layer for custom recipes into the build directory.
The build directory makes more sense as this layer/recipe is generated
for a particular build/project.

(Bitbake rev: 77f3728ee6ea379bffcf73f33c26e982cb0795f4)

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-03-23 17:53:56 +00:00
Michael Wood b60c9943bf bitbake: toaster: localhostbecontroller Allow file:/// uri type for git repo
We don't need to skip file:/// uri type locations for git repositories.
If you're using a file:/// uri you should know that it has to be a local
path.

[YOCTO #9200]

igned-off-by: Michael Wood <michael.g.wood@intel.com>
(Bitbake rev: 4d0e5804103c2d98d038b3c490cac37a73f3cc47)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-23 17:53:55 +00:00
Michael Wood 3025092142 bitbake: toaster: orm Add a constant for the CustomImageRecipe's layer name
Use a constant to define the name for the toaster custom images layer;
this constant is then used to identify this layer in various places.

(Bitbake rev: 2540969ec71612af7f9041cadcc401513e9b357b)

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-03-23 17:53:55 +00:00
Michael Wood 3df6551d8c bitbake: toaster: localhostbecontroller Don't clear out toaster custom layer dir
We may have a recipe which is based on a custom image recipe that has
already been built so keep the recipe file around so that it can be read
by the generate recipe function.

(Bitbake rev: 502148fe498fe0a41ae89c9f649d3cb1253b0487)

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-03-23 17:53:55 +00:00
Richard Purdie 8037ba4d86 bitbake: bb/tests/fetch: Update cups url
Update the upstream url used for testing cups versions after upstream website
changes.

(Bitbake rev: 5f06041d4936fc22297945bbbad7020bfa9083c6)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-21 12:43:12 +00:00
Brendan Le Foll 3c66619d50 bitbake: fetch2/npm: fix ud.registry so that alternative registries can be handled
Fixes [YOCTO #9231]

npm when given an invalid registry URL with --registry actually goes and
fetches from the default registry, but this commit makes sure it goes to the
specified one.

(Bitbake rev: 7c849be7c70a5db4f66fe3041486abb923b5e4ee)

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-12 09:35:52 +00:00
Lucas Dutra Nunes d53413d3a8 bitbake: server/process: Try connecting 4 times before giving up
Instead of trying one time with a timeout of 20 seconds try 4 times with
a timeout of 5 seconds, to account for a slow server start.

(Bitbake rev: 4a7fe63126dd8177baa5ad21e59e0bebeea8c596)

Signed-off-by: Lucas Dutra Nunes <ldnunes@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-09 22:47:29 +00:00
Michael Wood 0f0105932c bitbake: toaster: models List only have the specified project's imported layers
When returning the compatible layers make sure that we are only
listing: All the layers which are for this release && configuration
layers (i.e. aren't part of the build history) and which aren't an
imported layer OR are this project's imported layer(s).

[YOCTO #8944]

(Bitbake rev: de8baedaccb451c12bc3f642449db3f64aed6bf7)

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-03-09 22:47:29 +00:00
Elliot Smith 0dcab0258e bitbake: toaster: rework task buildstats storage and display
The data available from buildstats is now more fine grained than
previously, so take advantage of that to enrich the data we save
against tasks:

* Store the CPU usage for user and system separately, and display
them separately.
* Disk IO is now measured in bytes, not ms. Also store the
read/write bytes separately.
* Store started and ended times, as well as elapsed_time. This
will enable future features such as showing which tasks were
running at a particular point in the build.

There was also a problem with how we were looking up the Task
object, which meant that the buildstats were being added to
new tasks which weren't correctly associated with the build. Fix
how we look up the Task (only looking for tasks which match the
build, and the task and recipe names in the build stats data) so
the build stats are associated with the correct task.

[YOCTO #8842]

(Bitbake rev: efa6f915566b979bdbad233ae195b413cef1b8da)

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-03-09 22:45:16 +00:00
Sujith H cc74a8ae26 bitbake: toaster: use force_bytes to display non-ascii project names
When user enters a non-ascii character in the project
name of toaster, the build doesn't get triggered.
Use force_bytes to fix this.

Also deal with non-ascii project names when logging the
build request in runbuilds.

[YOCTO #9071]

(Bitbake rev: b6141c4d170885d3bdf63074afcb1e41fde0a8f0)

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-03-09 22:45:16 +00:00
Peter Kjellerstedt aebc22dbfa bitbake: fetch2: Make SRC_URI[md5sum] and SRC_URI[sha256sum] expand their values
For some reason, the values for SRC_URI[md5sum] and SRC_URI[sha256sum]
were not being expanded. That lead to the following code not working
as expected:

SRC_URI = "http://.../${PN}-${PV}.tar.gz"

MD5SUM = "123abc..."
SHA256SUM = "abcd1234..."

SRC_URI[md5sum] = "${MD5SUM}"
SRC_URI[sha256sum] = "${SHA256SUM}"

(Bitbake rev: ba011470df0ea8bd89f01c0b02ec4b3969e60ce7)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-09 22:45:16 +00:00
Ed Bartosh d405f97af3 bitbake: xmlrpc: fix bug in setting XMLRPCServer.single_use
XMLRPCServer.single_use attribute was always set to False.
This caused xmlrpc server to keep running after build is done as
BitBakeServerCommands.removeClient only shuts down server if its
single_use attribute is set to True.

(Bitbake rev: 0a60b0928a0a746a60d2c2f294ff1903963c7086)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-09 22:45:16 +00:00
Paul Eggleton c50bdb300b bitbake: fetch2/npm: add missing URL argument to ParameterError
Without this you get a rather odd traceback instead of the proper
exception message.

(Bitbake rev: 2fe1826d3077eeda6cde433d3a1e6620f74e08dd)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-09 22:45:16 +00:00
Paul Eggleton fbf27c4c5d bitbake: fetch2/npm: properly handle npm dependencies
The output of "npm view dependencies" isn't entirely JSON if there are
multiple results, but the code here was just discarding the output if
the entire thing didn't parse as JSON. Split the output into lines and
iterate over it, parsing JSON fragments as we find them; this way we end
up with the last package's dependencies since it'll be last in the
output.

Digging further, it seems that the dependencies field reported by "npm
view" also includes optional dependencies. That wouldn't be a problem
except some of these optional dependencies may be OS-specific; for
example the "chokidar" module has "fsevents" in its optional
dependencies, but fsevents only works on MacOS X (and is only needed
there). If we erroneously pull in fsevents, not only is it unnecessary
but it causes "npm shrinkwrap" to throw a tantrum. In the absence of a
better approach, look at the os field and discard the module (along with
any of its dependencies) if it isn't for Linux.

As part of this, we can reduce the calls to npm view to one per package
since we get the entire json output rather than querying twice for two
separate fields. Overall the time taken has probably increased since we
are being more thorough about dependencies, but it's not quite as bad as
it could have been.

(Bitbake rev: 436d67fe7af89ecfbd11749a6ae1bc20e81f2cc8)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-09 22:45:16 +00:00
Paul Eggleton ef6a4518e4 bitbake: fetch2/npm: fix errors with some version specifications
"2 || 3" is a valid version specification for a dependency in an npm
package.json file, but of course that looks like something else when
sent to a shell. Quote the version value to avoid this.

(Bitbake rev: bea0246831a46d943d2e27d6b38f6e498bd3413c)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-09 22:45:16 +00:00
Ed Bartosh 3322fa7670 bitbake: toasterui: fix warning 'Unknown event'
Continue after processing BuildStarted event to fix
WARNING: Unknown event: <bb.event.BuildStarted object at 0x2554150>

(Bitbake rev: 12f1fb8c9b70fea0c9145f881bcceb8af32df6af)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-07 17:23:04 +00:00
Ed Bartosh 621cbc86c9 bitbake: toasterui: exit on final events
Toasterui exits only if bitbake observer shuts down.
In build mode it should exit when build is done.

Made toasterui exit on bb.command.CommandCompleted,
bb.command.CommandFailed and bb.command.CommandExit events
when it's running in build mode.

(Bitbake rev: b11f9d6d3c2eb615335901e1dcea699daf3afb4c)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-07 17:23:04 +00:00
Ed Bartosh 8e138b7f2a bitbake: toasterui: make toasterui to work in build mode
Currently toasterui works only in observer mode. This is
artificial limitation which was made to support current toaster
design. As we decided to stop using bitbake server we'll
need to run toasterui also in build mode.

[YOCTO #7880]

(Bitbake rev: d4b5796899c3ca5c7becd7322291afd8afb35a31)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-07 17:23:04 +00:00
Ed Bartosh 0a6130697e bitbake: toasterui: check if setEventMask succeeded
Currently toasterui ignores return value of setEventMask
command, which created confusing difference between set of
events set by this command and the real set used in the code.

Checked if setEventMask succeeded. Print error message and
exit if it's not.

(Bitbake rev: 6e3f13ffb47102b5df2da91fbc3f5da3179245b2)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-07 17:23:04 +00:00
Ed Bartosh ac941ac0a2 bitbake: command: make setEventMask readonly
Executing setEventMask command when bitbake server is in readonly
mode causes runCommand to fail with the following error:
 'Not able to execute not readonly commands in readonly mode'

Set readonly attribute for setEventMask command to make it working
for Toaster UI. This should not do any harm as this command doesn't
influence cooker state.

(Bitbake rev: 8a47d30b2555255fbf6049c5ed69b29664c32b17)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-07 17:23:04 +00:00
Ed Bartosh dd3da9aa47 bitbake: toasterui: update list of events
Removed events not used in the code from the list.
Added events that are used in the code.

(Bitbake rev: 16b14ec16049cc2040a60ad5fc95f6e19dda91a6)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-07 17:23:04 +00:00
Ed Bartosh f56fa5dfd4 bitbake: toasterui: reformat list of events
Reformatted and reordered list of events to make changes
easily and see them clearly in the diffs.

(Bitbake rev: 42a2d1115f2b23dc063a3172285ca3be73cf70bb)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-07 17:23:04 +00:00
Ed Bartosh a71d32ac53 bitbake: toaster: remove sshbecontroller module
The code of this module is broken for a long time.
The functionality of it can be easily achieved by running
'manage.py runbuilds.py' on remote machine.

[YOCTO #8806]

(Bitbake rev: 975081eefdd7041a6b4bef6842c1bac9799a1b44)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-07 17:23:03 +00:00
Ed Bartosh 3db71b4087 bitbake: toaster: don't use sshbecontroller
Removed usage of sshbecontroller from bbcontroller, models, tests
and database schema.

(Bitbake rev: 3ee06eb7e96de5dba539ad52201867e77d06a53e)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-07 17:23:03 +00:00
Ed Bartosh 790b2d1387 bitbake: toaster: raise NotImplementedError
Raised NotImplementedError instead of Exception to be
able to catch it.

This is a preparation for removing sshbecontroller module.
It has to be done as code in bldcontrol/tests.py imports custom
NotImplementedException from sshbecontroller.

(Bitbake rev: c243ab6c83fe12d84777e4c3a18fd393827b9327)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-07 17:23:03 +00:00
Belen Barros Pena 96535ba720 bitbake: toaster: bring back the strict directive
This patch e0fd96442a removed the
"use strict" directive from the projectpage.js file by mistake.

This patch makes amends.

(Bitbake rev: b8044ce60af3f0b064cfba76c577503cc896e358)

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-03-07 17:23:03 +00:00
Belen Barros Pena 5b8b3993e4 bitbake: toaster: change 'revision' to 'Git revision'
I've received some feedback on the 'Revision' label we use in the import
layer page. It is not quite communicating that what's required is a Git
revision. Changing it to 'Git revision' to make it a bit more specific.

The change applies not only to the import layer page, but to all pages
showing revision information in the project configuration section.

For more on the feedback received, check

https://bugzilla.yoctoproject.org/show_bug.cgi?id=8429#c3

(Bitbake rev: 09392f36a4f115c2432302125e8cac48a9aa304f)

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-03-07 17:23:03 +00:00
Michael Wood 07ead9869a bitbake: toaster: views api Package info return both kinds of RDEPENDS
As we do with the popover snippet which shows dependencies inline in the
table also show dependencies which have both TYPE_TRDEPENDS and
TYPE_RDEPENDS.

Also remove obsolete comment

(Bitbake rev: d3b5f3b7ba4550e7cd03a37ca19ccd2fc0042b2d)

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-03-07 17:23:03 +00:00
Dave Lerner 9cda2ab8d5 bitbake: toaster: fixup dependency excludes for customimage
[YOCTO #9156]

For a customized image when adding a dependent package X that depends on
dependency package Y, in addition to adding X to appends_set and Y to
includes_set, make sure that Y is no longer in the excludes_set. Y may
have been added to the excludes_set by a prior package removal.

(Bitbake rev: 6b29d3297de2ae48a3ac5529ba0d22f895276b56)

Signed-off-by: Dave Lerner <dave.lerner@windriver.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-07 17:23:03 +00:00
Paul Eggleton a54cebe929 bitbake: fetch2/npm: ignore unknown headers in tarballs
Tarballs that are fetched down via npm repositories seem to often have
unknown headers. This doesn't affect our ability to extract the contents
though so we don't really care to see those warnings.

(Bitbake rev: b38975103e52a0c25e9ad9032c8cca1c47cbdcc2)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-07 17:23:03 +00:00
Paul Eggleton 0cd1be1f09 bitbake: fetch2/npm: handle alternative dependency syntax
npm allows you to specify a dependency as a Github username+path, or
omit the version entirely. You can hit these if you don't use a
shrinkwrap file, with the result that the code later fails due to the
output of "npm view" being empty; so handle this lazily by just ignoring
this part of the dependency if it's not really a version.

(Bitbake rev: 7b7a65c44dbdd5ba9366d4e2093f76df8758d546)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-07 17:23:03 +00:00
Paul Eggleton d9999279d9 bitbake: fetch2/npm: fix indentation
No code changes, just fix to use four spaces.

(Bitbake rev: 66a9ee7d54ca9c25209f72da079f260ccdcc872a)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-07 17:23:02 +00:00
brian avery a7d1b95c96 bitbake: ui: remove the puccho ui
This ui does not work in master, nor has it been updated for several years.

[YOCTO #9178]

(Bitbake rev: 9fad1d13eed1f725971e6d12d3977cd31e07019a)

Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-02 22:41:23 +00:00
bavery a9dc72f08b bitbake: hob: removal of hob ui and associated ui files
We've been gearing up the Toaster web UI to replace the Hob (GTK+ based) UI
for some time now; Hob has basically been on life support for the past few
releases. As of late last month in master, Toaster has the capability to
select the packages in an image, removing the last thing that Hob could do
that Toaster couldn't.

To recap, the reasons why Hob is being removed include:

- The code is tightly woven into BitBake, making it fragile. This means it
needs significant QA and maintenance on an ongoing basis.

- Some of the implementation is not ideal; we'll be able to remove some cruft
from BitBake and OE-Core at the same time.

- It's GTK+ 2 based, not the current GTK+ 3.

- Toaster is now a much more capable UI and is being actively maintained

The discussion about removing hob can be found at:
http://lists.openembedded.org/pipermail/openembedded-architecture/2016-February/000082.html

(Bitbake rev: be2cceea159c6ca9111eff3df87b98513eab6d72)

Signed-off-by: bavery <brian.avery@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-02 22:41:23 +00:00
Brendan Le Foll 27468dbc3a bitbake: fetch2/npm: Add missing ParameterError import
(Bitbake rev: b583a40c9086b3587065995d8cee45b7ea36c1b3)

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-02 22:41:22 +00:00
Brendan Le Foll 44e3461969 bitbake: npm: in cases where shrinkwrap resolved a git URL, ignore it and grab dist.tarball
npm-shrinkwrap will sometimes resolve a git URL which instead of a http url, in
this case go and grab the dist.tarball via npm instead of using the resolved
URL.

(Bitbake rev: eb53b927ff59aa19cf28bc46beb9f9a185a59990)

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-02 22:41:22 +00:00
Richard Purdie 2a7318133b bitbake: fetch2: Fix unpack for absolute file urls
The previous commit breaks absolute pathnames in file:// urls, this
fixes it.

(Bitbake rev: b8113a1800687a37a26ac28deafdbafd74cc138e)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-02 22:41:22 +00:00
Alexander Shashkevich 865d2feff6 bitbake: fetch2: fixes copying of file://dir; subdir=foo, bug 6128 and bug 6129
When in SRC_URI appears file://dir;subdir=foo unpacker copies 'dir' to ${WORKDIR}, not
${WORKDIR}/foo as it should be.

These changes are fixing following bugs as well:
Bug 6128 - Incorrect wildcard unpack behaviour in fetcher
Bug 6129 - Local directories unpack to a different location than local files

(Bitbake rev: e659a3b0c2771679057ee3e13cd42e6c62383ff2)

Signed-off-by: Alexander Shashkevich <alex@stunpix.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-02 22:41:22 +00:00
Richard Purdie 2e27c4bf23 bitbake: fetch2/npm: Enable fetcher
For some reason the enablement piece of the patch went missing, add it.

(Bitbake rev: 0270b5a3873ed0aeca3a66198c87a6164fb644b8)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-28 12:01:07 +00:00
Richard Purdie 030d920e2d bitbake: providers: Fix PREFERRED_VERSION lookup for '_' in PN
PN can contain '_', e.g. gcc-cross-x86_64 and an override cannot
hence we do this manually rather than use OVERRIDES.

(Bitbake rev: 7a6baf02617d1edced4eaff235e73d746e2a3b68)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-28 11:34:38 +00:00
Richard Purdie c679a3dd41 bitbake: fetch2: Skip lockfiles and donestamps for local files
For local files, there are no races with downloads, we don't need ".done"
stamps and we don't need lockfiles.

This considerably cleans up DL_DIR and all the pointless ".done" files
as well as removes stalls over local files with the same name.

(Bitbake rev: 48e903745db578d9b9b425a8d411c1369df0eb94)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-28 11:34:38 +00:00
Richard Purdie d01042eda9 bitbake: fetch2/__init__.py: Error if lockfile path invalid
Rather than create ".lock" and ".done" files with no name, error,
forcing us to fix the cases where this is a problem.

(Bitbake rev: 81158071508cc68c39db7d501370872f44d335cc)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-28 11:34:38 +00:00
Richard Purdie ab7b7bf94d bitbake: fetch2/__init__: Fix decodeurl to better handle urls without paths
If we specify urls such as npm://somehost;someparams the fetcher currently
does a poor job of handling mirrors of these urls due to deficiencies in the
way decodeurl works. This is because "somehost" is returned as a path, not
a host.

This tweaks the code so that unless its a file url, the host is returned
correctly.

This patch also adds test cases for these urls to the exist set of test
urls.

We need to tweak the URI() class since this thinks this is a relative url
which is clearly isn't. We also need to handle the fact that encodeurl will
error if passed a url of this form (it would want the path to be '/'.

(Bitbake rev: 83203cd2e677706e0111892a7843b83263cb8bd9)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-28 11:34:38 +00:00
Richard Purdie 06b4d8ffe4 bitbake: fetch2/wget: Set localfile for directories
If we wget something which looks directory like we end up with lock files
and done stamps without names, they also all use the same lockfile.

This change ensures that we use separate lock files based on the url
and avoid creating the mysterious ${DL_DIR}/.done files.

(Bitbake rev: 20bc82086018832e047345a672d74b6c1c113650)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-28 11:34:38 +00:00
Belen Barros Pena e0fd96442a bitbake: toaster: change 'delete layer' to 'remove layer'
I have received quite a few complaints about the use of the word
'delete' for layer removal, so change it to 'remove'. That also matches
the language we use for packages in image customisation.

[YOCTO #9165]

(Bitbake rev: 3c5ac2ddfb3f5ecd3f3218de0d6564e5f3842b98)

Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-26 17:20:38 +00:00
Belen Barros Pena 6e8282063f bitbake: toaster: rename 'run again' button
I quite dislike the 'Run again' label we use in the button that rebuilds
things. Changing it to 'Rebuild', which is shorter and more specific.

(Bitbake rev: 865a2015e86a1bc5cc7d63308f27c292d1ca98eb)

Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-26 17:20:36 +00:00
Dave Lerner c8dd72c797 bitbake: toaster: fix banner after customimage package add
Correct formatting of the banner message after adding a package to a
custom image.

[YOCTO #9101]

(Bitbake rev: da233005eb8cfa7842cd1a768c16e42aaaa55fad)

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-02-26 17:20:35 +00:00
Belen Barros Pena 149f57470c bitbake: toaster: custom breadcrumb for the default project
The default "Command line builds" project does not have a Configuration
page. It therefore needs a custom breadcrumb where the project name goes
to the project builds page, instead of the project configuration page.

(Bitbake rev: 5545acf6703a25ee46776138bbbd804615add89c)

Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-26 17:20:33 +00:00
Haris Okanovic 4a12865c7b bitbake: prserv: Add dump_db()
Returns a script (string) that reconstructs the state of the
entire database at the time this function is called. The script
language is defined by the backing database engine, which is a
function of server configuration.
Returns None if the database engine does not support dumping to
script or if some other error is encountered in processing.

The SQLite3 implementation in db.py calls iterdump() [1] to generate
a script. iterdump() is the library equivalent of the `sqlite3 .dump`
shell command, and the scripts are compatible. Execute the script in
an empty SQLite3 database using the sqlite3 utility to restore a backup
of prserv.

Use case: Backup a live PR server database in a non-racy way, such
that one could snapshot the entire database after a set of bitbake
builds all using a shared server. I.e. All changes made prior to
the start of a dump_db() operation should be committed and captured
in the script. Subsequent changes made during the backup process are
not guaranteed to be captured.

Testing: ~7MB database backs up in ~1s while PR server is under load
from 32 thread bitbake builds on two separate machines.

[1] https://docs.python.org/2/library/sqlite3.html#sqlite3.Connection.iterdump

(Bitbake rev: 004003daf6bd0f0233ce5c2d95f1d7d64ab91bb3)

Signed-off-by: Haris Okanovic <haris.okanovic@ni.com>
Reviewed-by: Ken Sharp <ken.sharp@ni.com>
Reviewed-by: Bill Pittman <bill.pittman@ni.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-26 17:20:31 +00:00
Dave Lerner bdb51abb3c bitbake: toaster: remove custom images from Image Recipes
Fix the view of 'Image Recipes' under 'Configuration' to only show
image recipes that are not customised since custom images have their
own page.

[YOCTO #9111]

(Bitbake rev: 18a93b360301a5497d5c8ef74ab71f374f2ad210)

Signed-off-by: Dave Lerner <dave.lerner@windriver.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-26 17:20:29 +00:00
Elliot Smith 98d462c8e6 bitbake: toaster: show suffix for image files and basename for artifact files
The build dashboard doesn't show image and artifact files correctly,
as it shows the full filename for images and the filename plus
path relative to DEPLOY_DIR for artifacts.

Instead, show just the suffix for image files, and the basename
for artifact files.

(Bitbake rev: 8084dcdc283b4dc170f066c202f89d56ce1abbef)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-26 17:20:28 +00:00
Belen Barros Pena 88b56603ce bitbake: toaster: add missing link to image recipe details
In the 'New custom image' page, each image recipe name listed should
link to the corresponding image recipe details page, so that users can
look into what packages are installed by a certain image, and decide
based on that if they want to customise it or not.

This patch adds that missing link.

(Bitbake rev: a481af693bfef0171732c18c298e285986b82de3)

Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-26 17:20:26 +00:00
Belen Barros Pena 25b179d5c3 bitbake: toaster: adjust the search field width
The search field at the top of our tables was using one of the Bootstrap
classes for text field sizing. Those classes are a bit rigid, resulting
in text fields too wide that made other table controls wrap.

Setting a maximum width to the search form using one of the span classes,
combined with a % width css declaration, make for text fields that
adapt a bit better to the horizontal space available in each table.

(Bitbake rev: 7833fab2e03f2d9a01ab9ad0a13c190382098b5e)

Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-26 17:20:24 +00:00
Belen Barros Pena a97081ba55 bitbake: toaster: make 'configuration' the first tab
Our project pages have 4 tabs: builds, configuration, import layer and
new custom image. Even though we treat the 'configuration' as the
default tab, it comes second after the builds tab.

That's a bit strange: the default tab should be the first one listed.
This patch changes the tab order to put 'configuration' first.

(Bitbake rev: ccb90019489c2c324c2a5a60295e02280a2ec18f)

Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-26 17:20:23 +00:00
Belen Barros Pena e1fc3190b7 bitbake: toaster: link to configuration in all breadcrumbs
The existing breadcrumb does not always provide a link to the project
configuration page. When you are in the build history pages, you must go
back to the builds information first, and from there access the project
configuration. That feels very long.

Change the breadcrumb so that the project name item always provides a
link to the project configuration.

(Bitbake rev: 9910f3f292d35fc91215d550c5f123dcf18ab35d)

Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-26 17:20:21 +00:00
Belen Barros Pena df2808f5f6 bitbake: toaster: reduce max height of modal dialogs
Now that we use modal dialogs to display dependency information for
packages, we are hitting their maximum height relatively often. It is set
by default to 400px, which makes it a bit tight at a 1280x800 viewport
size.

Reduce the maximum height to 300px to make things a bit more
comfortable.

(Bitbake rev: e36001d61768979d66cba0f3d4f5a2aaf4af2cb7)

Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-26 17:20:18 +00:00
Belen Barros Pena 6c51f0850f bitbake: toaster: disable add layer button on click
The 'add layer' button in the project configuration page remains enabled
after you add a layer. If you click it again, the same layer you just
added is added again.

This patch disables the 'add layer' button on click, to avoid this bit
of weirdness.

[YOCTO #8905]

(Bitbake rev: 63705f60035884a810fdd36e5a3fe10e411f23c7)

Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-26 17:20:16 +00:00
Belen Barros Pena d4a663a701 bitbake: toaster: apply error class to name field
The form for naming new custom images shows you an error message when
the name already exists or you include an invalid character in it. But
when an error appears, the input field was missing the red highlight.

This patch applies the right class to the form controls whenever an
error message is shown.

(Bitbake rev: df342e7662179410467c47cd870180ea75f863d4)

Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-26 17:20:15 +00:00
Belen Barros Pena 48f0ae2c12 bitbake: toaster: fix custom image name form
The placeholder text in the form where you name your new custom images
didn't display fully. This patch fixes the styles so that the text shows
properly. It also changes the text itself to make it a bit shorter.

[YOCTO #9122]

(Bitbake rev: 9df802182b0b96295b148a1681c2265e72d8306b)

Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-26 17:20:12 +00:00
Belen Barros Pena 07eb4f274c bitbake: toaster: comment out project release change
Although the support for building more than one release and how we
handle the build directories is the subject of lively discussion, we all
seem to agree on removing the ability to change the release of a
project. The feature is currently not working but exposed to users,
which is not a happy state of affairs.

This patch comments out the controls that give access to the release
changing functionality to hide them from users, but does not touch
anything else. Once all moving pieces start to settle down, we can make
a final decision regarding this feature, and clean up the code
accordingly.

[YOCTO #8917]

(Bitbake rev: 3a8c6f7155517cd61a160595b81e7bed84ba4eaf)

Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-26 17:20:11 +00:00
Richard Purdie 12ade9b093 bitbake: fetch2/npm: Add mirroring support for npm fetcher
(Bitbake rev: bff46c614d3f9cc18a1c8908c47842712e0e3a8c)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-26 17:20:09 +00:00
Brendan Le Foll ca5b6d66e0 bitbake: fetch2/npm: Add npm fetcher
npm fetcher with support for shrinkwrap files and lockdown files to easily
download and install an npm package with strict dependency resolution.

The SRC_URI should be in the format of:
SRC_URI = "npm://registry.npmjs.org/;name=${PN};version=${PV}"

To add a shrinkwrap and lockdown file use:
NPM_SHRINKWRAP := "${THISDIR}/${PN}/npm-shrinkwrap.json"
NPM_LOCKDOWN := "${THISDIR}/${PN}/lockdown.json"

(Bitbake rev: dec75bbc5d075acb322dad8b1c40d6bd518dc9fd)

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-26 17:20:07 +00:00
Brendan Le Foll 813bd1f806 bitbake: utils.py: Add sha1_file call
This is useful as npm-lockdown uses sha1 because npm releases the sha1 of
packages and whilst this is undocumented it seems no other algorithm is
supported

(Bitbake rev: fd5d9011f6dd7029895b64d8a02d33185b9aa8ae)

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-26 17:20:05 +00:00
Michael Wood 8c0ba8d9af bitbake: toaster: toastergui Fix invalid char test and implementation
This test was passing but because the assertion was the wrong way round
and should have expected the first one to pass and second one to fail,
in reality both were failing as the method for checking the invalid char
was incorrect.

(Bitbake rev: 932a92b8130d4815656dc885f0c6e4afa4502022)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-19 15:38:49 +00:00
Michael Wood 913e9b1cbc bitbake: toaster: PackagesTable show only installed packages
When showing the package list for the image recipe details only show the
packages which are installed in the image rather than all the packages
which are produced.

[YOCTO #9108]

(Bitbake rev: be7dca6c7607c0d13151c2d3f7ad7adcdf365076)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-19 15:38:48 +00:00
Michael Wood 94bca58067 bitbake: toaster: toastergui unit tests convert to use fixtures
Instead of having to manually write up in the setUp function all the
different objects to create in the database, just specifiy them in a
fixture and load it. This has the advantage that it can be used on a
live server by using the ./manage.py loaddata command and can then
be inspected.

(Bitbake rev: 8a653ad8b075892d24d15696b3070c5a28a4fbe2)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-19 15:38:48 +00:00
Michael Wood 8796ac8a55 bitbake: toaster: SoftwareRecipesTable apply default order_by
Make sure the default orderby for the SoftwareRecipesTable is applied

(Bitbake rev: 1688608b537d8de840c6d1e4802ae41ca872e5bf)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-19 15:38:48 +00:00
Michael Wood 8469e58025 bitbake: toaster: orm migrations Sort out migrations mess
We messed up the migrations by squashing some of the image
customisation model definitions into the initial migration which
has meant some irreversible operations on mysql took place.
This deletes, re-orders and fixes the migrations.

If your schema is up to date you may want to use ./manage migrate
with --fake or --fake-initial to avoid re-applying migrations.

[YOCTO #9116]

(Bitbake rev: 19bd63fc3a28dcbd0f531a5b06a037da34568bac)

Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-19 15:38:48 +00:00
Richard Purdie 4e5e501155 bitbake: data_smart: Drop default expand=False to getVarFlag [API change]
At some point in the future, getVarFlag should expand by default. To
get there from the current position, we need a period of time where the
expand parameter is mandatory.

This patch starts that process. Clear errors will result from any code
which doesn't provide this. Layers can be fixed with an expression
like:

sed -e 's:\(\.getVarFlag([^,()]*, [^,()]*\)):\1, False):g' -i `grep -ril getVar *`

(Bitbake rev: aa3faebdf6af66ab34f74d328b2113de0b08c7ee)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-18 07:48:00 +00:00
Richard Purdie c7610aa353 bitbake: data_smart: Drop default expand=False to getVar [API change]
At some point in the future, getVar should expand by default. To get
there from the current position, we need a period of time where the
expand parameter is mandatory.

This patch starts that process. Clear errors will result from any code
which doesn't provide this. Layers can be fixed with an expression
like:

sed -e 's:\(\.getVar([^,()]*\)):\1, False):g' -i `grep -ril getVar *`

(Bitbake rev: fab717d303df0bcef737661f6917f275f35215a4)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-18 07:48:00 +00:00
Markus Lehtonen 4f0ab27c6a bitbake: SignatureGeneratorBasic: make checksum cache file configurable
Define a new bitbake configuration variable BB_HASH_CHECKSUM_CACHE_FILE
that can be used to define the cache file to use for file checksum
cache.

(Bitbake rev: a965b390d6240e279c190b92b17c0573e9bd604c)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-18 07:41:16 +00:00
Markus Lehtonen 0cdf1934fd bitbake: MultiProcessCache: make cache filename configurable
If no cache file name is given a default from class variable is used,
like before.

(Bitbake rev: 2602a312818f564961de7dfa63c429d45ff9e5ac)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-18 07:41:16 +00:00
Markus Lehtonen ca552bb4b1 bitbake: FileChecksumCache: add get_checksums() method
Move the local file checksum functionality from bb.fetch2 into
bb.checksum module.

(Bitbake rev: 4f60933283f377d68f191db849dac6c1dc7a0aed)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-18 07:41:16 +00:00
Markus Lehtonen 8f61f2d881 bitbake: bb/runqueue: save task file dependency cache onto disk
Before this patch the usage of cache was quite useless as the file
checksums were not actually cached on disk but re-calculated every time.
This patch utilises the new writeout_file_checksum_cache() method of the
SignatureGenerator class to do the job.

(Bitbake rev: 5ac9cbf405841ed3f65e6f99a3cee032567fb182)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-18 07:41:16 +00:00
Markus Lehtonen 5177b1e4ac bitbake: SignatureGenerator: add method for saving the file checksum cache
Extend the API in order to be able to write out the file checksum cache
onto disk. SignatureGeneratorBasic class now implements a method that
update the fetcher local files checksum cache with the task file
dependency checksums.

(Bitbake rev: ecdabd321d48fa367b89ebffc00aa525b6eaa95c)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-18 07:41:15 +00:00
Markus Lehtonen 97617fd675 bitbake: bb/cache: drop some unused arguments
Drop unused 'd' argument from the cache save methods, simplifying the
API.

(Bitbake rev: 81bc1f20662c39ee8db1da45b1e8c7eb64abacf3)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-18 07:41:15 +00:00
Mirela Rabulea 5a87d8c477 bitbake: Allow Hob to run images on a custom simulator, other than qemu
The current behavior of Hob is that there is a "Run Image" button which becomes visible only for qemu images.

My suggested change is:
- if an image is selected and it is qemu-compatible, let the "Run image" button be named "Run qemu image"
- if an image is selected and it is not qemu-compatible, let the same button show up with the name "Run custom image", and besides that, an option shows-up to allow the selection of the custom script (by default it points out to runqemu script) to be used for launching this custom image

Note: in case there is more than one toggled image (qemu runnable or deployable), when the user clicks the "Run custom image" button, a dialog will be presented, allowing to choose between any of the existing images.

[YOCTO #8940]

(Bitbake rev: cc4cfc2370297b8feb2dc39d4262e73adf06c09a)

Signed-off-by: Mirela Rabulea <mirela.rabulea@nxp.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-18 07:41:15 +00:00
Christopher Larson a25858982a bitbake: bb.ui.knotty: prefix task messages with recipe/task
An example prefix: `perl-5.22.1-r0 do_compile:`

(Bitbake rev: 792b759e59e31d2e43d525a6e50d866b4f51f072)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-16 09:04:23 +00:00
Christopher Larson 4bf8b21ab8 bitbake: Move bb.{debug,note,..} into their own logging domain
This lets us filter and use -l to show messages from that source specifically.

(Bitbake rev: 7946927156dec33364418988eb921ddb273660eb)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-16 09:04:23 +00:00
Richard Purdie 8b217208cf bitbake: knotty: Set exit failure code on runQueueTaskFailed events
If the worker segfaults, we may never see a TaskFailed event from it, only
a runQueueTaskFailed event. In this case, return_value isn't getting set
leading to an incorrect exit code from bitbake. Fix by setting return_value
in both places.

(Bitbake rev: e5dd50e0d95d532fe31dde61f8c6b1a7a72321e9)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-15 16:48:12 +00:00
Richard Purdie a9223e20d1 bitbake: taskdata: Fix traceback issue with missing provider
If there is a missing provider and we're using "-k" mode alongside "-w",
we could get a traceback since there was no provider. Add tests to avoid this.

(Bitbake rev: 90a4805e4e770a433b4394ea99792731e9a4b546)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-15 16:48:12 +00:00
Richard Purdie 7593756cbb bitbake: cooker: Improve cache handling
We're seeing issues where the self test, which uses tinfoil doesn't
notice the changed contents of include files. The issue is
cached_statements in the parser being reused when the files have changed.

Whilst looking at this, I realised there were some other issues:

* We need to also invalidate the mtime cache when cooker restarts
* We should pass full filenames to the file invalidation code
* We should process cached_statements as part of inotify invalidation

With these fixes, the caching is more reliable for memory resident
bitbake too. It does raise some questions about cache validation and
lifecycles and indicates bitbake does need more work in the area,
preferably with the removal of the globals. This at least highlights
and works around some of the current issues.

(Bitbake rev: 3f507ff8bc467fba936cf3f31bb8ea8e02f168e8)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-15 16:48:12 +00:00
Richard Purdie 1c2d632a02 bitbake: Bump version post release to 1.29.0
(Bitbake rev: da1107a2c2331b3335c7bd46821edcb1933a0ff8)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-12 13:44:22 +00:00
Ed Bartosh f9f93ae856 bitbake: cooker: gracefully shutdown parsers
CookerParser.shutdown code doesn't do all required work to shutdown
parser processes. As a result bitbake hangs if interrupted during
parsing. Putting None into the parser_quit queue should fix this issue
as it makes parsers to quit main loop.

(Bitbake rev: f67307977e8f089ce6d208d3e9de2a6a1768757e)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-11 22:34:19 +00:00
Elliot Smith 1f7f077466 bitbake: buildinfohelper: unset brbe variable when build finishes
The brbe variable is set on the bitbake server when the Toaster
UI starts. This enables Toaster to associate events with the
correct build and build environment.

However, the brbe variable is also used when a build starts to
identify whether a new build needs to be created, or an existing
one looked up. This causes a bug for command-line builds which
happen after a Toaster-triggered build: because the brbe variable
is never unset on the server or the buildinfohelper, the new
command-line build events are treated as originating from the
previous build.

Ensure the brbe variable is reset when the buildinfohelper "closes"
a build, so that each build then either sets the brbe variable
(Toaster-triggered builds) or leaves it blank (command-line builds).

Also modify the localhostbecontroller so that the brbe variable
is not set on the server and not looked up from the server. This
ensures that it is only set when the triggerBuild() method is
called, and that it remains as None for command-line builds.

[YOCTO #9021]

(Bitbake rev: 4a6a8d0074f62208d843b06344be31ae73d9b745)

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-02-11 22:34:19 +00:00
Mihail Stanciu 19045bab71 toaster: tests Remove symlinks from toasteruitest folder
Remove symlinks in the UI tests folder as they are causing
problems for bitbake upstream.

[YOCTO #8787]

Signed-off-by: Mihail Stanciu <stanciux.mihail@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-11 17:07:39 +00:00
Richard Purdie 400f53003e bitbake: build: Improve python execution tracebacks
If something fails in a exec_func_python() the current stack trace shows
incorrect filenames and linenumbers. For example:

The stack trace of python calls that resulted in this exception/failure was:
File: '/media/build1/poky/meta/recipes-sato/images/core-image-sato.bb', lineno: 200, function: <module>
     0196:                chksum = bb.utils.sha256_file(fn)
     0197:                f.write('%s\t%s\n' % (chksum, os.path.relpath(fn, baseoutpath)))
     0198:
     0199:
 *** 0200:copy_buildsystem(d)
     0201:
File: '/media/build1/poky/meta/recipes-sato/images/core-image-sato.bb', lineno: 9, function: copy_buildsystem
     0005:IMAGE_FEATURES += "splash package-management x11-base x11-sato ssh-server-dropbear hwcodecs"
     0006:
     0007:LICENSE = "MIT"
     0008:
 *** 0009:inherit core-image
     0010:
     0011:IMAGE_INSTALL += "packagegroup-core-x11-sato-games"
File: '/usr/lib/python2.7/subprocess.py', lineno: 535, function: check_call
     0531:    The arguments are the same as for the Popen constructor.  Example:
     0532:
     0533:    check_call(["ls", "-l"])
     0534:    """
 *** 0535:    retcode = call(*popenargs, **kwargs)
     0536:    if retcode:
     0537:        cmd = kwargs.get("args")
     0538:        if cmd is None:
     0539:            cmd = popenargs[0]

The problem is the use of "FILE" to obtain the current filename. Instead,
we therefore inject the function being executed into the methodpool which
allows us to correct its linenumber and filename information. We can then
clearly mark the initial piece as autogenerated and the rest of the linenumber
and filename information should be correct. Afterwards the trace starts:

The stack trace of python calls that resulted in this exception/failure was:
File: 'exec_python_func() autogenerated', lineno: 2, function: <module>
     0001:
 *** 0002:copy_buildsystem(d)
     0003:
File: '/media/build1/poky/meta/classes/populate_sdk_ext.bbclass', lineno: 66, function: copy_buildsystem
     0062:    import glob
     0063:    import oe.copy_buildsystem
     0064:    import subprocess
     0065:
 *** 0066:    subprocess.check_call("foo")
     0067:
     0068:    oe_init_env_script = d.getVar('OE_INIT_ENV_SCRIPT', True)
     0069:
     0070:    conf_bbpath = ''
File: '/usr/lib/python2.7/subprocess.py', lineno: 535, function: check_call
     0531:    The arguments are the same as for the Popen constructor.  Example:
     0532:
     0533:    check_call(["ls", "-l"])
     0534:    """
 *** 0535:    retcode = call(*popenargs, **kwargs)
     0536:    if retcode:
     0537:        cmd = kwargs.get("args")
     0538:        if cmd is None:
     0539:            cmd = popenargs[0]

We can't inject into methodpool at parsing time, since there may be
_append or other override operations against the function before its
execution.

(Bitbake rev: fae153095d23157dd7e72c29f683f86149ee33a8)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 15:47:11 +00:00
Richard Purdie aece748762 bitbake: build/data: Don't expand python functions before execution [API change]
Right now, if you have some python code like:

X = "a"

def somefunction(d):
    d.setVar("X", "b")
    d.setVar("Y", "${X}")

then any sane person would expect that Y = "b" at the end of the
function. This is not the case, Y = "a".

This is due to the python function being expanded before execution, the
executed code would read d.setVar("Y", "a"). This understandably
confuses people, it also makes it near impossible to write ${} in a
python function without unintended things happening.

I think there is general agreement we should fix this and standardise
on non-expansion of python functions. We already don't expand anonymous
python (mostly).

I've checked OE-Core with buildhistory before and after this change and
there were a small number of issues this exposed which I've sent
patches for.

I propose we default to not expanding python code and then deal with
any consequences from that if/as/where identified. This will improve
new user understanding and usability of the system, it also allows
several long standing weird expansion issues to be fixed.

(Bitbake rev: 8bf33a8e92c0e188fa392030025756196c96fcbb)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 15:47:11 +00:00
Richard Purdie e39cfb1f9c bitbake: cooker: Don't expand python functions in variable dumps
We don't want to expand python functions since they aren't expanded
at execution time (e.g. anonymous python). They can also have side
effects.

This function is primarily used by toaster for variable dumps for later
display. The lack of expansion of python functions won't matter in this case
and actively helps some variable handling (e.g. SRCPV).

(Bitbake rev: 3f5520b4844a4bdd615046479ba08ed192bdc8cd)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 15:47:11 +00:00
Richard Purdie f652b6b9d0 bitbake: data: Don't expand python functions for variable dependencies
Expanding python functions for variable dependencies doesn't really make sense,
not least since this causes execution of any inline python, it also makes it
impossible to write expressions like d.expand("${X}") of d.setVar("X", "${Y}")
which may have the wrong values if expanded now.

This starts to standardise the approach across bitbake for handling python code.

(Bitbake rev: 765a2480dbe288f64562a9611dd93b6b6dd0a64e)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 15:47:11 +00:00
Richard Purdie d3e0c448ea bitbake: data_smart: Avoid expanding anonymous python functions
We don't expand anonymous python before execution, so nor should
we do this when calculating checksums for them.

(Bitbake rev: 5f10987edda35b08970a6dd6ccf9febad271ce3e)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 15:47:11 +00:00
Michael Wood e0eb2ea488 bitbake: toaster: models Remove manual transaction control from lsupdates
Revert "toaster: models.py do not use transactions".
This reverts commit e248a503ba
(Bitbake rev: 48d0d510816346073f135bb86fb7904fdb50bb27)

Manually managing the database transactions caused more
problems than it temporarily solved so we return control back to
Django's orm.

[YOCTO #8796]

(Bitbake rev: 25c531915b6f8f79a0822996ceb97f90483e359f)

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-02-10 13:33:40 +00:00
Belen Barros Pena 48622e1d6b bitbake: toaster: build section Improve display of builds when > 1 targets
* Display always the first target in alphabetical order to match what we
do in the breadcrumbs and the build dashboard heading

* Remove the extra space between the '+' and the additional number of
targets

* Make sure the tooltip with the full target list takes the Bootstrap
tooltip styles

* Replace the word 'targets' in the tooltip with 'recipes', since that's
how we call build targets everywhere else in Toaster

(Bitbake rev: 3b8747d0af4b9164e973940ed97751c951e74110)

Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 13:33:40 +00:00