From ba83eb315d1462e096e2d6682d246cbbe260b4c0 Mon Sep 17 00:00:00 2001 From: Alexandru DAMIAN Date: Wed, 18 Sep 2013 13:15:47 +0100 Subject: bitbake: bitbake: cooker,xmlrpc,servers: implement CookerFeatures Implementing feature set selection that allows a client to enable specific features in the server at connection time. Only enabling of features is supported, as there is no way to safely remove data loaded into the cooker. Once enabled, a feature will remain enabled for the life of the cooker. Client-server connection now supports specifying the feature set required by the client. This is implemented in the Process server using a managed proxy list, so the server cooker will now load dynamically needed features based on what client connects to it. In the XMLRPC server the feature set is requested by using a parameter for registerUIHandler function. This allows observer-only clients to also specify features for the server. The server code configuration now is completly separated from the client code. All hardcoding of client knowledge is removed from the server. The extra_caches is removed as the client can now specify the caches it needs using the feature. The UI modules now need to specify the desired featureSet. HOB is modified to conform to the featureSet specification. The only feature available is CookerFeatures.HOB_EXTRA_CACHES which forces loading the bb.cache_extra:HobRecipeInfo class. (Bitbake rev: 98e594837aab89ea042cfa9f3740d20a661b14e2) Signed-off-by: Alexandru DAMIAN Signed-off-by: Richard Purdie --- bitbake/bin/bitbake | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) (limited to 'bitbake/bin/bitbake') diff --git a/bitbake/bin/bitbake b/bitbake/bin/bitbake index 60c4b96c70..b4506efb52 100755 --- a/bitbake/bin/bitbake +++ b/bitbake/bin/bitbake @@ -75,18 +75,6 @@ def get_ui(config): sys.exit("FATAL: Invalid user interface '%s' specified.\n" "Valid interfaces: depexp, goggle, ncurses, hob, knotty [default]." % interface) -def gather_extra_cache_data(): - extra = [] - interfaces = ['depexp', 'goggle', 'ncurses', 'hob', 'knotty'] - for i in interfaces: - try: - ui = __import__("bb.ui." + i, fromlist = [i]) - if hasattr(ui, "extraCaches"): - extra = extra + ui.extraCaches - del ui - except: - pass - return extra # Display bitbake/OE warnings via the BitBake.Warnings logger, ignoring others""" warnlog = logging.getLogger("BitBake.Warnings") @@ -302,25 +290,22 @@ def main(): # Clear away any spurious environment variables while we stoke up the cooker cleanedvars = bb.utils.clean_environment() - # Collect all the caches we need - if configParams.server_only: - configuration.extra_caches = gather_extra_cache_data() - else: - configuration.extra_caches = getattr(ui_module, "extraCaches", []) - if not configParams.remote_server: # we start a server with a given configuration server = start_server(servermodule, configParams, configuration) else: - # we start a stub server that is actually a XMLRPClient to + # we start a stub server that is actually a XMLRPClient that connects to a real server server = servermodule.BitBakeXMLRPCClient(configParams.observe_only) server.saveConnectionDetails(configParams.remote_server) logger.removeHandler(handler) if not configParams.server_only: + # Collect the feature set for the UI + featureset = getattr(ui_module, "featureSet", []) + # Setup a connection to the server (cooker) - server_connection = server.establishConnection() + server_connection = server.establishConnection(featureset) # Restore the environment in case the UI needs it for k in cleanedvars: -- cgit v1.2.3-54-g00ecf