]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/log
thirdparty/openembedded/openembedded-core-contrib.git
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>
9 years agolib/bb/build.py: decode the command as UTF-8
Ross Burton [Fri, 15 Jul 2016 10:25:42 +0000 (11:25 +0100)] 
lib/bb/build.py: decode the command as UTF-8

The messaging FIFO is UTF-8, so decode the command as UTF-8 as well as the value
as otherwise "bberror" != b("bberror") and none of the messages from shell
functions are ever displayed.

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

[ YOCTO #9947 ]

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agolib/bb/utils: fix set_process_name
Ross Burton [Tue, 12 Jul 2016 15:14:25 +0000 (16:14 +0100)] 
lib/bb/utils: fix set_process_name

With Python 3 create_string_buffer needs a bytes() not a str() but as we were
catching all exceptions nobody noticed.

[ YOCTO #9910 ]

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: tests Add selenium test for layerdetails page
Michael Wood [Wed, 6 Jul 2016 17:22:39 +0000 (18:22 +0100)] 
toaster: tests Add selenium test for layerdetails page

This tests:
 - Adding remove layer from project
 - Deleting layer
 - Editing layer fields

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: add Layer delete front end feature to layerdetails
Michael Wood [Wed, 6 Jul 2016 17:22:38 +0000 (18:22 +0100)] 
toaster: add Layer delete front end feature to layerdetails

Add the front end feature to delete a layer from the layer details page.

[YOCO #9184]

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: api Add util function for returning the error response
Michael Wood [Wed, 6 Jul 2016 17:22:37 +0000 (18:22 +0100)] 
toaster: api Add util function for returning the error response

Also clean up flake8 warnings in XhrBuildRequest

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 api Fix saving of git revision of a layer
Michael Wood [Wed, 6 Jul 2016 17:22:36 +0000 (18:22 +0100)] 
toaster: layerdetails api Fix saving of git revision of a layer

Update, clean up and move the api for updating a layerversion from the
views to api. Also update the layerdetails page to include the
layerversion id in the url getter.

[YOCTO #8952]

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 agobuildinfohelper: ensure task datetimes are timezone-aware
Elliot Smith [Wed, 6 Jul 2016 11:00:35 +0000 (12:00 +0100)] 
buildinfohelper: ensure task datetimes are timezone-aware

When using toaster-eventreplay to run a bitbake event file
through toasterui/buildinfohelper, errors occur when the
tasks are updated with buildstats info:

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

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

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

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agoeventreplay: rewrite the script
Ed Bartosh [Wed, 6 Jul 2016 11:00:34 +0000 (12:00 +0100)] 
eventreplay: rewrite the script

Rewritten toaster-eventreplay to make code working as expected,
more compact and readable.

[YOCTO #9585]

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agoeventreplay: reorganize imports
Ed Bartosh [Wed, 6 Jul 2016 11:00:33 +0000 (12:00 +0100)] 
eventreplay: reorganize imports

Cleaned up module imports:
- Removed unused imports
- Removed import of print_function
- Removed duplicated imports
- Splitted importing bb.lib to 2 lines

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agoeventreplay: replace MockConfigParameters with namedtuple
Ed Bartosh [Wed, 6 Jul 2016 11:00:32 +0000 (12:00 +0100)] 
eventreplay: replace MockConfigParameters with namedtuple

class MockConfigParameters has only one attribute and only __init__
method. Replacing it with namedtuple makes code less nested and more
readable.

[YOCTO #9585]

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agoeventreplay: fix event loading code
Ed Bartosh [Wed, 6 Jul 2016 11:00:31 +0000 (12:00 +0100)] 
eventreplay: fix event loading code

Event objects are represented by base64-encoded strings in
the event file and can't be loaded by existing eventreplay code.

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

[YOCTO #9585]

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agoeventprelay: implement setEventMask command
Ed Bartosh [Wed, 6 Jul 2016 11:00:30 +0000 (12:00 +0100)] 
eventprelay: implement setEventMask command

Stored event mask list as self.eventmask for future use.
Fixed Exception: Command setEventMask not implemented.

[YOCTO #9585]

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agoeventreplay: add MockConnection.getEventHandle method
Ed Bartosh [Wed, 6 Jul 2016 11:00:29 +0000 (12:00 +0100)] 
eventreplay: add MockConnection.getEventHandle method

Fixed AttributeError: 'MockConnection' object has no attribute
'getEventHandle'

[YOCTO #9585]

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: fix layout for command-line builds in recent builds area
Elliot Smith [Mon, 4 Jul 2016 11:52:53 +0000 (12:52 +0100)] 
toaster: fix layout for command-line builds in recent builds area

Command-line builds were displayed incorrectly, so that the
HTML elements for other builds were being "consumed" by the
command-line build elements due to incorrect positioning of
element end tags.

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

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

[YOCTO #9842]

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 agobitbake-worker: don't reassign sys.stdout
Ed Bartosh [Mon, 4 Jul 2016 21:53:59 +0000 (00:53 +0300)] 
bitbake-worker: don't reassign sys.stdout

Worker needs input stream in binary mode as it reads binary content
from it. Current code does it by detaching a buffer from sys.stdin
and assigning it back to sys.stdin.

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

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

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: views Fix most frequently built target in project reporting
Michael Wood [Mon, 4 Jul 2016 15:34:46 +0000 (16:34 +0100)] 
toaster: views Fix most frequently built target in project reporting

Clean up and fix the most frequently built targets for the "Most built
recipes" section for the project configuration page.

[YOCTO #9846]

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: layerBtn avoid connecting handler to other build buttons
Michael Wood [Mon, 4 Jul 2016 15:34:45 +0000 (16:34 +0100)] 
toaster: layerBtn avoid connecting handler to other build buttons

Some pages contain other build buttons which may have the same class
attached. Make sure that we only select the buttons in the tables where
layerBtn is used.

[YOCTO #9841]

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 agobitbake: toaster-tests: tests for project config
Sujith H [Wed, 22 Jun 2016 09:10:42 +0000 (10:10 +0100)] 
bitbake: toaster-tests: tests for project config

Add basic tests to validate the value, user types
in the text box for DL_DIR and SSTATE_DIR. Added
test case to validate the first char and inclusion
of space between the characters.

[YOCTO #9646]

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: fix validation checks for DL_DIR and SSTATE_DIR
Sujith H [Wed, 22 Jun 2016 09:10:41 +0000 (10:10 +0100)] 
toaster: fix validation checks for DL_DIR and SSTATE_DIR

Validation logic on the project configuration page
prevented a user from adding ${variable} to these paths.

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

Either:

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

or

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

[YOCTO #9646]

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: remove SSTATE_MIRRORS from projectconf
Sujith H [Fri, 24 Jun 2016 15:25:54 +0000 (16:25 +0100)] 
toaster: remove SSTATE_MIRRORS from projectconf

Remove SSTATE_MIRRORS from getting blacklisted. Hence the SSTATE_MIRRORS
should be removed from projectconf.html file so that users can know that
this variable is no more blacklisted.

[YOCTO #9598]

Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: remove SSTATE_MIRRORS from blacklists in views
Sujith H [Fri, 24 Jun 2016 15:25:53 +0000 (16:25 +0100)] 
toaster: remove SSTATE_MIRRORS from blacklists in views

Remove SSTATE_MIRRORS variable from blacklists in views.py
This helps user to point mirrors using SSTATE_MIRRORS with
toaster.

[#YOCTO 9598]

Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agoprogress: Ensure missing start event is fired
Richard Purdie [Thu, 7 Jul 2016 13:27:43 +0000 (14:27 +0100)] 
progress: Ensure missing start event is fired

The init function of the parent class fires a progress event for 0
progress rather than a start event. UI code was assuming that progress
events should always have a start event first. This change ensures that
the start event is correctly generated.

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

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agoknotty: Handle process indicators more gracefully
Richard Purdie [Thu, 7 Jul 2016 13:26:34 +0000 (14:26 +0100)] 
knotty: Handle process indicators more gracefully

Mistakes can happen with the generation of the progress events, change
knotty to be more tolerant of this rather than crashing, reporting to the
user when something unexpected happens. I haven't debugged why multiple
finish events appear to be triggered.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agorunqueue: report progress for "Preparing RunQueue" step
Paul Eggleton [Thu, 23 Jun 2016 10:59:12 +0000 (22:59 +1200)] 
runqueue: report progress for "Preparing RunQueue" step

When "Preparing RunQueue" shows up you can expect to wait up to 30
seconds while it works - which is a bit long to leave the user waiting
without any kind of output. Since the work being carried out during this
time is divided into stages such that it's practical to determine
internally how it's progressing, replace the message with a progress
bar.

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

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agorunqueue: add ability to enforce that tasks are setscened
Paul Eggleton [Thu, 23 Jun 2016 10:59:11 +0000 (22:59 +1200)] 
runqueue: add ability to enforce that tasks are setscened

Add the ability to enter a mode where only a specified whitelist of
tasks can be executed outright; everything else must be successfully
provided in the form of a setscene task (or covered by a setscene task).
Any setscene failure outside of the whitelist will cause the build to
fail immediately instead of running the real task, and any real tasks
that would execute outside of the whitelist cause an immediate build
failure when it comes to executing the runqueue as well.

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

Part of the implementation of [YOCTO #9367].

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agoknotty: add quiet output mode
Paul Eggleton [Thu, 23 Jun 2016 10:59:10 +0000 (22:59 +1200)] 
knotty: add quiet output mode

Quiet output mode disables printing most messages (below warnings) to
the console; however these messages still go to the console log file.
This is primarily for cases where bitbake is being launched
interactively from some other process, but where full console output is
not needed.

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

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agoknotty: show task progress bar
Paul Eggleton [Thu, 23 Jun 2016 10:59:09 +0000 (22:59 +1200)] 
knotty: show task progress bar

In addition to the "currently running n tasks (x of y)" message, show a
progress bar for another view on how much of the build is left. We have
to take care to reset it when moving from the scenequeue to the
runqueue, and explicitly don't include an ETA since not all tasks take
equal time and thus it isn't possible to estimate the time remaining
with the information available.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agoknotty: add code to support showing progress for sstate object querying
Paul Eggleton [Thu, 23 Jun 2016 10:59:08 +0000 (22:59 +1200)] 
knotty: add code to support showing progress for sstate object querying

Add support code on the BitBake side to allow sstate.bbclass in
OpenEmbedded to report progress when it is checking for availability of
artifacts from shared state mirrors.

Part of the implementation for [YOCTO #5853].

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agolib/bb/progress: add MultiStageProgressReporter
Paul Eggleton [Thu, 23 Jun 2016 10:59:06 +0000 (22:59 +1200)] 
lib/bb/progress: add MultiStageProgressReporter

Add a class to help report progress in a task that consists of multiple
stages, some of which may have internal progress (do_rootfs within
OpenEmbedded is one example). Each stage is weighted to try to give
a reasonable representation of progress over time.

Part of the implementation for [YOCTO #5383].

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agolib: implement basic task progress support
Paul Eggleton [Thu, 23 Jun 2016 10:59:05 +0000 (22:59 +1200)] 
lib: implement basic task progress support

For long-running tasks where we have some output from the task that
gives us some idea of the progress of the task (such as a percentage
complete), provide the means to scrape the output for that progress
information and show it to the user in the default knotty terminal
output in the form of a progress bar. This is implemented using a new
TaskProgress event as well as some code we can insert to do output
scanning/filtering.

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

Part of the implementation for [YOCTO #5383].

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agoknotty: import latest python-progressbar
Paul Eggleton [Thu, 23 Jun 2016 10:59:04 +0000 (22:59 +1200)] 
knotty: import latest python-progressbar

Since we're going to make some minor extensions to it, it makes sense to
bring in the latest version of python-progressbar. Its structure has
changed a little but the API hasn't; however we do need to ensure our
overridden _needs_update() function's signature in BBProgress() matches
properly.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agoknotty: provide a symlink to the latest console log
Paul Eggleton [Thu, 23 Jun 2016 10:59:03 +0000 (22:59 +1200)] 
knotty: provide a symlink to the latest console log

If you're looking to find the latest console log repeatedly it can be a bit
tedious - let's just create a symlink just as we do with other logs to
make it easy to find.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agofetch2/wget: attempt checkstatus again if it fails
Ross Burton [Thu, 30 Jun 2016 21:32:24 +0000 (22:32 +0100)] 
fetch2/wget: attempt checkstatus again if it fails

Some services such as SourceForge seem to struggle to keep up under load, with
the result that over half of the autobuilder checkuri runs fail with
sourceforge.net "connection timed out".

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

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agolib/bb/build.py: remove task flag in deltask()
Robert Yang [Wed, 15 Jun 2016 02:42:10 +0000 (19:42 -0700)] 
lib/bb/build.py: remove task flag in deltask()

Otherwise the function like d.getVarFlag(e, 'task', True) which is used by
do_listtasks will still get it, and list the deleted tasks.

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agocooker: clean up EvertWriter
Ed Bartosh [Mon, 20 Jun 2016 11:00:52 +0000 (14:00 +0300)] 
cooker: clean up EvertWriter

Restructured EventWriter code to make it more readable:
 - got rid of init_file method as it's called only once
 - renamed exception variable e -> err
 - renamed event variable e -> evt
 - simplified main 'if' structure of send method

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agocooker: replace EventLogWriteHandler with namedtuple
Ed Bartosh [Mon, 20 Jun 2016 11:00:51 +0000 (14:00 +0300)] 
cooker: replace EventLogWriteHandler with namedtuple

class EventLogWriteHandler is a simple wrapper class with only one
class member. Replacing it with namedtuple makes code less nested and more
readable.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agocooker: don't remove event file
Ed Bartosh [Mon, 20 Jun 2016 11:00:50 +0000 (14:00 +0300)] 
cooker: don't remove event file

There is no need to remove output file as it gets rewritten by
open(self.eventfile, 'w') anyway.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agocooker: encode event objects to base64
Ed Bartosh [Mon, 20 Jun 2016 11:00:49 +0000 (14:00 +0300)] 
cooker: encode event objects to base64

pickle converts python objects into the binary form that can't be
decoded to text and therefore can't be converted to JSON format.

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

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

[YOCTO #9803]

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agocooker: move EventLogWriteHandler to the top module level
Ed Bartosh [Mon, 20 Jun 2016 11:00:48 +0000 (14:00 +0300)] 
cooker: move EventLogWriteHandler to the top module level

EventLogWriteHandler object was created and used in
BBCooker.initConfigurationData.
This causes creation of multiple EventLogWriteHandler objects
and results in duplicated entries in the output event file
as BBCooker.initConfigurationData is called multiple times.

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

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agodepexp.py: port to gtk+3
Jussi Kukkonen [Mon, 20 Jun 2016 12:20:03 +0000 (15:20 +0300)] 
depexp.py: port to gtk+3

The code is still a bit icky (and should be refactored to not use
Gdk.threads_enter/leave) but it should work about as reliably as
it did with Gtk+2.

Based on earlier patches by Maxin and Joshua.

Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: remove last css file with bootstrap v2 license
bavery [Thu, 16 Jun 2016 21:14:48 +0000 (14:14 -0700)] 
toaster: remove last css file with bootstrap v2 license

Remove unused css file that still had the bootstrap v2 license in it.

Signed-off-by: bavery <brian.avery@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agorunqueue: Use tid instead of taskid in find_chains()
George McCollister [Thu, 16 Jun 2016 20:22:03 +0000 (15:22 -0500)] 
runqueue: Use tid instead of taskid in find_chains()

In 2c88afb6 find_chains()'s taskid argument was renamed to tid but
taskid is still used as key to explored_deps dictionary. Use tid instead
of taskid.

Signed-off-by: George McCollister <george.mccollister@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agofetch2/perforce: Rework to support SRCREV and P4CONFIG
Andrew Bradford [Thu, 9 Jun 2016 13:44:08 +0000 (09:44 -0400)] 
fetch2/perforce: Rework to support SRCREV and P4CONFIG

In recipes which use the perforce fetcher, enable use of SRCREV to
specify any of: ${AUTOREV}, changelist number, p4date, or label.  This
is more in-line with how the other fetchers work for source control
systems.

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

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

References [YOCTO #6303]

Signed-off-by: Andrew Bradford <andrew.bradford@kodakalaris.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agofetch2: fix unpacking of deb packages
Stephano Cetola [Fri, 10 Jun 2016 17:56:38 +0000 (10:56 -0700)] 
fetch2: fix unpacking of deb packages

Python 3 changed the return value of check_output to binary rather than
a string. This fix decodes the binary before calling splitlines, which
requires a string.

Signed-off-by: Stephano Cetola <stephano.cetola@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: fix typo which causes table searches to fail
Elliot Smith [Thu, 16 Jun 2016 14:02:00 +0000 (15:02 +0100)] 
toaster: fix typo which causes table searches to fail

The iterator used to create a search query refers to a
variable "x" which isn't set, causing an "'x' is not defined" error
and preventing table searches (on non-ToasterTables) from working.

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

[YOCTO #9749]

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 agobitbake: fix wrong usage of format_exc
Ed Bartosh [Fri, 10 Jun 2016 11:58:17 +0000 (14:58 +0300)] 
bitbake: fix wrong usage of format_exc

First parameter of traceback.format_exc is a 'limit' - a number
of stracktraces to format.

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

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

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agoparse/ast, event: Ensure we reset registered handlers during parsing
Richard Purdie [Tue, 14 Jun 2016 11:48:37 +0000 (12:48 +0100)] 
parse/ast, event: Ensure we reset registered handlers during parsing

When parsing, we should reset the event handlers we registered when
done. If we don't do this, parse order may change the build, depending
on what the parse handlers do to the metadata.

This issue showed up as a basehash change:

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

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

Diffsigs showed:

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

with PN being set by the event handler.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: Remove mismerged files
Richard Purdie [Mon, 13 Jun 2016 21:03:54 +0000 (22:03 +0100)] 
toaster: Remove mismerged files

Another patch added migrations in the correct location (different date) so
these in the wrong directory can be removed.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotaskdata/runqueue: Rewrite without use of ID indirection
Richard Purdie [Sun, 12 Jun 2016 22:55:48 +0000 (23:55 +0100)] 
taskdata/runqueue: Rewrite without use of ID indirection

I'm not sure what possesed me when I wrote this code originally but its
indirection of everyting to use numeric IDs and position dependent lists
is horrific. Given the way python internals work, its completely and
utterly pointless from  performance perspective. It also makes the code
hard to understand and debug since any numeric ID has to be translated
into something human readable.

The hard part is that the IDs are infectous and spread from taskdata
into runqueue and even partly into cooker for the dependency graph
processing. The only real way to deal with this is to convert everything
to use a more sane data structure.

This patch:
* Uses "<fn>:<taskname>" as the ID for tasks rather than a number
* Changes to dict() based structures rather than position dependent lists
* Drops the build name, runtime name and filename ID indexes

On the most part there shouldn't be user visible changes. Sadly we did
leak datastructures to the setscene verify function which has to be
rewritten. To handle this, the variable name used to specifiy the version
changes from BB_SETSCENE_VERIFY_FUNCTION to BB_SETSCENE_VERIFY_FUNCTION2
allowing multiple versions of bitbake to work with suitably written
metadata. Anyone with custom schedulers may also need to change them.

I believe the benefits in code readability and easier debugging far
outweigh those issues though. It also means we have a saner codebase
to add multiconfig support on top of.

During development, I did have some of the original code coexisting with
the new data stores to allow comparision of the data and check it was
working correcty, particuarly for taskdata. I have also compared
task-depends.dot files before and after the change. There should be no
functionality changes in this patch, its purely a data structure change
and that is visible in the patch.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agorunqueue: Change buildable/running lists to sets
Richard Purdie [Sun, 12 Jun 2016 22:55:08 +0000 (23:55 +0100)] 
runqueue: Change buildable/running lists to sets

Using positions in lists for flags is an odd choice and makes the code
hard to maintain. Maintaining a list is slow since list searches are
slow (watch bitbake -n slow massively with it) but we can use a set()
instead.

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

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: tests browser Fix selenium tests after bootstrap3 breakage
Michael Wood [Mon, 13 Jun 2016 13:32:16 +0000 (14:32 +0100)] 
toaster: tests browser Fix selenium tests after bootstrap3 breakage

Fix a number of selectors which have changed after the port to
bootstrap3. Also fix the modal wait_until_visible and returning of the
text for the radio buttons in the modals for edit custom image and new
custom image on the build dashboard.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
9 years agotoaster: tests Rename test settings to python compliant name and fix import
Michael Wood [Mon, 13 Jun 2016 13:29:30 +0000 (14:29 +0100)] 
toaster: tests Rename test settings to python compliant name and fix import

Use underscore instead of dash in the file name for the test settings.
Also fix the import of the settings module.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
9 years agotoaster: selenium tests Fix all_projects page and sample tests
Michael Wood [Fri, 10 Jun 2016 16:54:37 +0000 (17:54 +0100)] 
toaster: selenium tests Fix all_projects page and sample tests

Fix the selectors after changes made for bootstrap3 and table links being
removed.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
9 years agotoaster: selenium tests Update unique custom image string and fix import
Michael Wood [Fri, 10 Jun 2016 15:48:33 +0000 (16:48 +0100)] 
toaster: selenium tests Update unique custom image string and fix import

- Update the string for recognising a duplicate image recipe
- Fix an incorrect relative import

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
9 years agotoaster: js tests Twitter typeahead library object is now ttTypeahead
Michael Wood [Fri, 10 Jun 2016 15:44:15 +0000 (16:44 +0100)] 
toaster: js tests Twitter typeahead library object is now ttTypeahead

Get the ttTypeahead object on the input to see if it's been initialised
correctly.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
9 years agotoaster: fix wrong usage of print_exc and format_exc
Ed Bartosh [Fri, 10 Jun 2016 09:34:12 +0000 (12:34 +0300)] 
toaster: fix wrong usage of print_exc and format_exc

First parameter of traceback.print_exc and traceback.format_exc APIs is
a 'limit' - a number of stracktraces to print.

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

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

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

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
9 years agotoaster: changed python version in shebang
Ed Bartosh [Fri, 10 Jun 2016 07:59:44 +0000 (10:59 +0300)] 
toaster: changed python version in shebang

Changed python to python3 in shebang to ensure that
manage.py is always run by python3.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
9 years agotoaster: toastergui tests Use new BeautifulSoup syntax
Michael Wood [Fri, 10 Jun 2016 10:45:48 +0000 (11:45 +0100)] 
toaster: toastergui tests Use new BeautifulSoup syntax

Fix deprecation warning specify the parser used for creating the
BeautifulSoup object.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
9 years agotoaster: open image files in binary mode when sending in response
Elliot Smith [Tue, 7 Jun 2016 15:37:29 +0000 (16:37 +0100)] 
toaster: open image files in binary mode when sending in response

The view code for downloading image files used the "r" flag
to read the file, then used the open file object to form the
HTTP response.

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

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

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
9 years agotoaster-tests: fix tests for latest Selenium version
Elliot Smith [Tue, 7 Jun 2016 15:37:28 +0000 (16:37 +0100)] 
toaster-tests: fix tests for latest Selenium version

Previously, we didn't specify a specific version of Selenium.
When upgrading to Python 3 and installing Selenium to work with it,
the JS unit test broke, as the report format produced by Selenium
had changed.

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

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

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
9 years agotoaster: fix broken reference to urllib
Elliot Smith [Tue, 7 Jun 2016 15:37:27 +0000 (16:37 +0100)] 
toaster: fix broken reference to urllib

The code previously imported urllib to make use of querystring
quoting, but was modified to support Python 3. During this
process, the reference to urllib was not fixed, which resulted
in table filters breaking.

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

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
9 years agotoaster: fix test_toaster_tables
Ed Bartosh [Tue, 7 Jun 2016 15:37:26 +0000 (16:37 +0100)] 
toaster: fix test_toaster_tables

Removed unneeded code as it causes the following error in Python 3:
    TypeError: expected bytes, bytearray or buffer compatible object

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
9 years agotoaster: fix incorrect file mode
Ed Bartosh [Tue, 7 Jun 2016 15:37:25 +0000 (16:37 +0100)] 
toaster: fix incorrect file mode

Python 3 complains about 'wa' mode this way:
 ValueError: must have exactly one of create/read/write/append mode

Fixed by using 'a' mode.

[YOCTO #9584]

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
9 years agotoaster: decode response content
Ed Bartosh [Tue, 7 Jun 2016 15:37:24 +0000 (16:37 +0100)] 
toaster: decode response content

Decoded response content to str to pass it to json.load as it breaks
in Python 3 with this error:
   TypeError: expected bytes, bytearray or buffer compatible object

[YOCTO #9584]

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
9 years agotoaster: fix migrations
Ed Bartosh [Tue, 7 Jun 2016 15:37:23 +0000 (16:37 +0100)] 
toaster: fix migrations

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
9 years agotoaster: replace viewkeys() -> keys()
Ed Bartosh [Tue, 7 Jun 2016 15:37:22 +0000 (16:37 +0100)] 
toaster: replace viewkeys() -> keys()

Python 3 doesn't have dict.viewkeys method, renaming
to keys().

[YOCTO #9584]

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
9 years agotoaster: bin Use python 3 for our django modules check
Michael Wood [Fri, 10 Jun 2016 10:01:10 +0000 (11:01 +0100)] 
toaster: bin Use python 3 for our django modules check

Explicitly use python3 so that the modules for python3 are checked.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
9 years agotoaster: BuildTasksTable filters remove outcome NA option
Belen Barros Pena [Thu, 9 Jun 2016 10:53:20 +0000 (11:53 +0100)] 
toaster: BuildTasksTable filters remove outcome NA option

In the 'outcome' filter for tasks, remove the 'not applicable' option,
since it should not be exposed to users.

Signed-off-by: Belen Barros Pena <belen.barros.pena@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
9 years agotoaster: BuiltPackagesTable format empty state in packages table
Belen Barros Pena [Thu, 9 Jun 2016 10:35:11 +0000 (11:35 +0100)] 
toaster: BuiltPackagesTable format empty state in packages table

The explanatory message in the empty state of the packages built table
was missing some spaces.

Signed-off-by: Belen Barros Pena <belen.barros.pena@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
9 years agotoaster: build data Fix left navigation
Belen Barros Pena [Wed, 8 Jun 2016 17:00:06 +0000 (18:00 +0100)] 
toaster: build data Fix left navigation

Make sure the current page is always highlighted in the left navigation.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Belen Barros Pena <belen.barros.pena@linux.intel.com>
9 years agotoaster: port all build analysis pages to bootstrap 3
Belen Barros Pena [Thu, 2 Jun 2016 13:26:16 +0000 (14:26 +0100)] 
toaster: port all build analysis pages to bootstrap 3

Port all the pages in the build analysis area to bootstrap version 3.

Signed-off-by: Belen Barros Pena <belen.barros.pena@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
9 years agotoaster: buildtables Remove links from non name fields
Belen Barros Pena [Fri, 10 Jun 2016 13:31:29 +0000 (14:31 +0100)] 
toaster: buildtables Remove links from non name fields

Design change to have no links for non-named fields in BuiltPackagesTable.
BuiltRecipesTables and BuildTasksTable.

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

Signed-off-by: Belen Barros Pena <belen.barros.pena@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
9 years agotoaster: fix typo which prevents filters from working
Elliot Smith [Tue, 7 Jun 2016 15:29:35 +0000 (16:29 +0100)] 
toaster: fix typo which prevents filters from working

'k' was replaced by 'key' at some point but not fixed in the
body of the loop. This caused a failure when the the query
was constructed for a filtered queryset, due to the variable
not being defined.

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
9 years agotoaster-tests: maximize browser window when running UI tests
Elliot Smith [Tue, 26 Apr 2016 16:12:52 +0000 (17:12 +0100)] 
toaster-tests: maximize browser window when running UI tests

In some pages of the UI, the UI tests failed because parts of
the UI which should be visible were being reported as not
visible by the Selenium PhantomJS driver.

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

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

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
9 years agotoaster: Rework displaying package dependencies across Toaster
Michael Wood [Thu, 26 May 2016 15:12:27 +0000 (16:12 +0100)] 
toaster: Rework displaying package dependencies across Toaster

After porting the build table to a unified mechanism for showing
dependencies in tables it highlighted that the dependencies selected to
be shown were un-filtered. i.e. all dependencies from all contexts were
shown. The context for a package's dependencies is based on the target
that they were installed onto, or if not installed then a "None" target.

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

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

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

[YOCTO #9676]

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
9 years agotoaster: widgets ToasterTable Catch template rendering exceptions
Michael Wood [Thu, 26 May 2016 15:12:26 +0000 (16:12 +0100)] 
toaster: widgets ToasterTable Catch template rendering exceptions

If a cell template rendering causes an exception catch it and carry on,
this at least allows the table to show the rest of the data if nothing
else. Also improve the error logging so that it's possible what the
offending template snippet was.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
9 years agotoaster: tests Add new build tables to tests
Michael Wood [Thu, 26 May 2016 15:12:25 +0000 (16:12 +0100)] 
toaster: tests Add new build tables to tests

- Add new build tables to be tested
- Add required data into the fixture and clean up a few empty fields
- Fix the SoftwareRecipesTable specific test so as not to rely on two
  particular defined recipes

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
9 years agotoaster: table.js Add the ability to highlight a particular row
Michael Wood [Thu, 26 May 2016 15:12:24 +0000 (16:12 +0100)] 
toaster: table.js Add the ability to highlight a particular row

As in the old build tables it's useful to jump and highlight a
particular row in the table using the #hash in the URL.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
9 years agotoaster: port Installed packages table to ToasterTable
Michael Wood [Thu, 26 May 2016 15:12:23 +0000 (16:12 +0100)] 
toaster: port Installed packages table to ToasterTable

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
9 years agotoaster: port Task tables to ToasterTables widget
Michael Wood [Thu, 26 May 2016 15:12:22 +0000 (16:12 +0100)] 
toaster: port Task tables to ToasterTables widget

Port the Task based tables to ToasterTable. This is the Task, Time, CPU
usage and Disk I/O tables.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
9 years agotoaster: port Built recipes table to toastertables
Michael Wood [Thu, 26 May 2016 15:12:21 +0000 (16:12 +0100)] 
toaster: port Built recipes table to toastertables

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
9 years agotoaster: port table for Built packages to ToasterTable
Michael Wood [Thu, 26 May 2016 15:12:20 +0000 (16:12 +0100)] 
toaster: port table for Built packages to ToasterTable

This is the table that displays all the packages built in the build.
Build -> Packages. Adds a template snippet for the git revision popover.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
9 years agotoaster: ToasterTable widget add an 'a' to Name in Exception class
Michael Wood [Thu, 26 May 2016 15:12:19 +0000 (16:12 +0100)] 
toaster: ToasterTable widget add an 'a' to Name in Exception class

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
9 years agotoaster: toaster tables Enable complex empty states
Belen Barros Pena [Thu, 5 May 2016 14:51:09 +0000 (15:51 +0100)] 
toaster: toaster tables Enable complex empty states

Make sure we can create empty states for toaster tables that include
actions for users to get out of the empty state. Allows a template to be
used as an empty state.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Belen Barros Pena <belen.barros.pena@linux.intel.com>
9 years agotoaster: Migrate project configuration from bootstrap 2 to bootstrap 3
Belen Barros Pena [Tue, 12 Apr 2016 14:56:43 +0000 (15:56 +0100)] 
toaster: Migrate project configuration from bootstrap 2 to bootstrap 3

Convert all the HTML templates, JS and CSS in the project parts of
toaster to use bootstrap 3.

Signed-off-by: Belen Barros Pena <belen.barros.pena@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
9 years agotoaster: work-around our lack of a synchronous fetch for typeaheads
Elliot Smith [Mon, 18 Apr 2016 15:59:05 +0000 (16:59 +0100)] 
toaster: work-around our lack of a synchronous fetch for typeaheads

The Twitter typeahead.js library expects the developer to use
a source which does a local search for matching suggestions, then
falls back to a remote search if that doesn't return enough
results.

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

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

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

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

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

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
9 years agotoaster: migrate typeahead library
Elliot Smith [Tue, 12 Apr 2016 11:07:01 +0000 (12:07 +0100)] 
toaster: migrate typeahead library

Migrate from Bootstrap 2's built-in typeahead to Twitter's
typeahead library.

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

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
9 years agotoaster: tests Add a BuildTest helper class
Michael Wood [Mon, 25 Apr 2016 18:04:56 +0000 (19:04 +0100)] 
toaster: tests Add a BuildTest helper class

Add a helper class for running build tests. Subclass this and call the
build method to get setup for running tests on the resulting data from a
build.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
9 years agotoaster: tweaks to recipe file downloads
Belen Barros Pena [Thu, 28 Apr 2016 12:45:17 +0000 (13:45 +0100)] 
toaster: tweaks to recipe file downloads

* In the custom images table, show the recipe file and download icon
only when the recipe file exists and can be downloaded.

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

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

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

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

Signed-off-by: Belen Barros Pena <belen.barros.pena@linux.intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
9 years agotoaster: testsjs Add call back to append elements on completion of tests
Michael Wood [Mon, 4 Apr 2016 10:49:37 +0000 (11:49 +0100)] 
toaster: testsjs Add call back to append elements on completion of tests

When the tests are complete add some marker elements to the test page
DOM which can then looked at for a selenium browser test.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
9 years agocooker.py: fix warn() -> warning()
Robert Yang [Sun, 12 Jun 2016 08:45:00 +0000 (01:45 -0700)] 
cooker.py: fix warn() -> warning()

Fixed:
DeprecationWarning: The 'warn' method is deprecated, use 'warning' instead

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agodata_smart/utils: Add 'd' to the context used for better_eval in python expansion
Richard Purdie [Thu, 9 Jun 2016 21:33:33 +0000 (22:33 +0100)] 
data_smart/utils: Add 'd' to the context used for better_eval in python expansion

If a line like:

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

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

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

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agolib/bb/main.py: Fix use of BBPOSTCONF and BBPRECONF
Mariano Lopez [Tue, 7 Jun 2016 12:27:39 +0000 (12:27 +0000)] 
lib/bb/main.py: Fix use of BBPOSTCONF and BBPRECONF

The functionality of BBPOSTCONF and BBPRECONF was added in
commit 21b314d4d1e5b8fbeb4cc57006f0a110f0b3aa8f but there
was a typo in the variable name that raises an exception
in bitbake.

[YOCTO #9235]

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agocodeparser: Use hashlib for hashing, not hash()
Richard Purdie [Fri, 3 Jun 2016 12:38:33 +0000 (13:38 +0100)] 
codeparser: Use hashlib for hashing, not hash()

"hash() is randomised by default each time you start a new instance of
recent
versions (Python3.3+) to prevent dictionary insertion DOS attacks"

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

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agocodeparser: Small optimisation to stop repeated hash() calls
Richard Purdie [Fri, 3 Jun 2016 12:35:32 +0000 (13:35 +0100)] 
codeparser: Small optimisation to stop repeated hash() calls

No functionality change, just avoids function call overhead in a
function which loops heavily.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agofetch2: fix unpacking of deb packages
Paul Eggleton [Wed, 25 May 2016 04:46:44 +0000 (16:46 +1200)] 
fetch2: fix unpacking of deb packages

deb packages in modern Debian versions have the data tarball compressed
with xz rather than gzip, and thus explicitly extracting data.tar.gz
fails. Unfortunately ar doesn't support wildcards matching items to
extract, so we have to find out what the name of the file is first and
then extract it, relying on tar to figure out how to unpack it based on
the filename rather than doing it with pipes and making that
determination ourselves.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agofetch2/git.py: References must match exactly
Peter Kjellerstedt [Mon, 23 May 2016 11:35:49 +0000 (13:35 +0200)] 
fetch2/git.py: References must match exactly

Previously the code used to match a reference to its SHA-1 in
_latest_revision() used the Python "in" operator, which made it match
if the reference matched the beginning of an existing tag or
branch. This test, however, must be exact. I.e., either the reference
matches a tag or branch exactly, or it does not match at all.

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agocookerdata: print an error if layer dir does not exist
Markus Lehtonen [Thu, 26 May 2016 08:05:43 +0000 (11:05 +0300)] 
cookerdata: print an error if layer dir does not exist

Makes it easier for user to identify problems, e.g. typos, in BBLAYERS.

[YOCTO #9507]

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobitbake-layers: show-layers: disable parsing
Paul Eggleton [Mon, 30 May 2016 23:16:58 +0000 (11:16 +1200)] 
bitbake-layers: show-layers: disable parsing

We don't need to parse all recipes just to show the list of layers,
since that comes straight from the configuration, so save a bit of time
by not doing so. (A minor regression that came in with the the
bitbake-layers refactoring).

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>