]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
bitbake: main: Fix environment handling for UI module imports
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 9 Oct 2018 17:59:25 +0000 (18:59 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 10 Oct 2018 11:47:48 +0000 (12:47 +0100)
The environment was being cleared before the UI imports occurred which
caused problems for graphical UIs like taskexp. The full environment was
intended to be available to UI clients and it was only meant to be cleared
for the server/cooker, so tweak the code order so this is the case.

This fixes problems reported for taskexp.

[YOCTO #12670]

(Bitbake rev: ac15028391fdcc3fec2dd0e64a4f763ce63e5449)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
bitbake/lib/bb/main.py

index f4474e410fa7378fcf1400a602fc7fb4ffc75007..732a315404e80f883161e368c3c2f8a91ae8b0a4 100755 (executable)
@@ -405,9 +405,6 @@ def setup_bitbake(configParams, configuration, extrafeatures=None):
         # In status only mode there are no logs and no UI
         logger.addHandler(handler)
 
-    # Clear away any spurious environment variables while we stoke up the cooker
-    cleanedvars = bb.utils.clean_environment()
-
     if configParams.server_only:
         featureset = []
         ui_module = None
@@ -423,6 +420,10 @@ def setup_bitbake(configParams, configuration, extrafeatures=None):
 
     server_connection = None
 
+    # Clear away any spurious environment variables while we stoke up the cooker
+    # (done after import_extension_module() above since for example import gi triggers env var usage)
+    cleanedvars = bb.utils.clean_environment()
+
     if configParams.remote_server:
         # Connect to a remote XMLRPC server
         server_connection = bb.server.xmlrpcclient.connectXMLRPC(configParams.remote_server, featureset,