Commit Graph

4769 Commits

Author SHA1 Message Date
Michael Wood b58b982eaf bitbake: toaster: orm models Project class Fix pyflake errors
(Bitbake rev: 69f33397083f54f977fa0cd4dd621731f32fd034)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-30 15:48:10 +00:00
Michael Wood 30a9f65dcc bitbake: toaster: buildinfohelper toaster-custom-images layer
This fixes the unidentified layers issue by making the
toaster-custom-images layer a local layer. By doing this we also fix the
git assumptions made for the local layers which stop recipes and other
meta data being associated with them. This also removed some of the
special casing previously needed when we didn't have the concept of a
local (non git) layer.

Also rename created flag var to a have a different var for each returned
value so that the same value isn't used multiple times.

[YOCTO #10220]

(Bitbake rev: ba5332d4960d7f4f79aef63136796e2fa67284e3)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-30 15:48:10 +00:00
Sujith H fa5ea98d3b bitbake: toaster: localhostbecontroller write toaster layers for project to toaster-bblayers.conf
Instead of updating conf/bblayers, here we update toaster-bblayers.conf
file. So extra effort to update bblayers.conf can be removed safely.

(Bitbake rev: f3e99d820f3798869a2a1d1604709c1c324dbbab)

Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-30 15:48:10 +00:00
Sujith H 5f0405abed bitbake: toaster: localhostbecontroller accept custom init script for build
When passed variable CUSTOM_BUILD_INIT_SCRIPT to toaster
setting, it would be nice to use it. Else toaster
can use oe-init script. This gives an oppurtunity to
use customized build init scritps.

(Bitbake rev: 9d168bb5f05453bdb7156793eea25da0a3119b4d)

Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-30 15:48:10 +00:00
Reyna, David c57533b83b bitbake: toaster: tablejs Fix missing close square bracket
There is a missing close square bracket.

[YOCTO #10631]

(Bitbake rev: f3da9f85e6036e6f43377172cbcfe701e0efca7f)

Signed-off-by: David Reyna <David.Reyna@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-30 15:48:10 +00:00
Reyna, David 13c0ffc81c bitbake: toaster: orm gen_layerdeps Protect against circular Layer dependencies
Limit the recursion (to say 20 levels) when processing layer dependencies
so that circular dependecies do not cause infinite decent and an
out-of-memory failure. The duplicate found layers are already immediately
filtered in the code.

[YOCTO #10630]

(Bitbake rev: e9efef0bdb8068984c3013b87aac9e872ffb38ae)

Signed-off-by: David Reyna <David.Reyna@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-30 15:48:10 +00:00
Michael Wood e336017e87 bitbake: toaster: customrecipejs Consume click event on 'a' link if disabled
Consume the click event on the download recipe link if it's disabled. To
prevent the link from sending user to an error page.
See http://getbootstrap.com/css/#forms-disabled-fieldsets and a link
caveat.

[YOCTO #10151]

(Bitbake rev: bc8401e78cea140349bded228d38f72f628b3980)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-30 15:48:09 +00:00
Michael Wood 6191f71f81 bitbake: toaster: Add an example production settings file
Add an example settings that can be used for the basis of the production
instance of Toaster.

[YOCTO #10581]

(Bitbake rev: 1a7c356491b88c8decced39fb2039ef90065f2d2)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-30 15:48:09 +00:00
Michael Wood 4477a762bd bitbake: toaster: tests Add management command tests
Add some simple sanity tests for the management commands that we use for
Toaster.

Can be executed with ./manage.py test tests.commands

For faster execution use the test settings and keepdb flag:
DJANGO_SETTINGS_MODULE=toastermain.settings_test ./manage.py test
tests.commands --keepdb

(Bitbake rev: 161ea71519e7f70d4aadaafc9c3294a12612f0cb)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-30 15:48:09 +00:00
Michael Wood 310a9e5d35 bitbake: toaster: runbuilds Write the pidfile in python rather than shell script
Write the pid file out in the start up of this management command. This
ensures this has happened instead of relying on the shell command having
been run which may or may not be the case. This also makes it simpler for
testing.

Couple of clean ups of runbuilds as identified by pyflake

(Bitbake rev: 999e980ee1a58d16f33ef6c0e41aecdcd0206f39)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-30 15:48:09 +00:00
Joshua Lock ddaac5e4e3 bitbake: bitbake: remove True option to getVarFlag calls
getVarFlag() now defaults to expanding by default, thus remove the
True option from getVarFlag() calls with a regex search and
replace.

Search made with the following regex:
getVarFlag ?\(( ?[^,()]*, ?[^,()]*), True\)

(Bitbake rev: c19baa8c19ea8ab9b9b64fd30298d8764c6fd2cd)

Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-30 15:48:09 +00:00
Joshua Lock 1fce7ecbbb bitbake: bitbake: remove True option to getVar calls
getVar() now defaults to expanding by default, thus remove the True
option from getVar() calls with a regex search and replace.

Search made with the following regex: getVar ?\(( ?[^,()]*), True\)

(Bitbake rev: 3b45c479de8640f92dd1d9f147b02e1eecfaadc8)

Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-30 15:48:09 +00:00
Kai Kang cd381cd714 bitbake: COW.py: fix sample codes
The call of methods iteritems() and itervalues() in sample codes were
replaced by items() and values() to convert to Python 3 by Bitbake rev
d0f904d407f57998419bd9c305ce53e5eaa36b24. But the methods iteritems()
and itervalues() belong to class COWDictMeta not class dict or set. The
modifications should not be made in purpose that it fails to run sample
codes, so revert them.

(Bitbake rev: d140f0ee6f301264e226914766d9f63558acfd6c)

Signed-off-by: Kai Kang <kai.kang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-23 10:59:56 +00:00
Michael Wood dbf3a9fa8e bitbake: toaster: layerindex updater Take into account layers being predefined
As we can now provide layer definitions through fixtures we need to be
more clever how we update the metadata in the database to avoid
duplicate metadata being created. To do this we make more effort to
match existing data in the database and update only the fields which
will be better provided by the layer index.

This removes the need for us to special case layers which are provided
as part of poky such as openembedded-core or meta-poky which exist on
the layerindex but with different git urls.

(Bitbake rev: f981b68f66718d5b196684f4e378a5f195ff0337)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <brian.avery@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-23 10:59:56 +00:00
Michael Wood f59ac87b46 bitbake: toaster: orm/fixtures Add the master release and correct morty release
Add the master release option to base your project on and correct the
morty release so that for poky based setups we use the poky provided
version of the layer rather than checking out the layer from its own git
repository.

[YOCTO #10497]

(Bitbake rev: c83ab92362378b22d3f4d6119bf362f704577ca2)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <brian.avery@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-23 10:59:56 +00:00
Michael Wood 50cb0f596f bitbake: toaster: settings fixture Set default release to master
Now that morty has been released we now set the DEFAULT_RELEASE back to
master.

(Bitbake rev: 115cee16a9aecfcd1061bb106ebca4e861d9b296)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <brian.avery@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-23 10:59:56 +00:00
Patrick Ohly 7bb38a3358 bitbake: taskdata.py: improve handling of depends/rdepends
Error handling only caught the cause where a dependency did not have
any colon, but ignored the case where more than one was given. Now
"pn:task:garbage" will raise an error instead of ignoring ":garbage".

The error message had a misplaced line break (?) with the full stop
on the next line. Indenting the explanation with a space might have
been intended and is kept.

split() was called three times instead of just once.

Instead of improving the two instances of the code (one for 'depends',
one for 'rdepends'), the common code is now in a helper function.

(Bitbake rev: 063d255fdcb3f79b2d1b0badedc80384b295a3f5)

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-23 10:59:56 +00:00
Patrick Ohly d7f76363fb bitbake: data_smart.py: don't reorder internal bitbake variables when calculating hash
Commit 260ced745 added __BBTASKS, __BBANONFUNCS, __BBHANDLERS to the
data that gets hashed, but only after reordering these lists. The
intention probably was to make the hash deterministic, but that's
unnecessary (the content of the variables should already be
deterministic) and hides potential reasons that might require
re-parsing.

(Bitbake rev: 3511d464f3a9d8b4334cda384b35016de69ce49e)

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-23 10:59:56 +00:00
Richard Purdie 2631c375b8 bitbake: data_smart: Default to expansion for getVar/getVarFlags
We've been building to this for a while, default to return expanded
values for getVar/getVarFlags.

We can then go through and remove the "True" option to many of the
calls to this function, all function calls should have a default by now
though since the parameter has been required for a while.

(Bitbake rev: caf5bb9b7fe254bca9da077ebcb84a37d1f96dd4)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-23 10:59:56 +00:00
Richard Purdie 30205c7148 bitbake: data: Drop deprecated old style bitbake API
The old style bb.data.getVar/setVar API has long since been deprecated in
favour of d.getVar/setVar and friends.

Now we're about to change the default expansion parameter, drop the old APIs
to simplify the transition and ensure everyone is using the new style functions.
Conversion is trivial if there are remaining stragglers.

I've left bb.data.expand() for now since its more widely used but would make a good
follow up patch series.

(Bitbake rev: 1825604d46fcd29fad6cfd325f1cb1e1b457d2c9)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-23 10:59:56 +00:00
Richard Purdie 8de811ae76 bitbake: lib/bb: Don't use deprecated bb.data.getVar/setVar API
The old style bb.data.getVar/setVar API is obsolete. Most of bitbake
doesn't use it but there were some pieces that escaped conversion. This
patch fixes the remaining users mostly in the fetchers.

(Bitbake rev: ff7892fa808116acc1ac50effa023a4cb031a5fc)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-23 10:59:56 +00:00
Paul Eggleton 4d8ee55164 bitbake: fetch2: npm: conditionally hide NPM_LOCKDOWN / NPM_SHRINKWRAP warnings
If ud.ignore_checksums is set (which we currently use to suppress the
warnings for missing SRC_URI checksums when fetching files from
scripts), then if we're fetching an npm package we should similarly
suppress the warnings when NPM_LOCKDOWN and NPM_SHRINKWRAP aren't set.

At the same time, make any errors reading either of these files actual
errors since if the file is specified and could not be found, that
should be an error - not the exact same warning.

Fixes [YOCTO #10464].

(Bitbake rev: cefb8c93c8299e68352cf7ec5ad9ca50c0d499ed)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-23 10:59:56 +00:00
brian avery 7c3a47ed89 bitbake: toaster: settings set ALLOWED_HOSTS to * in debug mode
As of Django 1.8.16, Django is rejecting any HTTP_HOST header that is
not on the ALLOWED_HOST list.  We often need to reference the
toaster server via a fqdn, if we start it via webport=0.0.0.0:8000 for
instance, and are hitting the server from a laptop. This change does
reduce  the protection from a DNS rebinding attack, however, if you are
running the toaster server outside a protected network, you should be
using the production instance.

[YOCTO #10578]

(Bitbake rev: 7f51149453c96a3f1da64ea85306518fd2b65f21)

Signed-off-by: brian avery <brian.avery@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-16 11:38:44 +00:00
Robert Yang edb5b524b3 bitbake: lib/bb/cooker.py: fix for BBFILE_PATTERN = ""
There would be error when BBFILE_PATTERN = None:
  BBFILE_PATTERN_foo not defined

This is the correct behaviour, but when the layer sets BBFILE_PATTERN = "",
it would match all the remaining recipes, and cause "No bb files matched BBFILE_PATTERN"
warnings for all the layers which behind it.

When a layer sets BBFILE_PATTERN = "" (for example, a layer only
provides git repos and source tarballs), now it means has no recipes.
This is different from BBFILE_PATTERN_IGNORE_EMPTY, the later one means
that it *may* not have any recipes.

(Bitbake rev: 91c3b34625fac2a0f093a4b46a46e89f813e7972)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-04 12:50:56 +00:00
Olaf Mandel 0038120f05 bitbake: toasterui.py: warn if buildstats is missing
Like for buildhistory, warn if buildstats is missing from INHERIT.

CC: Joshua Lock <joshua.g.lock@linux.intel.com>
(Bitbake rev: 3570a8cf94354c8ab07513c304ebae33623fea33)

Signed-off-by: Olaf Mandel <o.mandel@menlosystems.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-04 12:50:56 +00:00
Ed Bartosh b8cabc7ed3 bitbake: toaster: add tests/eventreplay/README
Put instructions on how to prepare event log files
and run eventreplay tests.

(Bitbake rev: 0e675547166acc8650498e153bd3482420342c32)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-04 12:50:56 +00:00
Ed Bartosh 934c9efa66 bitbake: toaster: add eventreplay test case for zlib
Run toaster-eventreplay with zlib.events.
Check if zlib build and package present in Toaster database.

(Bitbake rev: c922f4904301174cc72ba35e76870fbf964082cf)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-04 12:50:56 +00:00
Ed Bartosh 3503c5426e bitbake: toaster: add eventreplay test case for core-image-minimal
Run toaster-eventreplay with core-image-minimal.events and
test if all required packages present in Target_Installed_Package
table.

(Bitbake rev: 73410e6dc965b2885c68e87ed6fa8d8b57e9c49d)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-04 12:50:56 +00:00
Ed Bartosh 98ac0b0a5b bitbake: toaster: use current directory if BUILDDIR is not set
If BUILDDIR environment variable is not set signal_runbuilds function
throws TypeError as os.getenv('BUILDDIR') returns None:

ERROR: unsupported operand type(s) for +=: 'NoneType' and 'str'
Traceback (most recent call last):
  File "bitbake/lib/bb/ui/toasterui.py", line
391, in main
    buildinfohelper.update_build_information(event, errors, warnings,
taskfailures)
  File "bitbake/lib/bb/ui/buildinfohelper.py",
line 1184, in update_build_information
    self.internal_state['build'], errors, warnings, taskfailures)
  File "bitbake/lib/bb/ui/buildinfohelper.py",
line 238, in update_build_stats_and_outcome
    signal_runbuilds()
  File "bitbake/lib/toaster/orm/models.py", line
1746, in signal_runbuilds
    '.runbuilds.pid')) as pidf:
  File "/usr/lib64/python3.4/posixpath.py", line 82, in join
    path += b
TypeError: unsupported operand type(s) for +=: 'NoneType' and 'str'

Used os.getenv('BUILDIR', '.') to make it always return meaningful
directory path. Current directory '.' will be used if BUILDDIR is
not set.

(Bitbake rev: da631152a0db3f432709a05ff15a268d784ca3ab)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-04 12:50:55 +00:00
brian avery 637c93edfa bitbake: toaster: buildinfohelper Handle regex paths
We were presuming that all the layer dependency information was of the
form "^/path/to/layer" to we were just stripping the leading "^" off of
the layer information when we were matching the layer priorities to the
toaster database.  This patch splits out the priorities layer match which
gets a  regex from the task/recipe match which is gets a path.

(Bitbake rev: e23b574fe52f416184ee43838b8ab28b5b8eb71d)

Signed-off-by: brian avery <brian.avery@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-04 12:50:55 +00:00
Michael Wood 754fa212bc bitbake: toaster: tests builds test_core_image_min Clean ups
Instead of searching for the build for each test just use the returned
value of the completed build.

(Bitbake rev: ecb94e50262b3f4ca8d5107f77f053335ef23511)

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>
2016-11-04 12:50:55 +00:00
Michael Wood 83ebb89877 bitbake: toaster: tests builds Update buildtest
Now that we're using fixtures for configuration just load these instead
of trying to search for a toasterconf json file.

Also for convenience add the ability for the tests to source the build
environment script. To use this test make sure that directories are in
the same layout as poky.

(Bitbake rev: 448d1d9dc8989ef4c997a90c71cd7e1da0495c1c)

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>
2016-11-04 12:50:55 +00:00
Michael Wood 8e70fa1d79 bitbake: toaster: orm models Handle run builds process not yet running
During tests we may want to call the runbuilds process manually for
example when doing a "one shot" approach rather than a long running
process during tests.

(Bitbake rev: 60d3f93836da5523705b0b2e25567d1c9040ec89)

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>
2016-11-04 12:50:55 +00:00
Michael Wood 0c91a400e7 bitbake: toaster: test browser test_layerdetails_page add wait_until_visible
Add an additional wait_until_visible for the save buttons as firefox
animates this into view so slowly we get a race on them being visible

(Bitbake rev: 4b89db30af25da5f2c519cf684655d5af99f0e2c)

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>
2016-11-04 12:50:55 +00:00
Michael Wood 5bc6fa01e0 bitbake: toaster: Remove contrib tts
Remove the "Toaster test system". We don't need a home brew
test "framework" as the django test runner is more than adequate.
None of these tests here are currently working and have been obsoleted
by the work done on unit and browser tests in ./tests/.

(Bitbake rev: 7a82e45ca5c4d470f62f83e72d00cbe45baa1537)

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>
2016-11-04 12:50:55 +00:00
Michael Wood 953b2f50f0 bitbake: toaster: Delete useless bldcontrol/test
It doesn't work nor does it test anything useful

(Bitbake rev: cf727757767d96b2cd2055f519289712bdf0e505)

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>
2016-11-04 12:50:55 +00:00
Michael Wood effbf9e09e bitbake: toaster: Move views tests to main testing module
Consolidating all the tests to live in the same place to make them more
discoverable and consistent as well as not cluttering up the django app
directory.

(Bitbake rev: 66076c006079237d97aaef4f242af5a4fa116d97)

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>
2016-11-04 12:50:55 +00:00
Michael Wood d350276a86 bitbake: toaster: views Tests fix all pyflake identified issues
(Bitbake rev: f407acefcea5619c76fd7b413d6356efc93e63e8)

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>
2016-11-04 12:50:55 +00:00
Markus Lehtonen c5f609edbf bitbake: data: fix exception handling in exported_vars()
Fix a bug where a totally wrong value of a variable would be exported if
an exception happened during d.getVar(). Also, print a warning if an
exception happends instead of silently ignoring it. It would probably be
best just to raise the exception, instead, but use the warning for now
in order to avoid breaking existing builds.

[YOCTO #10393]

(Bitbake rev: f639f06cfa280adcc25438387567966271b9b2c3)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-04 12:50:55 +00:00
Richard Purdie 589f08aa85 bitbake: siggen: Ensure taskhash mismatches don't override existing data
We recalculate the taskhash to ensure the version we have matches
what we think it should be. When we write out a sigdata file, use
the calculated value so that we don't overwrite any existing file.
This leaves any original taskhash sigdata file intact to allow a
debugging comparison.

(Bitbake rev: 291353b711670ce2da3d45617fc96520bdf09d3f)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-04 12:50:55 +00:00
Richard Purdie 0a4a6d6956 bitbake: siggen: Pass basehash to worker processes and sanity check reparsing result
Bitbake can parse metadata in the cooker and in the worker during builds. If
the metadata isn't deterministic, it can change between these two parses and
this confuses things a lot. It turns out to be hard to debug these issues
currently.

This patch ensures the basehashes from the original parsing are passed into
the workers and that these are checked when reparsing for consistency. The user
is shown an error message if inconsistencies are found.

There is debug code in siggen.py (see the "Slow but can be useful for debugging
mismatched basehashes" commented code), we don't enable this by default due to
performance issues. If you run into this message, enable this code and you will
find "sigbasedata" files in tmp/stamps which should correspond to the hashes
shown in this error message. bitbake-diffsigs on the files should show which
variables are changing.

(Bitbake rev: 857829048c14338132784326ba98a71f12192db8)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-04 12:50:55 +00:00
Richard Purdie 157947efc7 bitbake: build: Ensure we preserve sigbasedata files as well as sigdata ones
We don't remove sigdata files, we also shouldn't remove sigbasedata files
as this hinders debugging.

(Bitbake rev: 8b879fd81fdcf86645cfabad0f54454ba573df52)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-04 12:50:55 +00:00
brian avery 4b94b498e2 bitbake: toaster: Update default release to Morty
Set Morty to be the default release in toaster for the Morty release
when creating new projects.

(Bitbake rev: 00f79096f639ce3a9c0b7c72cfb36f14e264733d)

Signed-off-by: brian avery <brian.avery@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-15 13:21:54 +01:00
brian avery 33324267c1 bitbake: toaster: Update poky fixture for Morty release
Update the poky fixture to the Morty release.  This removes the
master branch from the release and limits it to the morty branch.
Normally, we would also support at least one past branch but the change
from Python 2.7 -> Python 3 makes that infeasible.

(Bitbake rev: 2674ca33b900f4f3f16be504d7c67d0fc69c1c2d)

Signed-off-by: brian avery <brian.avery@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-15 13:21:54 +01:00
brian avery 7656dea6db bitbake: toaster: Update oe-core fixture for Morty release
Update the oe-core fixture to the Morty release.  This removes the
master branch from the release and limits it to the morty branch.
Normally, we would also support at least one past branch but the change
from Python 2.7 -> Python 3 makes that infeasible.

(Bitbake rev: 93f1e6c3d022b1f12a230879160efa941cb1e250)

Signed-off-by: brian avery <brian.avery@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-15 13:21:54 +01:00
Aníbal Limón 924ca1037c bitbake: bb.event: fix infinite loop on print_ui_queue
If bitbake ends before _uiready and bb.event.LogHandler was add
to the bitbake logger it causes an infinite loop when logging
something.

The scenario is print_ui_queue is called at exit and executes
the log handlers [2] one of them is bb.event.LogHandler this handler
appends the same entry to ui_queue causing the inifine loop [3].

In order to fix a new copy of the ui_queue list is created when iterate
ui_queue.

[YOCTO #10399]

[1] https://bugzilla.yoctoproject.org/show_bug.cgi?id=10399#c0
[2] http://git.openembedded.org/bitbake/tree/lib/bb/event.py?id=41d9cd41d40b04746c82b4a940dca47df02514fc#n156
[3]
http://git.openembedded.org/bitbake/tree/lib/bb/event.py?id=41d9cd41d40b04746c82b4a940dca47df02514fc#n164

(Bitbake rev: 46fecca9d531a07788b5cac8b2dc6a8267d8b6d0)

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-15 10:01:44 +01:00
Randy Witt a75bccdd14 bitbake: runqueue.py: Remove redundant whitelist checks
The whitelist checks for BB_SETSCENE_ENFORCE were running for every call
to execute(). Since the task list doesn't change for each call into
execute, the checks only need to be ran once.

[YOCTO #10369]

(Bitbake rev: f65e631ab6705dfd9188f19ee423eca33bca7d7d)

Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-11 23:43:16 +01:00
Richard Purdie 9756e534fd bitbake: bitbake: Update version to 1.32.0
(Bitbake rev: d9713ed13d0c88c7ee38e8d7b52aa525318af6e3)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-11 08:47:17 +01:00
Jussi Kukkonen 0f042b1e1f bitbake: depexp: Close UI with error message on NoProvider event
Without this the UI just sits there doing nothing. Showing an
infobar in-UI would be nicer but not much more useful since currently
user couldn't do anything in-UI to fix the situation. Implementation
is based on the one in knotty.

Fixes [YOCTO #9288]

(Bitbake rev: eee9231a543f1d0b9ef3cd8377fc46fd23afb97b)

Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-11 08:29:49 +01:00
Benjamin Esquivel b9d6a7cc23 bitbake: main: Check bitbake server-only port is a number
Either using the memres script or the bitbake call with --server-only
if the port is a string instead of a number then the process hangs
indefinitely causing a loop that never ends.

Add a check at the beginning for the port being a number otherwise
show an error message and exit cleanly.

[YOCTO #10397]

(Bitbake rev: 35927a98daeeb854ef5782e900206af6cd96b3d7)

Signed-off-by: Benjamin Esquivel <benjamin.esquivel@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-09 12:33:26 +01:00
Richard Purdie 77e56194dc bitbake: runqueue: Optimise task id string manipulations
Some task id manipulations were suboptimal:

* taskfn_fromtid and fn_from_tid were effectively the same function
* many calls to split_tid(), then taskfn_fromtid()
* taskfn_fromtid() called split_tid() internally

This patch adds split_tid_mcfn() to replace split_tid() and returns the
"taskfn" variant being used in many places. We update all core calls
to the new function and ignore the return values we don't need since the
function call overhead of the split_tid wrapper is higher than ignoring
a return value.

The one remaining standalone use of taskfn_fromtid is replaced with
fn_from_tid. I couldn't see any external usage so it was dropped.

There is external usage of split_tid so a wrapper remains for it.

Combined together these changes should improve some of the runqueue task
manipulation performance.

(Bitbake rev: 1bf2ef874fbe47f1320007efa0bdeef8d630b8a1)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-09 12:33:26 +01:00
Ed Bartosh 146eb22b0e bitbake: toaster: fix cloning of git+ssh repositories
Replaced '+' -> '_' to avoid having '+' in folder name.

Thanks Stephan Dünner for this fix.

(Bitbake rev: 858ade277d3bd62e84d3d78e9302f766c1b31dfb)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-09 12:33:26 +01:00
Christopher Larson f4366293ff bitbake: bb.runqueue: fix unexpected process death logic
`if w in self.rq.worker` when w *is* self.rq.worker doesn't make a great deal
of sense, and results in this error:

      File ".../poky/bitbake/lib/bb/runqueue.py", line 2372, in runQueuePipe.read():
                             name = None
        >                    if w in self.rq.worker:
                                 name = "Worker"
    TypeError: unhashable type: 'dict'

Most likely this was meant to be 'is' rather than 'in', but rather than
checking after the fact, just include the name in the iteration, instead.

While we're here, also clean up and fix the broken error message.

(Bitbake rev: 267e025cad44c8bd0fb157f1f7a2e08df117ba84)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-09 12:33:26 +01:00
Aníbal Limón 31aafe6852 bitbake: ui/knotty.py: Fix signal handling of SIGWINCH in BBProgress
Add the ability to pass default signal handler for SIGWINCH in BBProgress
because with multiple instace of BBProgress the original signal handler
set by TerminalFilter (sigwinch_handle) is lost.

This is a fix for stack trace due to multiple async calls of ProgressBar
_handle_resize (ioctl to terminal fd), see:

NOTE: Executing SetScene Tasks
Fatal Python error: Cannot recover from stack overflow.

Current thread 0x00007f70a4793700 (most recent call first):
  File
"/home/alimonb/repos/poky/bitbake/lib/progressbar/progressbar.py", line
183 in _handle_resize
  File "/home/alimonb/repos/poky/bitbake/lib/bb/ui/knotty.py", line 58
in _handle_resize
  File "/home/alimonb/repos/poky/bitbake/lib/bb/ui/knotty.py", line 60
in _handle_resize
...
  File "/home/alimonb/repos/poky/bitbake/lib/bb/ui/knotty.py", line 60
in _handle_resize
...
Aborted

(Bitbake rev: 812bd49cb569379ee90d5be28a4b6e60645f1e54)

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-09 12:33:26 +01:00
Michael Wood 4454d02448 bitbake: toaster: Update tests to reflect front end changes
- Browser test we changed the project heading access to use the class name
 - Update toastergui unit test for additional gotoUrl property
 - On faster browsers we had a race for layer details inputs being
   visible

(Bitbake rev: 80f377ebcffd01dbe393ccffb999df4b04552f8a)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: bavery <brian.avery@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-06 11:41:48 +01:00
Michael Wood 7f67977518 bitbake: toaster: Delete notification update front end implementation to design
Update the delete notifications to reflect feedback from design
review comments.

(Bitbake rev: e47a1cc160c0f1da060884a8585403b35375fb09)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: bavery <brian.avery@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-06 11:41:48 +01:00
Michael Wood 8df56061f6 bitbake: toaster: importlayer Fix layer dependencies button state toggle
Fix regression introduced by switching typeahead library. Make sure we
enable and disable the add button based on whether the selection event
has fired or not.

[YOCTO #9936]

(Bitbake rev: cfef79e98b023252cd116d6cc4f90d261d47d13f)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: bavery <brian.avery@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-06 11:41:48 +01:00
Michael Wood 5e9b405567 bitbake: toaster: checksettings Remove confusing startup messages
These "validation" messages are shown regardless as to whether the
settings are being correctly set or not.
For the time being remove them.

[YOCTO #9097]

(Bitbake rev: c57f20f9cd7cb4ea4d285291a1e71e5df7152799)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: bavery <brian.avery@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-06 11:41:48 +01:00
Michael Wood 25ea0b625d bitbake: toaster: buildinfohelper: Use correct way to get message from LogMessage
Use the correct method to get a message value from the LogMessage object
rather than constructing it ourselves which is not recommended. This
causes an exception when the msg contains a '%' such as when there are
wildcards in file names (something2.%.bbappends)

(Bitbake rev: 11b3b6a7087554d14a2812a9ae463dce740b879e)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: bavery <brian.avery@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-06 11:41:48 +01:00
Michael Wood fffce32ebd bitbake: toaster: api / project Cancel any in progress builds before project delete
Before we finally delete any project make sure we send the cancel command to
any in-progress builds. This ensures that an inaccessible build doesn't block
up the system and that we don't get errors after deletion.

[YOCTO #10289]

(Bitbake rev: 263762a01a6460332ef0cfea5df1e5b81c086df4)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: bavery <brian.avery@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-06 11:41:48 +01:00
Christopher Larson 7d27275ef8 bitbake: bb.build: in _exec_task, catch errors from TaskStarted
We don't always want a traceback when an exception is raised by the
TaskStarted event handler. Silently return if we get a SystemExit or
HandledException, and print the error and return for FuncFailed.

This is done via a separate try/catch block, to avoid firing TaskFailed if all
the TaskStarted event handlers didn't complete, otherwise the bitbake UIs get
unhappy.

(Bitbake rev: ca5b788280ad4303cc08a376e847cbbeda31970c)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-05 10:28:12 +01:00
Joshua Lock 1110dde73a bitbake: event: prevent unclosed file warning in print_ui_queue
Use logger.addHandler(), rather than assigning an array of Handlers
to the loggers handlers property directly, to avoid a warning from
Python 3 about unclosed files:

$ bitbake
Nothing to do.  Use 'bitbake world' to build everything, or run 'bitbake --help' for usage information.
WARNING: /home/joshuagl/Projects/poky/bitbake/lib/bb/event.py:143: ResourceWarning: unclosed file <_io.TextIOWrapper name='/home/joshuagl/Projects/poky/build/tmp/log/cooker/qemux86/20161004094928.log' mode='a' encoding='UTF-8'>
  logger.handlers = [stdout]

(Bitbake rev: 1e23b1f1a80066223b98e18b163840051ac74944)

Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-05 10:25:34 +01:00
Richard Purdie 3812e9f8d1 bitbake: bitbake: Update version to 1.31.2
(Bitbake rev: 100a0aef3d121d950d89c4152f56957628f2f933)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-05 10:10:11 +01:00
Aníbal Limón 79012f943d bitbake: bb/event.py: fire_ui_handlers enable threading lock support
In some cases there is a need to fire bb events into multiple
python threads so locking is needed (writing to a fd/socket).

Adding a helper functions for disable/enable by request to avoid
overhead.

[YOCTO #10330]

(Bitbake rev: a583dc0b296415ec904c081c4de96ceef46732a8)

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-05 10:10:11 +01:00
Richard Purdie 642197f7a4 bitbake: data: Fix handling of vardepvalueexclude
The value used for exclusion was always being expanded. This is actually
a bad idea since in most cases you'd want to exclude an unexpanded
value and makes it impossible to use the variable as intended.

This adjusts things so the value is not expanded and we can correctly
remove things from checksums much more easily.

(Bitbake rev: 81bc8201c475d2b6bef0168573915ad0140f6dad)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-01 21:45:57 +01:00
Ed Bartosh de34aab334 bitbake: toaster: make error message more informative
Error message
 ERROR: Unprocessed MetadataEvent <bb.event.MetadataEvent object at 0x7f750e671a58>
doesn't give a lot of information about the event. It just prints
event object, which is always bb.event.MetadataEvent.

Including event type into the error message should make it more
informative:
 ERROR: Unprocessed MetadataEvent TaskArtifacts

(Bitbake rev: 603c7c13536d3fa1786270e863688c1d2e511196)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-30 16:52:22 +01:00
Ed Bartosh af0f679344 bitbake: toaster: fix 'Unhandled MetadataEvent' error
New MetadataEvent 'TaskArtifacts' causes this error.
Processing of this event will hopefully be implemented in future.
For now it should be enough to just skip it.

(Bitbake rev: 114a3fe3f23ef09782c5aa18f425d0d0dbdfdd35)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-30 16:52:22 +01:00
Ed Bartosh c7b55ea170 bitbake: toaster: fix handling of EnvironmentError
Due to the bug in processing EnvironmentError exception,
toasterui ignores it. As EnvironmentError is a base for OSError
and IOError this means that all OSError and IOError exceptions
were silently ignored.

(Bitbake rev: c8f4ca008bf9396b0ed45d44bfe2220c82a614a9)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-30 16:52:22 +01:00
Ed Bartosh cc4c02a268 bitbake: toaster: check if file exist
Buildinfohelper assumes that all files mentioned in
manifest exist in deploy/ directory, which is not always
the case. Toaster crashes with OSError trying to
call os.stat on non-existing file.

Checking if file exists before processing it should
fix this.

[YOCTO #10185]

(Bitbake rev: 54565e7ca84d2722a2454e7fa52cda564b28b527)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-30 16:52:22 +01:00
Michael Wood 5b035ed9be bitbake: toaster: layerdetails Update implementation of delete imported layer
Update the implementation of delete an imported layer so that it is
consistent with the other delete messages and wording. Also use the new
libtoaster way of setting a notification that the delete was successful.

(Bitbake rev: 0b8d3ac48b5a0984963d664ff5630e3b02c4ecd1)

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>
2016-09-30 16:52:22 +01:00
Michael Wood ac5aba6cab bitbake: toaster: customrecipe Add frontend feature to delete custom image recipe
[YOCTO #8132]

(Bitbake rev: 19aee3dd7fa290e12216f9a5cf25a8b2c8d80d20)

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>
2016-09-30 16:52:22 +01:00
Michael Wood 5b23bf083b bitbake: toaster: importlayer Convert success import to new notification system
Use the simpler libtoaster method of showing a notification about
successful import of a layer.
Also a number of whitespace clean ups.

(Bitbake rev: 89d3acbc32eadd2acf90030d8b9703ce193dff0c)

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>
2016-09-30 16:52:22 +01:00
Michael Wood fbf7e14894 bitbake: toaster: Add front end controls for deleting a build
Add front end modal and controls for deleting a build from the build
dashboard.

Also convert the Actions list to links instead of buttons as per the
design.

[YOCTO #6238]

(Bitbake rev: 93bca6d877e0b2b5b8ef6b27288c0987a6c899b1)

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>
2016-09-30 16:52:22 +01:00
Michael Wood 44058c45ee bitbake: toaster: Add backend API for deleting a build
(Bitbake rev: cdc380c188fd17e55d1d270e5b468d931aa436b2)

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>
2016-09-30 16:52:22 +01:00
Michael Wood d209f8b7af bitbake: toaster: alerts and modals Avoid modals and alerts overlaying each other
Make sure that when we spawn a modal we clear any notifications and also
make sure that old notifications are cleared before showing a new one.

(Bitbake rev: c7f30a673ab973a2500092d2e981a47da05fbf12)

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>
2016-09-30 16:52:22 +01:00
Michael Wood 0d70606022 bitbake: toaster: project page Implement front end feature to delete project
Add confirm modal and api calls to delete a project from the project
dashboard.

[YOCTO #6238]

(Bitbake rev: e1cca28826dfa66d905dd4daf9964564c355207e)

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>
2016-09-30 16:52:22 +01:00
Michael Wood 7ca44f53bc bitbake: toaster: libtoaster Add a global notification set/show mechanism
We now have a number of places where we show change notifications based
on an event in a previous page (imported a layer, deleted a build,
deleted a project etc) and we show these notifications on various pages
so we add a simple notification utility to libtoaster.

(Bitbake rev: c8db313e907918b0df122006046b157d510ecc1d)

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>
2016-09-30 16:52:21 +01:00
Michael Wood 8ba7ccd252 bitbake: toaster: move MostRecentBuildsView to its own widget
This view is specific to the builds dashboard rather than gernic api so
like ToasterTable and ToasterTypeAhead we class it as a widget as it has
a single purpose. Also clean up some flake8 identified issues.

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

(Bitbake rev: 05428514e64ec896faae4055619e149e98bc8f57)

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>
2016-09-30 16:52:21 +01:00
Michael Wood 4d0bc8d521 bitbake: toaster: Clean up and convert to rest api project edit and get calls
Convert the project xhr calls into proper rest api and port the client
side calls to use the new API. Fix all the pyflakes identified issues
and clean up unused fields.

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

[YOCTO #9519]

(Bitbake rev: 8b01767d6e787cdb09789116ebf57dfb70f521bc)

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>
2016-09-30 16:52:21 +01:00
Richard Purdie 0b17e6d32c bitbake: runqueue: Ensure worker failure is accounted for in task statistics
If the worker fails to launch, ensure the task is shown as failed rather
than a confusing "all succeeded" message.

Patch from Juro Bystricky

[YOCTO #10335]

(Bitbake rev: 0e9a2ff96d138641501874a1cd7aa6cc7e94d727)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-30 16:52:21 +01:00
Juro Bystricky 8b24b0c359 bitbake: build.py: fix os.getcwd() exception
When trying to obtain the current directory from a directory
that does not exist anymore, an exception is raised.
This patch handles such exception.

[YOCTO #10331]

(Bitbake rev: 4bcf77589312d9936340d8c308006c2fc9baf67c)

Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-28 10:17:13 +01:00
Paul Eggleton 9173b11f2f bitbake: knotty: ensure progress bar output is accounted for in display
When calculating how many lines we'd printed we weren't properly taking
the progress bars into account, with the result that sometimes if the
last line printed on the terminal wrapped to the next line (which is
possible) we backed up less lines than we should have.

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

Hopefully this will fix [YOCTO #10046].

(Bitbake rev: 326d18d96faf02675ba34ad3c3a20cd424b39b91)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-23 15:01:56 +01:00
Richard Purdie 0d76de85bd bitbake: knotty: Show task elapsed time
Its often useful to know how long a task has been running for. This patch
adds that information to the task display, updating every 5s if there
were no other updates so the user can see how long tasks have been running
for.

[YOCTO #9737]

(Bitbake rev: 6c42025e5dd7761213be3f82f3252a7892d2239d)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-23 15:01:56 +01:00
Richard Purdie 88df0e4d5d bitbake: cooker/providers: Only add target to world build if task exists
A "bitbake world -c unpack" currently breaks as not all tasks have an
unpack task. This change allows addition of world targets only if the
specified task exists which makes certain commands possible when otherwise
you just get errors which can't easily be avoided.

(Bitbake rev: ca4f5e6d01b5c8cf315f59bc86194d63c0d3d042)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-22 11:18:11 +01:00
Ross Burton 37d5307db0 bitbake: fetch2: handle absolute paths in subdir
Currently if you use the subdir parameter in a SRC_URI and pass an absolute path
then it gets appended to the unpack directory instead of being used directly.
This is inconvenient as it may be useful to use ${S} when you want to unpack a
file into the source tree.

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

(Bitbake rev: c3873346c6fa1021a1d63bddd9b898a77c618432)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-22 11:18:11 +01:00
Christopher Larson 5503ed14ed bitbake: bb.build: in _exec_task, catch BBHandledException
We don't want a traceback for this exception, we need to catch it, fire
TaskFailed, and return failure.

(Bitbake rev: 63966ada459d44d3dc7817ad2a026a22e8f6700f)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-21 22:17:57 +01:00
Richard Purdie d3e6e1054c bitbake: runqueue: Handle missing sstate dependencies better
If you "bitbake glibc-locale" then delete the libpcre-native sstate
and "bitbake glibc-locale -C package_write_rpm", it will fail with
rpmbuild missing the libprce library.

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

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

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

(Bitbake rev: ba566b46d530b495f12f3a74f76434717b22a020)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-21 21:58:06 +01:00
Michael Wood a884c4307a bitbake: toaster: buildinfohelper local layer don't construct path using git info
When the layer is local source don't try and work out the location of
the layer by using the git information (getGitCloneDirectory)

[YOCTO #10199]

(Bitbake rev: 3dfea5214d4bd006e26630e5024774ecb84ea527)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: bavery <brian.avery@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-21 21:58:06 +01:00
Michael Wood 6066729797 bitbake: toaster: Add tests to detect if we have missing db migrations
Based on the same test as found in patchwork by Damien Lespiau
https://github.com/dlespiau/patchwork/blob/master/patchwork/tests/test_db.py

(Bitbake rev: 031cb194aaa1b6cc970fed3fa0d0dbd3ebac163f)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: bavery <brian.avery@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-21 21:58:06 +01:00
Ed Bartosh 7a3cccbd1a bitbake: toaster: unlock BuildEnvirnoment when build is done
There is no need to lock build environment before changing
build status as this operation is very fast. However, there
is a need to unlock it after changing build status.

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

(Bitbake rev: faa88272d656640c039572c5c8f3e6c56535b6f7)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-21 21:58:06 +01:00
Ed Bartosh ad04a6324e bitbake: runbuilds: code cleanup - remove unused imports
Fixed pylint warning:  W0611(unused-import): Unused import

(Bitbake rev: 49731a1a2b2b63c1a897d2e33bca4968524e8710)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-21 21:58:06 +01:00
Ed Bartosh 5e88c4a6fe bitbake: runbuilds: code cleanup - whitespaces, long lines
Fixed following pylint warnings:
 C0330(bad-continuation): Wrong hanging indentation before block.
 C0326(bad-whitespace): No space allowed around keyword argument assignment
 C0326(bad-whitespace): Exactly one space required before assignment
 C0301(line-too-long): Line too long

(Bitbake rev: 0eecd660e374a4dbcefe4c59f4c8654bf3a0e937)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-21 21:58:06 +01:00
Ed Bartosh 323b81a083 bitbake: runbuilds: process builds on start
If Toaster is stopped incorrectly there could be some
build requests and builds in incorrect state left from the previous run.
Running main processing function on start should take care of those.

(Bitbake rev: 6b9f8f6bb51d1aa2ca4effc34e076e331d0cb8d1)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-21 21:58:06 +01:00
Ed Bartosh 64d284b26c bitbake: runbuilds: process builds on SIGUSR1
Run main processing function 'runbuild' only if SIGUSR1 is
received. This signal is sent by Toaster when build status
is changed (either started, cancelled or finished).

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

[YOCTO #8918]

(Bitbake rev: 62d598cc5aa01d23f1e9284e9e926bd55b1d1878)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-21 21:58:06 +01:00
Ed Bartosh e9a12e5d37 bitbake: toaster: notify runbuilds when build status changes
Called signal_runbuilds API when build is scheduled, cancelled or
finished to notify runbuilds process about builds status change.

[YOCTO #8918]

(Bitbake rev: fe08f0fa4b328908e73695ebbceca87bc86a49f9)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-21 21:58:06 +01:00
Ed Bartosh 2478a6f208 bitbake: toaster: implement signal_runbuilds function
This function reads pid of runbuilds process from
BUILDDIR/.runbuilds.pid and sends SIGUSR1 to it. signal_runbuilds
function will be used in Toaster code to notify runbuilds when
build is scheduled, finished or cancelled.

(Bitbake rev: 62955224a6d99e9f581d2bef924058070bfa4c43)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-21 21:58:06 +01:00
Ed Bartosh 483c16a7ce bitbake: toaster: fix checking of repository url
Toaster checks gir repository url is the same as locally cloned before
checking it out to existing local clone. This check can be skipped if
commit is 'HEAD' as in this case repository is not hard reset to
commit, so the local clone won't be changed.

[YOCTO #10163]

(Bitbake rev: 7e9a89e3fde5e71cb859799635974ec41790c44d)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-21 21:58:06 +01:00
Mark Hatle 08af663a15 bitbake: cookerdata.py: Catch BBHandledException, preventing a backtrace in an event
The event handling 'Exception' was catching and triggering a backtrace.  This
trace was obscuring any errors from an event handler that had raised the
BBHandledException, which should indicate do not print additional information.

(Bitbake rev: 51ca5193a5674b27d816140b0254f485912177a2)

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-21 21:58:06 +01:00
Joe Slater f1d8f1e693 bitbake: cooker.py: add LAYERRECOMMENDS processing
Add recommended layers to collection_depends[] so that dynamic
priority assignment will work for both depends and recommends.

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

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

(Bitbake rev: 20cdc3d609f8aea992f97c3db336574d3a549973)

Signed-off-by: Joe Slater <jslater@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-21 21:58:06 +01:00
Belen Barros Pena 74acb91a79 bitbake: toaster: Remove duplicate layer information
In the custom recipe details page, the layer information is displayed
twice in the right hand column. Remove one of the layer entries, since
showing the layer information once should be enough.

[YOCTO #10037]

(Bitbake rev: e2b5dc3732781dc933c6bb10482926335720d110)

Signed-off-by: Belen Barros Pena <belen.barros.pena@linux.intel.com>
Signed-off-by: bavery <brian.avery@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-21 21:58:05 +01:00
Belen Barros Pena 07aa966b5b bitbake: toaster: Indicate active navigation element
The left navigation in the build history pages is not showing the active
item when you navigate directly to the errors or warnings information in
the build summary. Add a special case to make sure the "build summary"
item is highlighted.

[YOCTO #9864]

(Bitbake rev: f236d9ca28e45a270f50bb3edcd466b1bc8d2960)

Signed-off-by: Belen Barros Pena <belen.barros.pena@linux.intel.com>
Signed-off-by: bavery <brian.avery@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-21 21:58:05 +01:00
Belen Barros Pena 67ce1ce3cb bitbake: toaster: Fix links to tasks with specific outcome
The build dashboard provides a count of tasks that were executed and not
executed, and of tasks that failed (if any). The number is a link to the
list of tasks.

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

[YOCTO #9832]

(Bitbake rev: a75e70bbc9081f77f1e4aeeee8222b06112e4406)

Signed-off-by: Belen Barros Pena <belen.barros.pena@linux.intel.com>
Signed-off-by: bavery <brian.avery@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-21 21:58:05 +01:00
Ross Burton ac2ac31206 bitbake: uihelper: use elif instead of repeated if
(Bitbake rev: a1d6f6425cd9ef9e07344869817517172afd6e27)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-21 21:58:05 +01:00
Ed Bartosh 5414b80e8d bitbake: cooker: check if target contains task
Task name was incorrectly added to the targets that already
contained :task suffix and fired with BuildInit event. This
caused Toaster to create incorrect Target objects and show
them in UI.

[YOCTO #10221]

(Bitbake rev: b7faf1af3bd3110fba347fbe6e432fc4ee66590a)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-16 15:24:03 +01:00
Markus Lehtonen 088d386ddb bitbake: cookerdata: allow multiple passes of config re-parsing
[YOCTO #10188]

(Bitbake rev: 07a03a1290fd206df2b40ffc28381b5b3c10ba4a)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-16 15:24:03 +01:00
Markus Lehtonen e3e239ba54 bitbake: cookerdata: fire ConfigParsed event after re-parse
[YOCTO #10188]

(Bitbake rev: ec1c951a4ee0c33acdde29e578f79ad719a34aca)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-16 15:24:03 +01:00
Richard Purdie 0c1b8bf549 bitbake: Add missing file from 'toaster: Allow git information to be null for BRLayer'
(Bitbake rev: 3c762873bb8dc8a3cf89b26579a38d58f6731e04)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-16 14:36:03 +01:00
Richard Purdie 53b1fa2d3e bitbake: build: Allow dirs/cleandirs to work for empty functions
Users are surprised when dirs/cleandirs aren't acted upon for
empty functions. This reorders the code slightly so that those
flags are acted upon for empty functions as there are cases where
this is expected.

[YOCTO #10256]

(Bitbake rev: 5bf874673d75b5f4ff2b34f0ab8502558ee84d00)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-15 12:15:07 +01:00
Ulf Magnusson c3f630df52 bitbake: bitbake: fetch2: Make SRCREV_FORMAT name substitution safer
The implementation of SRCREV_FORMAT has at least two issues:

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

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

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

(Bitbake rev: 8e6a893cb7f13ea14051fc40c6c9baf41aa47fee)

Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-15 12:15:07 +01:00
Paul Eggleton d5698c0afc bitbake: fetch2/npm: don't download same URL multiple times
If we've already fetched a particular URL then we do not need to do so
again within in the same operation. Maintain an internal list of fetched
URLs to avoid doing that.

(Bitbake rev: b4705c80add1f618c11a9223cdd9578d763b50ec)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-15 12:15:07 +01:00
Ed Bartosh d649c64beb bitbake: event.py: output errors and warnings to stderr
All logging messages are printed on stdout when processing
UI event queue. This makes it impossible to distinguish between
errors and normal bitbake output. Output to stderror or stdout
depending on log level should fix this.

(Bitbake rev: 56ac0d4c7a5f47aeb707b15a0c305d9f73aae945)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-15 12:15:07 +01:00
Ed Bartosh ead0545626 bitbake: cooker: record events on cooker exit
Bitbake collects all events in special event queue when called with
-w option. However, it starts to write events to the eventlog only
after BuildStarted event is received. In some cases this event is
not received at all, e.g. when bitbake is run with --parse-only
command line option.

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

[YOCTO #10145]

(Bitbake rev: 57912de63fa83550c0ae658eb99b76e9cc91a8d1)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-08 00:33:47 +01:00
Belen Barros Pena 87cf84fead bitbake: toaster: orm Update IMAGE_FSTYPES values
This patch fixes a typo in one of the IMAGE_FSTYPES values listed in
Toaster. It also updates the hardcoded list of values to match the
latest list in meta/classes/image_types.bbclass

[YOCTO #9447]

(Bitbake rev: 46db3279cb81b3ca6ce047204aee620f5ee51220)

Signed-off-by: Belen Barros Pena <belen.barros.pena@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-08 00:33:47 +01:00
David Reyna 36fe748957 bitbake: toaster: keep layer name in variable history path
When converting variable history file names to relative
paths, keep the layer directory's name so that the user
can distinguish between conf files with the same name.

[YOCTO #8188]

(Bitbake rev: 59561d652af91c2099b735084f0e44275d68e637)

Signed-off-by: David Reyna <david.reyna@windriver.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-08 00:33:47 +01:00
Belen Barros Pena 8ba4f54037 bitbake: toaster: Allow forward slash in variable names
Add forward slash to the list of special characters allowed in variable
names. Also update the list of allowed special characters in the error
messages.

[YOCTO #9611]

(Bitbake rev: 146f6f95a8753308edb31e952d7c440c8de11870)

Signed-off-by: Belen Barros Pena <belen.barros.pena@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-08 00:33:47 +01:00
Belen Barros Pena b5070f5337 bitbake: toaster: layer details Fix "edit" form interaction
Make sure the layer information disappears when the edit form shows, and
that the layer details come back when you click the 'cancel' button in
the edit form.

(Bitbake rev: bd08abe7c1f5fc96ee73c20b2c9d10a591a5f69c)

Signed-off-by: Belen Barros Pena <belen.barros.pena@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-08 00:33:47 +01:00
Belen Barros Pena 23056fcc73 bitbake: toaster: import layer Layout fixes
The layout of the import layer form was looking a bit awkward. This
commit tidies things up a bit.

(Bitbake rev: e5e51ca1394bc392eba99742c59d86b8e5fd5623)

Signed-off-by: Belen Barros Pena <belen.barros.pena@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-08 00:33:46 +01:00
Belen Barros Pena c4fcf41d7f bitbake: toaster: layer details Layout fixes
The layout of the layer details page was looking a bit awkward. This
commit tidies things up.

(Bitbake rev: ce9a5f885f43bebf39d191309f48da83b31e60e0)

Signed-off-by: Belen Barros Pena <belen.barros.pena@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-08 00:33:46 +01:00
Belen Barros Pena 65e1d66727 bitbake: toaster: configuration Provide machine help text
When you change the machine from the project configuration page, you get
some useful suggestions as you start typing a machine name. However, the
suggestions only include machines provided by the layers added to your
project. This is not necessarily clear from the design (yes, it should
be improved), which means you might be looking for a machine, not see it
in the suggestions, and assume the machine is not supported by
OpenEmbedded.

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

[YOCTO #8034]

(Bitbake rev: 829c9bcb58f961c644e24b24265e0ef45f0fec57)

Signed-off-by: Belen Barros Pena <belen.barros.pena@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-08 00:33:46 +01:00
Belen Barros Pena ebc6e84b3e bitbake: toaster: tasks Remove recipe version from defaults
The 'Recipe version' column should not be part of the set of columns
shown by default in the tasks table. Set the hidden property for that
column to 'True' so that it doesn't show when you load that table
for the first time.

[YOCTO #10179]

(Bitbake rev: 249dd31fcaabbec32fdee30b0c84be90d4f92430)

Signed-off-by: Belen Barros Pena <belen.barros.pena@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-08 00:33:46 +01:00
Paul Eggleton ee7c6d00bb bitbake: lib/bb/utils: edit_metadata() comment tweaks
No functional changes, just make a couple of minor tweaks to the
comments for edit_metadata():

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

(Bitbake rev: 99675c19375c96140bc8ae8f9fc3a1945a77cebb)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-08 00:33:46 +01:00
Paul Eggleton d67e3b4c70 bitbake: fetch2/npm: clarify comment
The correct name of the parameter is "version" not "ver" so ensure we
aren't misleading the user by giving the latter in an example.

(Bitbake rev: 14c045c6a20993d389b91ae2459d811a1430a7b2)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-08 00:33:46 +01:00
Paul Eggleton 3a0f5d95a7 bitbake: fetch2/npm: handle top-level shrinkwrap file
Allow using a top-level shrinkwrap file with one or more npm://
dependencies, i.e. if the module isn't found at the top level then look
one level down.

Part of the fix for [YOCTO #9537].

(Bitbake rev: f7de3f8b5f628dee043fe783148812914ab20813)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-08 00:33:46 +01:00
Paul Eggleton 5ab6867714 bitbake: fetch2/npm: support subdir= parameter
"npmpkg" can be a default, but it should respect the subdir parameter as
with other FetchMethods. This allows us to have more than one npm://
entry in SRC_URI without nasty hacks.

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

(Bitbake rev: e6a94d2091ec5d42f25102334a8492a731b8dec3)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-08 00:33:46 +01:00
Paul Eggleton eb53750ab7 bitbake: fetch2/npm: fix broken fetches if more than one npm URL fetched
You cannot set a URL-specific value in an object-level variable on
the FetchMethod in urldata_init() or the result is the value specific to
the last URL will be the one that gets set. This prevented fetching more
than one npm:// URL correctly - the other tarballs would not download to
the correct location and do_unpack failed to find them as a result.

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

(Bitbake rev: 1435b49ea7d0f9d4cc4a665fb2aa83d1eea7900f)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-08 00:33:46 +01:00
Paul Eggleton 1937b17f67 bitbake: fetch2/npm: explicitly specify workdir
We were downloading into the current directory here, which is fine if
that current directory can be expected to be the right place - but
that's not true when called from recipetool within OE. We should
explicitly specify the directory to run the command in and then there
won't be a problem.

(Bitbake rev: 0ddaf725e5a0675b252b7f80b1706370e478175b)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-08 00:33:46 +01:00
Christopher Larson f2f177c94d bitbake: bb.fetch2.svn: correctly pass workdir when fetching
The ud.pkgdir argument was being passed as the 'quiet' argument to
runfetchcmd, not the 'workdir' argument, resulting in fetching the svn module
into the root of DL_DIR, not where it belongs.

Cc: Matt Madison <matt@madison.systems>
(Bitbake rev: dc756510a95f88b192352be6fcd1d5d77852c348)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-02 18:09:50 +01:00
Mariano Lopez 355e4ec0b6 bitbake: cooker.py: Catch when stdout doesn't have a file descriptor
Currently, there is a check to remove the TOSTOP attribute from
a tty to avoid hangs. It assumes that sys.stdout will have a
file descriptor and this is not always true, some IO classes
will throw exceptions when trying to get its file descriptor.

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

[YOCTO #10162]

(Bitbake rev: cb4f8f6efa28ef2b13bc738a0118b876baa15b3e)

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-02 18:09:50 +01:00
Michael Wood de83a8ab6d bitbake: toaster: localhostbecontroller Remove git assumption
We don't need to force everyone to use git for the method in which
openembedded-core is downloaded. For instance it could have been
downloaded and extracted as a tarball.

(Bitbake rev: 8b7180332691a41a013e07a52b26018402141b6a)

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-09-02 18:09:50 +01:00
Michael Wood ce592fc7f5 bitbake: toaster: Allow git information to be null for BRLayer
We no longer only deal with layers that have their source in a gir
repository, we also allow for local directories too so update the
BRLayer model to reflect this.

(Bitbake rev: a15f61f3ef5a87b87121457f76592c87f0ea5d7f)

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-09-02 18:09:50 +01:00
Michael Wood 4daae79875 bitbake: toaster: tests Add selenium test layer source switching layer details page
Add selenium tests for the new layer source switching functionality on
the layer details page. Edits the values for git repository and saves
and then edits the details for directory information and saves.

(Bitbake rev: acdfafdd753abe38a313c42e3a9d6211338b4e73)

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-09-02 18:09:50 +01:00
Michael Wood 2318f92580 bitbake: toaster: Move Custom image recipe rest api to api file
We now have a dedicated file for the rest API so move and rework for
class based views. Also clean up all flake8 identified warnings.

Remove unused imports from toastergui views.

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

(Bitbake rev: 37c2b4f105d7334cdd83d9675af787f4327e7fe7)

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-09-02 18:09:50 +01:00
Michael Wood 3b87f2895a bitbake: toaster: Fix oe-core fixture
Due to a copy paste error we managed to get some of the wrong
information in the oe fixture that provides a suggested default settings
for Toaster. This meant it tested correctly when it shouldn't have.
Fix:
 - The use of local bitbake
 - An incorrect call to realpath which didn't include its parent module.
 - The field used for the local_dir of an existing openembedded-core

(Bitbake rev: d57a9124650e5367919668dfccf6aad4962a77f1)

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-09-02 18:09:50 +01:00
Michael Wood 50a8d3a34c bitbake: toaster: layerdetails clean ups after integrating local layer changes
A few clean ups for the work done to integrate editing imported local layers
into the layer detail page.

(Bitbake rev: 092ef32e695b43c3337b7116722c4c6eba981396)

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-09-02 18:09:50 +01:00
Sujith H e99b4cd625 bitbake: toaster: update api to include local_source_dir
Add an additional argument to the api to handle
local_source_dir which is the value user passes
to import non-git layers.

[YOCTO #9913]

(Bitbake rev: 2b5728fc5c0e578560506697f271605e80b5918f)

Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-02 18:09:49 +01:00
Sujith H fa48ca677c bitbake: toaster: layerdetails js changes for switching layers
This patch helps to implement the switching of layers
between directories and git repositories. Specifically
selection of git and local directory. Also enabling
form to view the selection.

[YOCTO #9913]

(Bitbake rev: 5c20834691f1b65cfc4a0c4ec12958f86b34bbeb)

Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-02 18:09:49 +01:00
Sujith H d9b5d11664 bitbake: toaster: add switch of git and not-git layers imported
This patch updates the layerdetails html file to
add the feature of switching imported layers between
directories and git repositories.

[YOCTO #9913]

(Bitbake rev: 70319eb690a056b41b7e91d79560067edd623ee1)

Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-02 18:09:49 +01:00
Elliot Smith d2797b5ec2 bitbake: buildinfohelper: discover kernel artifacts correctly
Because some image_license.manifest files contain multiple
FILES lines, and because those lines can sometimes not contain
a list of files (i.e. they look like "FILES:\n"), we were
resetting the list of kernel artifacts when we hit the second
"empty" line.

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

[YOCTO #10107]

(Bitbake rev: 927ec3524625ac731326b3c1c1361c2a4d2bd9e1)

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-09-02 18:09:49 +01:00
Stephano Cetola 46bad463ef bitbake: wget: allow basic http auth for SSTATE_MIRRORS
If http basic auth creds were added to sstate mirrors like so:

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

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

[ YOCTO #9815 ]

(Bitbake rev: cea8113d14da9e12db80a5b6b5811a47a7dfdeef)

Signed-off-by: Stephano Cetola <stephano.cetola@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-02 18:09:49 +01:00
Markus Lehtonen 3658f6d477 bitbake: cookerdata/ast: Fail gracefully if event handler function is not found
[YOCTO #10186]

(Bitbake rev: 107c47c4e6de6a596cf1aeca5c18dbc1c5b44dc4)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-02 18:09:49 +01:00
Richard Purdie 412a26e154 bitbake: build/runqueue: Add noextra stamp file parameter to fix multiconfig builds
We can't execute the same task for the same package_arch multiple
times as the current setup has conflicting directories. Since
these would usually have the same stamp/hash, we want to execute in
sequence rather than in parallel, so for the purposes of task execution,
don't consider the "extra-info" on the stamp files. We need to add
a parameter to the stamp function to achieve this.

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

(Bitbake rev: a9041fc96a14e718c0c1d1676e705343b9e872d3)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-02 18:09:49 +01:00
Richard Purdie e7b2b7d40d bitbake: fetch2: Handle multiconfig fetcher issues
We need a separate fetcher cache per multiconfig as the revisions and other
SRC_URI data can potentially be different. For now, this is the simplest way
to achieve that and avoids linux-yocto kernel build failures when targeting
multiple machines for example.

(Bitbake rev: d98cc31d6668bc1d6372664593126b5e5132ef2c)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-02 18:09:49 +01:00
Paul Eggleton 26aad57ece bitbake: tinfoil: add a parse_recipe_file function
Parsing a recipe is such a common task for tinfoil-using scripts, and is
a little awkward to do properly, so add an API function to do it. This
should also isolate scripts a little from future changes to the internal
code. The first user of this will be the OpenEmbedded layer index update
script.

Part of the fix for [YOCTO #10192].

(Bitbake rev: 39780b1ccbd76579db0fc6fb9369c848a3bafa9d)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-02 18:09:49 +01:00
Paul Eggleton 818a36590a bitbake: cache: allow parsing a recipe with a custom config datastore
To accommodate the OpenEmbedded layer index recipe parsing, we have to
have the ability to pass in a custom config datastore since it
constructs a synthetic one. To make this possible after the multi-config
changes, rename the internal _load_bbfile() function to parse_recipe(),
make it a function at the module level (since it doesn't actually need
to access any members of the class or instance) and move setting
__BBMULTICONFIG inside it since other code will expect that to be set.

Part of the fix for [YOCTO #10192].

(Bitbake rev: 5b3fedfe0822dd7effa4b6d5e96eaf42669a71df)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-02 18:09:48 +01:00
Paul Eggleton 8f277fcf33 bitbake: tinfoil: add context manager functions
Since calling the shutdown() function is highly recommended, make
tinfoil objects a little easier to deal with by adding context manager
support - so you can do the following:

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

(Bitbake rev: f59bc6be2b4af1acdcf6a1b184956b5ffd297743)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-02 18:09:48 +01:00
Matt Madison c22293622d bitbake: fetch2: clean up remaining cwd saves/changes
Now that the fetchers all preserve the current working
directory, the cwd changes in the try_mirror_url,
download, and checkstatus methods are no longer needed.

(Bitbake rev: 0ed8975c42718342a104a9764a58816f964ec4ea)

Signed-off-by: Matt Madison <matt@madison.systems>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-25 22:53:43 +01:00
Jonathan Liu f078ccf1ac bitbake: siggen: Fix file variable typo in compare_sigfiles
(Bitbake rev: deab9a30987b225922490ca186c5307c15d45b82)

Signed-off-by: Jonathan Liu <net147@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-20 16:11:29 +01:00
Matt Madison ab09541d55 bitbake: fetch2: preserve current working directory
Fix the methods in all fetchers so they don't change
the current working directory of the calling process, which
could lead to "changed cwd" warnings from bitbake.

(Bitbake rev: 6aa78bf3bd1f75728209e2d01faef31cb8887333)

Signed-off-by: Matt Madison <matt@madison.systems>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-20 16:08:59 +01:00
Martin Jansa 9d0962491c bitbake: toasterui, knotty: don't print taskid followed by taskstring which are now in most cases identical
* unify the format how the task is described
* don't show taskid followed by taskstring as the taskstring is
  different only for setscene tasks (by _setscene suffix)
* the duplicated output was introduced by:
  2c88afb   taskdata/runqueue: Rewrite without use of ID indirection
  as reported and confirmed as a bug here:
  http://lists.openembedded.org/pipermail/openembedded-core/2016-June/123148.html
* show:
  NOTE: Running task 541 of 548 (/OE/build/oe-core/openembedded-core/meta/recipes-core/zlib/zlib_1.2.8.bb:do_package)
  instead of much longer:
  NOTE: Running task 541 of 548 (ID: /OE/build/oe-core/openembedded-core/meta/recipes-core/zlib/zlib_1.2.8.bb:do_package, /OE/build/oe-core/openembedded-core/meta/recipes-core/zlib/zlib_1.2.8.bb:do_package)

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

(Bitbake rev: 696693d45f5eff1226866ed79dbfb67161d8cd3f)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-20 16:08:59 +01:00
Markus Lehtonen 0b409117c9 bitbake: tests: add unit tests for the usehead url parameter
[YOCTO #9351]

(Bitbake rev: 63031c0236ace10a9d52b9db9bbb892c1b4bf7db)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-20 16:08:59 +01:00
Richard Purdie c04468d113 bitbake: git: Allow local repos to use HEAD
Introduce a new 'usehead' url parameter for git repositories. Specifying
usehead=1 causes bitbake to use whatever commit the repository HEAD is
pointing to. Usage of usehead=1 is only allowed for local git
repositories, i.e. it must always be accompanied with protocol=file url
parameter.

[YOCTO #9351]

(Bitbake rev: 2673fac5a9d06de937101e3fb2ddf1e60ff99abf)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-20 16:08:59 +01:00
Markus Lehtonen 9cce855f47 bitbake: bitbake-selftest: introduce BB_TMPDIR_NOCLEAN
Set this env variable to 'yes' to preserve temporary directories used by
the fetcher tests. Useful for debugging tests.

(Bitbake rev: 04132b261df9def3a0cff14c93c29b26ff906e8b)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-20 16:08:59 +01:00
Richard Purdie 8b35b032ed bitbake: bitbake: Update version to 1.31.1
(Bitbake rev: 3ff1c66e6f336e5de7dcbc983a97fcd19ddc6b81)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-18 10:06:27 +01:00
Richard Purdie 218b81acb6 bitbake: bitbake: Initial multi-config support
This patch adds the notion of supporting multiple configurations within
a single build. To enable it, set a line in local.conf like:

BBMULTICONFIG = "configA configB configC"

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

MACHINE = "A"

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

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

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

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

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

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

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

This initial implementation has some drawbacks:

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

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

(Bitbake rev: 5287991691578825c847bac2368e9b51c0ede3f0)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-18 10:06:27 +01:00
Paul Eggleton fac16ff8f7 bitbake: siggen: properly close files rather than opening them inline
If you don't do this, with Python 3 you get a warning on exit under some
circumstances.

(Bitbake rev: 49502685df3e616023df352823156381b1f79cd3)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-18 10:06:26 +01:00
Jérémy Rosen 0eb6d709b6 bitbake: ast/ConfHandler: Add a syntax to clear variable
unset VAR
will clear variable VAR
unset VAR[flag]
will clear flag "flag" from var VAR

(Bitbake rev: bedbd46ece8d1285b5cd2ea07dc64b4875b479aa)

Signed-off-by: Jérémy Rosen <jeremy.rosen@openwide.fr>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-18 10:06:26 +01:00
Richard Purdie b50b14e372 bitbake: cache: Build datastores from databuilder object
Rather than passing in a datastore to build on top of, use the data builder
object in the cache and base the parsed recipe from this. This turns
things into proper objects building from one another rather than messy
mixes of static and class functions.

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

(Bitbake rev: fef18b445c0cb6b266cd939b9c78d7cbce38663f)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-18 10:06:26 +01:00
Richard Purdie b176189df1 bitbake: cache: Split Cache() into a NoCache() parent object
There are some cases we want to parse recipes without any cache
setup or involvement. Split out the standalone functions into
a NoCache variant which the Cache is based upon, setting the scene
for further cleanup and restructuring.

(Bitbake rev: 120b64ea6a0c0ecae7af0fd15d989934fa4f1c36)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-18 10:06:26 +01:00
Richard Purdie e79550ea87 bitbake: cache/cooker: Pass databuilder into bb.cache.Cache()
Rather that the current mix of static and class methods, refactor
so that the cache has the databuilder object internally. This becomes
useful for the following patches for multi config support.

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

(Bitbake rev: 7da062956bf40c1b9ac1aaee222a13f40bba9b19)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-18 10:06:26 +01:00
Richard Purdie 97ce9126a6 bitbake: cache: Make virtualfn2realfn/realfn2virtual standalone functions
Needing to access these static methods through a class doesn't
make sense. Move these to become module level standalone functions.

(Bitbake rev: 6d06e93c6a2204af6d2cf747a4610bd0eeb9f202)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-18 10:06:26 +01:00
Richard Purdie 4cd5647f12 bitbake: cache/ast: Move __VARIANTS handling to parse cache function
Simple refactoring to allow for multiconfig support.

(Bitbake rev: 266b848da40904446eb1d084bbdc5307a9b45197)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-18 10:06:26 +01:00
Richard Purdie 0ef16f083e bitbake: runqueue: Abstract worker functionality to an object/array
With the introduction of multi-config and the possibility of distributed
builds we need arrays of workers rather than the existing two.

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

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

(Bitbake rev: 8181d96e0a4df0aa47287669681116fa65bcae16)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-18 10:06:26 +01:00
Richard Purdie 249686927b bitbake: cookerdata: Simplify prefiles/postfiles
The current codepaths are rather confusing. Stop passing these
as parameters and use the ones from when the object is created.

(Bitbake rev: 8c992c148d9619b10eeae8bbd9376ecf408037a5)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-18 10:06:26 +01:00
Francisco Pedraza 500ebdda6b bitbake: bb/utils.py: export_proxies add GIT_PROXY_COMMAND
This was added to enable the usage of git through proxies.

(Bitbake rev: 449fc52e483a3bf1cec1c5d8cf8c3946ec5292ab)

Signed-off-by: Francisco Pedraza <francisco.j.pedraza.gonzalez@intel.com>
Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-17 10:22:58 +01:00
Paul Eggleton 8a45291164 bitbake: knotty: don't show number of running tasks in quiet mode
There's not a whole lot of point showing how many tasks are running when
we're in quiet mode, it just looks a bit strange particularly when it's
not running any tasks.

(Bitbake rev: 5317200d9cd73c6f971bc1b0cfe8692749e27e3a)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-17 10:22:58 +01:00
Paul Eggleton ea0800049d bitbake: knotty: fix task progress bar not starting at 0%
If we have the task number here we need to subtract 1 to get the number
of tasks completed.

(Bitbake rev: 7c78a1cd3f0638ae76f7c7a469b7f667c7c58090)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-17 10:22:58 +01:00
Paul Eggleton 1b6f701cd9 bitbake: runqueue: fix two minor issues with the initialising tasks progress
A couple of fixes for the "Initialising tasks" progress bar behaviour:
* Properly finish the progress bar when using bitbake -S
* Finish the progress bar before calling BB_HASHCHECK_FUNCTION (so that
  in OE when that shows its own "Checking sstate mirror object
  availability"  progress bar it gets shown on the next line as it
  should).

(Bitbake rev: de6759d8e9990e426e6d6464a2e05381cd4c12d6)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-17 10:22:58 +01:00
Ross Burton 407ba77fe2 bitbake: lib/bb/tests/fetch: remove URL that doesn't exist anymore
The CUPS ipptool URL we were checking now redirects to github where the tarball
isn't present, so remove it from the test suite.

(Bitbake rev: 4b50895fb3462b21e3874a2e99c363c8d05e89e6)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-17 10:22:58 +01:00
David Reyna 40b655db22 bitbake: toaster: update web urls for openembedded-core's special case
The layer index update command has a special case for the
updating 'openembedded-core' layer, and it was missing reading
and updating the git web URL fields.

[YOCTO #8037]

(Bitbake rev: ce2f990a366d2d939e93e01f67688f12740c5fee)

Signed-off-by: David Reyna <david.reyna@windriver.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-17 10:22:58 +01:00
Michael Wood e274a5167e bitbake: toaster: buildinfohelper Add handling local layers (i.e. non-git) layers
Adds handling of the non-git layers to create and update the
corresponding layer objects in Toaster.

(Bitbake rev: 0a9b5d7d9655dbb09d458fc6e330e932f0f9dab6)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:30 +01:00
Michael Wood 4ac57fb73e bitbake: toaster: bldcontrol model BRLayer Add corresponding local_source_dir
Sync the BRLayer object with the new field added to the Layer object.
The BRLayer (BuildRequest Layers) are snapshots of the layers in the
project at build time and therefore need to mirror the required fields
of the layer object.

(Bitbake rev: a3112c922f036425977abffa0137b9133f61fcd6)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:29 +01:00
Sujith H cb5ed74e7f bitbake: toaster: adapt xhr_import_layer test locally imported layer
Update xhr_import_layer test to use locally imported
layer in local_source_dir.

[YOCO #9911]

(Bitbake rev: f855490dd04281beb5ae65d82430203d9fd263fc)

Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:29 +01:00
Sujith H 5827ae0a08 bitbake: toaster: update build configuration page
Update layer branch and layer commit section
in the build configuration page for locally
imported layers. For locally imported layers
this secion goes as "Not applicable".

[YOCO #9911]

(Bitbake rev: 4ca3f602a955e01d445fb4789496e925f8d4234b)

Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:29 +01:00
Sujith H f5acb4213b bitbake: toaster: update recipe details page
Update Layer branch and Layer commit
in recipe details page. For local layer
imported from toaster these fields are
not applicable.

[YOCO #9911]

(Bitbake rev: 35f7faabff17ca577fdd2e84bb25125047f66345)

Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:29 +01:00
Sujith H 875770daf7 bitbake: toaster: update package detail page
Update package details pages layer branch
and layer commit section for locally imported
layers. We add Not applicable to them along
with a helper text, which helps user understand
why its not applicable to those layers.

[YOCO #9911]

(Bitbake rev: 6978f65af4eabe91f65a6766799578c84a0988aa)

Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:29 +01:00
Sujith H 3a5039949a bitbake: toaster: updte build tables for locally imported layers
Update the build tables section for locally
imported layers. Here we do not provide informations
such as branch or commit. Because those are locally
imported layer(s).

[YOCO #9911]

(Bitbake rev: 1b0934b45d3704de604405826de9fc1da51ceae1)

Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:29 +01:00
Sujith H 186320fedf bitbake: toaster: update the tables information
Update table informations for pages:
1) Compatible layers
2) Compatible image recipes
Added Not Applicable to the fields of locally
imported layers because they are not git version.

[YOCO #9911]

(Bitbake rev: 7e73f8583a0f92d73b42410e1c960b6f2976a557)

Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:29 +01:00
Sujith H ef617e6f34 bitbake: toaster: collect details for local dir imported from ui
Collect the dir path imported from UI and make
sure that its getting added to bblayers.conf.
This patch exactly does the same job. Any layer
which is imported locally need not be cloned
again to _toaster_clones dir.

[YOCO #9911]

(Bitbake rev: 5669157994fc220a018e37927600988f3fd43271)

Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:29 +01:00
Sujith H 8cad51965d bitbake: toaster: add local_source_dir field to model
Add a new field local_source_dir to model.
This will clearly differentiate us from the
vcs_url which is for git path.
Adding migration file 0010_layer_local_source_dir_path.py
along with this patch.

[YOCO #9911]

(Bitbake rev: 83763d89f9d0bc535e930a2094ba8201675d40be)

Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:28 +01:00
Sujith H 494eae3db0 bitbake: toaster: add local directory to the db
Adding local directory to the database.
The local directory is added to vcs_url,
field of db.

[YOCO #9911]

(Bitbake rev: 2c3d48e7cd21a999ef145081352774f1759cd5e4)

Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:28 +01:00
Sujith H b3fa98d449 bitbake: toaster: improve the display when local dir is added
The helper text gets displayed accordingly when mouse
is hovered above the layers. If its a local directory
then no more branch is mentioned. Only directory path
is mentioned.

[YOCTO #9911]

(Bitbake rev: c1961c7844cab5b9c9144f3b4946197097f53e17)

Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:28 +01:00
Belen Barros Pena 331c1c6f0a bitbake: toaster: update css file for layer import
Update the css file for the layer import.
This changes will improve the UI for the
task.

[YOCO #9911]

(Bitbake rev: a41d0400478186c983334d8f83780639e7361c91)

Signed-off-by: Belen Barros Pena <belen.barros.pena@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:28 +01:00
Sujith H 42d3a414fe bitbake: toaster: add local_source_dir to the needed_fields
This change will help us know if local_source_dir
is null or if there is value associated with this
field. This change will help us display the details
for duplicate layers tryied to import locally.

[YOCOT #9911]

(Bitbake rev: 4350b01f776e6e35745c3eb9440587973de00eec)

Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:28 +01:00
Sujith H 836f332552 bitbake: toaster: control the selection of git and local repo
Changes made in this patch will help user to select
either repo based on git and local. This patch also
improves the help provided to user so that user can
understand them and take necessary action to proceed.

[YOCOT #9911]

(Bitbake rev: 26bee4c2c05dc202857270cd5f56abff79674ca7)

Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:28 +01:00
Sujith H c2c58a1879 bitbake: toaster: add import of local directory to UI
This patch will help to add local directory
to UI. The modification is made in importlayer.html
file. The radio buttons are created to separate
selection of git based repo and local directory.

Co-Author: Belen Barros Pena <belen.barros.pena@linux.intel.com>

[YOCOT #9911]

(Bitbake rev: 78e5edb8ed4bf6c8b0fb87fcf17a82485c145920)

Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:28 +01:00
Ed Bartosh 953ba7a221 bitbake: toaster: fix unhandled exception
manage.py lsupdates throws DataError exception if the recipe can't be
saved to the MySQL database:
    django.db.utils.DataError: (1406, "Data too long for column 'license' at row 1"

Adding DataError exception to the list of exceptions should make
lsupdates to print a warning message and skip the recipe.

(Bitbake rev: 01891c13ae8dcba64e5cf79956f1b64c2afdaae3)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:27 +01:00
Elliot Smith f6261da9c0 bitbake: toasterui: ensure that the Build object is always available
Many of the methods in toasterui and buildinfohelper rely
on the internal state of the buildinfohelper; in particular, they
need a Build object to have been created on the buildinfohelper.

If the creation of this Build object is tied to an event which
may or may not occur, there's no guarantee that it will exist.
This then causes assertion errors in those methods.

To prevent this from happening, add an _ensure_build() method
to buildinfohelper. This ensures that a minimal Build object
is always available whenever it is needed, either by retrieving
it from the BuildRequest or creating it; it also ensures that
the Build object is up to date with whatever data is available
on the bitbake server (DISTRO, MACHINE etc.).

This method is then called by any other method which relies on
a Build object being in the internal state, ensuring that the
object is either available, or creating it.

(Bitbake rev: 0990b4c73f194ec0be1762e4e48b1a525d8349fb)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:27 +01:00
Elliot Smith f17ab95c79 bitbake: toaster-tests: add test for showing self-dependent task
Toaster occasionally records a task which depends on itself.

Add a test which checks that a task which depends on itself
can be displayed in the task page.

[YOCTO #9952]

(Bitbake rev: b7a699e701785b5bd8da97b6e1b760a1c6dd05f5)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:27 +01:00
Elliot Smith 98ef970c8e bitbake: toaster: prevent infinite loop when finding task dependencies
Toaster occasionally records a task which depends on itself.
This causes a problem when trying to display that task if it
is "covered" by itself, as the code does the following: for
task A, find a task B which covers A; then, recursively
find the task which covers B etc. If B == A, this loop becomes
infinite and never terminates.

To prevent this, add the condition that, when finding a task B
which covers A, don't allow B == A.

[YOCTO #9952]

(Bitbake rev: 88c471c7e5995abb5bca62990b91650277b6c926)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:27 +01:00
Elliot Smith 2ff892d87c bitbake: toaster-tests: add tests for reverting to default sort
Add tests for ToasterTable UI table sort reverting, which can
only be exercised via the browser.

Check that if a table is sorted by a column, and that column
is hidden, then the sort reverts to the default for the table.

[YOCTO #9836]

(Bitbake rev: 5b016338478d784fd048ba2baae121c3e558090c)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:27 +01:00
Elliot Smith dd784598cd bitbake: toaster: reset table to default orderby when orderby column is hidden
When a ToasterTable is sorted by a column, and that column is
hidden from view, the sort doesn't revert to the default for the
table.

Modify the JS responsible for reloading the table data so that
it doesn't rely on clicking a table column heading (as this is
inflexible and error-prone). Instead, use a function to apply
the sort to the table; and call that function when column
headings are clicked.

This means that the ordering can be changed programmatically
to a specified default ordering when a column is hidden, without
having to click on a column heading.

Use this function when the current sort column is hidden, to
apply the default sort for the table.

[YOCTO #9836]

(Bitbake rev: a28377067b6f381bbc98db82f5c45fca6620f7ad)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:27 +01:00
Elliot Smith 01c8496d47 bitbake: toaster: show loading spinner after creating custom image
Creating a custom image through the "New custom image" dialog
can sometimes result in a long pause between pressing the button
to create the image, and being transferred to the page showing
details of its content. This can make it appear as though pressing
the button had no effect.

To prevent this from happening, disable the button and text box
in the new custom image dialog after the "Create image" button is
pressed. Also show a loading spinner and "loading..." text on
the button to make it clear that the application is still responding.

[YOCTO #9475]

(Bitbake rev: dd8bede91e08c0b64b949ca98c74e6144da88fd1)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:27 +01:00
Elliot Smith 6172fb1923 bitbake: toaster-tests: fix erroneous message when test fails
When one of the layer details tests fails (as it occasionally
does, if running on a machine under heavy load, due to sync issues),
the error message shown is misleading, as it is something like:

"Expected 'This was imported' in ['This was imported', ...]"

The string 'This was imported' is in the list shown in the message,
but the message suggests it isn't.

This is because the test compares the string with one list, but
then uses a different list in the fail message if the comparison
fails.

Fix the list shown in the message about the test failing.

(Bitbake rev: 34943b2278efe99c6744399e04a47cdda630468e)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:27 +01:00
Elliot Smith cf0b07c96f bitbake: toaster-tests: add tests for most recent builds state changes
Add tests for the state transitions in the "most recent builds"
area of the all builds page.

[YOCTO #9631]

(Bitbake rev: b95681cf38475903ad4f73059313dda8c0dccef6)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:27 +01:00
Elliot Smith 36f71db680 bitbake: toaster-tests: add tests for build dashboard menu and summary visibility
Test that the build dashboard only shows a menu and a build
summary area if a build has properly "started" (i.e. has at least
one Variable object associated with it).

[YOCTO #8443]

(Bitbake rev: 9e16f76fb254ae967ded6c21251243b2af9b16b6)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:27 +01:00
Elliot Smith 504a85822e bitbake: toaster-tests: add tests for build time links in the all builds page
When a build fails, it shouldn't have links on its build time in the
recent builds area or in the all builds table.

[YOCTO #8443]

(Bitbake rev: 3d7b247512eb01607741f5f6ce7cb01d241e49e7)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:26 +01:00
Elliot Smith 2d80b902b8 bitbake: toaster: adjust build dashboard for failed builds
Remove the side bar and build details modules for failed builds.

[YOCTO #8443]

(Bitbake rev: 9d68a5bfdccd399791e1af048fefa73b5df90bcb)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:26 +01:00
Elliot Smith e387a7ab9d bitbake: toaster: add started property to Build
Add a property to the Build model which records whether
the BuildStarted event has occurred for the build.

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

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

[YOCTO #8443]

(Bitbake rev: aa151a4d2de4a54fe3075a8c56a4935158398a18)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:26 +01:00
Elliot Smith dce5037646 bitbake: toaster: remove links from time field on failed builds
Failed builds don't have any time data recorded for them,
so the time field in the builds table, the time shown
in the recent builds area, and the build time shown in
the build dashboard should not be links for failed builds.

[YOCTO #8443]

(Bitbake rev: 6f9c472d95ee800da079f6b828b956d9f8c67ce6)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:26 +01:00
Elliot Smith 9ed45f7974 bitbake: toaster: tweak styling and typos in recent builds area
Help icons need to have the Bootstrap tooltip() method called on
them so that the popups are correctly styled.

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

Fix pluralisation of errors and warnings shown.

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

[YOCTO #9631]

(Bitbake rev: 98a923ff14188832ac44e0dbafc73bcba10e25da)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:26 +01:00
Elliot Smith 82d998d6c6 bitbake: toaster: show "Tasks starting..." until the first task completes
To prevent showing a "0% of tasks complete" message for a long time,
don't show the progress bar until the first task has finished.

While waiting for that first task, show a message about tasks
starting instead.

[YOCTO #9631]

(Bitbake rev: 5529bcd860d2932b967a064ae28690ac5a725342)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:26 +01:00
Elliot Smith dd99cf957d bitbake: toaster: show progress of recipe parsing in recent builds area
Modify buildinfohelper and toasterui so that they record the
recipe parse progress (from ParseProgress events in bitbake)
on the Build object.

Note that because the Build object is now created at the
point when ParseStarted occurs, it is necessary to set the
build name to the empty string initially (hence the migration).
The build name can be set when the build properly starts,
i.e. at the BuildStarted event.

Then use this additional data to determine whether a Build
is in a "Parsing" state, and report this in the JSON API.
This enables the most recent builds area to show the recipe
parse progress.

Add additional logic to update the progress bar if the progress
for a build object changes.

[YOCTO #9631]

(Bitbake rev: f33d51d46d70e73e04e325807c1bc4eb68462f7b)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:26 +01:00
Elliot Smith 952ffb3e1f bitbake: toaster: move most recent builds templating to client
The most recent builds area of the all builds and project builds
table needs to update as a build progresses. It also needs
additional functionality to show other states (e.g. recipe parsing,
queued) which again needs to update on the client side.

Rather than add to the existing mix of server-side templating
with client-side DOM updating, translate all of the server-side
templates to client-side ones (jsrender), and add logic which
updates the most recent builds area as the state of a build changes.

Add a JSON API for mostrecentbuilds, which returns the state of
all "recent" builds. Fetch this via Ajax from the build dashboard
(rather than fetching the ad hoc API as in the previous version).

Then, as new states for builds are fetched via Ajax, determine
whether the build state has changed completely, or whether the progress
has just updated. If the state completely changed, re-render the
template on the client side for that build. If only the progress
changed, just update the progress bar. (NB this fixes the
task progress bar so it works for the project builds and all builds
pages.)

In cases where the builds table needs to update as the result of
a build finishing, reload the whole page.

This work highlighted a variety of other issues, such as
build requests not being able to change state as necessary. This
was one part of the cause of the "cancelling build..." state
being fragile and disappearing entirely when the page refreshed.
The cancelling state now persists between page reloads, as the
logic for determining whether a build is cancelling is now on
the Build object itself.

Note that jsrender is redistributed as part of Toaster, so
a note was added to LICENSE to that effect.

[YOCTO #9631]

(Bitbake rev: c868ea036aa34b387a72ec5116a66b2cd863995b)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:26 +01:00
Elliot Smith c471740f5b bitbake: cooker: add BuildInit event
In situations where a bitbake run fails before the build
properly starts and BuildStarted is fired, a UI has no way
to get at the targets passed to the build. This makes it
difficult for the UI to report on the targets which failed.

Fire a BuildInit event before running buildTargets() or
buildFile(). This enables a UI to capture targets passed to
buildTargets(), even if the build fails (e.g. the targets
themselves are invalid).

[YOCTO #8440]

(Bitbake rev: ac02fda870965bf7d44ff5688eda54d2d11ab9c7)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:26 +01:00
Michael Wood f4e65d1cd0 bitbake: toaster: fixtures Add README
Add README to explain fixtures directory

(Bitbake rev: 4060776e408ec6baec3bafba79ac5db1bc380f01)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:26 +01:00
Michael Wood 71f553b022 bitbake: toaster: Remove old toaster config loading mechanism
This has been replaced using django's inbuilt loaddata.
Django command documented at:
https://docs.djangoproject.com/en/1.8/ref/django-admin/#django-admin-loaddata

(Bitbake rev: 3edd33aff2b9eef82090dc4f9b5461f901aec8be)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:25 +01:00
Michael Wood 49039829e1 bitbake: toaster: lsupdates Add spinner for parsing/http fetch
Adds a spinner so that you know that the parse and http fetch from the
layerindex is in progress.

(Bitbake rev: e1c1c8827f3892551084bf1c0909c1b33f0dca83)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:25 +01:00
Michael Wood 33a4006529 bitbake: toaster: checksettings call django's loaddata instead of custom command
Call django's inbuilt loaddata command to load the appropriate fixtures.
We also attempt to load a fixture called "custom" and fail silently if
we don't have one. This is where initial customisations can be done to
load particular settings or data into Toaster (for example layers or
default values for variables)

Make sure the value for TEMPLATECONF is available to checksettings so
that we can have a go a working out which default data to load.

(Bitbake rev: 7d14ca8cbabbb893e507a66e4cc6e3e77c1e8c84)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:25 +01:00
Michael Wood 72fa18fb35 bitbake: toaster: Add poky and openembedded configuration fixtures
These fixtures provide a recommended default configuration of toaster for
either using bitbake and oe-core or as part of poky.
They can be used as the sample configuration for writing custom configurations.

(Bitbake rev: d2f4ffbf061e874a7731441f8346fdc568e9f07f)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:25 +01:00
Michael Wood a1629a2b26 bitbake: toaster: tests test_new_project_page Catch button not enabled exception
When using firefox and selenium we get an exception generated when a
disabled button click is attempted. This should happen in the test but
we need to catch the exception to make sure it doesn't cause the test to
fail.

[YOCTO #10056]

(Bitbake rev: 06f74fe91f8e162f49a4e856a62a97093b48262a)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:07:09 +01:00
Ulrich Ölmann 5d1d1774ec bitbake: siggen: Fix typo
(Bitbake rev: 40f605199fb3ec2549611508b7576c64d735b2b7)

Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:07:09 +01:00
Terry Boese 93817932de bitbake: fetch2/gitannex.py: use 'git annex init' instead of 'git annex sync'
The git annex fetcher needs git annex to be initialized.  Previously
it was using 'git annex sync' to do this, but that has the downside
of moving the checkout to the tip of the default branch.  This means
that tags, SRCREV, etc don't work in the gitannex case.

(Bitbake rev: c1a57e2dd7fc96834643be5591a96f239215481a)

Signed-off-by: Terry Boese <terry.boese@vecima.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:07:08 +01:00
Richard Purdie 82da1e6f6c bitbake: persist_data: Fix py3 update stack overflow
Revision d0f904d407f57998419bd9c305ce53e5eaa36b24 accidentally broke
items() and values() and made them cause stack overflows. Undo that
breakage.

(Bitbake rev: 88c5beca705efa7df4a96fb2aaf3f13c336ac328)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:07:08 +01:00
Mariano Lopez a6630c2310 bitbake: fetch: Fix use of tar's --exclude option for tar >= 1.29
Starting from tar 1.29 the --exclude option won't work
anymore if is not used before the path. There are some
fetch modules that copy the ptest using tar and --exclude
option. This fixes these for bitbake.

[YOCTO #9763]

(Bitbake rev: cc71d5d9da71ea5f21d02f3b2fbf119bd2d794f0)

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10 10:46:34 +01:00
Richard Purdie aa2d945423 bitbake: lib/toaster: Fix missing new files from previous commits
(Bitbake rev: f77e6f21a2cc57a3fcb5970437e55cfae39849a3)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-01 09:38:35 +01:00
Elliot Smith 5b61fa04a3 bitbake: toaster-tests: fix URL given for Chromedriver download
The link to the Chromedriver downloads page is dead, so
put in the correct URL.

(Bitbake rev: f0e6832bc33df2bb1b2f4b7f436ffbf023e24b13)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-29 09:53:32 +01:00
Elliot Smith 05f82e8f12 bitbake: toaster-tests: define capabilities for latest Firefox driver
For the latest Firefox versions, WebDriver requires a download of a
separate binary and an additional capability to be defined on it.

Modify our tests so that when "marionette" is set as the browser,
this capability is defined on the Firefox driver. Also add a note to the
README about the additional installation steps required.

(Bitbake rev: f6011d986f9a573a39e7b98af0aefe6cc88461ad)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-29 09:53:32 +01:00
Paul Eggleton 2a849e7e9b bitbake: lib/bb/checksum: avoid exception on broken symlinks
If using OE's externalsrc with a source tree that is not tracked by git
and contains broken symlinks, you can receive "TypeError: unorderable
types: NoneType() < str()" within the file checksum code due to:

 checksums.sort(key=operator.itemgetter(1))

Don't add files with no checksum to the checksums list in order to avoid
this.

(Bitbake rev: 484fe5a3f5b840e5422cbdff0eef9aecfe944a19)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-29 09:53:32 +01:00
Ross Burton ea234239f4 bitbake: lib/bb/utils: show subprocess output in stack traces
If better_exec() throws a subprocess.CalledProcessError then show the output to
the user as it likely contains useful information for solving the problem.

(Bitbake rev: 8a6424ed871c3cbacd21cae8bc801197f83d67a6)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-29 09:53:32 +01:00
Maxin B. John c42b5333f0 bitbake: fetch2: fix pickle issues while switching from master to krogoth
While switching from master to krogoth build with a common download directory,
got a large number of warnings like the one listed below:

WARNING: freetype-2.6.3-r0 do_fetch: Couldn't load checksums from
donestamp /home/maxin/downloads/freetype-2.6.3.tar.bz2.done: ValueError
(msg: unsupported pickle protocol: 4)

These warnings are caused by the difference in pickle module
implementation in python3(master) and python2(krogoth). Python2 supports
3 different protocols (0, 1, 2) and pickle.HIGHEST_PROTOCOL is 2 where as
Python3 supports 5 different protocols (0, 1, 2, 3, 4) and
pickle.HIGHEST_PROTOCOL is obviously 4.

My suggestion is to use 2 since it is backward compatible with python2
(all the supported distros for krogoth provides python2 which supports
pickle protocol version 2)

(Bitbake rev: cc67800f279fb211ee3bb4ea7009fdbb82973b02)

Signed-off-by: Maxin B. John <maxin.john@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-29 09:53:32 +01:00
Ross Burton 1393b23f51 bitbake: lib/bb/build: handle incomplete message fragments in log FIFO
It's possible that the logging FIFO doesn't do a complete read (or the sender a
complete write) with the result that an incomplete message is read in bitbake.
This used to result in silently truncated lines but since 42d727 now also
results in a warning as the start of the rest of the message isn't a valid
logging command.

Solve this by storing incoming bytes in a bytearray() across reads, and parsing
complete messages from that.

[ YOCTO #9999 ]

(Bitbake rev: 508112793ee7ace613f07695222997309a2ca58f)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:10:37 +01:00
Elliot Smith 9411e33b88 bitbake: toaster-tests: add tasks and recipes sub-page tests
Add tests for the tasks and recipes sub-pages of the build
dashboard.

[YOCTO #9833]

(Bitbake rev: cecee440a76950f2824ea34b88e84185be493337)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:10:37 +01:00
Elliot Smith 4357d7a296 bitbake: toaster: set non-hideable columns for built recipes table
None of the columns in the built recipes table are marked
as not hideable, so it is possible to remove all the columns
and make the table disappear.

Set the recipe name and version columns as not hideable.

Also rename the "Name" column to "Recipe", for consistency with
the design and with other recipe tables.

[YOCTO #9833]

(Bitbake rev: 3abd0ac300462e6d1335018cf2d0420de7cc8b76)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:10:36 +01:00
Elliot Smith bd2cce00de bitbake: toaster: set non-hideable columns for build tasks table
The task, recipe and order columns in the build tasks table
should not be hideable. If they are, it's possible for the
table to have all of its columns hidden so that it no longer
displays.

Set the hideable property to prevent these columns from being
hidden.

[YOCTO #9833]

(Bitbake rev: dc1781e3783724823fd6b0c2d65f6b2771e8d0be)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:10:36 +01:00
Elliot Smith 83ccef335c bitbake: toaster: fix download URL for task logs
The task display template formatting had split the Django
url template tag across two lines and broken it. This resulted
in a gibberish URL for task logs.

Fix by placing the tag and its arguments on a single line.

[YOCTO #9837]

(Bitbake rev: d6e88b7b410b6b99b47b031111a1126da9fd31b3)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:10:36 +01:00
Mario Domenech Goulart 24905d3c2d bitbake: fetcher2/__init__: Print command in case of ExecutionError in runfetchcmd
(Bitbake rev: df7f4897c463a48c45514e2bcbd44cc7f86c4bb0)

Signed-off-by: Mario Domenech Goulart <mario.goulart@bmw-carit.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:10:36 +01:00
Michael Wood 729d9fcb54 bitbake: toaster: loadconf Partially add back some of the layerSource parsing
Partially add back a revised version of the layersource handling so that
we can continue to support the old toasterconf.json and it's setup of
the local project.

(Bitbake rev: cc1a1bc2ea6ae058278d4ecf483f5ea00502c6cb)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:10:36 +01:00
Michael Wood 04d1ad5fe7 bitbake: toaster: admin Add Layer_Version to the admin-able models
If the migration didn't get the release conversion right for say, a
local or imported layer it would be handy to be able to edit this
in the django admin page.

Also useful for developers to be able to tweak layers on the fly.

(Bitbake rev: 0b23b6919ef1162a0c7fb5b5a961a24653c51eb2)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:10:36 +01:00
Michael Wood 97278fb51c bitbake: toaster: orm Remove the layerindex specific up_branch fields
We don't need to keep track of layerindex data in our database. And
using branch==release is very confusing in the schema. Instead use the
existing Release definition to keep track of which release a
layer_version is for.

Remove the Branch model and all references to it.

Create a migration path to convert from up_branches to their
corresponding releases.

(Bitbake rev: f8f4cffe6fd371f3a7e63690c68f3fcb5dc1f297)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:10:36 +01:00
Michael Wood 8b3146007f bitbake: toaster: lsupdates Add progress information and clean up logging
Adds basic progress % information and provides better description of
what is happening.

(Bitbake rev: 6393dbf97d450d2521c0bc9429da0987bb7720ec)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:10:36 +01:00
Michael Wood bb260e94a6 bitbake: toaster: tests: Remove references to LayerSource model
Remove and replace layersource model references in the tests and test
data. Remove the orm/test as this only tested LayerSource interactions
which have now been removed.

(Bitbake rev: 61a47cbc92c856690cb0e8da7102b2e669eaee0a)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:10:36 +01:00
Michael Wood ef627d0ab8 bitbake: toaster: Replace references to LayerSource models
Replace references to the now deprecated layersource models across
Toaster with the new enums for layer source types.

(Bitbake rev: 48c09c62eb979d840132e58144f0d81ffee675b1)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:10:36 +01:00
Michael Wood ffc78d329d bitbake: toaster: lsupdates Add layerindex fetcher
Move and refactor the layerindex layer source update mechanism so that
we don't have to track the layerindex objects in the toaster database.
Move this out of the orm and into the management command.

Paves the way for future improvement to allow you to specify a layer
index server as an argument to the command.

(Bitbake rev: f83527edc6d52a34cd73a9c3650ee484407e2e0c)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:10:36 +01:00
Michael Wood 853450befc bitbake: toaster: models Remove LayerSource models and replace with enum
We had a lot of complexity around different layer sources to allow for
multiple sources and different priorities for these source. This was
implemented using rigged abstract classes which represented the
different layer sources when in fact just an enum/flag on the
layer_version object is sufficient for our needs.

Remove the LayerSourcePriority object as this is not needed. We no longer
have a problem of multiple layers coming from multiple sources so this
is not needed. Two migrations are added to first remove the child models
which represented layersources. Then a second migration is needed to
remove the LayerSource model it's self as Django can't understand the
non-standard base class dependency. Triggering this issue:
https://docs.djangoproject.com/en/1.8/topics/migrations/#dependencies

Clean up a number of flake8 warnings in classes which were modified.

[YOCTO #9853]

(Bitbake rev: 26624740418de95adb1f4a970a30a5f1149ebb79)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:10:35 +01:00
Michael Wood 20f939f242 bitbake: toaster: bldcollector admin Remove LayerSourceAdmin
Remove the LayerSource admin from django admin interface. LayerSources
are not going to be manageable from the admin interface.

(Bitbake rev: 1c20ffcf88c5b73f6cf5e9b69b81e6bc8cd2493d)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:10:35 +01:00
Michael Wood 1477886deb bitbake: toaster: loadconf remove Loading LayerSources
We don't need to configure layer sources in the initial configuration as
this information is provided by the models.

(Bitbake rev: fd56c152699bc4c2d22b87728d0fefbff5209135)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:10:35 +01:00
Paul Eggleton c27ae255db bitbake: lib/bb/progress: avoid possibility of start event being reported twice
In MultiStageProgressReporter, set a guard when we start the progress
so that it can't happen more than once. This fixes "Initialising
tasks.." being shown twice in succession when running bitbake in
non-interactive terminal mode.

(Bitbake rev: 923e68e069127ee7f6e11b91eb1cfa09d502a110)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:10:35 +01:00
Paul Eggleton 5f4559b2eb bitbake: knotty: don't display ETA for tasks with progress
It turns out that progress information we can extract from a task is
rarely apportioned closely enough to the time taken for the ETA to be
accurate, so showing it is going to be misleading most of the time for
anything but the most basic of examples. Let's just remove it and avoid
misleading (or worse, annoying) the user.

Fixes [YOCTO #9986].

(Bitbake rev: 235db4870b11db97250979e647b54cdb5ce4fbb6)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:10:35 +01:00
Paul Eggleton 23a551bea1 bitbake: knotty: fix some minor bugs in BBProgress
If you specify custom widgets then we don't want to assume where the
"extra" position is - you should have to specify it, and if it isn't
specified it shouldn't just wipe out the last widget or you can start to
see odd behaviour if you're modifying the code.

(Bitbake rev: 19e33c10feb1637589ceb05b5e8d58b1e012ccb8)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:10:35 +01:00
Enrico Scholz 0c3ce68410 bitbake: fetch: copy files with -H
When using a PREMIRROR with plain (non-unpack) files, a SRC_URI like

SRC_URI = "file://devmem2.c"

will cause devmem2.c to be a symlink in the WORKDIR pointing to the
local PREMIRROR.

Trying to apply a patch on this file will either modify the file on
the PREMIRROR or will fail due to sanity checks:

ERROR: devmem2-1.0-r7 do_patch: Command Error: 'quilt --quiltrc /cache/build-ubuntu/sysroots/x86_64-oe-linux/etc/quiltrc push' exited with 1  Output:
Applying patch devmem2-fixups-2.patch
File devmem2.c is not a regular file -- refusing to patch

(Bitbake rev: cfd481fe9799e7a4c6bfac32e56cc91cfcd81088)

Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:10:35 +01:00
Richard Purdie 7f6b6b2ab9 bitbake: cache: Don't interleave pickle cache file writing
For some reason the data written in this way is coming back out the
files out of order. I've not been able to simplify the test case to a
point where this was standalone reproducible. Simplify the code and
write out the cache files sequentially since this seems to avoid the
errors and makes the code more readable.

(Bitbake rev: 14ec47f5f0566dbd280fae8a03160c8500ad3929)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:10:35 +01:00
Richard Purdie 5d41200113 bitbake: cache: Add better cache loading sanity checks
We've seen cache corruption where the pairs come out in a different
order to the way we saved them for unknown reasons. Add better sanity
checking to give a more user friendly error rather than a crash/traceback.

Also allows the system to reparse and recover.

(Bitbake rev: 4be4a15491530bd6dc018033ad3d4b2562ab6e23)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:10:35 +01:00
Richard Purdie 40d45cf7a6 bitbake: cache: Drop/simplify pointless type checking
Since we no longer have random data like version fields in these structures
and we can assume any extra cache data subclasses our class, simplify the
code.

This is mostly reindenting after removal of the pointless type checks.

(Bitbake rev: 5eb36278ac9975de1945f6da8161187320d90ba7)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:10:35 +01:00
Richard Purdie c9e65c5d29 bitbake: cache: Improve versions fields handling
Firstly, don't store the versions fields in memory in the cache objects
data store. This just complicates the code for no good reason.

Secondly, write the version fields to all cache files, not just the
core one. This makes everything consistent and easier.

(Bitbake rev: cb666262b2f986b5d9331dfb30458ef1a151fa4d)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:10:35 +01:00
Richard Purdie 09f6a56aa4 bitbake: cache: Correctly handle missing extra caches
If an "extras" cache file is corrupted, the system would not notice
and later fail with errors about missing entries. Add a test for this
which means we can fall back to re-parsing in those cases.

[YOCTO #9902]

(Bitbake rev: 51843d8f2bbe2e54db7593ca61984abe70423ef6)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:10:34 +01:00
Richard Purdie b2ef908be1 bitbake: cache: Move the parsing message to a more logical place
Otherwise you can look at the log and wonder why parsing isn't happening
when it really is due to other code paths.

(Bitbake rev: b48d95677a4d285a77cda2892179965f7f8f06dd)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:10:34 +01:00
Ed Bartosh 317708235b bitbake: bitbake: implement idle timeout for xmlrpc server
Idle timeout can be specified either by -T/--idle-timeout option or
by sessing BBTIMEOUT environment variable. Bitbake xmlrpc server
will unload itself when timeout exprired, i.e. when server is idle
for more than <idle timeout> seconds.

[YOCTO #5534]

(Bitbake rev: 5fa0b3a19e7d0f40790f737abeddf499d53f1f6a)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-21 07:48:52 +01:00
Ed Bartosh 4cba010529 bitbake: bitbake: implement --foreground command line option
This option makes bitbake xmlrpc server to run in foreground.
It should be useful for debugging purposes.

(Bitbake rev: 9d4254be5853a546a346bf0d19919dcfba12773d)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-21 07:48:52 +01:00
Richard Purdie 90436919f8 bitbake: cooker: Fix incorrect dot file generation
In the runqueue cleanup/conversion, "dep" was mistakenly used where "tid" should
be leading to incorrect task-depends.dot files and causing general confusion.
Fix this, its clearly incorrect looking at the code.

(Bitbake rev: 689730dbb068c5ea3593e7b92fe5d5e5c0c3760a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 16:46:12 +01:00
Aníbal Limón 1bf1e2c208 bitbake: toaster-tests: add class SeleniumTestCaseBase for browser tests
In order to reuse the Selenium helper outside a Django
environment (for functional testing), add a new module
containing the base class SeleniumTestCaseBase, which only
inherits unittest.TestCase

Add a class SeleniumTestCase with multiple inheritance of
StaticLiveServerTestCase and SeleniumTestCaseBase to prevent
existing tests from breaking.

(Bitbake rev: 1177b3f368d8b7f8557eb649adb2e327b6df801c)

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20 10:38:52 +01:00