[oe-commits] [bitbake] 02/10: toaster: use a more flexible way to find bitbake

git at git.openembedded.org git at git.openembedded.org
Mon Aug 27 23:05:23 UTC 2018


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository bitbake.

commit 365d8d94ae3e4e0f95e0806dbcb7c77c20a55d2d
Author: Awais Belal <awais_belal at mentor.com>
AuthorDate: Sun Aug 26 15:33:25 2018 -0700

    toaster: use a more flexible way to find bitbake
    
    The current mechanism for finding the bitbake binary
    assumes a directory structure which is identical to
    poky, where oe-core's meta and bitbake directories are
    at the same level. There can be a case where bitbake
    is used from elsewhere and in such cases the above
    mentioned assumption fails to hold, whereas this is
    totally allowed by the oe-init-build-env script which
    can take bitbakedir as an argument.
    The better approach is to allow bitbake to be derived
    from PATH, while keeping the older mechanism in place so
    it can be removed after tests are done in various
    environments. This makes more sense as toaster has
    also been launched from the same bitbake instance
    that is the one in PATH.
    
    [YOCTO #12891]
    
    Signed-off-by: Awais Belal <awais_belal at mentor.com>
    Signed-off-by: David Reyna <David.Reyna at windriver.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 lib/toaster/bldcontrol/localhostbecontroller.py | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/lib/toaster/bldcontrol/localhostbecontroller.py b/lib/toaster/bldcontrol/localhostbecontroller.py
index 5df2290..aba09e0 100644
--- a/lib/toaster/bldcontrol/localhostbecontroller.py
+++ b/lib/toaster/bldcontrol/localhostbecontroller.py
@@ -444,8 +444,19 @@ class LocalhostBEController(BuildEnvironmentController):
         # clean the Toaster to build environment
         env_clean = 'unset BBPATH;' # clean BBPATH for <= YP-2.4.0
 
-        # run bitbake server from the clone
+        # run bitbake server from the clone if available
+        # otherwise pick it from the PATH
         bitbake = os.path.join(self.pokydirname, 'bitbake', 'bin', 'bitbake')
+        if not os.path.exists(bitbake):
+            logger.info("Bitbake not available under %s, will try to use it from PATH" %
+                        self.pokydirname)
+            for path in os.environ["PATH"].split(os.pathsep):
+                if os.path.exists(os.path.join(path, 'bitbake')):
+                    bitbake = os.path.join(path, 'bitbake')
+                    break
+            else:
+                logger.error("Looks like Bitbake is not available, please fix your environment")
+
         toasterlayers = os.path.join(builddir,"conf/toaster-bblayers.conf")
         if not is_merged_attr:
             self._shellcmd('%s bash -c \"source %s %s; BITBAKE_UI="knotty" %s --read %s --read %s '

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list