[gnome-continuous-yocto/gnomeostree-3.28-rocko: 1/218] bitbake: toaster: unset BBPATH before starting bbserver for backwards compatibility



commit 8eaf495b05912422614d4d6a2faa23940a4739fc
Author: David Reyna <David Reyna windriver com>
Date:   Fri Dec 1 15:30:12 2017 -0800

    bitbake: toaster: unset BBPATH before starting bbserver for backwards compatibility
    
    The latest build enviroment script is now setting BBPATH. This breaks
    building previous releases from a master-based Toaster, because with this
    newly inherited BBPATH value the 'bitbake.lock' file ends up in the
    Toaster build directory instead of the project's build directory.
    
    Toaster should always clear BBPATH so that the bbserver's environment
    is clean (enough).
    
    [YOCTO #12363]
    
    (Bitbake rev: 11cb604a83375ba3b05f7bd36513b9c68852174d)
    
    Signed-off-by: David Reyna <David Reyna windriver com>
    Signed-off-by: Richard Purdie <richard purdie linuxfoundation org>

 .../toaster/bldcontrol/localhostbecontroller.py    |   18 ++++++++++++------
 1 files changed, 12 insertions(+), 6 deletions(-)
---
diff --git a/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py 
b/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
index 83cb703..23b2792 100644
--- a/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
+++ b/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
@@ -332,15 +332,18 @@ class LocalhostBEController(BuildEnvironmentController):
                 conf.write('%s="%s"\n' % (var.name, var.value))
             conf.write('INHERIT+="toaster buildhistory"')
 
+        # clean the Toaster to build environment
+        env_clean = 'unset BBPATH;' # clean BBPATH for <= YP-2.4.0
+
         # run bitbake server from the clone
         bitbake = os.path.join(self.pokydirname, 'bitbake', 'bin', 'bitbake')
         toasterlayers = os.path.join(builddir,"conf/toaster-bblayers.conf")
-        self._shellcmd('bash -c \"source %s %s; BITBAKE_UI="knotty" %s --read %s --read %s '
-                       '--server-only -B 0.0.0.0:0\"' % (oe_init,
+        self._shellcmd('%s bash -c \"source %s %s; BITBAKE_UI="knotty" %s --read %s --read %s '
+                       '--server-only -B 0.0.0.0:0\"' % (env_clean, oe_init,
                        builddir, bitbake, confpath, toasterlayers), self.be.sourcedir)
 
         # read port number from bitbake.lock
-        self.be.bbport = ""
+        self.be.bbport = -1
         bblock = os.path.join(builddir, 'bitbake.lock')
         # allow 10 seconds for bb lock file to appear but also be populated
         for lock_check in range(10):
@@ -352,6 +355,9 @@ class LocalhostBEController(BuildEnvironmentController):
                 break
             logger.debug("localhostbecontroller: waiting for bblock content to appear")
             time.sleep(1)
+        else:
+            raise BuildSetupException("Cannot find bitbake server lock file '%s'. Aborting." % bblock)
+
         with open(bblock) as fplock:
             for line in fplock:
                 if ":" in line:
@@ -359,7 +365,7 @@ class LocalhostBEController(BuildEnvironmentController):
                     logger.debug("localhostbecontroller: bitbake port %s", self.be.bbport)
                     break
 
-        if not self.be.bbport:
+        if -1 == self.be.bbport:
             raise BuildSetupException("localhostbecontroller: can't read bitbake port from %s" % bblock)
 
         self.be.bbaddress = "localhost"
@@ -380,10 +386,10 @@ class LocalhostBEController(BuildEnvironmentController):
         log = os.path.join(builddir, 'toaster_ui.log')
         local_bitbake = os.path.join(os.path.dirname(os.getenv('BBBASEDIR')),
                                      'bitbake')
-        self._shellcmd(['bash -c \"(TOASTER_BRBE="%s" BBSERVER="0.0.0.0:%s" '
+        self._shellcmd(['%s bash -c \"(TOASTER_BRBE="%s" BBSERVER="0.0.0.0:%s" '
                         '%s %s -u toasterui  --read %s --read %s --token="" >>%s 2>&1;'
                         'BITBAKE_UI="knotty" BBSERVER=0.0.0.0:%s %s -m)&\"' \
-                        % (brbe, self.be.bbport, local_bitbake, bbtargets, confpath, toasterlayers, log,
+                        % (env_clean, brbe, self.be.bbport, local_bitbake, bbtargets, confpath, 
toasterlayers, log,
                         self.be.bbport, bitbake,)],
                         builddir, nowait=True)
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]