summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/main.py
Commit message (Collapse)AuthorAgeFilesLines
* bitbake: main: fix processing of BBEVENTLOGEd Bartosh2016-04-191-1/+1
| | | | | | | | | | | 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>
* bitbake: bitbake: xmlrpc: set single use mode differentlyEd Bartosh2016-03-241-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* bitbake: main/runqueue: Add --setscene-only option to bitbakeRichard Purdie2016-01-111-0/+3
| | | | | | | | | | | | | 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>
* bitbake: main: kill server without queue setupEd Bartosh2016-01-061-6/+7
| | | | | | | | | | | | | | | | | | | | | | 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>
* bitbake: xmplrpc: split connect methodEd Bartosh2016-01-061-0/+1
| | | | | | | | | | | | | | 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>
* bitbake: cooker: preserve pre and post configsEd Bartosh2015-10-271-0/+7
| | | | | | | | | | | | | | | | | | | 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>
* bitbake: lib/bb/main: avoid importing all server/UI modules on every executionPaul Eggleton2015-08-241-22/+38
| | | | | | | | | | | | | | | | 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>
* bitbake: main: Handle RuntimeError exception in list_extension_modulesRandy Witt2015-08-201-1/+1
| | | | | | | | | | | 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>
* bitbake: lib/bb/main: consolidate UI/server extension listing and loadingPaul Eggleton2015-08-191-31/+54
| | | | | | | | | | 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>
* bitbake: Fix -m handling if cannot connect to serverPaul Eggleton2015-08-191-2/+0
| | | | | | | | | | | 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>
* bitbake: cooker: properly fix bitbake.lock handlingRichard Purdie2015-08-011-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* bitbake: main: add skeleton documentation for the recipe:do_task syntaxRoss Burton2015-07-071-1/+1
| | | | | | | | | | 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>
* bitbake: bitbake: Check if bitbake versions matchEd Bartosh2015-04-291-2/+1
| | | | | | | | | | | | | | | | 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>
* bitbake: bitbake: Handle BBMainExceptionEd Bartosh2015-04-291-1/+1
| | | | | | | | | | | | | | | | 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>
* bitbake: Update to version 1.27.0 post 1.26 releaseRichard Purdie2015-03-251-1/+1
| | | | | | (Bitbake rev: 0153e0b4e089f62a7d5a92ca6be2fa5a8f61a6e4) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: Update to version 1.26.0Richard Purdie2015-03-251-1/+1
| | | | | | (Bitbake rev: 14da7bc06bc6ea6fd051c0afd8d4839d96f415e7) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: bin/bitbake: Create bitbake_main APIEd Bartosh2015-03-251-0/+390
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>