]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/log
thirdparty/openembedded/openembedded-core-contrib.git
9 years agotoaster: alerts and modals Avoid modals and alerts overlaying each other
Michael Wood [Mon, 26 Sep 2016 10:59:32 +0000 (13:59 +0300)] 
toaster: alerts and modals Avoid modals and alerts overlaying each other

Make sure that when we spawn a modal we clear any notifications and also
make sure that old notifications are cleared before showing a new one.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: project page Implement front end feature to delete project
Michael Wood [Mon, 26 Sep 2016 10:59:31 +0000 (13:59 +0300)] 
toaster: project page Implement front end feature to delete project

Add confirm modal and api calls to delete a project from the project
dashboard.

[YOCTO #6238]

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: libtoaster Add a global notification set/show mechanism
Michael Wood [Mon, 26 Sep 2016 10:59:30 +0000 (13:59 +0300)] 
toaster: libtoaster Add a global notification set/show mechanism

We now have a number of places where we show change notifications based
on an event in a previous page (imported a layer, deleted a build,
deleted a project etc) and we show these notifications on various pages
so we add a simple notification utility to libtoaster.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: move MostRecentBuildsView to its own widget
Michael Wood [Mon, 26 Sep 2016 10:59:29 +0000 (13:59 +0300)] 
toaster: move MostRecentBuildsView to its own widget

This view is specific to the builds dashboard rather than gernic api so
like ToasterTable and ToasterTypeAhead we class it as a widget as it has
a single purpose. Also clean up some flake8 identified issues.

Original author of the code moved in this commit is Elliot Smith.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: Clean up and convert to rest api project edit and get calls
Michael Wood [Mon, 26 Sep 2016 10:59:28 +0000 (13:59 +0300)] 
toaster: Clean up and convert to rest api project edit and get calls

Convert the project xhr calls into proper rest api and port the client
side calls to use the new API. Fix all the pyflakes identified issues
and clean up unused fields.

Also remove the api and client side code for changing release on the fly
as this is no longer supported.

[YOCTO #9519]

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agorunqueue: Ensure worker failure is accounted for in task statistics
Richard Purdie [Wed, 28 Sep 2016 09:35:12 +0000 (10:35 +0100)] 
runqueue: Ensure worker failure is accounted for in task statistics

If the worker fails to launch, ensure the task is shown as failed rather
than a confusing "all succeeded" message.

Patch from Juro Bystricky

[YOCTO #10335]

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobuild.py: fix os.getcwd() exception
Juro Bystricky [Mon, 26 Sep 2016 20:53:13 +0000 (13:53 -0700)] 
build.py: fix os.getcwd() exception

When trying to obtain the current directory from a directory
that does not exist anymore, an exception is raised.
This patch handles such exception.

[YOCTO #10331]

Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agoknotty: ensure progress bar output is accounted for in display
Paul Eggleton [Fri, 23 Sep 2016 09:14:32 +0000 (21:14 +1200)] 
knotty: ensure progress bar output is accounted for in display

When calculating how many lines we'd printed we weren't properly taking
the progress bars into account, with the result that sometimes if the
last line printed on the terminal wrapped to the next line (which is
possible) we backed up less lines than we should have.

Additionally, we should always print a newline after updating the
progress bar - there's no need to check if there wasn't output (there
always will be courtesy of our overridden _need_update()) and we now
allow the line to wrap so we don't need to check the other condition
either.

Hopefully this will fix [YOCTO #10046].

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agoknotty: Show task elapsed time
Richard Purdie [Thu, 22 Sep 2016 12:54:43 +0000 (13:54 +0100)] 
knotty: Show task elapsed time

Its often useful to know how long a task has been running for. This patch
adds that information to the task display, updating every 5s if there
were no other updates so the user can see how long tasks have been running
for.

[YOCTO #9737]

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agocooker/providers: Only add target to world build if task exists
Richard Purdie [Wed, 21 Sep 2016 21:31:57 +0000 (22:31 +0100)] 
cooker/providers: Only add target to world build if task exists

A "bitbake world -c unpack" currently breaks as not all tasks have an
unpack task. This change allows addition of world targets only if the
specified task exists which makes certain commands possible when otherwise
you just get errors which can't easily be avoided.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agofetch2: handle absolute paths in subdir
Ross Burton [Wed, 21 Sep 2016 16:31:27 +0000 (17:31 +0100)] 
fetch2: handle absolute paths in subdir

Currently if you use the subdir parameter in a SRC_URI and pass an absolute path
then it gets appended to the unpack directory instead of being used directly.
This is inconvenient as it may be useful to use ${S} when you want to unpack a
file into the source tree.

Change this behaviour so that absolute paths are used directly instead of being
appended to the root directory.  To ensure that recipes cannot write files to an
arbitrary location enforce that the subdir starts with the unpack root.

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobitbake-user-manual: Added information for using single quotes
Scott Rifenbark [Wed, 21 Sep 2016 21:03:10 +0000 (14:03 -0700)] 
bitbake-user-manual: Added information for using single quotes

Fixes [YOCTO #10293]

In the section about setting variables, I added a paragraph that
explains the use of single quotes when setting a variable.  The
case covers when you must have the double quote charater as part
of your variable's value.

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobitbake-user-manual: New section on functions you can call from Python
Scott Rifenbark [Wed, 7 Sep 2016 14:52:26 +0000 (07:52 -0700)] 
bitbake-user-manual: New section on functions you can call from Python

Fixes [YOCTO #10100]

I added a new parent directory named "Functions You Can Call From
Within Python".  This section contains a couple new sub-sections.
One is the existing "Functions for Accessing Datastore Variables".
The other is called "Other Functions", and it is used to point
or reference some commonly used functions that the user can call
from within Python.

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobb.build: in _exec_task, catch BBHandledException
Christopher Larson [Fri, 16 Sep 2016 20:05:11 +0000 (13:05 -0700)] 
bb.build: in _exec_task, catch BBHandledException

We don't want a traceback for this exception, we need to catch it, fire
TaskFailed, and return failure.

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agorunqueue: Handle missing sstate dependencies better
Richard Purdie [Tue, 20 Sep 2016 15:25:49 +0000 (16:25 +0100)] 
runqueue: Handle missing sstate dependencies better

If you "bitbake glibc-locale" then delete the libpcre-native sstate
and "bitbake glibc-locale -C package_write_rpm", it will fail with
rpmbuild missing the libprce library.

The reason is that libpcre-native fails to install from sstate (since
it isn't present) but doesn't get built and hence rpm-native tries to
run without its dependencies.

The simplest fix is not to add "covered" tasks which have failed to
install sstate. I can't help feeling there is more to this issue but
this does fix the current problem and shouldn't have adverse affects.
It is an unusual situation to have missing dependencies in sstate since
they're usually all present or not at all.

I've taken the opportunity to remove some old cruft from when we had
numeric task ids, the code can be simpler now.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: buildinfohelper local layer don't construct path using git info
Michael Wood [Tue, 20 Sep 2016 01:44:20 +0000 (18:44 -0700)] 
toaster: buildinfohelper local layer don't construct path using git info

When the layer is local source don't try and work out the location of
the layer by using the git information (getGitCloneDirectory)

[YOCTO #10199]

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: bavery <brian.avery@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: Add tests to detect if we have missing db migrations
Michael Wood [Mon, 19 Sep 2016 02:37:53 +0000 (19:37 -0700)] 
toaster: Add tests to detect if we have missing db migrations

Based on the same test as found in patchwork by Damien Lespiau
https://github.com/dlespiau/patchwork/blob/master/patchwork/tests/test_db.py

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: bavery <brian.avery@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: unlock BuildEnvirnoment when build is done
Ed Bartosh [Fri, 16 Sep 2016 16:22:35 +0000 (17:22 +0100)] 
toaster: unlock BuildEnvirnoment when build is done

There is no need to lock build environment before changing
build status as this operation is very fast. However, there
is a need to unlock it after changing build status.

Explicitly unlocked BuildEnvironment after build reaches
final status SUCCEEDED, FAILED or CANCELLED. This should
allow runbuilds process to pickup next build faster.

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>
9 years agorunbuilds: code cleanup - remove unused imports
Ed Bartosh [Fri, 16 Sep 2016 16:22:34 +0000 (17:22 +0100)] 
runbuilds: code cleanup - remove unused imports

Fixed pylint warning:  W0611(unused-import): Unused import

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>
9 years agorunbuilds: code cleanup - whitespaces, long lines
Ed Bartosh [Fri, 16 Sep 2016 16:22:33 +0000 (17:22 +0100)] 
runbuilds: code cleanup - whitespaces, long lines

Fixed following pylint warnings:
 C0330(bad-continuation): Wrong hanging indentation before block.
 C0326(bad-whitespace): No space allowed around keyword argument assignment
 C0326(bad-whitespace): Exactly one space required before assignment
 C0301(line-too-long): Line too long

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>
9 years agorunbuilds: process builds on start
Ed Bartosh [Fri, 16 Sep 2016 16:22:32 +0000 (17:22 +0100)] 
runbuilds: process builds on start

If Toaster is stopped incorrectly there could be some
build requests and builds in incorrect state left from the previous run.
Running main processing function on start should take care of those.

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>
9 years agorunbuilds: process builds on SIGUSR1
Ed Bartosh [Fri, 16 Sep 2016 16:22:31 +0000 (17:22 +0100)] 
runbuilds: process builds on SIGUSR1

Run main processing function 'runbuild' only if SIGUSR1 is
received. This signal is sent by Toaster when build status
is changed (either started, cancelled or finished).

This should stop continuous database polling as run_builds function
will be called only when needed, i.e. after build status is changed.

[YOCTO #8918]

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>
9 years agotoaster: notify runbuilds when build status changes
Ed Bartosh [Fri, 16 Sep 2016 16:22:30 +0000 (17:22 +0100)] 
toaster: notify runbuilds when build status changes

Called signal_runbuilds API when build is scheduled, cancelled or
finished to notify runbuilds process about builds status change.

[YOCTO #8918]

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>
9 years agotoaster: implement signal_runbuilds function
Ed Bartosh [Fri, 16 Sep 2016 16:22:29 +0000 (17:22 +0100)] 
toaster: implement signal_runbuilds function

This function reads pid of runbuilds process from
BUILDDIR/.runbuilds.pid and sends SIGUSR1 to it. signal_runbuilds
function will be used in Toaster code to notify runbuilds when
build is scheduled, finished or cancelled.

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>
9 years agotoaster: fix checking of repository url
Ed Bartosh [Fri, 16 Sep 2016 16:22:28 +0000 (17:22 +0100)] 
toaster: fix checking of repository url

Toaster checks gir repository url is the same as locally cloned before
checking it out to existing local clone. This check can be skipped if
commit is 'HEAD' as in this case repository is not hard reset to
commit, so the local clone won't be changed.

[YOCTO #10163]

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>
9 years agocookerdata.py: Catch BBHandledException, preventing a backtrace in an event
Mark Hatle [Thu, 15 Sep 2016 20:57:21 +0000 (15:57 -0500)] 
cookerdata.py: Catch BBHandledException, preventing a backtrace in an event

The event handling 'Exception' was catching and triggering a backtrace.  This
trace was obscuring any errors from an event handler that had raised the
BBHandledException, which should indicate do not print additional information.

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agocooker.py: add LAYERRECOMMENDS processing
Joe Slater [Wed, 14 Sep 2016 17:29:52 +0000 (10:29 -0700)] 
cooker.py: add LAYERRECOMMENDS processing

Add recommended layers to collection_depends[] so that dynamic
priority assignment will work for both depends and recommends.

Recommended layers do not cause an error or warning
if they are not in the collection list, but debug messages
are output for level 3 and above.

explode_dep_versions2 returns a dictionary, so we
change the variable deplist to depDict.  The dictionary
values are lists which are either empty or contain only one
version specification.

Signed-off-by: Joe Slater <jslater@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: Remove duplicate layer information
Belen Barros Pena [Mon, 19 Sep 2016 02:33:15 +0000 (19:33 -0700)] 
toaster: Remove duplicate layer information

In the custom recipe details page, the layer information is displayed
twice in the right hand column. Remove one of the layer entries, since
showing the layer information once should be enough.

[YOCTO #10037]

Signed-off-by: Belen Barros Pena <belen.barros.pena@linux.intel.com>
Signed-off-by: bavery <brian.avery@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: Indicate active navigation element
Belen Barros Pena [Mon, 19 Sep 2016 02:33:14 +0000 (19:33 -0700)] 
toaster: Indicate active navigation element

The left navigation in the build history pages is not showing the active
item when you navigate directly to the errors or warnings information in
the build summary. Add a special case to make sure the "build summary"
item is highlighted.

[YOCTO #9864]

Signed-off-by: Belen Barros Pena <belen.barros.pena@linux.intel.com>
Signed-off-by: bavery <brian.avery@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: Fix links to tasks with specific outcome
Belen Barros Pena [Mon, 19 Sep 2016 02:33:13 +0000 (19:33 -0700)] 
toaster: Fix links to tasks with specific outcome

The build dashboard provides a count of tasks that were executed and not
executed, and of tasks that failed (if any). The number is a link to the
list of tasks.

Fix the links so that they filter the tasks table by the selected
criteria (executed, not executed or failed).

[YOCTO #9832]

Signed-off-by: Belen Barros Pena <belen.barros.pena@linux.intel.com>
Signed-off-by: bavery <brian.avery@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agouihelper: use elif instead of repeated if
Ross Burton [Fri, 16 Sep 2016 11:32:27 +0000 (12:32 +0100)] 
uihelper: use elif instead of repeated if

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agocooker: check if target contains task
Ed Bartosh [Thu, 15 Sep 2016 08:26:28 +0000 (11:26 +0300)] 
cooker: check if target contains task

Task name was incorrectly added to the targets that already
contained :task suffix and fired with BuildInit event. This
caused Toaster to create incorrect Target objects and show
them in UI.

[YOCTO #10221]

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agocookerdata: allow multiple passes of config re-parsing
Markus Lehtonen [Thu, 15 Sep 2016 11:20:50 +0000 (14:20 +0300)] 
cookerdata: allow multiple passes of config re-parsing

[YOCTO #10188]

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agocookerdata: fire ConfigParsed event after re-parse
Markus Lehtonen [Thu, 15 Sep 2016 11:20:49 +0000 (14:20 +0300)] 
cookerdata: fire ConfigParsed event after re-parse

[YOCTO #10188]

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agoAdd missing file from 'toaster: Allow git information to be null for BRLayer'
Richard Purdie [Fri, 16 Sep 2016 13:35:57 +0000 (14:35 +0100)] 
Add missing file from 'toaster: Allow git information to be null for BRLayer'

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobuild: Allow dirs/cleandirs to work for empty functions
Richard Purdie [Wed, 14 Sep 2016 21:29:43 +0000 (22:29 +0100)] 
build: Allow dirs/cleandirs to work for empty functions

Users are surprised when dirs/cleandirs aren't acted upon for
empty functions. This reorders the code slightly so that those
flags are acted upon for empty functions as there are cases where
this is expected.

[YOCTO #10256]

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobitbake: fetch2: Make SRCREV_FORMAT name substitution safer
Ulf Magnusson [Mon, 12 Sep 2016 22:40:37 +0000 (00:40 +0200)] 
bitbake: fetch2: Make SRCREV_FORMAT name substitution safer

The implementation of SRCREV_FORMAT has at least two issues:

 1. Given two names "foo" and "foobar" and SRCREV_FORMAT = "foo_foobar",
    "foo" might currently get substituted twice, and "foobar" not at
    all.

 2. If the revision substitued for some name happens to contain another
    name as a substring, then that substring might incorrectly get
    replaced.

Fix both issues by sorting the names with the longest ones first and
replacing all names at once with a regular expression. This was inspired
by
http://stackoverflow.com/questions/6116978/python-replace-multiple-strings.

Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agofetch2/npm: don't download same URL multiple times
Paul Eggleton [Tue, 13 Sep 2016 02:11:41 +0000 (14:11 +1200)] 
fetch2/npm: don't download same URL multiple times

If we've already fetched a particular URL then we do not need to do so
again within in the same operation. Maintain an internal list of fetched
URLs to avoid doing that.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agoevent.py: output errors and warnings to stderr
Ed Bartosh [Thu, 8 Sep 2016 11:02:33 +0000 (14:02 +0300)] 
event.py: output errors and warnings to stderr

All logging messages are printed on stdout when processing
UI event queue. This makes it impossible to distinguish between
errors and normal bitbake output. Output to stderror or stdout
depending on log level should fix this.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agocooker: record events on cooker exit
Ed Bartosh [Mon, 5 Sep 2016 11:27:35 +0000 (14:27 +0300)] 
cooker: record events on cooker exit

Bitbake collects all events in special event queue when called with
-w option. However, it starts to write events to the eventlog only
after BuildStarted event is received. In some cases this event is
not received at all, e.g. when bitbake is run with --parse-only
command line option.

It makes sense to write all collected events when CookerExit event
received to make sure all events are written into the eventlog even
if BuildStarted event is not fired.

[YOCTO #10145]

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: don't kill all runserver processes
Ed Bartosh [Mon, 5 Sep 2016 14:29:32 +0000 (15:29 +0100)] 
toaster: don't kill all runserver processes

Toaster script kills runserver process 2 ways:
 - sending signal to pid from .toastermain.pid.
 - sending signal to pids found by grepping ps output:
       ps fux | grep "python.*manage.py runserver"

Second approach is redundant and harmfull as it kills all django
development server running on the machine.

[YOCTO #7973]

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>
9 years agotoaster: remove handling of .toasterui.pid
Ed Bartosh [Mon, 5 Sep 2016 14:29:31 +0000 (15:29 +0100)] 
toaster: remove handling of .toasterui.pid

This file is not created anywhere, but handled in toaster
script code.

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>
9 years agotoaster: don't kill toaster on start
Ed Bartosh [Mon, 5 Sep 2016 14:29:30 +0000 (15:29 +0100)] 
toaster: don't kill toaster on start

There is no point of trying to kill django development server
when toaster starts because 'manage.py checksocket' command is already
used in the script code to check if development server port is occupied.

Even if Toaster is listening on another port, killing previous instance
looks quite implicit and doesn't solve anything as there are other
processes that might be still running.

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>
9 years agotoaster: orm Update IMAGE_FSTYPES values
Belen Barros Pena [Mon, 5 Sep 2016 14:29:29 +0000 (15:29 +0100)] 
toaster: orm Update IMAGE_FSTYPES values

This patch fixes a typo in one of the IMAGE_FSTYPES values listed in
Toaster. It also updates the hardcoded list of values to match the
latest list in meta/classes/image_types.bbclass

[YOCTO #9447]

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>
9 years agotoaster: keep layer name in variable history path
David Reyna [Mon, 5 Sep 2016 14:29:28 +0000 (15:29 +0100)] 
toaster: keep layer name in variable history path

When converting variable history file names to relative
paths, keep the layer directory's name so that the user
can distinguish between conf files with the same name.

[YOCTO #8188]

Signed-off-by: David Reyna <david.reyna@windriver.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: Allow forward slash in variable names
Belen Barros Pena [Mon, 5 Sep 2016 14:29:27 +0000 (15:29 +0100)] 
toaster: Allow forward slash in variable names

Add forward slash to the list of special characters allowed in variable
names. Also update the list of allowed special characters in the error
messages.

[YOCTO #9611]

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>
9 years agotoaster: layer details Fix "edit" form interaction
Belen Barros Pena [Mon, 5 Sep 2016 14:29:26 +0000 (15:29 +0100)] 
toaster: layer details Fix "edit" form interaction

Make sure the layer information disappears when the edit form shows, and
that the layer details come back when you click the 'cancel' button in
the edit form.

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>
9 years agotoaster: import layer Layout fixes
Belen Barros Pena [Mon, 5 Sep 2016 14:29:25 +0000 (15:29 +0100)] 
toaster: import layer Layout fixes

The layout of the import layer form was looking a bit awkward. This
commit tidies things up a bit.

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>
9 years agotoaster: layer details Layout fixes
Belen Barros Pena [Mon, 5 Sep 2016 14:29:24 +0000 (15:29 +0100)] 
toaster: layer details Layout fixes

The layout of the layer details page was looking a bit awkward. This
commit tidies things up.

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>
9 years agotoaster: configuration Provide machine help text
Belen Barros Pena [Mon, 5 Sep 2016 14:29:23 +0000 (15:29 +0100)] 
toaster: configuration Provide machine help text

When you change the machine from the project configuration page, you get
some useful suggestions as you start typing a machine name. However, the
suggestions only include machines provided by the layers added to your
project. This is not necessarily clear from the design (yes, it should
be improved), which means you might be looking for a machine, not see it
in the suggestions, and assume the machine is not supported by
OpenEmbedded.

Since we are in no position to change the design of this page right now,
add some explanatory help text to address the situation.

[YOCTO #8034]

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>
9 years agotoaster: tasks Remove recipe version from defaults
Belen Barros Pena [Mon, 5 Sep 2016 14:29:22 +0000 (15:29 +0100)] 
toaster: tasks Remove recipe version from defaults

The 'Recipe version' column should not be part of the set of columns
shown by default in the tasks table. Set the hidden property for that
column to 'True' so that it doesn't show when you load that table
for the first time.

[YOCTO #10179]

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>
9 years agolib/bb/utils: edit_metadata() comment tweaks
Paul Eggleton [Mon, 5 Sep 2016 22:57:33 +0000 (10:57 +1200)] 
lib/bb/utils: edit_metadata() comment tweaks

No functional changes, just make a couple of minor tweaks to the
comments for edit_metadata():

* There are four elements to be returned by the callback function
* Add an example return statement for when you don't want to modify the
  value

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agofetch2/npm: clarify comment
Paul Eggleton [Mon, 5 Sep 2016 22:57:32 +0000 (10:57 +1200)] 
fetch2/npm: clarify comment

The correct name of the parameter is "version" not "ver" so ensure we
aren't misleading the user by giving the latter in an example.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agofetch2/npm: handle top-level shrinkwrap file
Paul Eggleton [Mon, 5 Sep 2016 22:57:31 +0000 (10:57 +1200)] 
fetch2/npm: handle top-level shrinkwrap file

Allow using a top-level shrinkwrap file with one or more npm://
dependencies, i.e. if the module isn't found at the top level then look
one level down.

Part of the fix for [YOCTO #9537].

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agofetch2/npm: support subdir= parameter
Paul Eggleton [Mon, 5 Sep 2016 22:57:30 +0000 (10:57 +1200)] 
fetch2/npm: support subdir= parameter

"npmpkg" can be a default, but it should respect the subdir parameter as
with other FetchMethods. This allows us to have more than one npm://
entry in SRC_URI without nasty hacks.

Fix required in order to support [YOCTO #9537].

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agofetch2/npm: fix broken fetches if more than one npm URL fetched
Paul Eggleton [Mon, 5 Sep 2016 22:57:29 +0000 (10:57 +1200)] 
fetch2/npm: fix broken fetches if more than one npm URL fetched

You cannot set a URL-specific value in an object-level variable on
the FetchMethod in urldata_init() or the result is the value specific to
the last URL will be the one that gets set. This prevented fetching more
than one npm:// URL correctly - the other tarballs would not download to
the correct location and do_unpack failed to find them as a result.

Fix required in order to support [YOCTO #9537].

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agofetch2/npm: explicitly specify workdir
Paul Eggleton [Mon, 5 Sep 2016 22:57:28 +0000 (10:57 +1200)] 
fetch2/npm: explicitly specify workdir

We were downloading into the current directory here, which is fine if
that current directory can be expected to be the right place - but
that's not true when called from recipetool within OE. We should
explicitly specify the directory to run the command in and then there
won't be a problem.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobb.fetch2.svn: correctly pass workdir when fetching
Christopher Larson [Wed, 31 Aug 2016 19:57:08 +0000 (12:57 -0700)] 
bb.fetch2.svn: correctly pass workdir when fetching

The ud.pkgdir argument was being passed as the 'quiet' argument to
runfetchcmd, not the 'workdir' argument, resulting in fetching the svn module
into the root of DL_DIR, not where it belongs.

Cc: Matt Madison <matt@madison.systems>
Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agocooker.py: Catch when stdout doesn't have a file descriptor
Mariano Lopez [Tue, 23 Aug 2016 07:06:11 +0000 (07:06 +0000)] 
cooker.py: Catch when stdout doesn't have a file descriptor

Currently, there is a check to remove the TOSTOP attribute from
a tty to avoid hangs. It assumes that sys.stdout will have a
file descriptor and this is not always true, some IO classes
will throw exceptions when trying to get its file descriptor.

This will add a check for such cases and avoid throwing an
exception.

[YOCTO #10162]

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: localhostbecontroller Remove git assumption
Michael Wood [Mon, 22 Aug 2016 15:42:36 +0000 (16:42 +0100)] 
toaster: localhostbecontroller Remove git assumption

We don't need to force everyone to use git for the method in which
openembedded-core is downloaded. For instance it could have been
downloaded and extracted as a tarball.

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: Allow git information to be null for BRLayer
Michael Wood [Mon, 22 Aug 2016 15:42:35 +0000 (16:42 +0100)] 
toaster: Allow git information to be null for BRLayer

We no longer only deal with layers that have their source in a gir
repository, we also allow for local directories too so update the
BRLayer model to reflect this.

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 Add selenium test layer source switching layer details page
Michael Wood [Mon, 22 Aug 2016 15:42:34 +0000 (16:42 +0100)] 
toaster: tests Add selenium test layer source switching layer details page

Add selenium tests for the new layer source switching functionality on
the layer details page. Edits the values for git repository and saves
and then edits the details for directory information and saves.

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: Move Custom image recipe rest api to api file
Michael Wood [Mon, 22 Aug 2016 15:42:33 +0000 (16:42 +0100)] 
toaster: Move Custom image recipe rest api to api file

We now have a dedicated file for the rest API so move and rework for
class based views. Also clean up all flake8 identified warnings.

Remove unused imports from toastergui views.

The original work for this API was done by Elliot Smith, Ed Bartosh,
Michael Wood and Dave Lerner

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: Fix oe-core fixture
Michael Wood [Mon, 22 Aug 2016 15:42:32 +0000 (16:42 +0100)] 
toaster: Fix oe-core fixture

Due to a copy paste error we managed to get some of the wrong
information in the oe fixture that provides a suggested default settings
for Toaster. This meant it tested correctly when it shouldn't have.
Fix:
 - The use of local bitbake
 - An incorrect call to realpath which didn't include its parent module.
 - The field used for the local_dir of an existing openembedded-core

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: layerdetails clean ups after integrating local layer changes
Michael Wood [Mon, 22 Aug 2016 15:42:31 +0000 (16:42 +0100)] 
toaster: layerdetails clean ups after integrating local layer changes

A few clean ups for the work done to integrate editing imported local layers
into the layer detail page.

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: update api to include local_source_dir
Sujith H [Mon, 22 Aug 2016 15:42:30 +0000 (16:42 +0100)] 
toaster: update api to include local_source_dir

Add an additional argument to the api to handle
local_source_dir which is the value user passes
to import non-git layers.

[YOCTO #9913]

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>
9 years agotoaster: layerdetails js changes for switching layers
Sujith H [Mon, 22 Aug 2016 15:42:29 +0000 (16:42 +0100)] 
toaster: layerdetails js changes for switching layers

This patch helps to implement the switching of layers
between directories and git repositories. Specifically
selection of git and local directory. Also enabling
form to view the selection.

[YOCTO #9913]

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>
9 years agotoaster: add switch of git and not-git layers imported
Sujith H [Mon, 22 Aug 2016 15:42:28 +0000 (16:42 +0100)] 
toaster: add switch of git and not-git layers imported

This patch updates the layerdetails html file to
add the feature of switching imported layers between
directories and git repositories.

[YOCTO #9913]

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>
9 years agobuildinfohelper: discover kernel artifacts correctly
Elliot Smith [Tue, 23 Aug 2016 11:18:26 +0000 (14:18 +0300)] 
buildinfohelper: discover kernel artifacts correctly

Because some image_license.manifest files contain multiple
FILES lines, and because those lines can sometimes not contain
a list of files (i.e. they look like "FILES:\n"), we were
resetting the list of kernel artifacts when we hit the second
"empty" line.

Fix by ignoring any FILES line which doesn't list files, and by
appending any files found in a valid FILES line, rather than
overwriting the existing list.

[YOCTO #10107]

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 agowget: allow basic http auth for SSTATE_MIRRORS
Stephano Cetola [Fri, 26 Aug 2016 17:41:43 +0000 (10:41 -0700)] 
wget: allow basic http auth for SSTATE_MIRRORS

If http basic auth creds were added to sstate mirrors like so:

https://foo.com/sstate/PATH;user=foo:bar;downloadfilename=PATH

The sstate mirror check would silently fail with 401 unauthorized.
This patch allows both the check, and the wget download to succeed by
checking for user credentials and if present adding the correct
headers, or wget params as needed.

[ YOCTO #9815 ]

Signed-off-by: Stephano Cetola <stephano.cetola@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agocookerdata/ast: Fail gracefully if event handler function is not found
Markus Lehtonen [Tue, 30 Aug 2016 09:53:30 +0000 (12:53 +0300)] 
cookerdata/ast: Fail gracefully if event handler function is not found

[YOCTO #10186]

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobuild/runqueue: Add noextra stamp file parameter to fix multiconfig builds
Richard Purdie [Wed, 31 Aug 2016 10:37:53 +0000 (11:37 +0100)] 
build/runqueue: Add noextra stamp file parameter to fix multiconfig builds

We can't execute the same task for the same package_arch multiple
times as the current setup has conflicting directories. Since
these would usually have the same stamp/hash, we want to execute in
sequence rather than in parallel, so for the purposes of task execution,
don't consider the "extra-info" on the stamp files. We need to add
a parameter to the stamp function to achieve this.

This avoids multiple update-rc.d populate_sysroot tasks executing in
parallel and breaking multiconfig builds.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agofetch2: Handle multiconfig fetcher issues
Richard Purdie [Wed, 31 Aug 2016 10:34:23 +0000 (11:34 +0100)] 
fetch2: Handle multiconfig fetcher issues

We need a separate fetcher cache per multiconfig as the revisions and other
SRC_URI data can potentially be different. For now, this is the simplest way
to achieve that and avoids linux-yocto kernel build failures when targeting
multiple machines for example.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotinfoil: add a parse_recipe_file function
Paul Eggleton [Tue, 30 Aug 2016 02:16:22 +0000 (14:16 +1200)] 
tinfoil: add a parse_recipe_file function

Parsing a recipe is such a common task for tinfoil-using scripts, and is
a little awkward to do properly, so add an API function to do it. This
should also isolate scripts a little from future changes to the internal
code. The first user of this will be the OpenEmbedded layer index update
script.

Part of the fix for [YOCTO #10192].

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
9 years agocache: allow parsing a recipe with a custom config datastore
Paul Eggleton [Tue, 30 Aug 2016 08:45:09 +0000 (20:45 +1200)] 
cache: allow parsing a recipe with a custom config datastore

To accommodate the OpenEmbedded layer index recipe parsing, we have to
have the ability to pass in a custom config datastore since it
constructs a synthetic one. To make this possible after the multi-config
changes, rename the internal _load_bbfile() function to parse_recipe(),
make it a function at the module level (since it doesn't actually need
to access any members of the class or instance) and move setting
__BBMULTICONFIG inside it since other code will expect that to be set.

Part of the fix for [YOCTO #10192].

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
9 years agobitbake-diffsigs/bitbake-layers: Ensure tinfoil is shut down correctly
Paul Eggleton [Wed, 5 Aug 2015 14:47:12 +0000 (15:47 +0100)] 
bitbake-diffsigs/bitbake-layers: Ensure tinfoil is shut down correctly

We should always shut down tinfoil when we're finished with it, either
by explicitly calling the shutdown() method or by using it as a
context manager ("with ...").

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
9 years agotinfoil: add context manager functions
Paul Eggleton [Wed, 5 Aug 2015 14:12:14 +0000 (15:12 +0100)] 
tinfoil: add context manager functions

Since calling the shutdown() function is highly recommended, make
tinfoil objects a little easier to deal with by adding context manager
support - so you can do the following:

    with bb.tinfoil.Tinfoil() as tinfoil:
        tinfoil.prepare(True)
        ...

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
9 years agobitbake-user-manual: Added "Exporting Variables to the Environment"
Scott Rifenbark [Thu, 1 Sep 2016 21:01:21 +0000 (14:01 -0700)] 
bitbake-user-manual: Added "Exporting Variables to the Environment"

Fixes [YOCTO #10196]

Added a new section named "Exporting Variables to the Environment".
This section provides a dedicated description for how to export
variables to the shell.

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
9 years agobitbake-user-manual: Corrected misspelled STAMPS_DIR
Scott Rifenbark [Mon, 22 Aug 2016 20:07:58 +0000 (13:07 -0700)] 
bitbake-user-manual: Corrected misspelled STAMPS_DIR

Fixes [YOCTO #10141]

Section on Checksums (Signatures) had this variable referred to as
STAMP_DIR.

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
9 years agofetch2: clean up remaining cwd saves/changes
Matt Madison [Sun, 21 Aug 2016 15:02:46 +0000 (08:02 -0700)] 
fetch2: clean up remaining cwd saves/changes

Now that the fetchers all preserve the current working
directory, the cwd changes in the try_mirror_url,
download, and checkstatus methods are no longer needed.

Signed-off-by: Matt Madison <matt@madison.systems>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agosiggen: Fix file variable typo in compare_sigfiles
Jonathan Liu [Sat, 20 Aug 2016 08:58:13 +0000 (18:58 +1000)] 
siggen: Fix file variable typo in compare_sigfiles

Signed-off-by: Jonathan Liu <net147@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agofetch2: preserve current working directory
Matt Madison [Wed, 10 Aug 2016 17:08:16 +0000 (10:08 -0700)] 
fetch2: preserve current working directory

Fix the methods in all fetchers so they don't change
the current working directory of the calling process, which
could lead to "changed cwd" warnings from bitbake.

Signed-off-by: Matt Madison <matt@madison.systems>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agodump_cache.py: use python3 as interpreter
Robert Yang [Thu, 18 Aug 2016 08:26:13 +0000 (01:26 -0700)] 
dump_cache.py: use python3 as interpreter

Fixed:
  File "bitbake/contrib/dump_cache.py", line 39
    print("Error, need one argument!", file=sys.stderr)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoasterui, knotty: don't print taskid followed by taskstring which are now in most...
Martin Jansa [Thu, 18 Aug 2016 15:06:29 +0000 (17:06 +0200)] 
toasterui, knotty: don't print taskid followed by taskstring which are now in most cases identical

* unify the format how the task is described
* don't show taskid followed by taskstring as the taskstring is
  different only for setscene tasks (by _setscene suffix)
* the duplicated output was introduced by:
  2c88afb   taskdata/runqueue: Rewrite without use of ID indirection
  as reported and confirmed as a bug here:
  http://lists.openembedded.org/pipermail/openembedded-core/2016-June/123148.html
* show:
  NOTE: Running task 541 of 548 (/OE/build/oe-core/openembedded-core/meta/recipes-core/zlib/zlib_1.2.8.bb:do_package)
  instead of much longer:
  NOTE: Running task 541 of 548 (ID: /OE/build/oe-core/openembedded-core/meta/recipes-core/zlib/zlib_1.2.8.bb:do_package, /OE/build/oe-core/openembedded-core/meta/recipes-core/zlib/zlib_1.2.8.bb:do_package)

  and similarly for failed tasks:
  ERROR: Task (virtual:native:/OE/build/oe-core/openembedded-core/meta/recipes-core/zlib/zlib_1.2.8.bb:do_install) failed with exit code '1'
  instead of much longer:
  ERROR: Task virtual:native:/OE/build/oe-core/openembedded-core/meta/recipes-core/zlib/zlib_1.2.8.bb:do_install (virtual:native:/OE/build/oe-core/openembedded-core/meta/recipes-core/zlib/zlib_1.2.8.bb:do_install) failed with exit code '1'

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotests: add unit tests for the usehead url parameter
Markus Lehtonen [Thu, 18 Aug 2016 16:12:02 +0000 (19:12 +0300)] 
tests: add unit tests for the usehead url parameter

[YOCTO #9351]

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agogit: Allow local repos to use HEAD
Richard Purdie [Thu, 18 Aug 2016 16:12:01 +0000 (19:12 +0300)] 
git: Allow local repos to use HEAD

Introduce a new 'usehead' url parameter for git repositories. Specifying
usehead=1 causes bitbake to use whatever commit the repository HEAD is
pointing to. Usage of usehead=1 is only allowed for local git
repositories, i.e. it must always be accompanied with protocol=file url
parameter.

[YOCTO #9351]

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobitbake-selftest: enable bitbake logging to stdout
Markus Lehtonen [Thu, 18 Aug 2016 16:55:54 +0000 (19:55 +0300)] 
bitbake-selftest: enable bitbake logging to stdout

Now you get the bb logger output for failed tests. This helps debugging
problems. Also, all stdout/stderr data for successful tests is silenced
which makes for less cluttered console output.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobitbake-selftest: introduce BB_TMPDIR_NOCLEAN
Markus Lehtonen [Thu, 18 Aug 2016 16:55:53 +0000 (19:55 +0300)] 
bitbake-selftest: introduce BB_TMPDIR_NOCLEAN

Set this env variable to 'yes' to preserve temporary directories used by
the fetcher tests. Useful for debugging tests.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobitbake-selftest: add help text for env variable(s)
Markus Lehtonen [Thu, 18 Aug 2016 16:55:52 +0000 (19:55 +0300)] 
bitbake-selftest: add help text for env variable(s)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobitbake-selftest: utilize unittest.main better
Markus Lehtonen [Thu, 18 Aug 2016 16:55:51 +0000 (19:55 +0300)] 
bitbake-selftest: utilize unittest.main better

This simplifies the script, and, gives new features. It is now possible
to run single test functions, for example. This is nice when writing new
test cases.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobitbake: Update version to 1.31.1
Richard Purdie [Thu, 18 Aug 2016 09:05:26 +0000 (10:05 +0100)] 
bitbake: Update version to 1.31.1

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobitbake: Initial multi-config support
Richard Purdie [Tue, 16 Aug 2016 16:47:06 +0000 (17:47 +0100)] 
bitbake: Initial multi-config support

This patch adds the notion of supporting multiple configurations within
a single build. To enable it, set a line in local.conf like:

BBMULTICONFIG = "configA configB configC"

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

MACHINE = "A"

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

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

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

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

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

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

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

This initial implementation has some drawbacks:

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

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

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agosiggen: properly close files rather than opening them inline
Paul Eggleton [Thu, 11 Aug 2016 03:37:00 +0000 (15:37 +1200)] 
siggen: properly close files rather than opening them inline

If you don't do this, with Python 3 you get a warning on exit under some
circumstances.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agoast/ConfHandler: Add a syntax to clear variable
Jérémy Rosen [Tue, 16 Aug 2016 12:04:47 +0000 (14:04 +0200)] 
ast/ConfHandler: Add a syntax to clear variable

unset VAR
will clear variable VAR
unset VAR[flag]
will clear flag "flag" from var VAR

Signed-off-by: Jérémy Rosen <jeremy.rosen@openwide.fr>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agocache: Build datastores from databuilder object
Richard Purdie [Mon, 15 Aug 2016 17:03:29 +0000 (18:03 +0100)] 
cache: Build datastores from databuilder object

Rather than passing in a datastore to build on top of, use the data builder
object in the cache and base the parsed recipe from this. This turns
things into proper objects building from one another rather than messy
mixes of static and class functions.

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

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agocache: Split Cache() into a NoCache() parent object
Richard Purdie [Mon, 15 Aug 2016 17:02:41 +0000 (18:02 +0100)] 
cache: Split Cache() into a NoCache() parent object

There are some cases we want to parse recipes without any cache
setup or involvement. Split out the standalone functions into
a NoCache variant which the Cache is based upon, setting the scene
for further cleanup and restructuring.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agocache/cooker: Pass databuilder into bb.cache.Cache()
Richard Purdie [Mon, 15 Aug 2016 17:01:54 +0000 (18:01 +0100)] 
cache/cooker: Pass databuilder into bb.cache.Cache()

Rather that the current mix of static and class methods, refactor
so that the cache has the databuilder object internally. This becomes
useful for the following patches for multi config support.

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

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agocache: Make virtualfn2realfn/realfn2virtual standalone functions
Richard Purdie [Mon, 15 Aug 2016 17:00:45 +0000 (18:00 +0100)] 
cache: Make virtualfn2realfn/realfn2virtual standalone functions

Needing to access these static methods through a class doesn't
make sense. Move these to become module level standalone functions.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agocache/ast: Move __VARIANTS handling to parse cache function
Richard Purdie [Mon, 15 Aug 2016 16:59:56 +0000 (17:59 +0100)] 
cache/ast: Move __VARIANTS handling to parse cache function

Simple refactoring to allow for multiconfig support.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agorunqueue: Abstract worker functionality to an object/array
Richard Purdie [Mon, 15 Aug 2016 16:58:39 +0000 (17:58 +0100)] 
runqueue: Abstract worker functionality to an object/array

With the introduction of multi-config and the possibility of distributed
builds we need arrays of workers rather than the existing two.

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

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

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>