aboutsummaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/main.py
AgeCommit message (Collapse)Author
2016-07-21bitbake: bitbake: implement idle timeout for xmlrpc serverEd Bartosh
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-21bitbake: bitbake: implement --foreground command line optionEd Bartosh
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-20bitbake: bitbake: main: implement server autostart featureEd Bartosh
If environment variable BBSERVER == 'autostart' bitbake will automatically load server if it's not running yet. If host and port are in bitbake.lock then bitbake tries to check if server is running and responses to commands and starts new server only if this check fails. [YOCTO #5534] (Bitbake rev: 89c6e625d47303b2aad8e6645762f17aee01b2d4) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08bitbake: knotty: add quiet output modePaul Eggleton
Quiet output mode disables printing most messages (below warnings) to the console; however these messages still go to the console log file. This is primarily for cases where bitbake is being launched interactively from some other process, but where full console output is not needed. Because of the need to keep logging all normal events to the console log, this functionality was implemented within the knotty UI rather than in bb.msg (where verbose mode is implemented). We don't currently have a means of registering command line options from the UI end, thus the option actually has to be registered in main.py regardless of the UI, however I didn't feel like it was worth setting up such a mechanism just for this option. (Bitbake rev: db95cdef08e339dec7462bfde3ad7d75c1c60dd8) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-09bitbake: lib/bb/main.py: Fix use of BBPOSTCONF and BBPRECONFMariano Lopez
The functionality of BBPOSTCONF and BBPRECONF was added in commit 21b314d4d1e5b8fbeb4cc57006f0a110f0b3aa8f but there was a typo in the variable name that raises an exception in bitbake. [YOCTO #9235] (Bitbake rev: 6d1379c8818400e5cdc442e6142f08a110fd5b95) Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02bitbake: bitbake: Convert to python 3Richard Purdie
Various misc changes to convert bitbake to python3 which don't warrant separation into separate commits. (Bitbake rev: d0f904d407f57998419bd9c305ce53e5eaa36b24) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-13bitbake: main: Ensure exceptions are correctly displayedRichard Purdie
If the cooker fails to start, ensure a correct exception is displayed to the user. After handling any queued events simply re-raise the original exception else the output can be unclear. (Bitbake rev: 9a4db1aa608c17d31bf5ea1cab5a99beb565dd83) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-13bitbake: main: Change warn() -> warning()Richard Purdie
This avoids a deprecation warning in python 3. (Bitbake rev: bf1a92d0c002d73e8a34472dced1343dc4a4251a) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-06bitbake: bitake: main: fix line-too-long pytling warningsEd Bartosh
Wrapped long lines to fix "Line too long" pylint warnings. (Bitbake rev: e329a932e14d002a561245b5026f974897f64598) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-06bitbake: bitbake: main: fix bad-continuation warningsEd Bartosh
Fixed pylint warning 'Wrong continued indentation'. (Bitbake rev: 5bfc8c0dc70abd6462a6df4ce905173d9f2cdc07) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-06bitbake: bitbake: main: fix bad-witespace pylint warningsEd Bartosh
Fixed pylint warnings: No space allowed around keyword argument assignment No space allowed after bracket No space allowed before bracket (Bitbake rev: c39770239f7b61217501782b9c5e9d3211355d42) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-06bitbake: bitbake: main: set defaults from env variablesEd Bartosh
Environment variables BBSERVER, BBTOKEN and BBEVENTLOG silently overwrite bitbake command line arguments. This is confusing and can cause issues that are difficult to debug. It's better to use them as default values instead. Used environment variables BBSERVER, BBTOKEN and BBEVENTLOG to set default values for command line arguments. Changed setting default value of --ui command line argument from BITBAKE_UI to look similar way. (Bitbake rev: 87040be4ff54cd460961318224deef8f2ea4c85a) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-06bitbake: bitbake: main: add 2 environment variablesEd Bartosh
Bitbake uses set of environment variables to set command line options, e.g. seeting BBTOKEN variable has the same effect as using --token command line option. Added new environment variables BBPRECONF and BBPOSTCONF that are equivalents of --read and --postread command line options. They can be used by high level scripts to append or prepend configuration files to conf/local.conf [YOCTO #9235] (Bitbake rev: bf604ec1ca4eb4d0b22bcc72249963e6d7445f34) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-19bitbake: main: fix processing of BBEVENTLOGEd Bartosh
Fixed typo that caused incorrect processing of BBEVENTLOG environment variable. Even if variable is set it was ignored by bitbake. (Bitbake rev: 2705b5f59aef4a070e2df2752d27bd04ea747057) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-24bitbake: bitbake: xmlrpc: set single use mode differentlyEd Bartosh
Currently xmlrpc server implicitly sets itself into single use mode when bitbake server is started with anonymous port (0) or no port is provided in command line. In this mode bitbake shuts down xmlrpc server after build is done. This assumption is incorrect in some cases. For example Toaster uses bitbake in this mode and expects xmlrpc server to stay in memory. Till recent changes single use mode was always unset due to the bug. When the bug was fixed it broke toaster builds as Toaster couldn't communicate with bitbake server in single use mode. Reimplemented logic of setting single use mode. The mode is explicity set when --server-only command line parameter is not provided to bitbake. It doesn't depend on the port number anymore. [YOCTO #9275] [YOCTO #9240] [YOCTO #9252] (Bitbake rev: afc0dd5c532684f6201b1e12bbf4c226ea19062d) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-11bitbake: main/runqueue: Add --setscene-only option to bitbakeRichard Purdie
Its turning out that we really need a way to have bitbake just run the setscene tasks but not any real tasks, particularly for SDK operations. Add an option for this since its pretty straight forward. This allows various nasty workarounds in OE-Core to be removed. (Bitbake rev: e4a2aafa1650a227a04d92a8a0b31efaed2c310e) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-06bitbake: main: kill server without queue setupEd Bartosh
Setup of event queue includes registering of UI handler. This operation can fail when cooker is busy. However, there is no need in registering UI handler for terminating the server. Moved the call of connection.terminateServer before setting up of the event queue. This should make terminating server to work more reliably as it doesn't depend on setting up the event queue and registering UI handler anymore. This should also help Toaster backend to restart bitbake server and observer without getting "Could not register UI event handler" errors. [YOCTO #8776] (Bitbake rev: 0c5a9349f797d05c282c2ada1893e187e05f0576) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-06bitbake: xmplrpc: split connect methodEd Bartosh
Current code in connect method sets up event queue, which requires registering UI handler. This functionality may not be needed for some operations, e.g. for server termination. Moved functionality of setting up event queue in from 'connect' method to 'setupEventQueue' in BitBakeXMLRPCServerConnection class. (Bitbake rev: 4429871da76d6bd29e023ff42740fe7daa6b40fa) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-27bitbake: cooker: preserve pre and post configsEd Bartosh
Additional config files passed to bitbake server with --read and --postread options are rewritten by client bitbake even if it doesn't use those options. This is a show stopper for toaster as toaster command line builds are based on the assumption that server is aware of toster configs, provided by --postread option. This behaviour is fixed by preserving values of --read and --postread options when bitbake server starts and restoring them if client bitbake doesn't explicitly specify them. (Bitbake rev: 02c64f7487ca8ec5d32c440f5002c4b8f64b76a6) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-24bitbake: lib/bb/main: avoid importing all server/UI modules on every executionPaul Eggleton
We're importing the server and UI modules in order to check they are valid, but it turns out that that has some nasty side-effects. We don't actually need to do this except when --help is passed or the module doesn't exist, so rearrange the code so that we only do the module listing in those two cases. Additionally, let's just go ahead and catch all errors on import; we really don't care to have them cause a failure now. (Bitbake rev: c9dc6d9c86e8b887821a6d00346bd0b09e1da97c) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-20bitbake: main: Handle RuntimeError exception in list_extension_modulesRandy Witt
This exception was triggered in toaster from recent changes and is completely breaking the whole of bitbake. Add the exception to the list so at least only toaster is affected. (Bitbake rev: f64def7cb6069dc1134fcd546bb59e4030c7376f) Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-19bitbake: lib/bb/main: consolidate UI/server extension listing and loadingPaul Eggleton
Provide us with a means of showing the list of UIs / server choices for the command line help, and do the processing in one place for both. (Bitbake rev: 24035c1daad5a904c3372d21d44191ee8182338f) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-19bitbake: Fix -m handling if cannot connect to serverPaul Eggleton
If we can't connect to the server we should error out, because it might not be that the server is actually dead - it might just be unable to execute commands. (Bitbake rev: d4b921676859d6ba4e1922fa4682ee941652f483) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-01bitbake: cooker: properly fix bitbake.lock handlingRichard Purdie
If the PR server or indeed any other child process takes some time to exit (which it sometimes does when saving its database), it can end up holding bitbake.lock after the UI exits, which led to errors if you ran bitbake commands successively - we saw this when running the PR server oe-selftest tests in OE-Core. The recent attempt to fix this wasn't quite right and ended up breaking memory resident bitbake. This time we close the lock file when cooker shuts down (inside the UI process) instead of unlocking it, and this is done in the cooker code rather than the actual UI code so it doesn't matter which UI is in use. Additionally we report that we're waiting for the lock to be released, using lsof or fuser if available to list the processes with the lock open. The 'magic' in the locking is due to all spawned subprocesses of bitbake holding an open file descriptor to the bitbake.lock. It is automatically unlocked when all those fds close the file (as all the processes terminate). We close the UI copy of the lock explicitly, then close the server process copy, any remaining open copy is therefore some proess exiting. (The reproducer for the problem is to set PRSERV_HOST = "localhost:0" and add a call to time.sleep(20) after self.server_close() in lib/prserv/serv.py, then run "bitbake -p; bitbake -p" ). Cleanup work done by Paul Eggleton <paul.eggleton@linux.intel.com>. This reverts bitbake commit 69ecd15aece54753154950c55d7af42f85ad8606 and e97a9f1528d77503b5c93e48e3de9933fbb9f3cd. (Bitbake rev: a29780bd43f74b7326fe788dbd65177b86806fcf) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-07bitbake: main: add skeleton documentation for the recipe:do_task syntaxRoss Burton
The incredibly useful recipe:do_task syntax on the command line isn't documented at all. This isn't much but it's better than nothing. (Bitbake rev: 7f4c07886ecff4ac77fdd2165bedd179099fcf19) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-29bitbake: bitbake: Check if bitbake versions matchEd Bartosh
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-29bitbake: bitbake: Handle BBMainExceptionEd Bartosh
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-03-25bitbake: Update to version 1.27.0 post 1.26 releaseRichard Purdie
(Bitbake rev: 0153e0b4e089f62a7d5a92ca6be2fa5a8f61a6e4) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-03-25bitbake: Update to version 1.26.0Richard Purdie
(Bitbake rev: 14da7bc06bc6ea6fd051c0afd8d4839d96f415e7) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-03-25bitbake: bin/bitbake: Create bitbake_main APIEd Bartosh
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>