Commit Graph

4460 Commits

Author SHA1 Message Date
Scott Rifenbark 100d6c2782 bitbake: bitbake-user-manual: Updated the example BitBake directory
This directory no longer has setup.py as part of the directory.
I removed that line from the example in the
"Obtaining BitBake" section.

Fixes YOCTO #8623

(Bitbake rev: 6a82f6432022debe48830db98b3fb16424411a87)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-29 17:03:53 +00:00
Ross Burton 9f22898e0f bitbake: fetch2/wget: fallback to GET if HEAD is rejected in checkstatus()
The core change here is to fall back to GET requests if HEAD is rejected in the
checkstatus() method, as you can't do a HEAD on Amazon S3 (used by Github
archives).  This meant removing the monkey patch that the default method was GET
and adding a fixed redirect handler that doesn't reset to GET.

Also, change the way the opener is constructed from an if/elif cluster to a
conditionally constructed list.

(Bitbake rev: 6ec70d5d2e330b41b932b0a655b838a5f37df01e)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-26 22:34:45 +00:00
Daniel Istrate 72f98ba577 bitbake: toaster: Update UI test runner
Add new runner options:
    --run-all-tests: finds all tests, ignores config
    --run-suite <suite> (from cfg)

Without arguments, run tests from current os section (config), e.g.:
    1. ./run_toastertests
    2. ./run_toastertests --run-all-tests
    3. ./run_toastertests --run-suite darwin

Update toaster logging to meet QA CI requirements.

(Bitbake rev: 5685feb51fbb6d54fde6027cc765b9edd8eda65a)

Signed-off-by: Daniel Istrate <daniel.alexandrux.istrate@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-25 16:29:10 +00:00
Richard Purdie 4a5458f38f bitbake: fetch2: Don't show checksum warnings if a single checksum was supplied
If one checksum is supplied to a SRC_URI, we really don't want to show
warnings about the other type which isn't present as one checksum
is really good enough for most cases.

(Bitbake rev: 43358a9b595b2928458a5f463cf1949394160c3a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-24 09:40:42 +00:00
Ed Bartosh bd1a534a11 bitbake: toaster: run bitbake server with --read option
Toaster script run bitbake with --postread conf/toaster.conf.
It turned out that variables set this way don't influence the
build. Changing --postread to --read makes bitbake to read
variables earlier and should fix this issue.

[YOCTO #8781]

(Bitbake rev: 76c9871740ef42ac35fdfdcb89a68478cca370cd)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-22 12:45:44 +00:00
Paul Eggleton 76a281c870 bitbake: taskdata: add the ability to access world targets list
In certain circumstances it can be useful to get access to the world
targets list from a recipe in order to add dependencies on some or all
of the items in it. If a special function, 'calculate_extra_depends' is
defined in the recipe, and the recipe is to be built, then call it at
the right point before we calculate which tasks should be run. The
function can append items to the "deps" list in order to add
dependencies. This is not as tidy a solution as I would have liked, but
it does at least do the job.

As part of this change, the buildWorldTargets function was moved to
bb.providers to make it possible to call from taskdata.

Part of the implementation of [YOCTO #8600].

(Bitbake rev: aba0dce57c889495ec5c13919991a060aeff65d2)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-22 12:45:44 +00:00
Robert Yang 11a1f49630 bitbake: cache.py: check existence before add to cachedata.rproviders
The rprovides maybe contain duplicated lines when parse again, we need
check it before add to cachedata.rproviders, similar to what we had done
to cachedata.providers.

(Bitbake rev: 6c488afb0fe30a9655ec62a1d22f9f388365f012)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-22 12:45:44 +00:00
Robert Yang 05c17750c3 bitbake: taskdata.py: add RuntimeProviders to close matches
This is useful for newbie, for example:
$ bitbake rpm-build
ERROR: Nothing PROVIDES 'rpm-build'. Close matches:
  pm-utils
  rpm RPROVIDES rpm-build

[YOCTO #8881]

(Bitbake rev: 4b59eb8cc2321fe72f2988b6c9c0fecd4883255b)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-22 12:45:44 +00:00
Richard Purdie cf9cb65eec bitbake: data_smart: Don't show exceptions for EOL literals
If variables are unset, the code simply doesn't expand them, there
aren't errors. If the code is a python expression, this can get a bit
messy, see the attached test case. The python expansion code sees the }
of the unexpanded value rather than the close of the python expression
and then raises a SyntaxError exception.

Ideally, we'd update the code to match pairs of brackets. I don't know
how to do that with the current regex and this is unfortunately a
performance sensitive piece of code. We also run the risk of breaking
existing code in OE-Core where there are "{" characters but not "}"
to close them (PKGE and PE).

Rather than raising the exception, matching the existing "just return
the expression" behaviour seems more consistent with the standard
variable behaviour.

This addresses an issue found in the recent image.bbclass code where
there are some variables we choose not to expand (TMPDIR/DATETIME).

This patch also adds a test case for this behaviour. It wouldn't preclude
improved bracket matching code in the future either.

(Bitbake rev: d80d39e73223a50fda0090784303d2c57167bb4c)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-22 12:01:24 +00:00
Olof Johansson c886a786cf bitbake: tests/codeparser.py: Add filename/lineno flags to test variable
A recent change in bitbake added filename/lineno information to the
parameters of bb.data.build_dependencies(). The codeparser tests
required a little adaption to the changes, adding the flags to the FOO
variable used in the tests.

The error seen when running the tests is a TypeError exception raised
in bb.codeparser:

  TypeError: int() argument must be a string or a number, not 'NoneType'

(Bitbake rev: f1fe674397ac5cd355696d5b4cc90b7cfa6c867f)

Signed-off-by: Olof Johansson <olof.johansson@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-19 17:38:51 +00:00
Ed Bartosh f130033856 bitbake: toaster: write variables to toaster.conf
With the resent change in rootfs creation code setVariable
rpc calls don't set variables for bitbake workers anymore.

Writen variables to toaster.conf should solve this issue.

[YOCTO #8910]

(Bitbake rev: d6dfe40320ff6ca420d9f9016b4d1d83d10f1d59)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-19 17:38:51 +00:00
Richard Purdie f0d47a6d9a bitbake: Revert "runqueue.py: Ensure one setscene function doesn't mask out another which needs to run"
This reverts commit b22592af81.

That commit isn't entirely clear about why this change is needed but
I do have a usecase where this breaks things. If for example you run
"bitbake X -c packagedata" and that packagedata is in sstate, you'd
expect this to work.

If sstate doesn't contain a do_populate_sysroot for a dependency, you
would still expect the command above to succeed and you would not
expect
it to rebuild that dependency. With the current code, this isn't what
happens. The code finds the sstate for do_populate_sysroot missing,
this makes the task "uncovered" and this in turn makes it unskippable.

The example I found with this was avahi-ui, where it would trigger
a build of libdaemon to obtain its populate_sysroot.

Since this behaviour seems completely incorrect, revert the older patch
and we'll address any issues that crop up as a result.

(Bitbake rev: 36a9840a5da17cc14561881fdd6a4f2cb0a75e49)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-19 17:26:15 +00:00
Elliot Smith f98e11c809 bitbake: toastergui: make artifact download more robust
When an artifact download is requested, Toaster goes through a
convoluted series of conditions to decide which file to push
to the response. In the case of build artifact downloads for
command line builds, this caused an ugly exception, as command
line builds don't have a build request.

To simplify and catch more corner cases, remove the code which
fetches files via the build environment (we only support the local
build environment anyway). Then push all requests along a single
path, catching any missing file errors, missing object errors
or poorly-formed URLs in a single except clause which always returns
a valid response.

Also modify the text on the "unavailable artifact" page so it
says that the artifact doesn't exist, rather than it "no longer"
exists (exceptions may occur because an invalid artifact was
requested, rather than an artifact which was removed).

[YOCTO #7603]

(Bitbake rev: 24e20db55c2933de5e58ca754b8fd5b624f47820)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-18 22:06:46 +00:00
Elliot Smith 68f3e1e067 bitbake: toasterui: log OSErrorException metadata events
OSErrors occurring in toaster.bbclass are converted to
OSErrorException metadata events. They were then being swallowed
as unprocessed events by toasterui, which made them difficult
to spot.

Explicitly catch OSErrorException events and log them so they
are easier to spot and debug.

(Bitbake rev: 69f2b2bc373ce114609600b59a6b6ccef20771c9)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-18 22:06:46 +00:00
Elliot Smith fb94754e83 bitbake: toasterui: listen for bb.event.MetadataEvent
The event mask for toasterui doesn't include MetadataEvents.
This means that we're missing the ArtifactFileSize event
(among others), which is the one we use to populate the SDK
artifact table.

Add that event type to the toasterui event mask so we can
record SDK artifacts as they are created.

[YOCTO #7603]

(Bitbake rev: d0276a831bb8cffd42c8367895633eaa1fa1ed30)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-18 22:06:46 +00:00
Ed Bartosh 0fe6e2dc7b bitbake: toaster: increase timeout
Sometimes Toaster connection to the bitbake server fails with
this error in the log:
   ERROR: Could not connect to server 0.0.0.0:46572
   : Could not register UI event handler
It happens more often on slow machines.

Increasing timeout after restarting bitbake should fix this issue.

[YOCTO #8776]

(Bitbake rev: b64a0adc1efd72aa4d46df3e043dd14543abae3d)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-16 10:36:50 +00:00
Elliot Smith 798e8b8d03 bitbake: toastergui: code formatting and clean-up
Minor fixes to code formatting and small improvements from
code review.

(Bitbake rev: 2c97f3a5c6ae37de910deb90390c5b856a600c5f)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-15 16:30:01 +00:00
Elliot Smith c4b50111e9 bitbake: toaster tests: fix Django tests for new ToasterTable pages
The Django command-line tests can no longer test the content
of the projects/, builds/ and projectbuilds/ pages, as
ToasterTable pages are populated by JavaScript.

Fix/remove affected tests by converting them to tests on the
JSON returned by the ToasterTable.

[YOCTO #8738]

(Bitbake rev: 85efa9530fa6181855e051bfd14de1c15db9c3b7)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-15 16:30:01 +00:00
Elliot Smith 88a262cbd2 bitbake: toastergui: remove unused views and template code
The code in views.py for setting up the template context for
old non-ToasterTable views is no longer necessary, as this
is now implemented in tables.py.

The template files for these views have also been removed.

[YOCTO #8738]

(Bitbake rev: 2b5a13afb068c85466436914d8d4ac3b31bc5c02)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-15 16:30:01 +00:00
Elliot Smith 059a274aa9 bitbake: toastergui: fix error and warning counts for builds
The error and warning counts displayed for builds were counts of
the errors and warnings objects associated with a build. Because these
values were being derived on the fly, it was not possible to sort by
them.

Previously, the 3rd party django-aggregate-if library was used to
add aggregate fields to Build objects and should then have been
used to populate the "all builds" and "project builds" tables. However,
at some point the templates had changed so that the error and warning
counts were coming from the properties on the Build model and not from
these aggregates. This meant that it was not possible to sort by these
fields.

Django 1.8 supports conditional aggregates in annotation fields on
querysets. This means we can remove django-aggregate-if, use the new Django
1.8 feature to derive errors_no and warnings_no fields as annotations,
then use those annotation fields in the templates. This makes the "builds"
tables sortable again.

[YOCTO #8738]

(Bitbake rev: 9be7c5c18b325f6ed40bc431ac408db242007eb1)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-15 16:30:01 +00:00
Elliot Smith 4103e0cb74 bitbake: toastergui: make "Apply" button state depend on filter range
If a range filter action had an empty from/to field, the range
filter could still be applied. This was confusing, as an invalid
filter range caused all records to display, even though a filter
appeared to have been applied (by the highlighted state of
the filter button).

Change the state of the "Apply" button, disabling it if the radio
button for a range filter action is selected but the range is
incomplete (from or to field is empty).

When a non-range filter is selected, the "Apply" button always
enable the "Apply" button.

[YOCTO #8738]

(Bitbake rev: 168184b28165d7aa354b9092b5986f91c58d550d)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-15 16:30:00 +00:00
Elliot Smith 6c2d88fda5 bitbake: toastergui: mute label for filter actions with no records
The radio button for a filter action is disabled if that filter
action has no associated records. However, the label retains
the normal font styling, so it's unclear that the action is
not available.

Add the "muted" class to the label for a filter action (and still
disable its radio button) if it has no records associated with it.

[YOCTO #8738]

(Bitbake rev: b7f7ff095c9c4c922e608f776713f17acc1f150d)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-15 16:30:00 +00:00
Elliot Smith f08730ab4d bitbake: toastergui: set default visible and hideable columns
Incorrect columns were shown by default in the "all builds",
"project builds" and "all projects" pages.

Set the "hidden" property on columns in these tables to hide the
correct columns.

Add a set_column_hidden() method to ToasterTable so that the
"hidden" property can be overridden for the machines column
in the project builds page (it shares a superclass with
all builds).

Make the time column on all builds page hideable.

[YOCTO #8738]

(Bitbake rev: be3982c71703eaa51e7f3352e0cb5b3af11c9ead)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-15 16:30:00 +00:00
Elliot Smith 112f3746cd bitbake: toastergui: serialise decimals correctly
The conversion of some ToasterTable Build object querysets to
JSON caused a serialisation error. This is because one of the
fields in the queryset was of type decimal.Decimal, and our
serialiser didn't know what to do with it.

Add a clause to check for decimal fields and serialise them
so that correct JSON can be generated.

(Bitbake rev: fa6229d4edf5904ccaa9dc323d0ab2318d1ef314)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-15 16:30:00 +00:00
Elliot Smith e024aab39c bitbake: toastergui: streamline construction of filter objects
In line with comments from review, remove the QuerysetFilter
class (redundant) and convert ProjectFilters into a class
with static methods.

[YOCTO #8738]

(Bitbake rev: 59379bf6467029223045c5ebef868729d8e02c86)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-15 16:30:00 +00:00
Elliot Smith fcb20f9dfd bitbake: toastergui: ensure filter_value updates
Clicking on the radio button for a date range filter action
populates the from and to fields for that action if they are empty.

However, because this doesn't fire "change" events, clicking on
the radio button doesn't update the filter_value hidden field. This
means that the date range action's filter_value parameter isn't
set correctly when the filter popup is submitted.

Manually call the changeHandler() to set the filter_value whenever
the radio for a date range filter is clicked.

[YOCTO #8738]

(Bitbake rev: 1a3038cf8d9b32532f1fe92cd3472b4473ffc0c4)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-15 16:30:00 +00:00
Elliot Smith f9c46f5e5e bitbake: toastergui: don't hide all elements with .col class
Disabling the "project" column in a ToasterTable for builds
causes the recent builds area to be hidden. This is because
the column hiding code hides all elements with a class matching
".<column>", regardless of where they occur on the page; and
the recent builds area was using the ".project-name" class,
which means it is included in the set of elements which are hidden.

Scope the element search to the table so that only elements
within the table are hidden or shown.

[YOCTO #8792]

(Bitbake rev: 151bc20daf51e0ab8baf11ea29244b7fec1f8a22)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-15 16:30:00 +00:00
Elliot Smith eaae82a19a bitbake: toastergui: convert project builds page to ToasterTable
Use the all builds ToasterTable as the basis for the project builds
ToasterTable.

[YOCTO #8738]

(Bitbake rev: 87bcfb740dd2d9944e35a2a1f71cbf8ff3b266e9)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-15 16:30:00 +00:00
Elliot Smith 33b011c158 bitbake: toastergui: implement "today" and "yesterday" filters
Add the "today" and "yesterday" filters to the started_on
and completed_on columns in the builds table.

During this work, some minor adjustments were made to the
behaviour of the builds table:

* Amend filter action variable names so they're more succinct.
* Retain order in which actions are added to a filter, as this
ordering is used in the UI when displaying the filter actions.
* Always show the table chrome, otherwise it's not possible
to edit the columns shown until there are 10 or more results.
* Because date range searches may return no results, make sure
that the search bar and "show all results" link are visible
when the query returns no results.

[YOCTO #8738]

(Bitbake rev: f17cfa009e58833e0e55884fa04de8abd522b6bc)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-15 16:30:00 +00:00
Elliot Smith f8d383d87f bitbake: toastergui: implement date range filters for builds
Implement the completed_on and started_on filtering for
builds.

Also separate the name of a filter ("filter" in the querystring)
from its value ("filter_value" in the querystring). This enables
filtering to be defined in the querystring more intuitively,
and also makes it easier to add other types of filter (e.g.
by day).

[YOCTO #8738]

(Bitbake rev: d47c32e88c2d4a423f4d94d49759e557f425a539)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-15 16:30:00 +00:00
Elliot Smith b929889cdd bitbake: toastergui: show recent builds on all builds page
The recent builds section was disabled while converting the
all builds page to ToasterTable.

Re-enable the recent builds area and add the data it requires
to the ToasterTable context.

[YOCTO #8738]

(Bitbake rev: d6df4545bd134a23c9bd3cd1ba3b61ddb26545e4)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-15 16:30:00 +00:00
Elliot Smith 1a4b203ca5 bitbake: toastergui: switch off filter highlights when inactive
In ToasterTables with multiple columns which allow filtering
(e.g. all builds), selecting one filter, then a second filter
(e.g. selecting "failed builds" then "outcome" for all builds),
would result in both filters being highlighted at the same time.

Fix this by removing the "active" highlight on all column filter
buttons when a new filter value is submitted (via the filter modal).

NB to enable this, added a data-filter-on attribute to all
column filter buttons to make them easy to select.

[YOCTO #8738]

(Bitbake rev: 7347ad0d4baace593751b44a86ab8e11a04a02b6)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-15 16:29:59 +00:00
Elliot Smith 809046c6fb bitbake: toastergui: refactor ToasterTable filtering
The filter code for ToasterTable was difficult to follow
and inflexible (not allowing different types of filter, for example).

Refactor to a set of filter classes to make the structure cleaner
and provide the flexibility needed for other filter types
(e.g. date range filter).

[YOCTO #8738]

(Bitbake rev: 94031bb30bdaf665d0c8c68b591fcb7a17b6674d)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-15 16:29:59 +00:00
Elliot Smith 294579b531 bitbake: toastergui: convert all builds page to ToasterTable
For better long-term maintainability, use ToasterTable instead
of Django template and view code to display the all builds page.

NB the builds.html template has been left in, as this will
otherwise cause conflicts when merging the new theme.

[YOCTO #8738]

(Bitbake rev: e0590fc8103afeb4c5e613a826057555c8193d59)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-15 16:29:59 +00:00
Elliot Smith 6c12ca7f93 bitbake: toastergui: use event delegates for hover help elements
libtoaster.js binds to hover help elements via their hover() and
mouseout() methods. However, any elements added to the DOM after
libtoaster has initialised will not have these bindings added.
This causes a problem for ToasterTables which have hover-help
elements (e.g. the builds/ table).

Use the on() method instead. This uses event delegation to bind
a handler to any th or td elements already in the DOM, or
which will be added to the DOM in future. ToasterTables can
now reconstruct the table DOM and still have the correct handlers
attached once the table is done.

[YOCTO #8738]

(Bitbake rev: 1f3ff01fed0b4de8721191f108033ad044cdc26a)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-15 16:29:59 +00:00
Elliot Smith ef93dce7e1 bitbake: toastergui: switch projects/ view to ToasterTable
Remove the old projects page and replace with the new
ToasterTable-based version.

NB although the projects.html template is no longer required,
it's been left in as there will be changes applied to it for
the new theme. These changes will have to then be transferred
from the projects.html template to projects-toastertable.html.

Similarly, the code for the projects page in views.py has been
retained.

[YOCTO #8738]

(Bitbake rev: ebe7831ef65e78a9d100f29a63311518577fc838)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-15 16:29:59 +00:00
Elliot Smith 417f1d3f53 bitbake: toaster: check inferred file suffixes against list of known types
The algorithm for finding the suffix for image files produced by
the build doesn't reference a list of known file suffixes, so
could be prone to error.

Modify how file suffixes are parsed from the file path so that
they are compared against a list of known types; if this fails,
use the part of the basename of the file path after the first
'.' character.

Also rationalise the places in the views code where we
extract the file name extensions for builds, so they both use
the same algorithm (before, the same code was duplicated in
two places).

[YOCTO #8417]

(Bitbake rev: dd1c509696b8ab5e593cc64637060a58e95fcd1f)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-15 16:29:59 +00:00
Elliot Smith c02ee05857 bitbake: toaster: move image file suffix list to model
Image file suffixes are used in the project configuration page to
show a list of available image file types. This list is stored
as a function in the views code.

However, this list is also needed when parsing image file paths,
so that the suffixes can be shown in the "all builds" and "project
builds" tables.

Move the list of valid image file suffixes to the Target_Image_File
class to make is accessible in other places where it may be needed.

[YOCTO #8738]

(Bitbake rev: c2f20232077917552623fd0726d0820e50b04cae)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-15 16:29:59 +00:00
Elliot Smith d29e4cd040 bitbake: toastergui: use ToasterTable for projects page
The projects page uses the old approach for showing tables,
which means a template for each table. This means that applying
changes to ToasterTable (which is used for most tables) has
no effect on the layout, styling and behaviour for these older
tables, and requires additional duplicated effort.

Move the projects page to use ToasterTable instead, to remove
the duplication of effort.

[YOCTO #8738]

(Bitbake rev: df56a35bc71639457329c4b58839976c5ee40106)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-15 16:29:59 +00:00
Richard Purdie f8508deb01 bitbake: Revert "fetch/git: Change to use clearer ssh url syntax for broken servers"
This reverts commit 4193e99adce8e88f12ac88d7578ad39575f7e346.

It seems the underlying issue was caused by ":" in the url which isn't
supported. The patch was therefore incorrect.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-15 15:02:40 +00:00
Richard Purdie da43a56d35 bitbake: Revert "fetch2/local.py: avoid using PREMIRROR"
This reverts commit e130dca85bac82bd4d88f94a6bf9fe36e8ad4d7c.

This is in fact a valid use case, for example the sstate.bbclass code
sets up SSTATE_MIRRORS as PREMIRRORS. Its quite common to map those
file:// urls to remote http:// urls and with the above change, this
no longer works.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-13 09:47:28 +00:00
Kristian Amlie 1724ffd32d bitbake: fetch2/git.py: Add missing "errno" module import.
This goes undetected most of the time, but when updating a repository,
if the ud.fullmirror file is not present, you end up getting an
exception instead of carrying on because the errno module is not
loaded (specifically "if exc.errno != errno.ENOENT").

(Bitbake rev: e6fca8480731ce817df9bee61438347a5e3d3017)

Signed-off-by: Kristian Amlie <kristian.amlie@mender.io>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-11 23:28:55 +00:00
Chen Qi 74fa824e6c bitbake: bitbake: clean up stamp-base related codes
The 'stamp-base' and 'stamp-base-clean' related codes are no longer useful,
clean them up.

[YOCTO #8468]

(Bitbake rev: 7b4c42b315d4a26dd8f2ceb874a94737bf9f183e)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-11 23:28:55 +00:00
Richard Purdie 43328feccc bitbake: runqueue: Fix setscene task dependencies
Debugging suggests that setscene tasks are being a little greedy about their
dependencies, for example, lsof is insisting that gcc-runtime's do_package
is installed. If it isn't, its requiring gcc to rebuild.

If gcc-runtime do_package_write_xxx and do_packagedata is available, there
is no reason do_package should be needed.

The reason this is happening appears to be from the batching up of task
dependencies code, rather than setscene tasks stopping when passing over
a setscene task, they were being carried forward. This patch fixes it
so the data is 'zeroed' when passing over a setscene task boundary,
which gives the dependency graph that is expected.

After this patch, lsof will rebuild quite happily without
gcc-runtime:do_package being present, as expected. This should lead to
less dependencies being installed for builds from sstate and generally
better performance in general.

(Bitbake rev: f8bcb0a1e3b008b71c9a7cd21f76d0906f2d8068)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-11 23:26:33 +00:00
Michael Wood 7b905caf60 bitbake: toaster: settings Add uid to the toaster cache dir
Make the default toaster cache dir unique to the user running
toaster. If we have multiple users running toaster we previously
got a permission denied exception on saving a cache file.

[YOCTO #8782]

(Bitbake rev: 5207abdf58019271bf92bff4bcce3911b8691508)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-11 23:26:33 +00:00
Ed Bartosh dff7a277e3 bitbake: toaster: show 'satisfied via' text for reverse deps
Showed '<dependency> satisfied via <provider>' text and
help tooltip for the reverse build dependencies provided
through 'PROVIDES' in the 'Reverse build dependencies' tab.

[YOCTO #6169]

(Bitbake rev: c7bb98e2e2111790ded86087b13c8b49462d6b75)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-11 23:26:33 +00:00
Ed Bartosh 89f493261a bitbake: toaster: show 'satisfied via' text for build deps
Showed '<dependency> satisfied via <provider>' text and
help tooltip for the build dependencies provided through
'PROVIDES' in the 'Build dependencies' tab.

[YOCTO #6169]

(Bitbake rev: de77e338fe70341fe98561e2e40b534f5c88db10)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-11 23:26:33 +00:00
Ed Bartosh febb898a06 bitbake: toaster: show list of provides for the recipe
Showed list of names that recipe provides.

(Bitbake rev: 60318c9a049292bd33322d8446a629d778337e8a)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-11 23:26:33 +00:00
Ed Bartosh 2ff4ccb13f bitbake: buildinfohelper: add provides info to the db
Added new entries to Provides model and link them to
Recipe_Dependency using 'via' field.

This data will be used by Toaster UI to show 'Provides:'
information for the recipes.

[YOCTO #6169]

(Bitbake rev: 336ddc8df611d4c8f1c3d3a06d0a85bb544c38bc)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-11 23:26:32 +00:00
Ed Bartosh 16a81fb97a bitbake: toaster: add Provider model
Added new model Provider and a foreign key 'via' to link
Recipe_Dependency to it.

[YOCTO #6169]

(Bitbake rev: e45fff6314741d46e2549b2f72ed380cbbb95593)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-11 23:26:32 +00:00
Ed Bartosh 6a28ed33b7 bitbake: buildinfohelper: use providermap
Used providermap in store_dependency_information function
to find virtual dependencies. This should fix annoying
warnings "stpd: KeyError saving recipe dependency"

[YOCTO #6169]

(Bitbake rev: 85c416ca338c886db6e79651e44727482df9fb07)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-11 23:26:32 +00:00
Ed Bartosh f2b7252190 bitbake: cooker: add providermap to dep_tree
Added providermap information to the result of buildDependTree API.

This will be used by Toaster to map virtual dependencies to recipes.

(Bitbake rev: d3e07368549f30265f59846a260efa8230a225ca)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-11 23:26:32 +00:00
Ed Bartosh 7e380d460c bitbake: taskdata: refactor get_providermap
Added optional parameter 'prefix' to filter out names that
don't start with specified prefix. Changed existing call
of get_providermap according to changed API.

Optimized the code: got rid of extra loop and temporary
list variable virts.

(Bitbake rev: df5a1392d6f91ccb44a99721c7d847da242121bb)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-11 23:26:32 +00:00
Richard Purdie 46731daa5f bitbake: main/runqueue: Add --setscene-only option to bitbake
Its turning out that we really need a way to have bitbake just run
the setscene tasks but not any real tasks, particularly for SDK
operations.

Add an option for this since its pretty straight forward. This allows
various nasty workarounds in OE-Core to be removed.

(Bitbake rev: e4a2aafa1650a227a04d92a8a0b31efaed2c310e)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-11 23:26:32 +00:00
Richard Purdie 221d864042 bitbake: fetch/git: Change to use clearer ssh url syntax for broken servers
Some servers, e.g. bitbucket.org can't cope with ssh:// as part of
the git url syntax. git itself is happy enough with this but you
get server side errors when using it.

This changes the git fetcher to use the more common ssh url format
which also means we need a : before the path.

Seems a shame to have to do this due to broken servers however
it should be safe enough since this other form is the one most people
use on the commandline so it should be safe enough.

[YOCTO #8864]

(Bitbake rev: 4193e99adce8e88f12ac88d7578ad39575f7e346)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-08 13:58:08 +00:00
Richard Purdie 46d62d076d bitbake: knotty: Use non-interactive mode as fallback for dumb terminals
TERM=dumb bitbake X

shows no output for task status which is suboptimal. Use the non-interactive
mode if the terminal doesn't support what we need for interactive mode giving
a better user experience. Also print a note to the console to say this has
happened.

[YOCTO #8768]

(Bitbake rev: 6f84cf4bd77f35fcd07e0b2f5149f1d6866a414d)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-08 13:58:08 +00:00
Ross Burton bfa7859ffa bitbake: cooker: fix findFilesMatchingInDir documentation
The documentation for findFilesMatchingInDir() was inconsistant with the
implementation: the regex was escaped before searching so effectively it's a
pure textual substring, and the machine example was broken.

(Bitbake rev: 6bef981488ec94b46dbe3797acfecf9c4b6ecbbc)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-08 13:58:08 +00:00
Ross Burton 3d4273716d bitbake: cooker: use in instead of count
No point counting all instances when we just want to know if there's any or not.

(Bitbake rev: 3369072efb653339da8dbd1ca864ff8e1ff899ca)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-08 13:58:08 +00:00
Richard Purdie f8185ff9f8 bitbake: ast: Add filename/lineno to mapped functions
Where we add in mappings for EXPORT_FUNCTIONS, add dummy filename
and lineno data so ensure the assumption that all python functions
have this is correct.

(Bitbake rev: 547128731e62b36d2271c4390b3fee2b16c535dc)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-06 15:27:35 +00:00
Ed Bartosh a178c5a163 bitbake: main: kill server without queue setup
Setup of event queue includes registering of UI handler.
This operation can fail when cooker is busy. However, there is
no need in registering UI handler for terminating the server.

Moved the call of connection.terminateServer before setting up
of the event queue. This should make terminating server to work
more reliably as it doesn't depend on setting up the event queue
and registering UI handler anymore.

This should also help Toaster backend to restart bitbake server
and observer without getting "Could not register UI event handler"
errors.

[YOCTO #8776]

(Bitbake rev: 0c5a9349f797d05c282c2ada1893e187e05f0576)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-06 15:27:35 +00:00
Ed Bartosh 773700dbc3 bitbake: xmplrpc: split connect method
Current code in connect method sets up event queue, which requires
registering UI handler. This functionality may not be needed for
some operations, e.g. for server termination.

Moved functionality of setting up event queue in from 'connect'
method to 'setupEventQueue' in BitBakeXMLRPCServerConnection class.

(Bitbake rev: 4429871da76d6bd29e023ff42740fe7daa6b40fa)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-06 15:27:35 +00:00
Ed Bartosh 05b4fbc947 bitbake: uievent: refactor retry loop
Replaced 'while' loop with 'for' loop.
Made the code more compact and hopefully more understandable.

(Bitbake rev: 4e1e497c8432536b3522295e5b1284844ccea056)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-06 15:27:35 +00:00
Ed Bartosh ebc169c360 bitbake: uievent: get rid of EventHandler attribute
This attribute was introduced by mistake. EventHandle is used in the
code for the same purpose.

(Bitbake rev: 8d505ec8913a7d51de48b4f52bb64c5d6a0bb08e)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-06 15:27:35 +00:00
Ed Bartosh 4e0de6eca2 bitbake: uievent: add error to registerEventHandler return
Current code throws Exception("Could not register UI event handler")
if event handler can't be registered. The real reason of this is that
cooker is in busy state. Error message lacks information about this.

Added error message to the return value of registerEventHandler.
Included returned error message into the log message and exception
text.

(Bitbake rev: 07de1ca7d57dcd0cc37406feae2949da12a3fa7a)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-06 15:27:34 +00:00
Ed Bartosh 01419d5565 bitbake: cooker: add state.get_name method
Added method to convert state code into the human readable name.
It will be used in logging and error reporting.

(Bitbake rev: 9ec6379b27d210214d0b3f2e55962f721b7f5f51)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-06 15:27:34 +00:00
Juro Bystricky 763506d49b bitbake: fetch2/__init__.py: Add support for 7-Zip
7-Zip is a file archiver claiming the highest compression ratio.
This patch allows using 7-Zip commpressed files in bitbake recipes.
Two common formats are supported:

SRC_URI = "file://abc.tar.7z"
SRC_URI = "file://abc.7z"

(Bitbake rev: 7120f5bfaae54e91bc95da5667831424724ce613)

Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-06 15:27:34 +00:00
Richard Purdie f5bfc1cc26 bitbake: utils: Remove double compile from better_compile
Poking around the ast to correct linenumbers works well for runtime failures
but not for parsing ones. We can use blank linefeeds to correct the line
numbers instead, with the advantage that we don't need to double compile.

(Bitbake rev: 10256ac3e7be7e691176ecc5d55856d88f1fe940)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-06 15:27:34 +00:00
Robert Yang b4141f6494 bitbake: fetch2/local.py: avoid using PREMIRROR
The PREMIRROR isn't useful for "file://", so avoid using it, this is
good for searching speed and can reduce useless lines in log.do_fetch.

(Bitbake rev: e130dca85bac82bd4d88f94a6bf9fe36e8ad4d7c)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-06 15:27:34 +00:00
Richard Purdie 1ad3595e8c bitbake: siggen: Change exception note into a warning
This makes no sense as just a note, its at least a warning and useful
to get an idea of which codepath is failing.

(Bitbake rev: 0194cf0da24dc72dab0612cd54aa5190e6cd92f2)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-06 15:27:34 +00:00
Richard Purdie 4ba49aca42 bitbake: data: Drop misleading ExpansionError exception
This codepath can be triggered by a python indentation error for example.
Showing it as an ExpansionError is misleading.

Change the code to add a warning about where the failure came from (in
particular giving the variable key name that triggered it) but raise the
proper exception.

(Bitbake rev: d49d46533704e8b4404e29abfb5a7383d704c91a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-06 15:27:34 +00:00
Richard Purdie 2c9431135d bitbake: cooker: Drop useless parsing exception
The SyntaxError exception simply shows the recipe that failed to parse
which is pretty useless without the actual exception. We could make it
print more info, however we can just use one of the more generic handlers
instead and remove this one.

For a python indentation error, this leads to a much more readable error
message.

(Bitbake rev: 9241eb10847634e34c5ff8767ed8c114f66ff6cf)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-06 15:27:34 +00:00
Richard Purdie a16b543436 bitbake: data: Pass lineno/filename data from build_dependencies
If parse_python() fails, the output is confusing. Passing in the extra
file/line data isn't expensive and improves readability significantly.

(Bitbake rev: a4bb753488d322e0e31c31d6377ba780f2f824c4)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-06 15:27:34 +00:00
Richard Purdie 958f0ff56b bitbake: codeparser: Add support for correct linenumbers
Currently, if there is something like a python indentation error in a
python function, the linenumbers and even file aren't reported correctly.

This allows lineno and filename parameters to be passed in to correct this.

The lack of a lineno parameter to python's compile() function is worked
around by using empty linefeeds. Ugly, but effective and with minimal
performance overhead.

(Bitbake rev: 5796ed550d127853808f38257f8dcc8c1cf59342)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-06 15:27:34 +00:00
Richard Purdie 0381b78aa4 bitbake: event/utils/methodpool: Add a cache of compiled code objects
With the addition of function line number handling, the overhead of
the compile functions is no longer negligible. We tend to compile
the same pieces of code over and over again so wrapping a cache around
this is beneficial and removes the overhead of line numbered functions.

Life cycle of a cache using a global like this is in theory problematic
although in reality unlikely to be an issue. It can be dealt with
if/as/when we deal with the other global caches.

(Bitbake rev: 98d7002d1dca4b62042e1589fd5b9b3805d57f7a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-22 00:02:05 +00:00
Richard Purdie c61c1eb26a bitbake: BBHandler: Improve IN_PYTHON_EOF handling
Now we're actively using the line numbers for other thins, having
magic values like IN_PYTHON_EOF causes problems, in particular, 32
bit overflow on 32 bit machines.

There is a neater way to signal eof to feeder(), just using an extra
parameter so use this instead and drop the IN_PYTHON_EOF magic values.

This has the added bonus that line numbers are then correct for
python functions at the end of files.

(Bitbake rev: e0f05871c2a6f1e86ae19ad343c7c6f822ddb67e)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-22 00:02:05 +00:00
Ed Bartosh 5f406915b5 bitbake: toaster: remove 2 confusing parameters
Removed nobrowser and brbe script parameters as both
are confusing and nobrowser is not used anywhere.

brbe parameter usage can only be justified if toaster
doesn't work properly and user has to manually connect
toaster to running bitbake server. Even in this scenario
it's very unlikely to achieve as toaster script is not
designed for this kind of usage.

(Bitbake rev: 0fd04ede3fda6894d97a5ef830b79dbbc9c6cf51)

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>
2015-12-18 13:51:54 +00:00
Ed Bartosh 3960b6ec5c bitbake: toaster: move setting of default values
Set default values of script parameters just before
they are parsed to increase readability.

(Bitbake rev: 627f0d6adcfe281ef0487bf15a35151f1ceff194)

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>
2015-12-18 13:51:54 +00:00
Ed Bartosh b194c0c00a bitbake: toaster: move startup checks to a better place
Moved addr:port, bitbake.lock and toastermain.pid checks
to the place where the rest of Toaster starting happens.

(Bitbake rev: 0e7812b5512e609ea815db30be1d7caca896ab60)

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>
2015-12-18 13:51:54 +00:00
Ed Bartosh 064d2c7984 bitbake: toaster: remove 2 unused functions
Removed check_pidbyfile and notify_chldexit functions from
toaster script as they're not called in the script.

(Bitbake rev: ead2823e5457c9c4d0321c2191fb99982b282d26)

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>
2015-12-18 13:51:54 +00:00
Ed Bartosh c505f24ebd bitbake: toaster: remove addtoConfiguration function
This function is useless as it's called just once
and makes code less readable.

(Bitbake rev: 96e85159905e44533882ad8290b1c9dd252ff3ea)

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>
2015-12-18 13:51:54 +00:00
Ed Bartosh c7e4404273 bitbake: toaster: updated header of the toaster script
Updated GPL information, years of development and
usage information. Removed outdated information about
2 ways of starting Toaster.

(Bitbake rev: b4789c9e3093e1ec8e70f67305c88709443578e6)

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>
2015-12-18 13:51:54 +00:00
Ed Bartosh af34920dff bitbake: toaster: add MANAGE variable
Used MANAGE variable to avoid repeating path to
manage.py in many places in toaster script.

(Bitbake rev: e8e19168ff43b72a2481771e7a40d9d7c155cfd2)

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>
2015-12-18 13:51:54 +00:00
Ed Bartosh 563b786d4b bitbake: toaster: remove unused variable
Removed unused variable RUNNING from the toaster script.

(Bitbake rev: 8b3f0b2c6efa2962d9c16e453f4d2c1af6419c6c)

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>
2015-12-18 13:51:54 +00:00
Ed Bartosh aa3cc12db9 bitbake: toaster: split long lines, add/remove whitespace
Made toaster script more readable by splitting long lines and
removing and adding whitespace.

(Bitbake rev: 6d61d7903eb4fb12464bfea54d3a225f99ad394f)

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>
2015-12-18 13:51:53 +00:00
Ed Bartosh 8e4acacb53 bitbake: toaster: check if address:port is in use
Used new management command checksocket to check if
Toaster can listen on address:port.

[YOCTO #8775]

(Bitbake rev: 8a306ffe5a3642fe833c875362a183096a39f641)

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>
2015-12-18 13:51:53 +00:00
Ed Bartosh 847b93596d bitbake: toaster: implement checksocket command
Implemented new management command to check if it's
possible to listen on specified address:port.

[YOCTO #8775]

(Bitbake rev: 0339b90842fd7c878c511b4b89ebcaee9a431bba)

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>
2015-12-18 13:51:53 +00:00
Richard Purdie 522dcaa0cb bitbake: knotty: Improve exception error message
Instead of:
"""
can only concatenate tuple (not "int") to tuple
"""
we now see:

"""
Traceback (most recent call last):
  File "/media/build1/poky/bitbake/lib/bb/ui/knotty.py", line 324, in main
    termfilter.updateFooter()
  File "/media/build1/poky/bitbake/lib/bb/ui/knotty.py", line 210, in updateFooter
    lines = 1 + int(len(content) / (self.columns + 1))
TypeError: can only concatenate tuple (not "int") to tuple
"""

which makes tacking down and fixing the problem much easier.

Also ensure we set an error exit code.

(Bitbake rev: d965bcae6cfd268406a3bd1ef77c5bb6c6e1c6d7)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-18 12:18:19 +00:00
Richard Purdie 01d67bfa77 bitbake: knotty: Fix row/column function return value issue
When the row handling was introduced, one of the callbacks was
missed resulting in:

TypeError: can only concatenate tuple (not "int") to tuple

Fix it.

(Bitbake rev: 0b77cea2bf5b5f5704e2650fb0332f5d78037781)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-18 12:18:19 +00:00
Richard Purdie 6c12efa5c2 bitbake: buildinfohelper: Update for buildstats layout change
This updates buildinfo helper for the recent buildstats layout change

(Bitbake rev: 30311bbe667e9f22de17fae00ff58da06a7c3e23)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-18 12:18:19 +00:00
Christopher Larson 28ea1a1c95 bitbake: fetch: use orig localpath when calling orig method
When a mirror tarball is fetched, the original fetch method is called, which
unpacks the mirror tarball. After the original method is called, it checks the
localpath of the mirror tarball rather than the clone path, which isn't ideal,
particularly if the mirror tarball was removed due to being out of date. We
know the original fetch method will do what it needs to do to get its content
in the form it needs from the mirror tarball, so we can use its localpath
instead.

(Bitbake rev: 1732ad65d6c7d67b7d07cb30c074f5016adadbea)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Awais Belal <awais_belal@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-18 12:18:19 +00:00
Richard Purdie 5cb6d83f17 bitbake: utils: Improve traceback from better_exec internal errors
If you break the internals of better_exec(), you get a very weird
error about tb_next not being a method of None. Fix this by checking
we can step back a trace level.

(Bitbake rev: 1d710ed484f68fca0789022dde7ba877b9a894f5)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-18 12:18:19 +00:00
Richard Purdie 0019edc818 bitbake: ast/event/utils: Improve tracebacks to include file and line numbers more correctly
Currently bitbake tracebacks can have places where the line numbers are
inaccurate and filenames may be missing. These changes start to try and
correct this.

The only way I could find to correct line numbers was to compile as a
python ast, tweak the line numbers then compile to bytecode. I'm open
to better ways of doing this if anyone knows of any.

This does mean passing a few more parameters into functions, and putting
more data into the data store about functions (i.e. their filenames
and line numbers) but the improvement in debugging is more than worthwhile).

Before:
----------------
ERROR: Execution of event handler 'run_buildstats' failed
Traceback (most recent call last):
  File "run_buildstats(e)", line 43, in run_buildstats(e=<bb.build.TaskStarted object at 0x7f7b7c57a590>)
NameError: global name 'notexist' is not defined

ERROR: Build of do_patch failed
ERROR: Traceback (most recent call last):
  File "/media/build1/poky/bitbake/lib/bb/build.py", line 560, in exec_task
    return _exec_task(fn, task, d, quieterr)
  File "/media/build1/poky/bitbake/lib/bb/build.py", line 497, in _exec_task
    event.fire(TaskStarted(task, logfn, flags, localdata), localdata)
  File "/media/build1/poky/bitbake/lib/bb/event.py", line 170, in fire
    fire_class_handlers(event, d)
  File "/media/build1/poky/bitbake/lib/bb/event.py", line 109, in fire_class_handlers
    execute_handler(name, handler, event, d)
  File "/media/build1/poky/bitbake/lib/bb/event.py", line 81, in execute_handler
    ret = handler(event)
  File "run_buildstats(e)", line 43, in run_buildstats
NameError: global name 'notexist' is not defined

----------------

After:
----------------
ERROR: Execution of event handler 'run_buildstats' failed
Traceback (most recent call last):
  File "/media/build1/poky/meta/classes/buildstats.bbclass", line 143, in run_buildstats(e=<bb.build.TaskStarted object at 0x7efe89284e10>):
         if isinstance(e, bb.build.TaskStarted):
    >        trigger = notexist
             pn = d.getVar("PN", True)
NameError: global name 'notexist' is not defined

ERROR: Build of do_package failed
ERROR: Traceback (most recent call last):
  File "/media/build1/poky/bitbake/lib/bb/build.py", line 560, in exec_task
    return _exec_task(fn, task, d, quieterr)
  File "/media/build1/poky/bitbake/lib/bb/build.py", line 497, in _exec_task
    event.fire(TaskStarted(task, logfn, flags, localdata), localdata)
  File "/media/build1/poky/bitbake/lib/bb/event.py", line 170, in fire
    fire_class_handlers(event, d)
  File "/media/build1/poky/bitbake/lib/bb/event.py", line 109, in fire_class_handlers
    execute_handler(name, handler, event, d)
  File "/media/build1/poky/bitbake/lib/bb/event.py", line 81, in execute_handler
    ret = handler(event)
  File "/media/build1/poky/meta/classes/buildstats.bbclass", line 143, in run_buildstats
    trigger = notexist
NameError: global name 'notexist' is not defined
----------------

(Bitbake rev: 1ff860960919ff6f8097138bc68de85bcb5f88b0)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-18 12:18:19 +00:00
Richard Purdie b14ccb2367 bitbake: runqueue: Add support for <task>- syntax
It can be useful to run all tasks up to but not including a specific task. The
main reason this was never added was the lack of a good syntax. This patch
uses the syntax <taskname>- to denote this behaviour which is simple, not
invasive and fits what we need from good syntax IMO, hence we can add this.

(Bitbake rev: 99ccfd411ab3f7baa111f9f3d50fae68816a9a83)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-18 12:18:19 +00:00
Belen Barros Pena 03d715e541 bitbake: toaster: tables Set a default order for the software recipes table
Add default order by recipe name, so that the table content is sorted
when the page loads.

[YOCTO #8791]

(Bitbake rev: 36cc814b64bcf3825ed096ade0b8c590e497259f)

Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-14 23:16:13 +00:00
Ed Bartosh 4ff0d60ea8 bitbake: toaster: rework checking of Django version
Checked django version considering information from
toaster-requirements.txt, e.g. if requirements file contains
line "Django>1.8,<1.9" toaster should be able to check that
requirement correctly.

(Bitbake rev: 49976eca4a6e37e7653814c569badcd3e0fb719a)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-14 23:13:08 +00:00
Ed Bartosh 4a78416943 bitbake: toaster: monkey patch Queryset
Fixed 'database is locked' issue by monkey patching django QuerySet
methods.

The actual patching places were found by bisecting Django codebase.

This commit should be removed after Django is fixed if it's fixed
at all.

(Bitbake rev: 175411bf05423b1892c7928c2b928843b39645f0)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-14 23:13:07 +00:00
Ed Bartosh c1c8eff3f9 bitbake: toaster: removed extra calls of migrate
One manage.py migrate should be enough to apply migrations for
all applications. Extra calls just slow toaster script down.

Removed calls of migrate for orm and bldcontrol apps.

(Bitbake rev: 9299d7fa88e51294c4fd3f1354874d8253d25aff)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-14 23:13:07 +00:00
Ed Bartosh 507aafbd7a bitbake: toaster: work around 'database is locked' error
When sqlite can not cope with a stream of 'insert' queries it throws
'database is locked' exception.

Wrapping model.save in transaction.atomic context and repeating the call
should solve this issue.

(Bitbake rev: eb305308ca8f6228c6f52dac1bd941f29c7e5eb6)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-14 23:13:07 +00:00
Ed Bartosh 322b4709d8 bitbake: toaster: fixed format strings
Printing id as a number breaks toaster if object is not saved
yet as id/pk is None in this case.

Changed format spec to print id as a string in __str__
and __unicode__ methods of Build, Task and LayerVersion models.

(Bitbake rev: d5ca2bae623db214764324da5c9e4dac6beef760)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-14 23:13:07 +00:00
Ed Bartosh 84daa40bc7 bitbake: toaster: use OneToOneField instead of ForeignKey
Used OneToOneField to reference BuildRequest in BRBitbake model.

Fixed django warning:
WARNINGS: Setting unique=True on a ForeignKey has the same effect
          as using a OneToOneField.

(Bitbake rev: aaa4319ebbb06facb77b4ba936cf3aa2068ff238)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-14 23:13:07 +00:00
Elliot Smith c464f34d5b bitbake: toaster: Amend regex for MySQL database URLs
The database URL detection doesn't admit a MySQL URL without a port.

As this is a common case (e.g. you would set the HOST to a mysql.sock
path if pointing at a local MySQL server, with no port setting),
amend the regex so it will correctly recognise paths, as well
as HOST:PORT URLs.

(Bitbake rev: 89386aab888f806d5aa4a8083c06566e48d9445b)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-14 23:13:07 +00:00
Elliot Smith f001a4ac3c bitbake: toaster: Remove compatible_layerversions() method
Remove compatible_layerversions() and replace calls to it with
calls to get_all_compatible_layer_versions().

The sorting done in compatible_layerversions() is not relevant,
and the code can be simplified by using get_all_compatible_layer_versions().

[YOCTO #8364]

(Bitbake rev: 7bca51277314f7c0b6ee0e0d470327dfd60d37fe)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-14 23:13:07 +00:00
Elliot Smith 0adffdf790 bitbake: toaster: Check Django version against toaster-requirements.txt
Instead of hard-coding the required Django version in the start
script, look it up from the toaster-requirements.txt file.

[YOCTO #8364]

(Bitbake rev: 2149ff805424692f9fde29618f2ae0eb99f710d2)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-14 23:13:07 +00:00
Elliot Smith 8d058cfb8f bitbake: toaster: Update deprecated manage.py command
syncdb is deprecated in favour of migrate in Django 1.7:
https://docs.djangoproject.com/en/1.8/releases/1.7/#schema-migrations

Update to the "migrate" command in Toaster's start script.

[YOCTO #8364]

(Bitbake rev: 7ff1630574180e1895b90ecef1ea0caf51304446)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-14 23:13:07 +00:00
Elliot Smith 717c636d71 bitbake: toaster: Prevent deprecation warnings for RedirectView
The API for RedirectView is due to change in Django 1.9, which
means that Toaster generates deprecation warnings.

Set the "permanent" flag when constructing RedirectView instances
to prevent this warning.

[YOCTO #8364]

(Bitbake rev: 4aa09488bfe65cb365356b320cd9865643bb4fe5)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-14 23:13:07 +00:00
Elliot Smith 0f602c1a22 bitbake: toaster: Update API used to make runbuilds methods run in transactions
runbuilds previously had its methods decorated with
transaction.commit_on_success, which is now deprecated. transaction.atomic
is an (almost) drop-in replacement for this, so use this instead.

[YOCTO #8364]

(Bitbake rev: c4804b84eaaef6a81027bae5cf8bfe63d949c293)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-14 23:13:07 +00:00
Ed Bartosh 93f573836c bitbake: toaster: rename get_query_set -> get_queryset
Renamed get_query_set to get_queryset as get_queryset causes
deprecation warning in Django 1.7 and is deprecated in Django 1.8

(Bitbake rev: ef8b399dccd413070e32ce05e013337ea01fa64d)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-14 23:13:06 +00:00
Elliot Smith 23c48065d2 bitbake: toaster: Start Django machinery for database access
buildinfohelper, with the new import paths for our Django models
and Django 1.8, was not getting an active connection to the database.

In buildinfohelper, call django.setup() explicitly to make sure
that the database connection is ready and models can be queried
and saved.

[YOCTO #8364]

(Bitbake rev: 671aaab8cb7c494cd5c7621b45a6f41a203d8bb5)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-14 23:13:06 +00:00
Elliot Smith 7a0c45e478 bitbake: toaster: Create default project with get_or_create* method
Rather than maintain data as part of the migrations (as was
done for the default project previously), create the default
(cli builds) project on demand as a by-product of getting
it from the database.

[YOCTO #8364]

(Bitbake rev: 5fd8e90ab9b81d1bd0d301bc1c91228ecbbea74b)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-14 23:13:06 +00:00
Ed Bartosh 9de8dfa11a bitbake: toaster: Fix references to app paths
The buildinfohelper runs outside of Django, but still needs
access to our Django app classes.

Previously, the imports referenced the toaster.* app, which worked
fine. But in Django 1.8, this causes an error about the same
module being loaded multiple times from different paths.

Change the paths to our Django modules so they don't cause
this error to be thrown. We can do this as we've added our
application libraries to sys.path in the buildinfohelper anyway.

[YOCTO #8364]

(Bitbake rev: 070da64cf32c32b5ffc34d611b463c3a3960b419)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-14 23:13:06 +00:00
Ed Bartosh 535fc9b6fb bitbake: toaster: Remove South migrations
South has been deprecated in favour of Django's own migration framework,
so remove the old South migrations and replace them with Django ones.

[YOCTO #8364]

(Bitbake rev: 427d8bc02d1aa00a19057602d592d58334514804)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-14 23:13:06 +00:00
Elliot Smith 8ca46641ef bitbake: toaster: Upgrade to Django 1.8.6 and remove South
Upgrade Django to long-term support version.

Django now provides its own migration framework, so remove
requirement for South.

[YOCTO #8364]

(Bitbake rev: 648b62654c52116451c6a68a46d7264db3a34d09)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-14 23:13:06 +00:00
Ed Bartosh b322dec016 bitbake: toasterui: process SetBRBE event
Currently BRBE is known to toasterui only when build is
started. It's passed to it with BuildStarted event. This is
too late as if build fails earilier than build starts toasterui
can not inform Toaster about the failure.

Set BRBE as soon as it's provided by Toaster.
This should make toasterui to be able to inform Toaster
about early build failures, e.g. failures during recipe parsing.

(Bitbake rev: d7819508dac488a64be3caec88db285cda9599ab)

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>
2015-12-14 23:13:06 +00:00
Ed Bartosh 0274b68450 bitbake: toaster: trigger SetBRBE event
Triggered MetadataEvent "SetBRBE" when TOASTER_BRBE variable
is set on bitbake server. This should make buildinfohelper
aware of the build request id, which is used to properly
report build status and failures back to Toaster.

(Bitbake rev: 8b136fb093020bc912a7b21d5163e1cd5fb12124)

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>
2015-12-14 23:13:06 +00:00
Ed Bartosh fdb8e7433c bitbake: toaster: implement BitbakeController.triggerEvent
This API will be used to pass data from Toaster to
toaster_ui and buildinfohelper.

(Bitbake rev: 6dca6fd47c5e8d66687fb07177e98cd531cd971d)

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>
2015-12-14 23:13:06 +00:00
Richard Purdie 5de3800c30 bitbake: event: Fix subprocess event error traceback failures
If subprocess raises a CalledProcessError() error, e.g. from a call
like subprocess.check_call("false"), bitbake would try and pass the
object over IPC and fail, leading to an unusual error:

('__init__() takes at least 3 arguments (1 given)', <class 'subprocess.CalledProcessError'>, ())%

To avoid this, we turn the value into a string which prevents the
issues the IPC has trying to deal with the object (for the same reason
we deal with tracebacks here too).

[YOCTO #8752]

(Bitbake rev: 05695424b918fc81b16cbac70d79d8271a0b6045)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-14 23:13:06 +00:00
brian avery 7e8ff7b9d7 bitbake: toaster: toasterui Add ParseStarted/ParseProgress events to mask
Toaster is not able to see ParseStarted and ParseProgress events
for command-line builds. This means it's not possible for Toaster
to detect failed builds, if the failure occurs at a point before
the BuildStarted event, as the build won't show up at all.

Add these events to the event mask, so that Toaster's toasterui
can detect and respond to them.

(Bitbake rev: 16bfd3e3d145705a2b3a05648ddbcacc7a338dfa)

Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-09 09:03:35 +00:00
Richard Purdie f9384b0669 bitbake: knotty: Enforce terminal line limit to stop crazy scrolling
If there are more tasks running than there are lines on the terminal, the data
scrolls in ways the UI wasn't designed for. This patch adjusts the UI just to
show the processes which fit onto the number of rows in the terminal window.
You can see the total number running from the counter in the top left as usual
and this makes warning and errors messages scrolling from the top of the window
work as designed.

Ultimately, scrolling would be nice but is for another time, this fixes the
biggest UI issue on highly parallel machines.

(Bitbake rev: 67b77658e2bfa849f6f55c9c262cb11d6bfdb399)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-08 10:31:48 +00:00
Alexander Kanavin 3745479596 bitbake: bitbake: rename REGEX, REGEX_URI, and GITTAGREGEX.
Rename REGEX to UPSTREAM_CHECK_REGEX, REGEX_URI to UPSTREAM_CHECK_URI, and
GITTAGREGEX to UPSTREAM_CHECK_GITTAGREGEX to better reflect their purpose
and to reflect a common namespace.

(Bitbake rev: f0a9e783f9969573fd74edfa241ef14f18ac684e)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-08 10:20:31 +00:00
Ed Bartosh dd282d475c bitbake: toaster: return back 'New project' button
The button was removed by mistake in merging modes patchset.

(Bitbake rev: f7b33a95b5d53973bc673373bdd2652f4d32f0c2)

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>
2015-12-07 17:39:08 +00:00
Mihail Stanciu 2a8e970d42 bitbake: toaster: tests Update UI tests to work with 2.0 changes
Update tests that were referencing items removed in 2.0.

Update most xpath elements left to use IDs.

(Bitbake rev: c4dda67dd3773d02b760d96dd9c6f26bff93533d)

Signed-off-by: Mihail Stanciu <stanciux.mihail@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-07 17:39:08 +00:00
Mihail Stanciu fe8a0a3697 bitbake: toaster: tests Automated build-mode backend tests
Add tests to check various backend scenarios that
require UI interaction.

Add necessary files for above tests (the sqlite file
and the default config json).

(Bitbake rev: 8dcad75ad1d9b8adddeca57e996b8d904b209df5)

Signed-off-by: Mihail Stanciu <stanciux.mihail@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-07 17:39:08 +00:00
Ed Bartosh 0497b570e5 bitbake: toaster: unset environment variables
Toaster script sets environment variables when it starts.
It makes sense to unset them when toaster stops as they can
cause other programs to behave incorrectly.

(Bitbake rev: 7a2e9745ff3ef6d6360f74b222248d4bd35e6a08)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-07 17:37:11 +00:00
Ed Bartosh 8b7a548e30 bitbake: toaster: get rid of complicated heuristics
Removed buildinfohelper code which was trying to guess layer version of
the recipe using build request information. The code caused creation of
duplicated recipes as it resulted in layer version from layer index
instead of returning build layer version. As a result of this Toaster
UI was not showing any information about recipes.

Default approach used to find layer version seems to work much better as
it finds proper layer version. Now toaster will use it as the only
way to find layer version.

(Bitbake rev: 101690bda7ad55dc0657483233c90c374713755b)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-07 17:37:11 +00:00
Ed Bartosh 556b8b6156 bitbake: toaster: remove SDKMACHINE from project variables
Removed SDKMACHINE from predefined set of variables
for the project as it causes bitbake build error:
   SDKMACHINE is set, but SDK_ARCH has not been changed as a result

This variable does not need to be predefined as it's not used by
toaster.

It's still possible to specify it in project configuration
if needed. SDK_ARCH variable should be set too to avoid above
mentioned build failure.

(Bitbake rev: a6ab2a38ab666376b4a5e796d3a88929e8cbfb22)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-07 17:37:11 +00:00
Ed Bartosh 4186f5b04e bitbake: toaster: stop using toaster-pre.conf
This file is not needed anymore as toaster UI doesn't
write variables to it. It sets them directly on bitbake
server.

(Bitbake rev: 624240460ec32af918dcea8c04a913e3b94e012b)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-07 17:37:10 +00:00
Ed Bartosh 361faa3e6c bitbake: toaster: remove writeConfFile API
This API is not used anymore as toaster doesn't write variables
to configuration files anymore. It sets variables through its
connection to bitbake server.

(Bitbake rev: 6dda2916b75d688874d208192d5c7cdb302eec35)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-07 17:37:10 +00:00
Ed Bartosh fcbba5a89b bitbake: toaster: set varibales on bitbake server
Set project variables using connection to bitbake server
instead of writing them to toaster configuration files.

This is a way to avoid rewriting configuration files before
and after every build, triggered by toaster UI.

(Bitbake rev: 3f77c69b867735b5d27c6ab7c62e39ac8d5cb2b5)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-07 17:37:10 +00:00
Ed Bartosh 993bc7eacd bitbake: toaster: implement BitbakeController.getVariable
Added new API to get value of bitbake variable from bitbake server.
The API will be used to update INHERIT variable instead of writing
it to the toaster configuration files.

(Bitbake rev: effc371e3a4a2262e53e9e560c7c08cffad195da)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-07 17:37:10 +00:00
Michael Wood 53e981e583 bitbake: toaster: buildinfohelper Broaden the toaster created recipe data case
When build information is the 'original' source of the information we
need to return the recipe that was created rather than the copy of the
recipe that is taken for keeping build history. We do this already for
command line triggered builds, but we also have this case for custom
images. We can simply check if the built_recipe exists instead of
special casing this.

(Bitbake rev: 9a8653bf602b2111dee7ee6a459682a68a695b22)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-07 17:37:10 +00:00
Ed Bartosh 57e5f24e57 bitbake: toaster: do not create duplicate HelpText objects
buildinfohelper code expects only one HelpText object per
build/variable/description.
Current code creates more than one such an object, which causes
toastergui to crash with this exception:
 MultipleObjectsReturned: get() returned more than one HelpText -- it returned 2!

Used git_or_create API to ensure that only one HelpText object is
created.

(Bitbake rev: e9b46803eb6f1f4044919abf90c8aeb3536e73ed)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-07 17:37:10 +00:00
Ed Bartosh 4c1e5ec29a bitbake: toaster: remove usage of BUILD_MODE variable
As both modes can be used at the same time we can't have any
difference in UI between modes.

Removed all conditional statements that used BUILD_MODE.

(Bitbake rev: 4ce1559c2558bd0fd278ff02a1a93bec03c4156b)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-07 17:37:10 +00:00
Ed Bartosh 990289511b bitbake: toaster: do not terminate bb server
Toaster needs bb server to be running all the time due
to merged analysis and managed modes. Server gets restarted
before every build triggered by UI, but it shouldn't be
terminated as it will influence command line builds.

[YOCTO #8279]

(Bitbake rev: e69c87c7842e796ffcd7193ecde22c8f688498f5)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-07 17:37:09 +00:00
Ed Bartosh 58765a8719 bitbake: toaster: remove stopBBServer API
Removed stopBBServer API from build controller as toaster
doesn't stop bitbake server anymore. It's reused for both
types of builds: triggered by UI and started manually.

(Bitbake rev: 0cad802da171d51814f22cc9383f496a63cd0c75)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-07 17:37:09 +00:00
Ed Bartosh 95a3cf7549 bitbake: toaster: reimplemented startBBServer method
Rewritten LocalhostBEController.startBBServer to use
'toaster restart-bitbake' and read bitbake port number from
bitbake.lock.

Removed complicated logic of running oe-init-memres and looking for
bitbake port number in the logs.

(Bitbake rev: 4b065353c3454923a1ef88e9f0a8702e5626060e)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-07 17:37:09 +00:00
Ed Bartosh 76d53b5856 bitbake: toaster: remove _setupBE function
This function is not needed as build environment is always created
because of the new way to run Toaster. It can be only sourced after
oe-init-build-env is sourced.

(Bitbake rev: 27a59b4373a449f17e46ab93e0eba15cf75967ae)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-07 17:37:09 +00:00
Ed Bartosh 87b2f954b9 bitbake: toaster: implement 'toaster restart-bitbake'
This implementation allows to have functionality of restarting
bitbake in toaster script. It can be used by toaster script and
build controllers.

[YOCTO #8279]

(Bitbake rev: 24cd26b39014419d883b7cf45e4943c301d585cc)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-07 17:37:09 +00:00
Ed Bartosh 891484ada9 bitbake: toaster: implement start_bitbake function
Separated functionality of starting bitbake server and observer
processes.

This functionality will be used by build controllers to restart
bitbake processes.

(Bitbake rev: d8e9ce7ba3f5b89c51e769bd4a46c2026a110d40)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-07 17:37:09 +00:00
Ed Bartosh bf25471341 bitbake: toaster: implement stop_bitbake function
Separated functionality of stopping bitbake server and observer
processes.

This functionality will be used by build controllers to restart
bitbake processes.

(Bitbake rev: dd40d70b707a3ff59edfa69923d4d9b671928a66)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-07 17:37:08 +00:00
Ed Bartosh 7c2b22556b bitbake: toaster: update brbe and project attributes
Updated attributes of buildinfohelper object as they can
be changed for every build. For example brbe is set by
runbuilds for every build triggered by Toaster UI.

(Bitbake rev: ea3bc8d01704dc64f6cb7b4f5fe66c312a575174)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-07 17:37:08 +00:00
Ed Bartosh de812d086e bitbake: toaster: start 'manage.py runbuilds' in the script
Running runbuilds machinery in background allows Toaster to
start builds initiated by toaster UI.

Added runbuilds pid file to the list in webserverKillAll to
kill runbuilds the same way as runserver process.

(Bitbake rev: 91bf323e873c31d883b01ea993c005f45382e83f)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-07 17:37:08 +00:00
Ed Bartosh 28e8ccf437 bitbake: toaster: make runbuilds to loop
Made runbuilds to loop to avoid having a loop in shell code and
initialize heavy Django init machinery every second.

Ignored exceptions to prevent exiting a loop.

(Bitbake rev: e04da15556ca0936de652b8c085e4199e5551457)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-07 17:37:08 +00:00
Ed Bartosh a3871a37de bitbake: toaster: use parent of the build dir
Assigned TOASTER_DIR to the parent of the build directory.
This should fix local controller crash as it assumes that
TOASTER_DIR is a root of local poky and tries to clone it.

(Bitbake rev: 124eb2bb15de18e4d2d6483c3549e1d887234736)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-07 17:37:08 +00:00
Ed Bartosh 2a96d35893 bitbake: toaster: check for toaster configuration later
Moved check for toasterconf.json after check of build environment.
We'll need some variables from build environment to find toasterconf.json
better way.

(Bitbake rev: a4f6809237dffb1abff78c6a8c82bcc4852aedfa)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-07 17:37:08 +00:00
Ed Bartosh d87a5346cf bitbake: toaster: remove unused variable
Removed variable RUNNING as it's not used anymore
in the toaster script.

(Bitbake rev: 187c31a8789c37723b9288afd35f1785f1993895)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-07 17:37:07 +00:00
brian avery dc6a489c65 bitbake: toaster: change toasterconf.json logic to use TEMPLATECONF, like oe-setup-builddir
This changes the way we pick a toasterconf.json file so that it
matches the way oe-setup-builddir does it. We now base it on TEMPLATECONF
found in the .templateconf file.

(Bitbake rev: 8476db82ea80edf2b70bc2082bcecee09037556d)

Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-07 17:37:07 +00:00
Ed Bartosh 5a42c2d050 bitbake: toaster: run bitbake the same way
Run bitbake in toaster script the same way as it's run
by localbuildcontroller.

(Bitbake rev: c5d5da095d5eace03f8a50910f5a60ab35acbb1a)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-07 17:37:07 +00:00
Ed Bartosh cac91db01d bitbake: toaster: set DATABASE_URL in toaster script
Set environment variable DATABASE_URL in bitbake/bit/toaster
Variable value is obtained by running 'manage.py get-dburl'

(Bitbake rev: ac4800cc8b765b270f27ea9a5938f3f2a2e0ced4)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-07 17:37:07 +00:00
Ed Bartosh a464bf23b4 bitbake: toaster: implement get-dburl command
Implemented management command to call getDATABASE_URL API.
It will be used to get database url from toaster shell script
by running 'manage.py get-dburl'

(Bitbake rev: fabe9c8f14fd7b8ab204a2b610c64ac5b62135ac)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-07 17:37:07 +00:00
Ed Bartosh e4731514f8 bitbake: toaster: don't allow to run toaster as a script
Removed support of starting toaster as a script.

Sourcing a toaster script becomes the only way to start it.
It's consistent with the way oe build system is started by sourcing
oe-init-build-env. It also returns user back to shell, so user can
continue running builds without having to open new terminal window.

[YOCTO #8279]

(Bitbake rev: 7e8632c0527245c1474e487dd9a972948e794471)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-07 17:37:07 +00:00
Paul Eggleton 4de214f752 bitbake: lib/bb/utils: improve edit_bblayers_conf() handling of bblayers.conf formatting
Make the following improvements to edit_bblayers_conf():

* Support ~ in BBLAYERS entries
* Handle where BBLAYERS items are added over multiple lines with +=
  instead of one single long item

Also add some comments documenting the function arguments and return
values as well as a set of bitbake-selftest tests.

(This function is used by the bitbake-layers add, remove and
layerindex-fetch subcommands, as well as devtool when adding the
workspace layer).

(Bitbake rev: e9a0858023c7671e30cc8ebb08496304b7f26b31)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-07 17:01:21 +00:00
Paul Eggleton 0debb11883 bitbake: lib/bb/utils: fix error in edit_metadata() when deleting first line
If you tried to delete the variable on the first line passed to
edit_metadata() this failed because the logic for trimming extra blank
lines didn't expect the list to be empty at that point - fix that bad
assumption.

(Bitbake rev: 8bce6fefdc5c046b916588962a2b429c0f648133)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-07 17:01:21 +00:00
Alexander Kanavin 9d19dd9bd7 bitbake: wget.py: parse only <a> tags
For two reasons:
1) The important one: we hit the following bug when doing upstream version checks
on some webpages:
https://bugs.launchpad.net/beautifulsoup/+bug/1471755

2) Also, documentation for beautifulsoup states that memory usage and
speed is improved that way.

(Bitbake rev: 7546d4aeb3ba8fda9832081b84d93138dc5e58d6)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-07 17:01:21 +00:00
Michael Wood 71ede7b689 bitbake: toaster: toastergui tests Add generic test for ToasterTables widget
For each of the ToasterTables defined test:
 - Data returned
 - Search
 - Order by
 - Limit
 - Paginate
 - Filter

These tests test that the functions on all tables work, it does not
validate the content of the data in the tables themselves, this needs
to be done in table specific tests.

(Bitbake rev: 649d563f95ffc57d0fe3dbf494e7dbffcc99a1b4)

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>
2015-12-07 17:01:20 +00:00
Michael Wood 34b22cf897 bitbake: toaster: tables Fix invalid field name on NewCustomImagesTable
Correct the field name in the NewCustomImagesTable as it is a Recipe
object it's self and not a container.

(Bitbake rev: ebd1c493d8b7fb9ee7b3e40c17165dc9c22ca795)

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>
2015-12-07 17:01:20 +00:00
Michael Wood 1c59846fc0 bitbake: toaster: tables Add default_orderby field where it was missing or unset
This value is used to set the default ordering of the model that is used
for ToasterTables, it is picked up client side to set the ordering
indicator.

[YOCTO #8695]

(Bitbake rev: f1c91bff810a579b169c46b7710e22f5553b484e)

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>
2015-12-07 17:01:20 +00:00
Michael Wood d82c541147 bitbake: toaster: CustomImageRecipe add search_allowed_fields to this model
In order to search the model from the UI some fields must be nominated
as searchable.

(Bitbake rev: 2558729b4c248a2fa5a11d877bc42cb05a30602e)

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>
2015-12-07 17:01:20 +00:00
Michael Wood bdf62414f2 bitbake: toaster: machines table Fix missing layers information needed for filter
The current layers information wasn't being passed to the template for
the Select/Add button for the Compatible machines filter.

(Bitbake rev: 559102984d3f62a7675899e058166bdf4d552c46)

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>
2015-12-07 17:01:20 +00:00
Michael Wood b90a8dca99 bitbake: toaster: tablejs Make sure click handlers consume click event
Avoid the click event from propagating and causing strange side effects
in toaster tables.

[YOCTO #8527]
[YOCTO #8148]

(Bitbake rev: f23e54292a673b2fd3f17d317c21984c753727c7)

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>
2015-12-07 17:01:20 +00:00
Michael Wood c075bcf545 bitbake: toaster: projectpage Make sure build targets are space separated
Make sure the build targets are space separated when building multiple
targets. Also fix error path now that YOCTO #7995 is resolved.

[YOCTO #8450]

(Bitbake rev: e9719eb2e8249f0d10b39bfdd4aef563368b5ffd)

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>
2015-12-07 17:01:20 +00:00
Belen Barros Pena 88f9310ce0 bitbake: toaster: builds pages Fix the download cooker log link
The 'all builds' page was missing the download icon next to the outcome
icon, which allows you to download a build log from the 'all builds' page.

This patch brings it back. It also adds a check in the project builds page
to make sure the download icon only appears if the build generates a cooker
log, since builds that fail at the build request stage do not generate a
cooker log.

(Bitbake rev: 50d7ffa697764d84d96f26a3ae58a9dacde7b31e)

Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-11-16 11:55:08 +00:00
Belen Barros Pena d04af8b571 bitbake: toaster: project pages Link to image recipes table in notifications
The project created notifications and the 'Choosea recipe to build' link in
the project page are linking to the software recipes table. Changes them to
link to the image recipes table instead, which is bound to be more useful.

(Bitbake rev: 10e1fbee0d79dbbf15b89ebc155bb2c0092a71f2)

Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-11-16 11:55:08 +00:00
Ke Zou 70465c717a bitbake: toaster: tests: Re-write some cases to make them more maintainable
(Bitbake rev: c3c7e94cadb3a3a2d8ef33ed456f439c106018c1)

Signed-off-by: Ke Zou <ke.zou@windriver.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-11-16 11:55:08 +00:00
Richard Purdie 536b73f55f bitbake: data_smart: Only support lowercase OVERRIDES
Our current OVERRIDES handling means we end up caching and checking for
a lot of possible override combinations which turn out to very unlikely.
A typical example is the SRC_URI variable where we have to check if
"URI" is an override. Having spent many hours working in this code, I've
realised all the actual overrides we use are lower case and our standard
variables are mostly uppercase.

This means we could gain quite some speed advantage if we write this
into the code, that overrides only consist of lowercase characters. This
patch shows how simple this is and the resulting speed gains are
significant. This is a significant change but tests show we don't appear
to have any users of capitals in overrides in any OE-Core metadata.

Before "time bitbake -p":

real	2m4.224s
user	7m32.312s
sys	0m7.116s

After "time bitbake -p":

real	1m26.009s
user	5m10.484s
sys	0m4.640s

This check could also be made conditional however I'm not seeing a need
to do that at present.

(Bitbake rev: c9b9443faa76ee7366b1400a56f826f3f9dec1be)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-11-16 11:55:08 +00:00
Richard Purdie fb01a66f48 bitbake: fetch2: Remove crazy code in unpack
This looks reasonable until you realise self.localpath is a function. Data
expansion of something which isn't a string is the original value so this
code just wastes CPU cycles and makes no sense. Remove it.

(Bitbake rev: 37214ea9bf484998b75dbc1200d53f1afc5257ed)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-11-16 11:55:08 +00:00
Richard Purdie 7db88aa67d bitbake: parse: Don't try to expand __base_depends/__depends
Trying to expand a variable which isn't a string doesn't make sense.

(Bitbake rev: 62367cca1f1793eb9827406bcdd5980fdeb80a60)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-11-16 11:55:07 +00:00
Richard Purdie 4c04ce0576 bitbake: cache: Don't try to expand __inherit_data
Trying to expand a variable which isn't a string doesn't make sense.

(Bitbake rev: 54d0ddd166a6707b4f8c8535639e3055b783363b)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-11-16 11:55:07 +00:00
Elliot Smith 9d8e36a6c9 bitbake: toaster: localhostbectrl Pass DATABASE_URL in via the process environment
Instead of putting the DATABASE_URL as part of the command for launching
the bitbake observer process set it as part of environment.

This fixes two issues 1. Where the value isn't quoted and therefore will be
interpreted in the shell and 2. Anyone being able to see the value of
DATABASE_URL in the process tree.

[YOCTO #8669]

(Bitbake rev: 832a8523067606b180c02f0d1544e8a23219bb08)

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>
2015-11-16 11:55:07 +00:00
Michael Wood 4677d8b4fb bitbake: toaster: Remove the new-build-input button widget
The button required a lot of state maintenance to make sure it
showed up when the project was configured properly, showed correctly
according to the projects known to Toaster, displayed correctly
according to the mode Toaster was in, and was able to be
used to change the current project.

(Bitbake rev: b644514a96f3947ad3f307a26301c064c8ae18f8)

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>
2015-11-16 11:55:07 +00:00
Michael Wood 55f44943d7 bitbake: toaster: projecttopbar Use the project in context to get num builds
Use the project in the template context rather than ajax request to get
the number of ended builds.

(Bitbake rev: 1f6bfa876b17a600fc83c789af8aaa2639a463b2)

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>
2015-11-16 11:55:07 +00:00
Michael Wood e9d4962a0c bitbake: toaster: projectpage Disable/Enable build input if we have 0 layers
If we've removed all the layers in the configuration, disable the build
button and build input.

(Bitbake rev: 872bd5ccf58236f5146b1640cc1c465b58371e44)

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>
2015-11-16 11:55:07 +00:00
Michael Wood 5fa4c73603 bitbake: toaster: orm Fix get_number_of_builds to count all apart from IN_PROGRESS
The count of a project's builds should not include those which are
currently in progress.

(Bitbake rev: a981700701c41c7bbb6a9778e95f691278c5c294)

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>
2015-11-16 11:55:06 +00:00
Richard Purdie c4032f479e bitbake: codeparser: Only load the codeparser cache once
The server state gets reset multiple times during startup and currently
we reload the codeparser cache each time. This is pointless and causes
unnecessary interaction time with bitbake.

(Bitbake rev: 4f700316933e8e7b2d27366e5ce6176895b913e7)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-11-16 11:55:06 +00:00
Elliot Smith a0791c19db bitbake: toasterui: Create per-build logs
Rather than relying on bug 8411, which is conveniently creating
separate log files for each of our builds, create our own
log file for each build.

The log files are created in the same tmp directories that
bitbake users, but are timestamped to the millisecond to avoid
name collisions.

Each log file is opened on a ParseStarted event (for builds
triggered by Toaster) or BuildStarted event (for builds on the
command line: Toaster doesn't get the ParseStarted event
for command-line builds).

The log file is closed on the BuildCompleted event, or if the
build fails.

Because we start logging on ParseStarted for Toaster builds,
we're able to capture the "Build Configuration" section which
bitbake writes to output.

[YOCTO #8373]

(Bitbake rev: 7974203cd8bc66dff1fcc55f8723dedefaf72840)

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>
2015-10-29 22:05:36 +00:00
Richard Purdie 290534d3ff bitbake: build/utils: Add BB_TASK_IONICE_LEVEL support
Similarly to BB_TASK_NICE_LEVEL, add BB_TASK_IONICE_LEVEL which allows the ioprio
of tasks to be adjusted. This is in response to various qemu runtime timeouts
which have been witnessed on the autobuilder, seemingly due to IO starvation (we
already use NICE_LEVEL to adjust tasks). This has a fairly urgent need to deal
with certain 'random' failures we're seeing on the autobuilders in testing.

The format of the data in the variable is BB_TASK_IONICE_LEVEL = "<class>.<prio>".

For <class>, 2 is best effort (the default), 1 is real time and 3 is idle. You'd
need superuser privileges to use realtime. The <prio> value is a default of 4,
and can be set between 0 and 7 with 7 being lowest priority and 0 the highest.
The user can set this freely with normal privileges

Note that in order for this to take effect, you need the cfq scheduler selected
for the backing block device.

We could use nice wrapper functions for ioprio from modules like psutil however
that would complicate bitbake dependencies. This version has some magic numbers
but works on the main 32 and 64 bit x86 build architectures and can easily be
extended if ever needed. When we move to python 3.x, we can likely replace this
with standard calls.

(Bitbake rev: b9471ad147b102c45d65f5ffd9521864df7ff9c1)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-29 07:35:52 +00:00
Richard Purdie 3ebf7617d6 bitbake: cooker: Ensure BB_CONSOLE remains correct over server resets
The console log data is written to is created at console initialisation
time and does not change over reset events. This ensures the
BB_CONSOLELOG value is correct over such resets by preserving it.

(Bitbake rev: 335eb2db228f7543a49de71f063ac72b865c947a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-29 07:35:52 +00:00
Richard Purdie 5b19b71252 bitbake: bb/ui: Use getSetVariable command for BB_CONSOLELOG
Metadata can define BB_CONSOLELOG as containing ${DATETIME} and
this can get expanded to a different value each time the variable
is read. In the case of BB_CONSOLELOG, this behaviour is not
desireable.

The values of DATE/TIME are locked down at build time but this is too
late for the purposes of ensuring the system can figure out the real
value of BB_CONSOLELOG.

The best way to do this is to set the variable into the datastore, thereby
preserving its value.

[YOCTO #8411]

(Bitbake rev: 021f2eb55ab5863b57ed1b3f19f1b329bc1ad477)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-29 07:35:51 +00:00
Richard Purdie acc7b4d931 bitbake: command: Add getSetVariable command
There are some use cases where we want to read a variable but also
set the variable to the value read, effectively locking in any
expansion of it. This adds such a command.

(Bitbake rev: 0c0c524691e3d2ffd9953a106fcc06262cbde910)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-29 07:35:51 +00:00
Scott Rifenbark c8051c52a4 bitbake: bitbake-user-manual: Added new description for BB_TASK_IONICE_LEVEL
Added a new variable description here for this variable.

(Bitbake rev: 4e0da1ef4a58a7ba4b92d4e07ef79cf7bd90abf0)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-29 07:35:51 +00:00
Scott Rifenbark 183290a9d4 bitbake: bitbake-user-manual: Added BBTARGETS variable description.
(Bitbake rev: 0f0c205b9d6c24bee334eabb359973e0368ce931)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-29 07:35:51 +00:00
Belen Barros Pena 66d3c353f8 bitbake: toaster: templates Add meaningful title tags
Our title tags are all over the place, and have no relation to the page
content. This commit adds a meaningful title tag to each Toaster page.

(Bitbake rev: 1ab8827d684a19a70f3b788aed2327bf30edffe2)

Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-29 07:32:10 +00:00
Michael Wood 62e200e3e3 bitbake: toaster: orm Fix restrictive LogMessage message length
Log messages can be quite long so use a TextField rather than a char
field with max length of 240. mySQL is especially picky about field
lengths and will cause an exception if the log is too long.

[YOCTO #8475]

(Bitbake rev: 349119f44cdad240dda7f4db45992e2539e1416f)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-27 07:24:31 +00:00
Elliot Smith 78f935df8f bitbake: toaster: Remove all navigation when not in build mode
The user is redirected to the all builds page or all projects
page from the landing page, regardless of mode.

In build mode, this makes sense; but in analysis mode, we are
restricting the view to just the cli builds project. This means
that "all projects" and "all builds" only contains items relating
to this one project.

Modify the landing page so it redirects to the project builds page
for the cli builds project when not in build mode. Also remove
navigation elements which are irrelevant when not in build mode.

[YOCTO #8514]

(Bitbake rev: ae754655fa1bc5168f43e8821773e7b7b9440a5d)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-27 07:24:31 +00:00
Elliot Smith c5f147b4ab bitbake: toaster: Run tests in build mode
Now that the UI content is conditional on whether BUILD_MODE
is active, modify the existing tests so that they run in
this mode by default.

[YOCTO #8514]

(Bitbake rev: 991712f3f88759e2d68af5a3fe83c1395c4f67f6)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-27 07:24:31 +00:00
Elliot Smith 1d17109d62 bitbake: toaster: Hide builds for non-cli projects in analysis mode
The "latest builds" sections of the "all builds" page
show builds for all projects. This is not appropriate
for analysis mode, where we can only affect the command-line
builds project.

Modify the "latest builds" section to only show builds for
the command line builds project if in analysis mode.

Also rationalise where we get the queryset of latest builds from:
we have a _get_latest_builds() function which was being used
to get the latest builds in most places, but not all.

Also modify _get_latest_builds() to sort by started_on, rather
than primary key, as assuming that a higher primary key value equates
with later start time is incorrect.

[YOCTO #8514]

(Bitbake rev: 52de2c8cd11fa743f8fd7cb0cf776eea622ac474)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-27 07:24:31 +00:00
Elliot Smith a580479452 bitbake: toaster: Hide top bar buttons in analysis mode
The "new build" and "new project" buttons are irrelevant in
analysis mode, as you can't start a build or a project.

Hide these buttons if not in BUILD_MODE.

[YOCTO #8514]

(Bitbake rev: b1858653c22eb6d51fc23f75ccad69b76523eb41)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-27 07:24:31 +00:00
Elliot Smith 1ec2ec3429 bitbake: toaster: Show mode-appropriate landing page
The same landing page is shown for both analysis and
build modes. This means that users in analysis mode can see
options which are not available or broken in that mode.

Modify the landing page template to show a simple "run a build"
message if the user is in analysis mode and has no builds yet.

Also clean up the landing page HTML, because the indentation was
a mess and the HTML was invalid.

[YOCTO #8514]

(Bitbake rev: 86b4a10cc817abb5e3e63360dc8b3c550337f17c)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-27 07:24:31 +00:00
Elliot Smith bbac0f092a bitbake: toaster: Add BUILD_MODE flag to context
We set a TOASTER_MANAGED env variable in the startup script,
which has a value of "1" if Toaster should run in build mode.

Add a BUILD_MODE variable to settings.py which is True if
TOASTER_MANAGED is set to "1", False otherwise.

Add this to the context for every template, so we can use this
information to conditionally alter the content of pages
according to the mode we're in.

[YOCTO #8514]

(Bitbake rev: f9cf4739fc85c9760ce748323dc7c8de3fa7eaec)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-27 07:24:31 +00:00
Ed Bartosh 851f0d82d9 bitbake: toaster: add get_or_create_targets API
Target objects are created before the build if build is
started from UI in build mode. However, in analysis mode Target
objects don't exist and need to be created using information
from bitbake events.

Added new API call get_or_create_targets to retrive existing
target objects or create them if they don't exist yet.

(Bitbake rev: ef69be31d133696bde54605f5a18da660099734c)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-27 07:24:30 +00:00
Jens Rehsack dcd9cd0f9e bitbake: fetcher: svn: Add support for checkout to a custom path
Add support for the Subversion fetcher to checkout modules to a custom path
than the module name to avoid checkout is always module - svn is path
based and tag/branch-checkout might break builds because of invaid path specs.

(Bitbake rev: af88f538e61afa1b115be4d7afe00d8477f61750)

Signed-off-by: Jens Rehsack <sno@netbsd.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-27 07:24:30 +00:00
Ed Bartosh 4ab7202c31 bitbake: cooker: preserve pre and post configs
Additional config files passed to bitbake server with --read and
--postread options are rewritten by client bitbake even if
it doesn't use those options.

This is a show stopper for toaster as toaster command line
builds are based on the assumption that server is aware of
toster configs, provided by --postread option.

This behaviour is fixed by preserving values of --read and
--postread options when bitbake server starts and restoring
them if client bitbake doesn't explicitly specify them.

(Bitbake rev: 02c64f7487ca8ec5d32c440f5002c4b8f64b76a6)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-27 07:24:30 +00:00
Elliot Smith a9053ac082 bitbake: toaster: Add tests for error message display on the build dashboard
Add tests to ensure that log messages with CRITICAL level and
with EXCEPTION level are shown in the main errors display
on the build dashboard.

[YOCTO #8320]

(Bitbake rev: 7b3ed62800cb7352154897c1c5ad2440a54df198)

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>
2015-10-16 15:00:00 +01:00
Elliot Smith 2517987f8d bitbake: toaster: Modify "New build" button behaviour for cli builds project
The "New build" button should only be displayed if there are
user-generated projects, not if there is only the command-line
builds project. (Toaster can't run builds on behalf of the
command-line builds project.)

The "New build" form should also display as if no project has
been set (i.e. show the project and recipe text entries).

Add a variable which tracks the number of non-command-line projects,
then use this to hide the button when appropriate.

Also track whether the current project is the default one, and
use this to add extra conditions to when the "New build" text
entries are shown.

[YOCTO #8231]

(Bitbake rev: 07e7bc29a7d976941eeae997f78a25ed6edddfc8)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-16 14:59:59 +01:00
Elliot Smith 56d4c84cec bitbake: toaster: Clean up template code
Some errors in the HTML template didn't show up until
they were rendering command line builds.

One useless conditional was lingering in another template.

Clean up these issues to display the latest builds section
correctly.

(Bitbake rev: c781d6be94a25f942946d3a406e07791385e4596)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-16 14:59:59 +01:00
Elliot Smith d96cedf51f bitbake: toaster: More linting of tests
Fix some more lint errors on the tests for toastergui.

(Bitbake rev: a31710db562a91da8ef37f5cd2231132474f46da)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-16 14:59:59 +01:00
Elliot Smith 7c8877efde bitbake: toaster: Show tooltip next to cli builds project name in all builds
In the all builds page, show an icon with tooltip next to the
command line builds project name.

[YOCTO #8231]

(Bitbake rev: 0240d92c6a508e0b22f37b3ea804171dd3dea5a6)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-16 14:59:59 +01:00
Elliot Smith 76702347a8 bitbake: toaster: Hide tabs and add info popups for command line builds
Command line builds don't have a configuration or
layers which can be modified through Toaster.

Change the project builds page for the command line builds project,
to hide the tabs and add some info popups in appropriate places on
that page.

[YOCTO #8231]

(Bitbake rev: 565611749d47c915035890db60d19ab2fca7c42e)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-16 14:59:59 +01:00
Elliot Smith da4c6144f1 bitbake: toaster: Make the builds view the project page for "command line builds"
Command line builds don't have configuration or layers which can
be manipulated in Toaster, so these pages shouldn't be visible.
However, the configuration page is the default page for the
project view (/project/X/), which isn't correct for the
command line builds project.

Modify all project page links across the application so that
the command line builds project (aka the "default" project)
always displays the builds tab.

Add a project_url tag for templates which contains the logic
determining where the URL for a project links to, based on
whether it is the default project or not.

[YOCTO #8231]

(Bitbake rev: 3ea10f4c16a557e94781251f6776b13acb8e9eba)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-16 14:59:59 +01:00
Elliot Smith ef6fc2bc1a bitbake: toaster: Replace "Run again" button with help text for cli builds
It's not possible to run a command-line build again, as Toaster
doesn't have access to the data used for that build.

Replace the "Run again" button with an icon which pops up some
help text to that effect.

Add test to check that the run again button is hidden and the
help icon displayed instead for command-line builds.

[YOCTO #8231]

(Bitbake rev: b67ac9e7cbab50951847dd1a63b12f41bb345dbb)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-16 14:59:59 +01:00
Elliot Smith 7467b6802d bitbake: toaster: Exclude "command line builds" project from projects typeahead
The "New build" drop-down provides autocomplete for Toaster projects.

However, it should not include the default project (for command
line builds), as it should not be possible for the user to
select this project as the container for a Toaster build.

[YOCTO #8231]

(Bitbake rev: d6210cd75b0cd8b6d24d5e99f607ba5cc45daf97)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-16 14:16:17 +01:00
Elliot Smith b5624c77ed bitbake: toaster: Show 'not applicable' for default project machine and release
The machine and release for the default project should show as
'not applicable' on the all projects page, as that information
isn't available for command-line builds.

Modify the templates with some conditionals to check for the
default project row, plus some data-* attributes to mark
where that data is to make testing possible.

Add some tests for the all projects page to ensure that
the correct machine/release are still shown for non-default projects,
and 'not applicable' for the default project.

[YOCTO #8231]

(Bitbake rev: ce27b3fd728f0373aa1adc0d47baace264529b45)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-16 14:16:17 +01:00
Elliot Smith 3c4c984e33 bitbake: toaster: Reorganise and lint tests
Get test suite ready to accommodate new tests for how command line
builds are shown on various pages.

(Bitbake rev: 1ee1fc5dcdbb26c9f6e04b7719d7196083212d4c)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-16 14:13:24 +01:00
Logan Buchy 3ba43f26ee bitbake: fetch2/hg: Include missing errno import
errno.ENOENT checked if deletion of the fullmirror fails.
Exception was thrown since module not imported

(Bitbake rev: d92ebfc34b69ad5df2d151e6b8299fbb5afa3e5f)

Signed-off-by: Logan Buchy <logan.buchy@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-16 14:13:24 +01:00
Ed Bartosh 6fa3fecb12 bitbake: cooker: normalize build targets
BuildStarted event not fully represents build tasks for
the targets. If -c option is used to specify default task
it's not included into the event.

Made build targets to always look as <target>:do_<task>.
Consider default task (do_build or specified by -c command
line option) when normalizing.

(Bitbake rev: 0b0e214e6f53c97ad3d48f622c7fc0ca149956f6)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-16 14:13:23 +01:00
Michael Wood 5effe8f632 bitbake: toaster: Allow any text input to machine configuration variable
Allow any text input to the machine variable; as we may not have discovered
all the available machines until after a build.

[YOCTO #8418]

(Bitbake rev: f44b34833f164daf34c57703429ed8f122888037)

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>
2015-10-16 14:13:23 +01:00
Ed Bartosh 320d05ea9f bitbake: toaster: exit or return depending on the mode
When toaster script is sourced 'return' should be used as
using 'exit' will cause script to exit the shell and close terminal
window. If script is called 'exit' should be used. Otherwise shell
will throw and error:
  return: can only `return' from a function or sourced script

Used 'return' or 'exit' depending on the toaster mode using
TOASTER_MANAGED variable.

(Bitbake rev: 643c42069a2788e9f40fa1bc9845f32aed3d096c)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-16 14:13:23 +01:00
Ed Bartosh 2e2e40c2c4 bitbake: toaster: set TOASTER_MANAGED variable
Set TOASTER_MANAGED to 1 if toaster is run as a script.

(Bitbake rev: 9f68f317e33d617558fce3427a94e14ef65c7d88)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-16 14:13:23 +01:00
Ed Bartosh a73895e492 bitbake: toaster: get rid of SRCFILE
Used TOASTER variable instead of SRCFILE as they're
essentially the same.

(Bitbake rev: 4b8cb1098ad73b4e9dc65b5c6de7d11d2e2468c7)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-16 14:13:23 +01:00
Ed Bartosh 779539cfb9 bitbake: toaster: use path to the script to guess config path
Used $TOASTER variable(path to the toaster script) instead of
current directory name to get path to the toasterconf.json

This way script should work in both modes and it doesn't depend
on the current directory.

(Bitbake rev: 5368d9af4e2c121938fc2421a536fb7f20a987fd)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-16 14:13:23 +01:00
Elliot Smith eb8b2b9ec8 bitbake: toaster: Guard against builds with no targets
Although this probably can't happen in practice (builds without
targets), this constraint is not currently enforced in the data model.

In the unlikely event that a build has no target (e.g. in test cases),
this causes a template rendering error.

Rather than rework the data model, add a guard to the template
to prevent it from rendering the target name if there are no
targets associated with the build.

(Bitbake rev: 4f409d8c01bae898ea142bd1417db99e12067753)

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>
2015-10-16 14:13:23 +01:00
Elliot Smith 65e8bde9f1 bitbake: toaster: Remove Toaster exceptions section of build dashboard
Fatal build errors were displayed as exceptions, and highlighted
with less severity than they deserved.

Roll back to treating Toaster exceptions as errors by removing
the toaster_exceptions member on Build objects and displaying
EXCEPTION events in the errors section on the dashboard.

[YOCTO #8320]

(Bitbake rev: 59197320bdcefddf06084e871f1b5b21b21cbb63)

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>
2015-10-16 14:13:23 +01:00
Elliot Smith 93f0b61749 bitbake: toaster: Record critical errors
Critical errors (where a build failed for reasons of
misconfiguration, such as a machine being specified which is not
in a project's layers) were being ignored (only log records
up to ERROR level were being logged to Toaster's db). This meant that
the build would fail but would not correctly report why.

Add support for CRITICAL error levels to the LogMessage model,
include errors at this level in the errors property for a build,
and show errors at this level in the build dashboard.

[YOCTO #8320]

(Bitbake rev: b6eacbca9cacb607de864ab7d093deb296da8226)

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>
2015-10-16 14:13:22 +01:00
Elliot Smith 069a611097 bitbake: toaster: Test that exception isn't thrown by project page
Add a test which checks that an exception is no longer thrown
for the /toastergui/project/X page for the default project.

Note that we still get a spinning dialogue box on this page
because the default project has no configuration to display,
but at least it doesn't fail altogether.

[YOCTO #8277]

(Bitbake rev: 8795667d03bd8705d7e13c5d3d6bb6da371fa91d)

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>
2015-10-16 14:13:22 +01:00
Elliot Smith 026e981264 bitbake: toaster: Check whether buildrequest exists before using it
Builds initiated from the command line don't have a buildrequest
associated with them. The build.buildrequest association is
only added if a build is triggered from toaster.

Some of the code for displaying the status of a build refers
to build.buildrequest without checking whether it has been set,
which causes an error to be thrown.

Add a guard to check whether the buildrequest has been set.

[YOCTO #8277]

(Bitbake rev: af33409612139ab2347baf6b847b23faea19752d)

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>
2015-10-16 14:13:22 +01:00
Elliot Smith 1feeb8e499 bitbake: toaster: Always run bldcontrol migrations
The toaster startup script conditionally migrates the database
tables depending on whether you are in managed mode or not. This
means that if you are in analysis mode, some of the bldcontrol*
database tables used by managed mode are not available.

As a consequence, some of the code in toaster which refers to
those tables can break in analysis mode, as there's no clean
isolation of the two modes.

To prevent this from happening, always run the migrations for
managed mode and create the bldcontrol* tables, even if in
analysis mode.

Also clean up the function which starts up toaster so the
logic is easier to follow.

[YOCTO #8277]

(Bitbake rev: b1fc592131286ebbede2693be8c86636f0039011)

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>
2015-10-16 14:13:22 +01:00
Michael Wood ae82d778e6 bitbake: toaster: buildinfohelper Detect command line builds
When we're building using toaster as just a listener to bitbake
(analysis mode) we need to handle the case where the toaster configuration data
isn't present so we don't need to try and update the existing information.

(Bitbake rev: a22faae2c3a5948356ce3cbc73c34509de65d370)

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>
2015-10-16 14:13:22 +01:00
Belen Barros Pena 596c219bf4 bitbake: toaster: Disable add layer button when input is empty
The 'add layer' button in the project configuration page
is enabled when you select a layer from the type ahead.
However, if you delete the layer name, the 'add layer'
button remains enabled, and if you click it, the last
selected layer from the type ahead will be added to the
project.

It is probably better to disable the 'add layer' button
when the input field is empty.

[YOCTO #8449]

(Bitbake rev: d4820f16c76398400ddd573db03c654c51d40c1b)

Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-16 14:13:22 +01:00
Belen Barros Pena 24e5a178e1 bitbake: toaster: Have 'Version' next to recipe name
In all Toaster tables we show the version next to the recipe
or package names, with one exception: the recipes table in
the layer details page, where we are showing the version
next to the recipe description.

This patch moves the version column next to the recipe name,
for consistency with all other Toaster tables.

(Bitbake rev: b5af7084b28158a8a9eaf78db463555ae8e0f620)

Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-16 14:13:22 +01:00
Belen Barros Pena c895838189 bitbake: toaster: Improve directory structure layout
File names in the directory structure often wrap
due to big indenting for nested files and directories,
unnecessary width in certain columns, and not using
colspan when the symlink and package cells are empty.
The wrapping makes the table harder to read.

This patch reduces the amount of indenting, limits the
width of the 'Size', 'Permissions', 'Owner' and 'Group'
columns, and sets colspan to use the white space of the
symlink and package names when empty.

(Bitbake rev: 6167ee5a7569d8f841c340e672645cc133ea5a31)

Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-16 14:13:21 +01:00
Ed Bartosh 2f52ef4b2f bitbake: toaster: importlayer Update property names for importlayer api calls
Update the property names used in checking for existing layers. The
server side API changed but not all references were updated.

[YOCTO #8300]

(Bitbake rev: 1cbf0cf77a638257e18066f911fe4c4e13c278c6)

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>
2015-10-16 14:13:21 +01:00
Michael Wood d302c98822 bitbake: toaster: Fix missing tooltips from layers on project configuration page
Re-enable the layer tooltips on the project configuration page.
This adds the required fields to the API used for the layer dependencies
to be able to show the metadata needed.

Also fixes link hrefs which were missing in the add layers confirmation
dialog (bug 8251).

[YOCTO #8295]
[YOCTO #8251]

(Bitbake rev: c7cb8255d0ab1fd7715e878c1c83ef0cd920387e)

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>
2015-10-13 15:35:49 +03:00
Ed Bartosh 7e5464b451 bitbake: toaster: Fix broken test case
Fixed test_show_tasks_in_projectbuilds broken by latest changes in
project build view.

(Bitbake rev: 3c72c7634ab69a5eb18aa20a5c6d16a3e2666f62)

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>
2015-10-12 14:38:57 +01:00
Ed Bartosh 2e375e63bf bitbake: toaster: exclude recipes with empty names
Modified get_all_compatible_recipes function to exclude recipes
with empty names from the result queryset. This should stop UI
to show recipes with empty names in compatible recipes page.

[YOCTO #7969]

(Bitbake rev: f7c1bd49e2e28d12c6604f5ae54bc96e1e7b6946)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-12 14:38:57 +01:00
Ed Bartosh fa3e82d952 bitbake: toaster: delete recipe if it can't be saved
Due to Recipe model constraints some recipes can't be
saved. However, they still can create incomplete records in
the database. This causes all sorts of errors when Toaster
operates with those objects. Removing them should fix those
issues.

[YOCTO #7969]

(Bitbake rev: 4d76a9e418fd98a7882aa29f974a7389f9689314)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-12 14:38:56 +01:00
Belen Barros Pena 82675fc4ed bitbake: toaster: Remove project name from latest project builds
The 'latest builds' list in the project builds page does not
need to show the project name, since it lists only builds
for the selected project.

This patch removes the redundant project name.

(Bitbake rev: 065652b9c649135f9e2fc5d9ba90e98f560dccdd)

Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-12 14:38:56 +01:00
Ed Bartosh 6aeaca1c83 bitbake: toaster: test get_alldeps API
Added test case to test Layer_Version.get_alldeps API.

(Bitbake rev: 159aa333c2f6344b5b37911c3f09601b9f0df6d8)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-12 14:38:56 +01:00
Ed Bartosh 0fb6be01fe bitbake: toaster: fix orm tests
Cleaned up and fixed orm tests. Removed test_build_layerversion as
it's not needed due to changed compatible_layer_versions API.

(Bitbake rev: 73ea29ed065bfaa80ee368b2a38c157e36fe1676)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-12 14:38:55 +01:00
Ed Bartosh dea679af1a bitbake: toaster: fix NameError
Fixed exception: NameError: global name 'DoesNotExist' is not defined

(Bitbake rev: eee5311b867d3c8c33e06d04e103bfd3647146f4)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-12 14:38:55 +01:00
Ed Bartosh 6e0c0fd835 bitbake: toaster: use get_alldeps in layerdetails renderer
Used Layer_Version.get_alldeps api in layerdetails template
renderer to get list of layer dependencies.

[YOCTO 8004]

(Bitbake rev: 077d0f41a3bd9cf2802a1488f1d6156ccac7df1d)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-12 14:38:54 +01:00
Ed Bartosh bd2ec77510 bitbake: toaster: implement API to get full list of deps
Implemented Layer_Version.get_alldeps API to recursively get
full list of dependencies for the layer. Dependencies that are
already in the project are filtered out from the result.
Result list of Layer_Version objects is sorted by layer name
for UI to look consistent.

This API is going to be used to show amount and list of
dependencies for the layer in the list of compatible layers
for the project.

(Bitbake rev: 7d853a3054a9ae3d18eb6f5bc13ba27d2795c31a)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-12 14:38:54 +01:00
Michael Wood e35c404537 bitbake: toaster: Don't descend into directories for cached_layers
As toaster makes use of clones of itself we have a mechanism to just
clone the current checkout and use that as a basis for the git clone for
the layers inside. For instance, in poky, if we're running in that directory,
we don't ever want to change the current checkout so we make a copy of
ourselves to do this work in.

This steps through cached_layers and previously-traversed directories
inside the current checkout to find any pre-existing checkouts.

This was ending up traversing too many directories down, so remove
the traverse and only deal with the current directory.

[YOCTO #8463]

(Bitbake rev: 9c40b3b6377ab8f5d6ac9b8e00585b71de00bf74)

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>
2015-10-11 08:12:58 +01:00
Michael Wood 2d6701f190 bitbake: toaster: Update JS unit tests
Update JS unit tests.
- Expand the add remove layer check to make sure that the layer is
  actually added to the project.
- Remove some unused vars
- Make sure that the layers/project ids will always exist at the point
  of running the test.
- Add the missing typeahead input fields to the dom to fix the failing
  typeahead test.

(Bitbake rev: 46af40b95f842aa14ef7e3f0d516aef3899d5e42)

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>
2015-10-11 08:11:30 +01:00
Michael Wood ab896df63b bitbake: toaster: Fix stale layer state buttons
Move the "is available to the project" state computation to the template
for the Layer add/remove buttons, Recipe build/Add layer as done for the
Package add/remove. This is more reliable as we can get an inconsistent
state on the front end JS as there are many opportunities for hitting
out of date project information.

[YOCTO #8294]

(Bitbake rev: 43469c3360566ad4897785f14f8717a9bc8b6078)

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>
2015-10-11 08:11:29 +01:00
Michael Wood 41a5f82b4a bitbake: toaster: tables Add the recipe filter back into the Recipe table
Add the "Is recipe currently available in the project" filter back to
the Recipe table which was removed when we had intermediate
AvailableRecipe tables.

(Bitbake rev: b3682d1d851e616efa0715f9d43815a92e259432)

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>
2015-10-11 08:11:29 +01:00
Michael Wood 2bebcd4995 bitbake: toaster: Fix typo in returning pk list of layer versions in current project
This was accidentally returning the primary key of the ProjectLayer
rather than the ProjectLayer.Layer_Version.pk

(Bitbake rev: b20f3626148e89af0e9fcfca911a5a1e4e355a41)

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>
2015-10-11 08:11:29 +01:00
Michael Wood d6d680d2e5 bitbake: toaster: layerdetails update build recipe button class name
Update the class name which we are using for the recipe build button.
This fixes a regression in the buttons being enabled/disabled when
adding and removing the layer being viewed from the project.

(Bitbake rev: cc63f10f69105205e65b5f9647232b2b4b23ad48)

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>
2015-10-11 08:11:28 +01:00
Elliot Smith 7794b5728d bitbake: toaster: Hide "Download build log" button if log doesn't exist
Our builds pages show all builds, but also include build requests
which may have resulted in a build failure, before the build
started (e.g. at the recipe parsing stage).

In such cases, the BuildStarted event is not captured by Toaster,
so we have no idea where the log file for the failed build is.

The result is that a build is shown by the Toaster UI /builds/ pages,
but it is really a pretend build which never went beyond being a
build request, and which has no associated log file. In turn, this
breaks the "Download build log" button on the build dashboard,
as there's no log file associated with the build.

Fix this by hiding the "Download build log" button for builds
which don't have a cooker_log_path.

[YOCTO #8373]

(Bitbake rev: 89e6cd03aa11c886f28520557af6c7ad51827b0e)

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>
2015-10-11 08:11:28 +01:00
Ed Bartosh 8c695393cd bitbake: toaster: fix naming for clone directory
Toaster uses git url and branch to make a clone directory
name. Current code leaves '@' and '%' characters unchanged,
which can cause generation of wrong directory names.

Fixed this issue by replacing '@' and '%' with underscore.

(Bitbake rev: e076888a2120a37c388930073694750735d86507)

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>
2015-10-11 05:39:50 +01:00
Michael Wood 41286f4730 bitbake: toaster: buildinfohelper Skip packages we have no build info about
If there are more packages listed as installed than we know about from
bitbake, and therefore have insufficient information to be able to
create a Toaster Package object then skip it. Also handle the case where
a dependency references such a package.

Also clarify the error logging.

(Bitbake rev: b4ce793685f70cab3f28cb4329aaaf3878cd62e8)

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>
2015-10-11 05:39:04 +01:00
Michael Wood 97d000677e bitbake: toaster: buildinfohelper associate build data with built_recipe
Make sure we associate build data with the built recipe rather than
toaster's configuration copy of the recipe.

(Bitbake rev: 34d4ef7289d72d151ad0acdccab8b99c8c31221e)

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>
2015-10-11 05:39:03 +01:00
brian avery 0dcc96323c bitbake: toaster: remove bashisms so script works in dash as well
[YOCTO #8217]

(Bitbake rev: be2d04c1831608922f90da03cb26d7fd5c863a47)

Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-11 05:33:06 +01:00
brian avery 8068aa3b0f bitbake: toaster: get rid of interactivity in bldcontrol
removed layer dir questions and base off TOASTER_DIR

removed build dir questions and base off TOASTER_DIR

base configuration file off of TOASTER_CONF

fixed some pylint issues

[YOCTO #8217]

(Bitbake rev: d5811968b5f22093365f381fb7e75ab46e5269c2)

Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-11 05:33:06 +01:00
brian avery 7d7823e597 bitbake: toaster: check for configuration file and exit if not found
[YOCTO #8217]

(Bitbake rev: 49e30c1aa8d717adbdcc15c90a668000789a6961)

Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-11 05:33:05 +01:00
brian avery 315989cd95 bitbake: toaster: remove layer and build dir interactive questions
added TOASTER_CONF env var for toaasterconf.json

added TOASTER_DIR env var for working dir

added bugfix so WEB_PORT env variable is honored

(Bitbake rev: c4b351e40060a359d59ab51b5ed2f9713ca1a9a5)

Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-11 05:33:05 +01:00
brian avery 489d5ff1c9 bitbake: toaster: removed superuser question from startup
added comment explaining how to create one later

(Bitbake rev: 782b7c74d5f10ed255538ba0c975ff342a34f5bf)

Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-11 05:33:04 +01:00
Michael Wood c7d1dab1c4 bitbake: toaster: orm Machines filter don't pass self in as parameter
Fix typo don't pass self in as a parameter, this evaluated to true
giving the wrong results meaning the machines typeahead did not return
valid results.

(Bitbake rev: 55ba889ef8900c95447861fa3985ca9cfe06afdf)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-11 05:33:04 +01:00
Elliot Smith dd957fe0f2 bitbake: toaster: Rationalise mimetype guessing to fix artifact downloads
Artifact download links were broken because the function to
get the mimetype for the artifact was incorrectly using the
underlying mimetype library. The function was also attached
to the build environment controller, which was unnecessary, as
we only support local controllers anyway.

Remove the mimetype getter on the build environment and
use the one in the view code instead. This works correctly
and prevents the download error from occurring.

[YOCTO #8369]

(Bitbake rev: 805fb2a9388c728600596e9b845a5c7eeaebd99c)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-11 05:33:04 +01:00
Elliot Smith ce9011a9de bitbake: toaster: Use Python's mimetypes module
filemagic is used to guess the mimetype of files when a user
requests a download. However, this adds a dependency on an
external library.

Python does have a mimetypes module, though this guesses the
mimetype rather than doing anything clever with the actual
file content. But for our purposes, it's more than adequate.
(NB Django also uses this module when serving static files.)

Use this instead of relying on any external code, and remove
the filemagic dependency.

(Bitbake rev: 0dd0ac25d54c73f13812db04826b57b3d16ea43f)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-11 05:33:03 +01:00
David Reyna 466bbec242 bitbake: toaster: display warnings for bad "IMAGE_FSTYPES" values
Display warning message for IMAGE_FSTYPES when no value is selected or
when the filter does not have any matches

[YOCTO #8126]

(Bitbake rev: 9a825eb928cb35096d2c1563788310fb6a13e93e)

Signed-off-by: David Reyna <David.Reyna@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-11 05:33:03 +01:00
Belen Barros Pena 8b7d846c68 bitbake: toaster: Set default columns in recipes tables
The compatible image recipes and software recipes tables
show pretty much all their columns by default. That's a few
too many columns. The default columns in both tables should
be: recipe, version, description, layer and build.

This patch sets the above as the default columns. It also
changes the table heading 'Recipe Version' to just 'Version',
which is shorter and self-explanatory.

[YOCTO #8421]

(Bitbake rev: 1f7bfe5e13bc39bb7eb6e039fe4b6291fc95d531)

Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-11 05:33:03 +01:00