Commit Graph

472 Commits

Author SHA1 Message Date
Ed Bartosh c1c8eff3f9 bitbake: toaster: removed extra calls of migrate
One manage.py migrate should be enough to apply migrations for
all applications. Extra calls just slow toaster script down.

Removed calls of migrate for orm and bldcontrol apps.

(Bitbake rev: 9299d7fa88e51294c4fd3f1354874d8253d25aff)

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

[YOCTO #8364]

(Bitbake rev: 2149ff805424692f9fde29618f2ae0eb99f710d2)

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

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

[YOCTO #8364]

(Bitbake rev: 7ff1630574180e1895b90ecef1ea0caf51304446)

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

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

[YOCTO #8364]

(Bitbake rev: 648b62654c52116451c6a68a46d7264db3a34d09)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-14 23:13:06 +00:00
Ed Bartosh 0497b570e5 bitbake: toaster: unset environment variables
Toaster script sets environment variables when it starts.
It makes sense to unset them when toaster stops as they can
cause other programs to behave incorrectly.

(Bitbake rev: 7a2e9745ff3ef6d6360f74b222248d4bd35e6a08)

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

(Bitbake rev: 624240460ec32af918dcea8c04a913e3b94e012b)

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

[YOCTO #8279]

(Bitbake rev: 24cd26b39014419d883b7cf45e4943c301d585cc)

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

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

(Bitbake rev: d8e9ce7ba3f5b89c51e769bd4a46c2026a110d40)

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

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

(Bitbake rev: dd40d70b707a3ff59edfa69923d4d9b671928a66)

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

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

(Bitbake rev: 91bf323e873c31d883b01ea993c005f45382e83f)

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

(Bitbake rev: 124eb2bb15de18e4d2d6483c3549e1d887234736)

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

(Bitbake rev: a4f6809237dffb1abff78c6a8c82bcc4852aedfa)

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

(Bitbake rev: 187c31a8789c37723b9288afd35f1785f1993895)

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

(Bitbake rev: 8476db82ea80edf2b70bc2082bcecee09037556d)

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

(Bitbake rev: c5d5da095d5eace03f8a50910f5a60ab35acbb1a)

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

(Bitbake rev: ac4800cc8b765b270f27ea9a5938f3f2a2e0ced4)

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

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

[YOCTO #8279]

(Bitbake rev: 7e8632c0527245c1474e487dd9a972948e794471)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-07 17:37:07 +00:00
Ed Bartosh 320d05ea9f bitbake: toaster: exit or return depending on the mode
When toaster script is sourced 'return' should be used as
using 'exit' will cause script to exit the shell and close terminal
window. If script is called 'exit' should be used. Otherwise shell
will throw and error:
  return: can only `return' from a function or sourced script

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

(Bitbake rev: 643c42069a2788e9f40fa1bc9845f32aed3d096c)

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

(Bitbake rev: 9f68f317e33d617558fce3427a94e14ef65c7d88)

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

(Bitbake rev: 4b8cb1098ad73b4e9dc65b5c6de7d11d2e2468c7)

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

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

(Bitbake rev: 5368d9af4e2c121938fc2421a536fb7f20a987fd)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-16 14:13:23 +01:00
Elliot Smith 1feeb8e499 bitbake: toaster: Always run bldcontrol migrations
The toaster startup script conditionally migrates the database
tables depending on whether you are in managed mode or not. This
means that if you are in analysis mode, some of the bldcontrol*
database tables used by managed mode are not available.

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

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

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

[YOCTO #8277]

(Bitbake rev: b1fc592131286ebbede2693be8c86636f0039011)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-16 14:13:22 +01:00
brian avery 0dcc96323c bitbake: toaster: remove bashisms so script works in dash as well
[YOCTO #8217]

(Bitbake rev: be2d04c1831608922f90da03cb26d7fd5c863a47)

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

removed build dir questions and base off TOASTER_DIR

base configuration file off of TOASTER_CONF

fixed some pylint issues

[YOCTO #8217]

(Bitbake rev: d5811968b5f22093365f381fb7e75ab46e5269c2)

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

(Bitbake rev: 49e30c1aa8d717adbdcc15c90a668000789a6961)

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

added TOASTER_DIR env var for working dir

added bugfix so WEB_PORT env variable is honored

(Bitbake rev: c4b351e40060a359d59ab51b5ed2f9713ca1a9a5)

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

(Bitbake rev: 782b7c74d5f10ed255538ba0c975ff342a34f5bf)

Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-11 05:33:04 +01:00
Richard Purdie 8fb5a5a338 bitbake: bitbake/lib: Update version to 1.28.0
(Bitbake rev: 3e63abc6977bd5ef52ccb4d3757536bd564dfd34)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-01 15:17:53 +01:00
Richard Purdie 1e467b333f bitbake: bitbake-worker: Guard against multiprocessing corruption of event data
In the forked child, we may use multiprocessing. There is only one event
pipe to the worker controlling process and if we're unlucky, multiple
processes can write to it at once corrupting the data by intermixing it.

We don't see this often but when we do, its quite puzzling. I suspect it
only happens in tasks which use multiprocessng (do_rootfs, do_package)
and is much more likely to happen when we have long messages, usually many
times PAGE_SIZE since PAGE_SIZE writes are atomic. This makes it much more
likely within do_roofs, when for example a subprocess lists the contents
of a rootfs.

To fix this, we give each child a Lock() object and use this to serialise
writes to the controlling worker.

(Bitbake rev: 3cb55bdf06148943960e438291f9a562857340a3)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-01 07:43:38 +01:00
Cristian Iorga 9f66aa1a11 bitbake: toaster: start script warning text formatting small improvement
Add a carriage return to build environment warning message to
avoid it being  mixed up with shell prompt.

(Bitbake rev: d3675cca419946cc19b3f280446fe1f656f11902)

Signed-off-by: Cristian Iorga <cristian.iorga@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-23 22:44:56 +01:00
Richard Purdie 68aefbb27d bitbake: bitbake-worker: Ensure pipe closure doesn't crash before killpg()
If the pipe is closed, we want to ensure that we kill any child processes
by triggering the sigterm handler before we exit. This code does that,
hopefully avoiding the remaining process left behind issues on the autobuilder.

(Bitbake rev: 60f6c2818f38c4d9c2d9aaa42acf3071636f4a3b)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-12 22:50:14 +01:00
Richard Purdie 6271fcb589 bitbake: bitbake-worker: Handle SIGKILL of parent gracefully
If we SIGKILL cooker (the parent process), ensure the worker notices
and shuts down gracefully. To do this:

* trigger the sigterm handler if the parent exits
* ensure broken pipe writes don't trigger backtraces which interfer with
  other exit work
* notice if our command pipe is broken due to EOF and sigterm if so

(Bitbake rev: c43d6a8d711db8d3bd9a1976b9f8e3efdb4cb4ae)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-09 14:27:57 +01:00
Richard Purdie 3195cd92eb bitbake: bitbake-worker: Simple code cleanup
start/end are unused here and we can improve the code conditional blocks.

(Bitbake rev: 68f53dd77fe0bbfa044bd037a9484e0e1c9088b4)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-09 14:27:56 +01:00
Paul Eggleton ae7d04832b bitbake: bitbake-layers: show-recipes: allow filtering by class inheritance
Add a -i/--inherits option to filter the output to include only recipes
inheriting the specified class(es).

Implements [YOCTO #7475].

(Bitbake rev: e4ec622d9dc5f882049f5e8027331ec1e17681de)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-19 18:05:50 +01:00
Paul Eggleton a3967e2ba5 bitbake: bitbake-layers: fix mapping files to layers
bitbake-layers needs to map recipe and class files to the layer they
came from within the show-recipes and show-overlayed commands. However,
it turns out that mapping a file to the layer it came from is not as
trivial as it might seem. To do it properly we need to match the path to
an entry in BBFILES then map that to the collection name using
BBFILE_PATTERN, then map that to the actual layer using variable
history. If it doesn't match any entry in BBFILES, then we can fall back
to BBFILE_PATTERN (to handle classes and conf files).

This fixes the layer name not showing up properly in the output of the
show-recipes and show-overlayed commands for recipes in layers such as
meta-intel that have subdirectories in BBFILE_PATTERN. It also fixes the
priority not showing up in show-layers for such layers.

As part of this I've added a function to VariableHistory which for a
space-separated list variable gives you a dict mapping the items added
to the files in which they were added. I've also fixed
bb.utils.get_file_layer() and reduced some of the duplication by using
this function in bitbake-layers. Also fixes the priority not showing up
for layers such as meta-intel

Fixes [YOCTO #8160].

(Bitbake rev: e852f6cabd7489585477ab567a1afeb2252377ac)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-19 18:05:49 +01:00
Paul Eggleton 22e8c6cbd3 bitbake: bitbake-layers: remove-layer: accept just layer directory
If the specified layer isn't a path, then just match on the directory.

Fixes [YOCTO #7839].

(Bitbake rev: b4c45bf6c42b4d319ba868f4ce77e86c8b585818)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-19 18:05:49 +01:00
Paul Eggleton c4989e7bf3 bitbake: bitbake-layers: ensure we exit if BBLAYERS_LAYERINDEX_URL is not set
We were printing an error here, but not exiting.

(Bitbake rev: ddcaf8950a0b1cc74806e1ad7b49a1de0ea0d2b1)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-19 18:05:49 +01:00
Paul Eggleton 97067755b9 bitbake: bitbake-layers: use "with open" consistently
It's best practice to use "with open..." rather than open & close where
practical.

(Bitbake rev: 1ef38549cae5639f2c8bcc2b270c5c82a5e29e3c)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-19 18:05:47 +01:00
Paul Eggleton 90d97f7a57 bitbake: bitbake-layers: refactor show-appends to stop using cooker bbappends list
(Bitbake rev: 60a253555a3ebadea775cfdc3331cba78ee3e71b)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-19 18:05:47 +01:00
Richard Purdie 67a6a4d6c0 bitbake: bitbake-layers: Convert flatten to use collections.bbappends
flatten support currently looks broken since it doesn't appear to
deal with handling "%" support in bbappend file names.

This patch converts it to use collections.get_file_appends() which
correctly handles "%" support.

(Bitbake rev: 0448714c52bc1e9584a5282cffdcaa404fb0618a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-19 18:05:47 +01:00
Richard Purdie 901be2cb69 bitbake: bitbake-selftest: Add -v option for verbosity
Also document BB_SKIP_NETTESTS=yes parameter in --help output.

(Bitbake rev: 5196bfa9639eed2b1e6452f45775551203f8eeb4)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-23 08:48:41 +01:00
Ed Bartosh 5a013b562e bitbake: toaster: Make toaster script to work in dash
Made it working in dash. Note, that due to dash limitations
script will not work if sourced.

(Bitbake rev: febf8bedf8f9d37659831cdde208d14ece2fb322)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-12 00:01:49 +01:00
Ed Bartosh 0eaf070337 bitbake: toaster: Code cleanup: bashisms
Fixed the following bashisms:
 replaced echo -e -> printf
 removed 'function' from function definitions
 replaced $(< ${file}) -> `cat ${file}`

(Bitbake rev: bd95425c35c7d8386c57329e425aa7802537b479)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-12 00:01:49 +01:00
Richard Purdie 926de56da9 bitbake: bitbake: Bump version to 1.27.1
(Bitbake rev: 430f7a288b4446600b3a943c51f6711ffcf9e619)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-09 13:30:09 +01:00
Alexandru DAMIAN 356809ff40 bitbake: toaster: enable no browser start
We enable a "nobrowser" parameter that inhibits
the launch of a browser when toaster starts.

This is useful for integration with automated startup scripts
and enables headless testing.

(Bitbake rev: ccf7f39d470fe6d743b58b1140c19cb8da31ecaf)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-29 11:59:46 +01:00
Alexandru DAMIAN a5236be47f bitbake: toaster: enable server-side sessions for all usages
In an effort to fix client-side session storage using
cookies, we enable server-side session support for all pages.

(Bitbake rev: ba10b6f89767c0dad8a2b064f42a84956764e9da)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-29 11:59:43 +01:00
Jason Wessel 5ee122244a bitbake: bitbake-worker: Fix regression with unbuffered logs
I noticed that I was seeing loss of the log files when hitting
control-c while debugging a function in bitbake.  In fact if you
take a recipe and replace its compile function as shown below let
it run for a few seconds and hit control-c, you will see first
hand that log data is not there.

do_compile () {
        while [ 1 ] ; do
                echo -n "Output date: "
                date
                sleep 1
        done
}

It turns out there was a regression introduced by commit:
d0f0e5d9e6 which created the bitbake worker.  Since the bitbake
worker is started in its own process space, it needs the exact
same code added from commit: 88429f018b where the problem was
fixed the first time around.

(Bitbake rev: 8d1748f75763b4a66516cc46d5457ee6404b1b68)

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-26 10:33:06 +01:00
Randy Witt 8b8859a8fe bitbake: toaster: Remove dependency on daemon application
The bitbake observer is now started using python subprocess. This should
allow for toaster to run without installing the "daemon" application.

[Yocto #7271]

(Bitbake rev: 1dd599ddfcdb547bee49bd7d86acddf64c675b42)

Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-19 11:58:45 +01:00
Richard Purdie 2a56445b9b bitbake: tests/parse: Add very basic start of parse tests
This tests very basic usage of the parser and then adds a test
to ensure that incomplete functions raise an exception.

(Bitbake rev: b7bcef141b56fe8eb03724ea5251e3251fc63817)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-15 17:45:00 +01:00
Ed Bartosh b546be990d bitbake: toaster: Code cleanup: indent
Replaced tabs with 4 spaces.
Removed useless semicolons at the end of lines.

(Bitbake rev: 5bfe5eb0bf1e53ddb04c31e786e1ffc15542e6e8)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-12 12:14:12 +01:00
Ed Bartosh 13e88144bf bitbake: toaster: Make toaster script working in zsh
Fixed shell syntax not understood by zsh. Made toaster
script to work for both shells in both modes: sourced and
directly called.

[YOCTO #6964]

(Bitbake rev: e7b27843e2f37619dbe555a8883ac67f418f32dc)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-12 12:14:12 +01:00
Alexander Kanevskiy 84a294edde bitbake: toaster: clear up toaster shutdown for mac osx
This patch properly shuts down toaster in interactive mode
under Mac OSx.

(Bitbake rev: a00cd5135a4bbd61d311fa17569894f974ab4420)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-12 12:14:12 +01:00
Alexandru DAMIAN 7759cd4931 bitbake: toasterui: proper exit code on toaster errors
This patch modifies the toasterui to properly return the exit
code based on the errors found in the toaster itself.

The upload event file API call will not delete event logs for which
toasterui showed an error. This will facilitate debugging.

Minor enhancement in the buildinfohelper to reduce the number
of lookups on unknown layer objects (prevented testing of the patch).

(Bitbake rev: 1ddd6a9e4280a4adf971132ff1fe7ec9b3252905)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-08 17:42:05 +01:00
Ed Bartosh 4eeae70a45 bitbake: bitbake: use sys.exit to simplify the code
Used sys.exit instead of assigning exit code to
variable. This way it's more clear when bitbake
exists and which exit code is used.

(Bitbake rev: 5ecb8817bd49223652ede4fe513f1a42f2196798)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-29 10:59:53 +01:00
Ed Bartosh 37e46e49dd bitbake: bitbake: Check if bitbake versions match
Bitbake program and core versions must match.

Moved __version__ from main.py back to bin/bitbake.
Implemented check for version match in bin/bitbake.

(Bitbake rev: 2fe7d8c574ddf6a30278cff1a5a5c4089dc56d6d)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>

tbs

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-29 10:59:53 +01:00
Ed Bartosh 47e2dbd89a bitbake: bitbake: Handle BBMainException
Some error messages were lost because BBMainException was
inherited from bb.BBHandledException. When bb.BBHandledException
is processed error messages are not printed as they suppose to
be printed before raising this exception.

Stopped to inherit BBMainException from bb.BBHandledException.
Handled BBMainException in bin/bitbake and printed error message
to the stderr.

(Bitbake rev: c8e2a40c4e9865ebef9936d23644f2602a5c90f5)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-29 10:59:53 +01:00
Chen Qi 547b189951 bitbake: bitbake-diffsigs: consider the situation where sigdata and siginfo files having the same hash values
For now, `bitbake-diffsigs -t <recipe> <task>' doesn't work. It always outputs
nothing.

The problem is that bitbake-diffsigs are comparing sigdata and siginfo files
that have the same hash value. This is not what we want. These two files are
actually duplicates considering the purpose of bitbake-diffsigs. So we need
to remove one of them so that bitbake-diffsigs could actually compare the
correct signature files.

(Bitbake rev: c34613eb69fd19770cbfc78ab8384221f10d5587)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-17 11:55:44 +01:00
Richard Purdie df9069d958 bitbake: bitbake-layers: ensure non-extended recipe name is preferred
In show-recipes and show-overlayed, we only list one variant of each
recipe where multiple exist, therefore we should show the main one (e.g.
in OpenEmbedded, we now show openssl and not nativesdk-openssl which
would otherwise sort first.)

Fixes [YOCTO #7514].

(Bitbake rev: c4172fe33f0c63eda7f4af2bd36a5e9738e13595)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-13 22:33:24 +01:00
Richard Purdie fe9c5b1ba9 bitbake: bin/image-writer: Add ext4 as a deployable image type
This is particularly problematic since qemu images switched to ext4 by
default and now cannot work properly with UIs like hob.

This patch adds in ext4 to the appropriate variable fixing this.

[YOCTO #7426]

(Bitbake rev: a1431b1b85bf90ed5f771552d0ce91de288047d4)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-03-31 22:39:21 +01:00
Ed Bartosh 4e18659633 bitbake: bin/bitbake: Create bitbake_main API
Moved most of functionality of bin/bitbake to lib/bb/main.py
to be able to call bitbake from python code.

(Bitbake rev: d377f7f88d73f4e5d2dffef03d6acee809827ac6)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-03-25 12:39:50 +00:00
Paul Eggleton 313ad2a5cc bitbake: bitbake-layers: use stdout instead of stderr for logging
We use logger.plain() to produce actual output which needs to go to
stdout. We could use more advanced filtering (and probably should in
future) but for the moment let's just fix the regression.

Fixes [YOCTO #7458].

(Bitbake rev: e96fc0ccfc9f5be2c41c9733c92dc81df3df5065)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-03-16 17:41:29 +00:00
Paul Eggleton efd78e3508 bitbake: bitbake-layers: fix wildcard support in remove-layer
The recent refactoring caused use of wildcards to trigger a traceback
because the old variable name was being used.

Fixes [YOCTO #7367].

(Bitbake rev: 7182cdd3c4a534a87147bb0aad7b360ffef6426b)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-25 23:29:29 +00:00
Alexandru Damian 6de6739c4c bitbake: toaster: update requirement for Django 1.6
In order to bring in transaction.set_commit support,
we need Django 1.6, discarding support for Django 1.5

This patch removes 1.5 from the list of acceptable Django
versions.

(Bitbake rev: 8640769296c3fffa2cf56cfb5327ca24533f5a41)

Signed-off-by: Alexandru Damian <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-24 23:35:44 +00:00
Chong Lu dfa28485fc bitbake: bitbake-layers: add ability to fetch layers and their dependencies from layer index
Add a command to query layer dependencies from a layer index such as the
OpenEmbedded Layer Index at http://layers.openembedded.org. Fetches the
layer and its dependencies and adds them into conf/bblayers.conf.

[YOCTO #5348]

(Bitbake rev: 4b8fcf9a5bc802793bf332334217faace55f14f6)

Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-21 22:05:37 +00:00
Paul Eggleton 90ffdc01ba bitbake: bitbake-layers: fix logging
Logging output was simply not getting printed.

(Bitbake rev: 62b825b19b13a914cbff5303d541bd5dbbec90a7)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-21 22:05:37 +00:00
Paul Eggleton 4a32837971 bitbake: bitbake-layers: refactor to use argparse instead of cmd
This makes help formatting and option handling a lot more standardised
and allows us to drop a bunch of code. We also gain slightly more
straightforward error handling.

One side-effect however is that the old subcommand syntax using
underscores is no longer supported. The dashed form has been supported
(and displayed in the help text) for quite a while now so I wouldn't
imagine that will be much of an issue.

(Bitbake rev: 6e2f09b58882d3949026b9dd545f789ad3fe6fab)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-21 22:05:37 +00:00
Alexandru DAMIAN da8110a86a bitbake: toaster: improve logging facilities for toaster
This patch improves the logging facilities for toaster in order
to help diagnose bugs that happen on user machines.

The logs are stored now under "/tmp/toaster_$$" where $$ is a
PID-based unique identifier. On shutdown, toaster will automatically
erase all logs unless errors are listed in the log file.

On error, Toaster provides suggestions on what to do.

This patch includes a minor fix found as a result of logging
improvements.

(Bitbake rev: 8a8248f7b7e30469f592e2f8adbf6ce21e8685c5)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-10 23:07:48 +00:00
Alexandru DAMIAN 0c89846daf bitbake: toaster: enhancements for the startup sequence
This patch brings fixes and enhancements in the startup sequence.

- the dependency version checking is now correctly enforced when
starting in both modes
- fixed errors in looking up environment variables
- added message with 'daemon' program start location
- presenting menu for selecting config file

[YOCTO #7283]
[YOCTO #7291]
[YOCTO #7273]

(Bitbake rev: c5ddd9d88910857a1b745b1c237df0390dd56835)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-10 23:07:48 +00:00
Belen Barros Pena ed5c448e2b bitbake: toaster: correct typo in toaster script
A small typo slipped in the message included in
the fix for [YOCTO #6023].

(Bitbake rev: f28fb3d660d8726b75e6c31fa36bc22b54e1bca7)

Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-10 23:07:47 +00:00
Alexandru DAMIAN 2237c9fcaa bitbake: toaster: proper setup for build configuration
This patch makes sure that all the toaster conf files are actually
written from the build enviroment controllers.

Additionally, toaster checks that the 'daemon' program, which is used
to start the build system, is available (currently for localhost).

[YOCTO #7171]

(Bitbake rev: 0a1db7d1531f8254955e1152bcd8e6db4ec1d277)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-02 12:34:53 +00:00
Alexandru DAMIAN c58c94824b bitbake: toaster: update texts for the startup sequence
This patch updates the prompts to the user to better explain
what Toaster is doing and the information it needs from the user.

Additionally, fixes a check in loadconf command.

[YOCTO #6785]
[YOCTO #7251]

(Bitbake rev: 90ef8975f35e2da824bc1c80e41ca26d9af0b208)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-01-30 15:14:58 +00:00
Ross Burton f0d5edc91e bitbake: bin/bitbake: only check that /dev/shm is writable on Linux
(Bitbake rev: 7a87ca9518f7239a2dfeb4576c59ea7b1f8d3071)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-01-21 14:37:39 +00:00
Alexandru DAMIAN 3e73af423f bitbake: toaster: do not launch web browser on noweb option
This patch makes Toaster managed mode obey the "noweb" parameter
by not starting the web server and launching the web browser
command if the "noweb" parameter is specified.

The web browser will be pointed at 127.0.0.1 instead of 0.0.0.0

[YOCTO #7039]

(Bitbake rev: 4037f8b08bc9fb5c4c9f260efb847105be718a32)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-01-08 22:34:36 +00:00
Alexandru DAMIAN 3c37669272 bitbake: toaster: write pre-read conf file for build variables
We change the setting of variables from directly injection
into the set-up cooker to writing a conf file that is pre-read
on bitbake server startup. This is needed because the injection
can only happen after the variable set is parsed, and the variables
already inferred, so setting up variables happens too late.

[YOCTO #7045]

(Bitbake rev: 854f680b5b9d2d0fa796af84cb1218545fbfc55a)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-01-08 22:34:36 +00:00
Richard Purdie 130958cc24 bitbake: bitbake-worker: Use setsid() rather than setpgid()
The bug has a long discussion of this. Basically, in some environments,
the exact details of which aren't understood, a Ctrl+C signal to the
UI is being transmitted to all the process children. Looking at the output
of "ps ax -O tpgid", its clear the main process is still the terminal
owner of these processes.

stty -a on a problematic system shows: "-ignbrk brkint"
and on a working system shows: "-ignbrk -brkint"

The description of brkint would suggest this is the problem, setting up
that terminal environment wasn't able to reproduce the problem though.
It was confirmed that using setsid() caused the problem to be resolved
and is probably the right thing to be doing anyway, so lets do it.

[YOCTO #6949]

(Bitbake rev: 461aa73fff0ab616032d28c4fd0322eb88838be6)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-01-08 09:46:58 +00:00
Paul Eggleton b264f5629b bitbake: bitbake-layers: fix error handling in add-layer / remove-layer
* Fix add-layer error message when a layer is already in BBLAYERS
* Ensure we show an error message if we can't find BBLAYERS at all

(Bitbake rev: 1c743fd2103730e27699dd55efc6914d3b0c3702)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-12-30 09:21:42 +00:00
Paul Eggleton db3f589f49 bitbake: bitbake-layers: add commands for adding and removing layers
Add add-layer and remove-layer commands for easily adding and removing
layers to/from bblayers.conf.

(Bitbake rev: 0e94aed033917b91ea6ba0522b14a040c3bdc987)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-12-23 10:18:21 +00:00
Alexandru DAMIAN 85a17f86ea bitbake: add option to write offline event log file
This patch adds a "-w/--write-log" option to bitbake
that writes an event log file for the current build.

The name of the file is passed as a parameter to the "-w"
argument. If the parameter is the empty string '', the file
name is generated in the form bitbake_eventlog_DATE.json,
where DATE is the current date and time, with second precision.

The "-w" option can also be supplied as the BBEVENTLOG
environment variable.

We add a script, toater-eventreplay, that reads an event
log file and loads the data into a Toaster database, creating
a build entry.

We modify the toasterui to fix minor issues with reading
events from an event log file.

Performance impact is undetectable under no-task executed builds.

(Bitbake rev: 1befb4a783bb7b7b387d4b5ee08830d9516f1ac2)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-12-18 10:24:06 +00:00
Richard Purdie 9315a2b645 bitbake: bitbake: Update to 1.25.0 as development version after release
(Bitbake rev: 94d9590a4310f96396e8e782bcf65918f4dcdb36)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-12-03 12:24:01 +00:00
Alexandru DAMIAN 0b6859cdf3 bitbake: toastergui: layer name correlation
This patch modifies how layers are identified and matched.

Layers were primarely organized by the source of layer information,
and Releases were separated by both layer git branches and originating
source of layer information. This setup prevented mixing layers from
different sources for a certain release, which didn't match the way
people use Yocto Project / bitbake.

This patch brings name-based indentification, where layers with the
same name are assumed to be equivalent, in the sense of being able
to substitute one another. To facilitate this identification to
humans, layers are differentiated by GIT URI instead of layer sources,
which was a rather arbitrary abstraction.

Additional changes include modification to models in order accomodate
for the new data structure, and to config file loading to match
the new toasterconf.json layout.

(Bitbake rev: 4357200aed522ad56cfd84917f877645b83b6a70)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-11-21 11:49:23 +00:00
Belen Barros Pena 2f3e40c5d8 bitbake: toaster: fix file name collision
When toaster is used by multiple users on the same machine,
it is possible that files in /tmp have a name race.

This patch makes sure that the files have unique names.

(Bitbake rev: d4a47bc84f762666a847f1152cc2e75c9ef36092)

Signed-off-by: Belen Barros Pena <belen.barros.pena@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-11-21 11:49:23 +00:00
Robert Yang c09e56168e bitbake: bitbake-worker: exit normally when SIGHUP
Fixed:
1) Run "bitbake recipe" in the terminal
2) Close the terminal while building
3) $ ps aux | grep bitbake-worker
There will be many processes, and they will keep the resources (e.g.,
memory), and won't exit unless kill or kill -9.

(Bitbake rev: 40d2ae0723de2bf5fee343faafb4afda40546839)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-11-20 14:15:32 +00:00
Alexandru DAMIAN 0ca70ce37a bitbake: toaster script: webport option and other improvements
We add the "webport=" command line option as to allow starting
the web server on a custom port.

The bitbake server port is now auto-allocated. This is needed
to be able to run multiple toaster environments on a single machine.

We tackle bug 6023 (toaster refusing to start when lock file is present)
by using more specific checks, and automatically recover from
bitbake server down / webserver up error mode.

Command line parameters are now read on both interactive and managed
modes.

The localhost and ssh controllers are updated to work with the modified
toaster launcher script.

[YOCTO #6023]

(Bitbake rev: cd3eb5b051743463cfe51dba97cae4da75420048)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-11-12 17:04:48 +00:00
Alexandru DAMIAN f19b4e995e bitbake: bitbake: clarify startup message
Fix the startup message by making clear which
server runs on which port.

(Bitbake rev: 26d601ab2a677a422bab425696a2cf6357ff3576)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-10-30 13:39:52 +00:00
Alexandru DAMIAN 2837b110ae bitbake: toaster: change startup parameter passing to avoid race
We avoid a race between the setting the TOASTER_BRBE variable
and reading the variable in toaster ui by supplying the variable
at server startup time through the toaster.conf post-read file.

Additional small changes are included, including marking the
build request with the environment id of where the build took place.

(Bitbake rev: 7c333350418c4140e6c988c5272940f8057d327d)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-10-30 13:39:51 +00:00
Richard Purdie c84b0c0b73 bitbake: bin/bitbake: Update to version 1.24.0
(Bitbake rev: 637ce8df2658e4905fab8a0600a45505596bf472)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-09-23 22:10:12 +01:00
Richard Purdie afdbe3112b bitbake: bitbake-worker: Fix bitbake -n
Without this you see:

File "bitbake/bin/bitbake-worker", line 201, in fork_off_task
    os._exit(child())
TypeError: an integer is required

(Bitbake rev: cd477b5e77ab0373248b8a8fa30e1c7b8ea984fd)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-09-22 15:54:40 +01:00
Richard Purdie 51e392106e bitbake: bin/bitbake: Update to version 1.23.2
(Bitbake rev: e24095f54c52a547c0462836586a5d716249036e)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-09-11 17:31:17 +01:00
Richard Purdie bb54fd0570 bitbake: siggen/runqueue/bitbake-worker: Improve siggen data transfer interface
We need to transfer some of the siggen data from the core/cooker into
the worker instances. There was a partial API created for this but
its ugly and its not possible to extend it from the siggen class.

This patch completes the interface/abstraction for the data and
means the class can extend/customise it in any siggen class.

(Bitbake rev: cf2d642052979d236185c5b8ca2c5478c06e62ae)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-09-11 17:31:17 +01:00
Alexandru DAMIAN 5bd2b3f9a6 bitbake: toaster: bitbake server listen on all interface
We change the toaster starting script to make the
bitbake server listen on all interfaces on the local machine.

This is needed to be able to receive a controlling client
running on a remote machine.

(Bitbake rev: 137179eafca8d1a5a69b6302f8cc8961be3b45c4)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-09-05 10:14:24 +01:00
Alexandru DAMIAN 95df54238b bitbake: toaster: update checksettings command for auto-detection
We enhance the checksettings command to try to automatically
detect settings for running on localhost.

The checksettings will look for a nearby poky layer source,
for a nearby build directory, and will try to import settings
from "toasterconf.json" files found in the local layer.

On new configuration, it will also perform updates from the
layer source.

(Bitbake rev: 2aab77dfccb538e2b09829841ea6c464d40cafb1)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-29 13:56:50 +01:00
Richard Purdie 34226b82da bitbake: bitbake-worker: Extra profiling data dump
Currently we get no profiling oversight into either the main bitbake worker
process, or the overall parsing before task execution. This adds in extra
profiling hooks so we can truly capture all parts of bitbake's execution
into the profile data.

To do this we modify the 'magic' value passed to bitbake-worker to trigger
the profiling, before the configuration data is sent over to the worker.

(Bitbake rev: 446e490bf485b712e5cee733dab5805254cdcad0)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-28 15:12:45 +01:00
Richard Purdie c501492132 bitbake: bitbake-worker: Improve sigterm handler
When processes terminate, we really want all of the child processes to
terminate too. This was not happening for worker processes which spawned their
own multiprocessing pools, leading to build hangs. This change ensures any
sigterm gets passed to the whole process group. In local tests, this resolved
some hanging process workloads I could generate. It does rely on signals
being delivered in a timely fashion and there is a multiprocessing bug we have
to work around there.

(Bitbake rev: 96f8ea07ace1379380fab2d78eb592fa40c867d4)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-23 09:31:42 +01:00
Robert Yang 8f52c69183 bitbake: bitbake: remove choices for dump-signatures
The SIGNATURE_HANDLER can be defined by the user, so we can't use choices.

(Bitbake rev: 0036b36e333a68c6d30a6bf5c21bfd4fd3e8441b)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-07-24 12:31:39 +01:00
Alexandru DAMIAN 37d2066c83 bitbake: toaster-requirements.txt: document requirements for the python environment
Since Toaster adds a number of specific requirements managed
by pip, we document these requirements in order to be able
to run bitbake and toaster under virtualenv. The target here
is to break the dependency on distro packages for specific
python libraries.

In order to start bitbake/Toaster in a distro-independent manner,
we use virtualenv and pip. We add venv to the .gitignore list
to make room for the virtualenv deployment in this directory.

Use this command sequence to setup the virtualenv:

$ virtualenv venv
$ . venv/bin/activate
$ cat toaster-requirements.txt | xargs pip install

bitbake and Toaster will then run normally under virtualenv.

We also fix bugs related to toaster starting in managed mode
through this script:
  * toaster will not use bldcontrol application in interactive mode
  * a proper message will be displayed if toaster detects a managed
start request in a build environment

(Bitbake rev: b5789c7ea7e6d1a4b67ec60fc0e4233ec543ba3a)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-07-23 20:07:43 +01:00
Alexandru DAMIAN 6cfb76fa8b bitbake: toaster: add fields for sourcedir and builddir paths
We add explicit absolute paths for a directory where
the layer sources will be checked out (sourcedir) and
where the build activities will take place.

Adding minimal checking when starting the application in
order to make sure that BuildEnvironment (BE) settings are
usable. This check is ran by the toaster script at startup.

Modify the localhost bbcontroller to use the BE settings
instead of trying to self-configure on checked out sources.

(Bitbake rev: d17500d3f73fdeeef5f11fb3773a65e927be3f02)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-07-23 20:06:57 +01:00
Robert P. J. Day 653b557770 bitbake: "per-package" should say "per-recipe"
(Bitbake rev: 1cd369883469747a8158826bb8d67dcca2a8577f)

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-07-23 10:02:13 +01:00
Robert Yang 231c7373fb bitbake: bitbake: update help message for dump-signatures
The bitbake -S had been updated which always reuires an argument, so
update the help info:
- Add the two args in the help message: none and printdiff

- Use type="choice" so that we can get more friendly error messages,
  for example:
  bitbake: error: option -S: invalid choice: 'printdiffX' (choose from 'none', 'printdiff')

- dump-signatures=DUMP_SIGNATURES -> dump-signatures=SIGNATURE_HANDLER

(Bitbake rev: 021b778fa4685bdde39e1a0f6c7c57632dcf792a)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-07-21 11:00:58 +01:00
Alexandru DAMIAN cff19351a8 bitbake: toaster: add project pages
We add the new project and project page skeletons.

In the process, we add an identifier in the settings.py
to detect whenever Toaster is running in managed mode,
and a context processor to make this value available
to the template processor.

(Bitbake rev: 927a27c68e24cfe13f62ca5f0e60878b04fa4e24)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-07-14 14:10:03 +01:00
Alexandru DAMIAN e163522205 bitbake: toaster: build control functionality
We add the build control functionality to toaster.

* The bldcontrol application gains bbcontroller classes
that know how to manage a localhost build environment.

* The toaster UI now detects it is running under build
environment controller, and update the build controller
database and will shut down the bitbake server once
the build is complete.

* The toaster script can now run in standalone mode,
launching the build controller and the web interface instead
of just monitoring the build, as in the interactive mode.

* A fixture with the default build controller entry for
localhost is provided.

[YOCTO #5490]
[YOCTO #5491]
[YOCTO #5492]
[YOCTO #5493]
[YOCTO #5494]
[YOCTO #5537]

(Bitbake rev: 10988bd77c8c7cefad3b88744bc5d8a7e3c1f4cf)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-06-13 11:55:34 +01:00
Alexandru DAMIAN 74cd8c38aa bitbake: xmlrpc: add support for token reusing
We add support to specify a connection token in the command line
and in the environment variable BBTOKEN.

When a client registers to a bitbake server, that client
will have exclusive access to the server. The client is identified
by a server-supplied token. If a client terminates, we cannot
reconnect to the server as the token is lost.

This patch adds the capability to specify the connection token
in the command line for xmlrpc clients. This allows us
to have bitbake work as an already-authenticated
client with the server and resume sending commands to a server.

(Bitbake rev: db5390940c0afbcdc9fbcf1225761968ae51d4a7)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-06-13 11:55:33 +01:00
Alexandru DAMIAN 3bd8e9adc8 bitbake: toaster: create models for bldcontrol and enable it
We create the model classes that store information
about triggering builds, and the available build
environments.

We add a fixture with a default build environment
for build control, using a "build/" directory under
the poky checkout directory.

We enable the bldcontrol in toaster starting script
and in the toaster settings as to allow the actual database
to be kept in sync with the source code.

(Bitbake rev: d4bfe9059f765f11244b97e324c0131f32f8e400)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-06-13 11:55:33 +01:00
Alexandru DAMIAN 9c3b53f12e bitbake: toaster: comment out bldcontrol migration command
This fixes toaster startup failing after the preparatory patches
for bldcontrol application have been merged.

I slipped a bldcontrol-specific line into the toaster startup
script and this prevents toaster from starting. We comment
out this line until the bldcontrol application have been merged.

(Bitbake rev: d095eec6fc958d0aeb514cdc206734617fd7c930)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-06-11 10:35:47 +01:00
Ash Charles 66d5be204f bitbake: bitbake: show wildcard appends for bitbake-layers
The 'bitbake-layers show-appends' command can use the built-in
get_file_appends() method which correctly identifies bbappends that
include a '%' wildcard in their filename.

(Bitbake rev: 2732dbae67c1945b668c38cc4cc5678c4aafe3d6)

Signed-off-by: Ash Charles <ashcharles@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-06-06 10:33:19 +01:00
Alexandru DAMIAN b68b74ddd4 bitbake: toaster: update toaster to run in managed mode
We disable bitbake self start to prevent race condition.

ToasterUI will shutdown the server when the build is done
if running in managed mode.

We fix usage of kill server flag in the bitbake binary.

(Bitbake rev: 30159dbda3a40fa596302f91c705cb5f148c97a9)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-06-06 10:32:54 +01:00
Alexandru DAMIAN b610aaee9d bitbake: toaster: startup script standalone mode
The toaster starter script was designed to be sourced in
a build environment and set up the build recording environment
to be used in an interactive mode.

For the standalone web server mode, we modify the toaster
script to be run directly from the checked-out sources,
without a build environment set up, and run the web server
alone. In the standalone mode, the build environemnts and
all build activities are controled through the web interface.

(Bitbake rev: c1db4ccf27bedcbab2f03e7539fdb11b042c4fb9)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-06-06 10:32:54 +01:00
Alexandru DAMIAN 05cf6fe0ff bitbake: toaster: startup script noweb mode
We add an option to the startup script, named "noweb" that
will start toaster without the embedded web server.

This is useful to start the system for build-only environments,
where the web server code is running on a different machine.

(Bitbake rev: c39838201301b9732581288a93783400bebe6591)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-06-06 10:32:54 +01:00
Alexandru DAMIAN e89db137f0 bitbake: xmlrpc: client - remove fatal errors
When we use the XMLRPC client API to connect to a bitbake server,
we want to receive errors from the API instead of having the
API exiting without warning.

Thus the "bb.fatal" calls have been replaced with "bb.warn" calls,
and we re-raise the original exception for handling by the
original caller.

The bitbake starting script has been modified to properly test
for failures in calling the client API and handle them.

Additional error handling added in the client, as to prevent
fatal crashes.

(Bitbake rev: eb63f08c33644f64752aaae2146a000956ce894a)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-06-06 10:32:54 +01:00
Alexandru DAMIAN a5d01e9ec7 bitbake: bitbake: move configuration reading code
The configuration reading code should live in the
main bitbake entry point, and the server modules should
be supplied with correct configuration instead of attempting
to parse from configuration files.

This patch moves the endpoint address reading from XMLRPC
to the bitbake main script.

(Bitbake rev: ac5753274ff932e1d6f073ab4dab7bd6fe5355a1)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-06-06 10:32:54 +01:00
Paul Eggleton 8cdc7926ec bitbake: bitbake-layers: show-cross-depends: add support for RRECOMMENDS
RRECOMMENDS must be satisfied at build time, and these could cross layer
boundaries, so report these if they exist.

(Bitbake rev: 5569b3dca61e6d962494ca65c7aad09b2eb2ae63)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-05-28 08:29:18 +01:00
Paul Eggleton 8ae64ff2e4 bitbake: bitbake-layers: show-cross-depends: ignore self-satisfied RDEPENDS
Overlayed recipes caused this to show false positives because the
overlaying version appeared to be satisfying the overlayed version's
RDEPENDS; but you'd never be building both at the same time.

(Bitbake rev: b94318174fe7f92b9a20eabb0bc4055066cb3d51)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-05-28 08:29:18 +01:00
Paul Eggleton 603f3fbe98 bitbake: bitbake-layers: show-cross-depends: ignore global inherits
It's not particularly useful to show globally inherited classes here
since they do not normally represent a dependency.

(Bitbake rev: d16948bb88fcf44d861985838030be7c08697963)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-05-28 08:29:18 +01:00
Paul Eggleton e124c0f9a8 bitbake: bitbake-layers: show-cross-depends: add option to ignore a layer
By default, show-cross-depends shows dependencies on OE-Core (i.e.
"meta") which is not particularly useful. Add an option to allow you to
hide those. For example, to hide all dependencies on OE-Core:

  bitbake-layers show-cross-depends -i meta

Multiple layers can be specified by using commas as separators (no
spaces).

(Bitbake rev: 0e9062e65acbb05c1d9b3a9145eb866c3d562309)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-05-28 08:29:18 +01:00
Richard Purdie afcf8e87aa bitbake: bitbake: Bump version to 1.23.1
(Bitbake rev: c40a4100ddb841d231360344616e59ab98e61fb5)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-05-01 22:47:58 +01:00
Jacob Kroon a688c9cbab bitbake: bitbake-diffsigs: Fix runtime error when no arguments are given
If bitbake-diffsigs is run without arguments it will error:

    Traceback (most recent call last):
      File "./bin/bitbake-diffsigs", line 121, in <module>
        if output:
    NameError: name 'output' is not defined

Fix this by moving the check for output into the inner else-clause.

(Bitbake rev: 7d3545a66863ad7183a7650b2af57eee091c45ae)

Signed-off-by: Jacob Kroon <jacob.kroon@mikrodidakt.se>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-04-27 01:27:55 +01:00
Richard Purdie 81a1b83954 bitbake: bitbake-worker: Drop BBHASH variables
Iterating through and calling setVar on this number of variables has significant
overhead in the profiling data. By not setting this, we save 3,000 calls
to setVar which gives a noticeable improvement to the speed of task execution.

The BBHASH variables have since been replaced by accessing that data through
the siggen code and going forward, that is the preferred way work with it.

(Bitbake rev: 92526eadd09d19938762290e0492076174367583)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-04-23 11:43:29 +01:00
Richard Purdie 4ba4ffeb05 bitbake: bitbake: Update to version 1.23.0 for master
(Bitbake rev: bb4980c63db386ce7d30d9a6b86e9f3861b3bc3a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-04-10 17:57:56 +01:00
Richard Purdie c3a216c5f5 bitbake: bitbake: Update to version 1.22.0
(Bitbake rev: a8a32de0fb74ff63e5490e3b5e4419146a8f7367)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-04-10 17:57:56 +01:00
Paul Eggleton 68ec4c1d1a bitbake: bitbake-selftest: fix help message to include command line
(Bitbake rev: 3016af554d9cc67aec2429b96d8d085b88315e77)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-04-09 14:31:14 +01:00
Richard Purdie adba3edca2 bitbake: bin/bitbake: Only try and process an event_queue if it exists
The connection may have failed before the event queue has been setup.
Handle this correctly in the exception handler.

(Bitbake rev: db4d80b5c2d32117cdf06333b9627202998b1512)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-30 10:10:37 +01:00
Alexandru DAMIAN 87fd184639 bitbake: bitbake: toaster: do not trap SIGCHLD
We remove trapping SIGCHLD due to a weird interaction
with the bash version used with Ubuntu 14.04 LTS.

(Bitbake rev: 59f2f33440449c586c23dd3a192698a37aaf0595)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-30 10:10:36 +01:00
Richard Purdie ef28fcd7fe bitbake: bin/bitbake/cooker: Ensure initial featureset is optimal
If the featureset didn't match the defaults, we'd pay the price of two
base configuration parses which showed up adversely in the performance
benchmarks. This also passes the feature set into the cooker creation so
in the common case we don't have to reset the server. This speeds up
both knotty and hob startup. If the featureset doesn't match, the system
will reset as before, this just streamlines the common case.

(Bitbake rev: 1249543c4dbf3edeac033d888497864cfc807a4e)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-30 10:10:36 +01:00
Richard Purdie 774eb753d8 bitbake: bitbake: Force -S option to take a parameter
There is no easy way to make this change. We really need parameters for the -S
(dump signatures) handling code. Such a parameter can then be used within the
codebase to handle the signatures in different ways.

For now, "none" is the recommended default and "printdiff" will execute the
new (and more expensive) comparison algorithms.

(Bitbake rev: b9873588696507dfb6aade6821f6f75cb9a19e0a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-27 09:42:07 +00:00
Alexandru DAMIAN 70f1a3db5e bitbake: toaster: clean exit on bb server shutdown
This patch adds the capability to have the Toaster UI
detect when the Bitbake server exited and cleanly
trigger a clean shutdown of the system through the toaster
starting script.

(Bitbake rev: a9cfa3eacfc99550e1ad3f8bb61b2a0bc9b44332)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-25 11:17:34 +00:00
Richard Purdie d1161cb4da bitbake: bitbake-worker: Ensure children have default sigterm handler
The children of the worker should have the default SIGTERM handler,
else they'll try and do cleanup which should only happen in the
parent leading to all kinds of bizarre build failures.

(Bitbake rev: a53c8d1f846d94082aa459996c4114f10970b8ef)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-11 20:18:53 -07:00
Ross Burton e1d7a45bb6 bitbake: bitbake: fix typo in variable name
When passing -t with an incorrect server type, the error message was using a
variable that doesn't exist.

(Bitbake rev: 98b991287df06cd89955c1d0591fce3b5d4403d1)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-11 12:27:24 -07:00
Alexandru DAMIAN 6b4aedc0c9 bitbake: toaster: erase checks for stop command
We remove the checks for the stop command, since we assume
the user really means it wants to shutdown the system when
he issues the command.

	[YOCTO #5376]

(Bitbake rev: 5d6594de8876be8ce4df56b846fee0fc687a6261)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-11 12:24:31 -07:00
Richard Purdie 1568879852 bitbake: bitbake-worker: Gracefully handle SIGTERM
Currently if bitbake-worker handles a SIGTERM, it leaves the child
processes to complete or hang. It shouldn't do this so hook the SIGTERM
event and gracefully shutdown any children.

(Bitbake rev: 551406f3f9ee94de09d2da6e16fea054c6dbfdb7)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-10 11:09:58 -07:00
Paul Eggleton 2f8be92de6 bitbake: bitbake-selftest: enable specifying tests to run on command line
If you are just trying to fix one test at a time, it can be useful to be
able to specify an individual test(s) rather than running them all:

 bitbake-selftest bb.tests.codeparser bb.tests.cow

You can even specify the test class or function to run, e.g.:

 bitbake-selftest bb.tests.fetch.URITest
 bitbake-selftest bb.tests.fetch.FetcherNetworkTest.test_fetch

(Bitbake rev: 4df9c72663e972437131a848e6ddcf3769ae1d2b)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-28 14:50:43 +00:00
Alexandru DAMIAN 6c294f0a2e bitbake: toaster: add two-stage commit startup logic
Toaster start script lunches multiple process components
of the toaster system.

This patch adds logic into the startup script to
safely fail startup and do proper cleanup on any error
that may happen during system start.

Bitbake needs to return 0 if it will successfully lunches
the server-mode.

(Bitbake rev: f43d284e7ae752049711d8215a6020bee6966d45)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-01-07 13:03:05 +00:00
Richard Purdie 8bbaed40c1 bitbake: Update to version 1.21.1 for master
(Bitbake rev: 4cc6e61fe11eb233bdba7c1bdc110b8cdafa56f8)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-12-20 12:26:06 +00:00
Alexandru DAMIAN 415ebb738d bitbake: toaster: migrate orm models to South
As Toaster advances, database schema alteration
will force users to delete old versions and lose
all data collected.

In order to prevent this, and to allow database
updates to happen without having to delete old data,
we use South to handle migrations for the ORM
application which stores the Toaster data.

    [YOCTO #5559]

(Bitbake rev: 6936faed8d94f3a2ab4055049cd27d02d8229003)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-12-10 11:16:14 +00:00
Alexandru DAMIAN 81ebce0778 bitbake: toaster: update to Django 1.5
In order to remain up to date with the relevant technologies,
Toaster is updated with this patch to Django 1.5. This also
makes headways to allow usage of emerging
Django-related technologies.

Changes include the startup script Django version check, usage
of TemplateView instead of deprecated simple function to do
redirects, and update to the new form of the _url_ template tag.

Support for Django 1.4.5 is now deprecated.

    [YOCTO #5558]

(Bitbake rev: 2d37a1731a2b681bc976f3f391d65abb7745b6f9)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-12-10 11:16:13 +00:00
Jason Wessel a67fde0ab1 bitbake: bitbake.lock: Add host:port to bitbake.lock for memres server
The idea is to build on the --status-only option for bitbake and
expose a mechanism where the oe init scripts can easily switch between
memres server and the non-memres server.

In the case of the standard oe init script the following
can shut down the server:

if [ -z "$BBSERVER" ] && [ -f bitbake.lock ] ; then
    grep ":" bitbake.lock > /dev/null && BBSERVER=`cat bitbake.lock` bitbake --status-only
    if [ $? = 0 ] ; then
       echo "Shutting down bitbake memory resident server with bitbake -m"
       BBSERVER=`cat bitbake.lock` bitbake -m
    fi
fi

A similar function can be used to automatically detect if the server
is already running for the oe memres init script.  This new
functionality allows for the memres init script to be started in a new
shell and connect up to an alaready running server without seeing the
error of trying to start the server multiple times.

(Bitbake rev: b1803958de8d7c3c3279841e38604a08dc2316cc)

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-12-02 17:33:14 +00:00
Jason Wessel 6ff9c9e39d bitbake: bitbake, xmlrpc.py: Implement memory resident auto port configuration/restart
This patch adds the ability to dynamically select a port for the
bitbake memory resident server when the BBSERVER port is set to -1.
This allows for running multiple instances of the bitbake memory
resident server on the same system in different build directories.

The client portion of the bitbake instance can also request that the
server automatically start when using the auto port feature.  This is
to deal with a bitbake instance that eventually times out and exits or
that has died for some unknown reason.

The new functionality allows for lazy startup of the server after
sourcing the init script for the memory resident functionality.

(Bitbake rev: d6abc07ff385357d312d8435b89e0a9c1f965433)

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-12-02 11:28:27 +00:00
Jason Wessel 0bea372b0f bitbake: bitbake: Add --status-only option
The --status-only option is purely to check the health of the server.
The idea is to use it from the oe environment script so as to know if
the server needs to be started or not.

(Bitbake rev: 46b26ef5c27bfa9c91680f494f02750305b8098c)

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-12-02 11:28:27 +00:00
Richard Purdie d061692372 bitbake: bitbake: Share BB_TASKDEPDATA with tasks
Currently tasks have no knowledge of which other tasks they depend
upon. This makes it impossible to do at least two things which would be
desirable/interesting:

a) Have the ability to create per recipe sysroots
b) Allow the aclocal files to be present only for the entries in
   DEPENDS (directly and indirectly)

By exporting task data through this new variable, tasks can inspect
their dependencies and then take actions based upon this.

(Bitbake rev: 84f1dde717dac22435005b79d03ee0b80a3e8e62)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-11-26 23:01:33 +00:00
Paul Eggleton 4ca910d4cf bitbake: bitbake-layers: avoid loading configuration when not needed
In recent versions of bitbake, it is not possible to initialise a
BBCooker object without having it load the configuration first. Thus we
should avoid creating the Tinfoil object here in bitbake-layers which
does that internally until we actually need to, so you can run
"bitbake-layers help" and not have to wait several seconds for the
output.

(Bitbake rev: 8f1e280fbbb6432d7bcc1fb4241f402668c6c5ea)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-11-24 12:25:37 +00:00
Richard Purdie bc267ef6fe bitbake: runqueue/bitbake-worker: Fix dry run fakeroot issues
When using the dry run option (-n), bitbake would still try and fire
a specific fakeroot worker. This is doomed to failure since it might
well not have been built.

Add in some checks to prevent the failures.

[YOCTO #5367]

(Bitbake rev: f34d0606f87ce9dacadeb78bac35879b74f10559)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-11-24 12:25:36 +00:00
Alexandru DAMIAN 9160f37606 bitbake: toaster: enable required classes in the toaster startup script
In order to use toaster, now you have to set INHERIT+="toaster buildhistory"
To keep it simple, I've done some changes in order to automate it. When toaster
is started, this line is added to a new file called toaster.conf.

This file is passed to the bitbake server with the --postread parameter.

Based on a patch by Cristiana Voicu <cristiana.voicu@intel.com>

(Bitbake rev: 029e868044989eda370340f8bf4200cfd2670fca)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-11-04 09:36:22 +00:00
Alexandru DAMIAN 16067d5295 bitbake: toaster: server shutdown on terminal exit
If the terminal where the server was started is closed,
the bitbake server should shutdown. Currently the system
is left in hanging state.

This patch uses "trap" command to make sure the servers
are closed on terminal exit.

[YOCTO #5376]

(Bitbake rev: 5f8b97010f7b465753b6ff6275d18426006ee14b)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-11-04 09:36:22 +00:00
Alexandru DAMIAN 164ab730cc bitbake: toaster: add toaster code to bitbake
This patch adds the Toaster component to Bitbake.

Toaster is a module designed to record the progress of a
Bitbake build, and data about the resultant artifacts.

It contains a web-based interface and a REST API allowing
post-facto inspection of the build process and artifacts.

Features present in this build:
* toaster start script
* relational data model
* Django boilerplate code
* the REST API
* the Simple UI web interface

This patch has all the development history squashed together.

Code portions contributed by Calin Dragomir <calindragomir@gmail.com>.

(Bitbake rev: d24334a5e83d09b3ab227af485971bb768bf5412)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-10-18 11:13:49 +01:00
Richard Purdie f41922d0c7 bitbake: bitbake: Update post 1.20 to development version
(Bitbake rev: 03d051b6da52ec4ee26f97aa9038622f8d87e55d)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-10-14 16:59:12 +01:00
Paul Eggleton 3c5b6af991 bitbake: bitbake-dumpsig: introduce command line and error handling
This utility doesn't take any special arguments, but it's nice if it at
least knows how to deal with no arguments, --help and errors properly.

(Bitbake rev: 0cabdf1d0cde6687bc1372675a0d6242587c87a0)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-10-07 09:37:35 +01:00
Paul Eggleton e57bd62e17 bitbake: bitbake-diffsigs: improve error handling
* Set up a logger independent of BitBake so we can log errors ourselves
* Handle common errors without printing a traceback

(Bitbake rev: 77b5f5b8dca4deebb06eeb06a8e7f2ccdbfff46f)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-10-07 09:37:35 +01:00
Paul Eggleton e0e30c6239 bitbake: bitbake-diffsigs: refactor argument parsing slightly
* Use OptionParser to parse the two options to -t rather than trying to
  pick them out ourselves.
* Add a description shown with --help output

(Bitbake rev: daab42d19463b4108968fc88b207936e5ac84154)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-10-07 09:37:34 +01:00
Paul Eggleton 7c72144419 bitbake: bitbake-diffsigs: handle if task name is specified without do_ prefix
Adjust the task name automatically if the -t option is specified with
a task name that doesn't start with do_ (e.g. "configure" instead of
"do_configure").

(Bitbake rev: d182cbc63745303ef2dc9fa2cbbf5d87a68e0b52)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-10-07 09:37:34 +01:00
Richard Purdie f18194c088 bitbake: bin/bitbake: Clarify server error message
Getting an error message about --remote-server being set when really
BBSERVER was is confusing, clarify the message.

(Bitbake rev: d7b5938a30a9b0ed83f899a06a88786e8392f8bd)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-10-07 09:37:34 +01:00
Richard Purdie 06afe1fafe bitbake: bin/bitbake: Clear ui-queue when starting a server
When starting a server we don't want to show the debug event queue which
is reserved for when when errors have occurred. This patch copies the UI
code to ensure the user doesn't see confusing output.

(Bitbake rev: a886cda58415085981646fb9a024fa7641f55865)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-10-07 09:37:34 +01:00
Richard Purdie 266a7d8c97 bitbake: bin/bitbake: No need to show tracebacks for BBHandledExceptions
For BBHandledExceptions, we've already displaced a sensible error to
the user so we don't need to do it again. Just exit with an error
value.

(Bitbake rev: 1ff5ec26eba70ab1c85674a60b7dac77317bf349)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-10-07 09:37:34 +01:00