summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandru DAMIAN <alexandru.damian@intel.com>2014-06-03 16:26:16 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-06-06 10:32:54 +0100
commitb68b74ddd4be4a767e84c72a011cc087e059d132 (patch)
treec413e63894ef8cf8afc5faccd68f5445b8edaf91
parentb610aaee9d4a1ee6671f74fbb5902ca48b09ad4a (diff)
downloadast2050-yocto-poky-b68b74ddd4be4a767e84c72a011cc087e059d132.zip
ast2050-yocto-poky-b68b74ddd4be4a767e84c72a011cc087e059d132.tar.gz
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>
-rwxr-xr-xbitbake/bin/bitbake34
-rw-r--r--bitbake/lib/bb/ui/toasterui.py16
2 files changed, 28 insertions, 22 deletions
diff --git a/bitbake/bin/bitbake b/bitbake/bin/bitbake
index ab881c5..f120bac 100755
--- a/bitbake/bin/bitbake
+++ b/bitbake/bin/bitbake
@@ -301,6 +301,9 @@ def main():
if configParams.observe_only and (not configParams.remote_server or configParams.bind):
sys.exit("FATAL: '--observe-only' can only be used by UI clients connecting to a server.\n")
+ if configParams.kill_server and not configParams.remote_server:
+ sys.exit("FATAL: '--kill-server' can only be used to terminate a remote server")
+
if "BBDEBUG" in os.environ:
level = int(os.environ["BBDEBUG"])
if level > configuration.debug:
@@ -332,29 +335,14 @@ def main():
server = servermodule.BitBakeXMLRPCClient(configParams.observe_only)
server.saveConnectionDetails(configParams.remote_server)
- def _getServerConnection(server, featureset):
- try:
- server_connection = server.establishConnection(featureset)
- except Exception as e:
- bb.fatal("Could not connect to server %s: %s" % (configParams.remote_server, str(e)))
- return server_connection
if not configParams.server_only:
- if configParams.status_only:
- server_connection = _getServerConnection(server, featureset)
- server_connection.terminate()
- sys.exit(0)
-
- # Setup a connection to the server (cooker)
try:
server_connection = server.establishConnection(featureset)
- except:
+ except Exception as e:
if configParams.kill_server:
- bb.fatal("Server already offline")
- configParams.bind = configParams.remote_server
- start_server(servermodule, configParams, configuration, featureset)
- bb.event.ui_queue = []
- server_connection = _getServerConnection(server, featureset)
+ sys.exit(0)
+ bb.fatal("Could not connect to server %s: %s" % (configParams.remote_server, str(e)))
# Restore the environment in case the UI needs it
for k in cleanedvars:
@@ -362,6 +350,16 @@ def main():
logger.removeHandler(handler)
+
+ if configParams.status_only:
+ server_connection.terminate()
+ sys.exit(0)
+
+ if configParams.kill_server:
+ server_connection.connection.terminateServer()
+ bb.event.ui_queue = []
+ sys.exit(0)
+
try:
return ui_module.main(server_connection.connection, server_connection.events, configParams)
finally:
diff --git a/bitbake/lib/bb/ui/toasterui.py b/bitbake/lib/bb/ui/toasterui.py
index 9a9fe6f..c1696b2 100644
--- a/bitbake/lib/bb/ui/toasterui.py
+++ b/bitbake/lib/bb/ui/toasterui.py
@@ -226,11 +226,19 @@ def main(server, eventHandler, params ):
buildinfohelper.update_build_information(event, errors, warnings, taskfailures)
+
+ brbe = server.runCommand(["getVariable", "TOASTER_BRBE"])[0]
# we start a new build info
- errors = 0
- warnings = 0
- taskfailures = []
- buildinfohelper = BuildInfoHelper(server, build_history_enabled)
+ if brbe is not None:
+ print "we are under BuildEnvironment management - after the build, we exit"
+ server.terminateServer()
+ else:
+ print "prepared for new build"
+ errors = 0
+ warnings = 0
+ taskfailures = []
+ buildinfohelper = BuildInfoHelper(server, build_history_enabled)
+
continue
if isinstance(event, bb.event.MetadataEvent):
OpenPOWER on IntegriCloud