]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/log
thirdparty/openembedded/openembedded-core-contrib.git
9 years agotoaster: add started property to Build
Elliot Smith [Wed, 13 Jul 2016 13:39:47 +0000 (14:39 +0100)] 
toaster: add started property to Build

Add a property to the Build model which records whether
the BuildStarted event has occurred for the build.

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

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

[YOCTO #8443]

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
9 years agotoaster: remove links from time field on failed builds
Elliot Smith [Wed, 13 Jul 2016 10:37:01 +0000 (11:37 +0100)] 
toaster: remove links from time field on failed builds

Failed builds don't have any time data recorded for them,
so the time field in the builds table, the time shown
in the recent builds area, and the build time shown in
the build dashboard should not be links for failed builds.

[YOCTO #8443]

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
9 years agotoaster: tweak styling and typos in recent builds area
Elliot Smith [Tue, 12 Jul 2016 15:38:06 +0000 (16:38 +0100)] 
toaster: tweak styling and typos in recent builds area

Help icons need to have the Bootstrap tooltip() method called on
them so that the popups are correctly styled.

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

Fix pluralisation of errors and warnings shown.

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

[YOCTO #9631]

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
9 years agotoaster: show "Tasks starting..." until the first task completes
Elliot Smith [Tue, 12 Jul 2016 15:14:42 +0000 (16:14 +0100)] 
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]

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
9 years agotoaster: show progress of recipe parsing in recent builds area
Elliot Smith [Mon, 11 Jul 2016 13:47:06 +0000 (14:47 +0100)] 
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]

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
9 years agotoaster: move most recent builds templating to client
Elliot Smith [Wed, 29 Jun 2016 14:41:56 +0000 (15:41 +0100)] 
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]

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
9 years agocooker: add BuildInit event
Elliot Smith [Mon, 11 Jul 2016 15:23:05 +0000 (16:23 +0100)] 
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]

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
9 years agotoaster: fixtures Add README
Michael Wood [Tue, 2 Aug 2016 13:19:17 +0000 (14:19 +0100)] 
toaster: fixtures Add README

Add README to explain fixtures directory

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
9 years agotoaster: Remove old toaster config loading mechanism
Michael Wood [Mon, 1 Aug 2016 18:49:43 +0000 (19:49 +0100)] 
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

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
9 years agotoaster: lsupdates Add spinner for parsing/http fetch
Michael Wood [Mon, 1 Aug 2016 18:38:28 +0000 (19:38 +0100)] 
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.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
9 years agotoaster: checksettings call django's loaddata instead of custom command
Michael Wood [Mon, 1 Aug 2016 18:32:53 +0000 (19:32 +0100)] 
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.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
9 years agotoaster: Add poky and openembedded configuration fixtures
Michael Wood [Mon, 25 Jul 2016 12:43:08 +0000 (13:43 +0100)] 
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.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
9 years agotoaster: tests test_new_project_page Catch button not enabled exception
Michael Wood [Fri, 5 Aug 2016 08:26:49 +0000 (09:26 +0100)] 
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]

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>
9 years agotoaster: --help now returns 0 instead of 1
Randy Witt [Tue, 2 Aug 2016 23:43:54 +0000 (16:43 -0700)] 
toaster: --help now returns 0 instead of 1

If the user explicitly passes in "--help" then it should return 0. This
is the convention follow by the typical application. This allows the
user to check for options without triggering an error.

Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agosiggen: Fix typo
Ulrich Ölmann [Mon, 1 Aug 2016 08:43:00 +0000 (10:43 +0200)] 
siggen: Fix typo

Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agofetch2/gitannex.py: use 'git annex init' instead of 'git annex sync'
Terry Boese [Wed, 10 Aug 2016 15:14:15 +0000 (09:14 -0600)] 
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.

Signed-off-by: Terry Boese <terry.boese@vecima.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agopersist_data: Fix py3 update stack overflow
Richard Purdie [Wed, 10 Aug 2016 15:00:33 +0000 (16:00 +0100)] 
persist_data: Fix py3 update stack overflow

Revision d0f904d407f57998419bd9c305ce53e5eaa36b24 accidentally broke
items() and values() and made them cause stack overflows. Undo that
breakage.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agofetch: Fix use of tar's --exclude option for tar >= 1.29
Mariano Lopez [Fri, 5 Aug 2016 13:54:44 +0000 (13:54 +0000)] 
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]

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>
9 years agobitbake-user-manual: Applied typo fix to "Override Style Operation Advantages"
Scott Rifenbark [Mon, 1 Aug 2016 18:52:10 +0000 (11:52 -0700)] 
bitbake-user-manual: Applied typo fix to "Override Style Operation Advantages"

Fixes [YOCTO #9985]

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

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
9 years agobitbake-user-manual: Changed bitbake command example.
Scott Rifenbark [Fri, 29 Jul 2016 21:18:35 +0000 (14:18 -0700)] 
bitbake-user-manual: Changed bitbake command example.

Fixes [YOCTO #7718]

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

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
9 years agobitbake-user-manual: Updated the PROVIDES variable
Scott Rifenbark [Fri, 29 Jul 2016 21:08:25 +0000 (14:08 -0700)] 
bitbake-user-manual: Updated the PROVIDES variable

Fixes [YOCTO #10011]

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

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
9 years agobitbake-user-manual: Added non-existant variable expansion
Scott Rifenbark [Fri, 22 Jul 2016 15:36:09 +0000 (08:36 -0700)] 
bitbake-user-manual: Added non-existant variable expansion

Fixes [YOCTO #10003]

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

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
9 years agobitbake-user-manual: Applied some review comments
Scott Rifenbark [Thu, 21 Jul 2016 18:27:57 +0000 (11:27 -0700)] 
bitbake-user-manual: Applied some review comments

Fixes [YOCTO #9985]

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

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
9 years agobitbake-user-manual: Updated the "Inline Python Variable Expansion" section.
Scott Rifenbark [Thu, 21 Jul 2016 18:02:52 +0000 (11:02 -0700)] 
bitbake-user-manual: Updated the "Inline Python Variable Expansion" section.

Fixes [YOCTO #9984]

Added a small note to the bottom to help clarify.

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
9 years agobitbake-user-manual: Fixed override operator syntax.
Scott Rifenbark [Thu, 21 Jul 2016 17:51:11 +0000 (10:51 -0700)] 
bitbake-user-manual: Fixed override operator syntax.

I had inconsistent usage of the "_append" style operator syntax
in the chaper.  I was using a mix of <filename>_append</filename>
and "_append".  I changed to "_append" for consistency.

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
9 years agobitbake-user-manual: Clarified override-style operators.
Scott Rifenbark [Thu, 21 Jul 2016 17:37:09 +0000 (10:37 -0700)] 
bitbake-user-manual: Clarified override-style operators.

Fixes [YOCTO #9985]

Made the following changes:

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

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

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

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
9 years agobitbake-user-manual: Updated the variable expansion section.
Scott Rifenbark [Thu, 21 Jul 2016 16:49:08 +0000 (09:49 -0700)] 
bitbake-user-manual: Updated the variable expansion section.

Fixes [YOCTO #9984]

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

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
9 years agoRevert "bitbake-user-manual: Added new section on command-line execution"
Richard Purdie [Tue, 2 Aug 2016 14:10:38 +0000 (15:10 +0100)] 
Revert "bitbake-user-manual: Added new section on command-line execution"

This reverts commit 6f6cd0674fd1595f4e74b7da692e0c348b2660c6 as it was
a duplicated commit.

9 years agolib/toaster: Fix missing new files from previous commits
Richard Purdie [Mon, 1 Aug 2016 08:38:23 +0000 (09:38 +0100)] 
lib/toaster: Fix missing new files from previous commits

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster-tests: fix URL given for Chromedriver download
Elliot Smith [Wed, 20 Jul 2016 16:37:04 +0000 (17:37 +0100)] 
toaster-tests: fix URL given for Chromedriver download

The link to the Chromedriver downloads page is dead, so
put in the correct URL.

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster-tests: define capabilities for latest Firefox driver
Elliot Smith [Wed, 20 Jul 2016 16:37:03 +0000 (17:37 +0100)] 
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.

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>
9 years agolib/bb/checksum: avoid exception on broken symlinks
Paul Eggleton [Tue, 26 Jul 2016 03:36:40 +0000 (15:36 +1200)] 
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.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agolib/bb/utils: show subprocess output in stack traces
Ross Burton [Mon, 18 Jul 2016 16:22:55 +0000 (17:22 +0100)] 
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.

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agofetch2: fix pickle issues while switching from master to krogoth
Maxin B. John [Fri, 29 Jul 2016 08:23:35 +0000 (11:23 +0300)] 
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)

Signed-off-by: Maxin B. John <maxin.john@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agolib/bb/build: handle incomplete message fragments in log FIFO
Ross Burton [Mon, 25 Jul 2016 22:32:26 +0000 (23:32 +0100)] 
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 ]

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster-tests: add tasks and recipes sub-page tests
Elliot Smith [Thu, 21 Jul 2016 15:58:40 +0000 (18:58 +0300)] 
toaster-tests: add tasks and recipes sub-page tests

Add tests for the tasks and recipes sub-pages of the build
dashboard.

[YOCTO #9833]

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>
9 years agotoaster: set non-hideable columns for built recipes table
Elliot Smith [Thu, 21 Jul 2016 15:58:39 +0000 (18:58 +0300)] 
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]

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>
9 years agotoaster: set non-hideable columns for build tasks table
Elliot Smith [Thu, 21 Jul 2016 15:58:38 +0000 (18:58 +0300)] 
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]

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>
9 years agotoaster: fix download URL for task logs
Elliot Smith [Thu, 21 Jul 2016 15:42:35 +0000 (18:42 +0300)] 
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]

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>
9 years agofetcher2/__init__: Print command in case of ExecutionError in runfetchcmd
Mario Domenech Goulart [Thu, 21 Jul 2016 14:08:01 +0000 (16:08 +0200)] 
fetcher2/__init__: Print command in case of ExecutionError in runfetchcmd

Signed-off-by: Mario Domenech Goulart <mario.goulart@bmw-carit.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: loadconf Partially add back some of the layerSource parsing
Michael Wood [Thu, 21 Jul 2016 13:43:32 +0000 (14:43 +0100)] 
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.

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>
9 years agotoaster: admin Add Layer_Version to the admin-able models
Michael Wood [Thu, 21 Jul 2016 13:43:31 +0000 (14:43 +0100)] 
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.

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>
9 years agotoaster: orm Remove the layerindex specific up_branch fields
Michael Wood [Thu, 21 Jul 2016 13:43:30 +0000 (14:43 +0100)] 
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.

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>
9 years agotoaster: lsupdates Add progress information and clean up logging
Michael Wood [Thu, 21 Jul 2016 13:43:29 +0000 (14:43 +0100)] 
toaster: lsupdates Add progress information and clean up logging

Adds basic progress % information and provides better description of
what is happening.

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>
9 years agotoaster: tests: Remove references to LayerSource model
Michael Wood [Thu, 21 Jul 2016 13:43:28 +0000 (14:43 +0100)] 
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.

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>
9 years agotoaster: Replace references to LayerSource models
Michael Wood [Thu, 21 Jul 2016 13:43:27 +0000 (14:43 +0100)] 
toaster: Replace references to LayerSource models

Replace references to the now deprecated layersource models across
Toaster with the new enums for layer source types.

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>
9 years agotoaster: lsupdates Add layerindex fetcher
Michael Wood [Thu, 21 Jul 2016 13:43:26 +0000 (14:43 +0100)] 
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.

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>
9 years agotoaster: models Remove LayerSource models and replace with enum
Michael Wood [Thu, 21 Jul 2016 13:43:25 +0000 (14:43 +0100)] 
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]

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>
9 years agotoaster: bldcollector admin Remove LayerSourceAdmin
Michael Wood [Thu, 21 Jul 2016 13:43:24 +0000 (14:43 +0100)] 
toaster: bldcollector admin Remove LayerSourceAdmin

Remove the LayerSource admin from django admin interface. LayerSources
are not going to be manageable from the admin interface.

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>
9 years agotoaster: loadconf remove Loading LayerSources
Michael Wood [Thu, 21 Jul 2016 13:43:23 +0000 (14:43 +0100)] 
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.

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>
9 years agolib/bb/progress: avoid possibility of start event being reported twice
Paul Eggleton [Fri, 22 Jul 2016 12:18:39 +0000 (00:18 +1200)] 
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.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agoknotty: don't display ETA for tasks with progress
Paul Eggleton [Fri, 22 Jul 2016 12:18:38 +0000 (00:18 +1200)] 
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].

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agoknotty: fix some minor bugs in BBProgress
Paul Eggleton [Fri, 22 Jul 2016 12:18:37 +0000 (00:18 +1200)] 
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.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agofetch: copy files with -H
Enrico Scholz [Thu, 26 May 2016 00:08:06 +0000 (02:08 +0200)] 
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

Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agocache: Don't interleave pickle cache file writing
Richard Purdie [Fri, 22 Jul 2016 10:28:57 +0000 (11:28 +0100)] 
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.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agocache: Add better cache loading sanity checks
Richard Purdie [Fri, 22 Jul 2016 10:28:23 +0000 (11:28 +0100)] 
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.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agocache: Drop/simplify pointless type checking
Richard Purdie [Fri, 22 Jul 2016 10:27:51 +0000 (11:27 +0100)] 
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.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agocache: Improve versions fields handling
Richard Purdie [Fri, 22 Jul 2016 10:27:21 +0000 (11:27 +0100)] 
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.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agocache: Correctly handle missing extra caches
Richard Purdie [Thu, 21 Jul 2016 16:27:35 +0000 (17:27 +0100)] 
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]

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agocache: Move the parsing message to a more logical place
Richard Purdie [Thu, 21 Jul 2016 16:25:19 +0000 (17:25 +0100)] 
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.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobitbake: implement idle timeout for xmlrpc server
Ed Bartosh [Tue, 19 Jul 2016 20:20:34 +0000 (23:20 +0300)] 
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]

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobitbake: implement --foreground command line option
Ed Bartosh [Tue, 19 Jul 2016 19:54:38 +0000 (22:54 +0300)] 
bitbake: implement --foreground command line option

This option makes bitbake xmlrpc server to run in foreground.
It should be useful for debugging purposes.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobitbake-user-manual: Added new section on command-line execution
Scott Rifenbark [Wed, 8 Jun 2016 01:24:27 +0000 (18:24 -0700)] 
bitbake-user-manual: Added new section on command-line execution

Needed a section on executing a list of task and recipe combinations.

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobitbake-user-manual: Applied review edits to "Recursive Dependencies"
Scott Rifenbark [Tue, 19 Jul 2016 18:35:26 +0000 (11:35 -0700)] 
bitbake-user-manual: Applied review edits to "Recursive Dependencies"

Added a minor tweak to the third paragraph to be more inclusive
of the topic.

Fixes [YOCTO #9970]

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
9 years agobitbake-user-manual: Fixed typo in the BBDEBUG variable description.
Scott Rifenbark [Sat, 16 Jul 2016 19:04:57 +0000 (12:04 -0700)] 
bitbake-user-manual: Fixed typo in the BBDEBUG variable description.

In the BBDEBUG variable description, the "-d" parameter needed to
be "-D".  Fixed it.

Fixes [YOCTO #9950]

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
9 years agobitbake-user-manual: Added review changes to BBCLASSEXTEND description
Scott Rifenbark [Thu, 14 Jul 2016 19:52:30 +0000 (12:52 -0700)] 
bitbake-user-manual: Added review changes to BBCLASSEXTEND description

Fixes [YOCTO #9909]

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

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
9 years agobitbake-user-manual: Added review changes to recursive section.
Scott Rifenbark [Thu, 14 Jul 2016 19:00:09 +0000 (12:00 -0700)] 
bitbake-user-manual: Added review changes to recursive section.

Applied formatting to a "after" word that should be
<filename>after</filename>.  Also added a new clarifying paragraph in
the "Recursive Dependencies" section.

Fixes [YOCTO #9861]

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
9 years agobitbake-user-manual: Addeds support for the Perforce Fetcher
Andrew Bradford [Thu, 14 Jul 2016 18:42:56 +0000 (11:42 -0700)] 
bitbake-user-manual: Addeds support for the Perforce Fetcher

Added a new Perforce Fetcher section in the same spirit as the existing
sections for other supported fetchers.  Changes included the new section,
removal of the bulleted item that mentioned this fetcher as an
"additional" fetcher, and the creation of a new variable in the glossary
named P4DIR.

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
9 years agobitbake-user-manual: Added clarifying note to BBCLASSEXTEND variable.
Scott Rifenbark [Tue, 12 Jul 2016 21:08:32 +0000 (14:08 -0700)] 
bitbake-user-manual: Added clarifying note to BBCLASSEXTEND variable.

Fixes [YOCTO #9909]

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

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
9 years agobitbake-user-manual: Added a note providing examples of task dependencies
Scott Rifenbark [Tue, 12 Jul 2016 20:41:12 +0000 (13:41 -0700)] 
bitbake-user-manual: Added a note providing examples of task dependencies

Fixes [YOCTO #9861]

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

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
9 years agobitbake-user-manual: Updated dependency section for tasks
Scott Rifenbark [Mon, 11 Jul 2016 21:24:22 +0000 (14:24 -0700)] 
bitbake-user-manual: Updated dependency section for tasks

Fixes [YOCTO #9861]

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

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
9 years agobitbake-user-manual: Updated the defaults for getVar and getVarFlag
Scott Rifenbark [Thu, 9 Jun 2016 17:32:39 +0000 (10:32 -0700)] 
bitbake-user-manual: Updated the defaults for getVar and getVarFlag

There is no default.

Fixes [YOCTO #9683]

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
9 years agobitbake-user-manual: Added new section on command-line execution
Scott Rifenbark [Wed, 8 Jun 2016 01:24:27 +0000 (18:24 -0700)] 
bitbake-user-manual: Added new section on command-line execution

Needed a section on executing a list of task and recipe combinations.

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
9 years agocooker: Fix incorrect dot file generation
Richard Purdie [Wed, 20 Jul 2016 15:08:17 +0000 (16:08 +0100)] 
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.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster-tests: add class SeleniumTestCaseBase for browser tests
Aníbal Limón [Tue, 19 Jul 2016 15:49:10 +0000 (16:49 +0100)] 
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.

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>
9 years agobitbake: main: implement server autostart feature
Ed Bartosh [Mon, 18 Jul 2016 16:07:18 +0000 (19:07 +0300)] 
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]

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobitbake: utils: add BBSERVER to the list of preserved variables
Ed Bartosh [Mon, 18 Jul 2016 16:07:17 +0000 (19:07 +0300)] 
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.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobitbake: xmlrpc: implement check of connection to server
Ed Bartosh [Mon, 18 Jul 2016 16:07:16 +0000 (19:07 +0300)] 
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]

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agolib/bb/utils: no need to unsetenv when manipulating os.environ
Ross Burton [Mon, 18 Jul 2016 22:10:41 +0000 (23:10 +0100)] 
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.

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agofetch2: implement progress support
Paul Eggleton [Wed, 6 Jul 2016 04:26:10 +0000 (16:26 +1200)] 
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].

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>
9 years agotoaster-tests: package count/size shouldn't show for non-image builds
Elliot Smith [Tue, 12 Jul 2016 22:54:58 +0000 (15:54 -0700)] 
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.

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>
9 years agotoaster-tests: new custom image button shouldn't show for non-image builds
Elliot Smith [Tue, 12 Jul 2016 22:54:57 +0000 (15:54 -0700)] 
toaster-tests: new custom image button shouldn't show for non-image builds

[YOCTO #9514]

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>
9 years agotoaster-tests: add tests for build artifact display on build dashboard
Elliot Smith [Tue, 12 Jul 2016 22:54:56 +0000 (15:54 -0700)] 
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]

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>
9 years agotoaster: the customise image button shouldn't rely on targets
Elliot Smith [Tue, 12 Jul 2016 22:54:55 +0000 (15:54 -0700)] 
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.

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>
9 years agotoaster: add package manifest path to Target objects
Elliot Smith [Tue, 12 Jul 2016 22:54:54 +0000 (15:54 -0700)] 
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.

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>
9 years agotoaster: better display of targets which produced no images
Elliot Smith [Tue, 12 Jul 2016 22:54:53 +0000 (15:54 -0700)] 
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]

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>
9 years agotoaster: show manifests in their own section of the build dashboard
Elliot Smith [Tue, 12 Jul 2016 22:54:52 +0000 (15:54 -0700)] 
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.

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>
9 years agotoaster: only show "New custom image" button for builds with image targets
Elliot Smith [Tue, 12 Jul 2016 22:54:51 +0000 (15:54 -0700)] 
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]

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>
9 years agotoaster: use has_images() methods to display images correctly
Elliot Smith [Tue, 12 Jul 2016 22:54:50 +0000 (15:54 -0700)] 
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]

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>
9 years agobuildinfohelper: only record image files for tasks which make images
Elliot Smith [Tue, 12 Jul 2016 22:54:49 +0000 (15:54 -0700)] 
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]

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>
9 years agotoaster: improve scan for SDK artifacts
Elliot Smith [Tue, 12 Jul 2016 22:54:48 +0000 (15:54 -0700)] 
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]

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>
9 years agobuildinfohelper: fix retrieval of targets
Elliot Smith [Tue, 12 Jul 2016 22:54:47 +0000 (15:54 -0700)] 
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.

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>
9 years agotoaster: attach kernel artifacts to targets
Elliot Smith [Tue, 12 Jul 2016 22:54:46 +0000 (15:54 -0700)] 
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]

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>
9 years agotoaster: improve image file suffix retrieval
Elliot Smith [Tue, 12 Jul 2016 22:54:45 +0000 (15:54 -0700)] 
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.

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>
9 years agotoaster: do image and artifact scan on BuildCompleted
Elliot Smith [Tue, 12 Jul 2016 22:54:44 +0000 (15:54 -0700)] 
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]

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>
9 years agotoaster: display Target targets in build dashboard
Elliot Smith [Tue, 12 Jul 2016 22:54:43 +0000 (15:54 -0700)] 
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]

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>
9 years agorunqueue: improve exception logging
Ed Bartosh [Fri, 15 Jul 2016 16:44:01 +0000 (09:44 -0700)] 
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.

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>
9 years agolib/bb/utils.py: return sorted OrderedDict in explode_dep_versions2
Robert Yang [Mon, 18 Jul 2016 03:42:51 +0000 (20:42 -0700)] 
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.

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agoknotty: avoid errors when fetching outside of a task
Paul Eggleton [Fri, 15 Jul 2016 08:54:30 +0000 (20:54 +1200)] 
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.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobuild: don't use $B as the default cwd for functions
Ross Burton [Thu, 14 Jul 2016 18:56:22 +0000 (19:56 +0100)] 
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 ]

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>