summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
diff options
context:
space:
mode:
authorAwais Belal <awais_belal@mentor.com>2018-08-26 15:33:25 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-08-28 10:32:08 +0100
commitaf52215712098ffe9a167171971f6e7af519c0a1 (patch)
tree4309120ae1a06e44db47dd14862fee0736c2d4e0 /bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
parent95e37ba260adee18cf16dd099a67f0a4fe22b7a9 (diff)
downloadpoky-af52215712098ffe9a167171971f6e7af519c0a1.tar.gz
bitbake: 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] (Bitbake rev: 365d8d94ae3e4e0f95e0806dbcb7c77c20a55d2d) Signed-off-by: Awais Belal <awais_belal@mentor.com> Signed-off-by: David Reyna <David.Reyna@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/bldcontrol/localhostbecontroller.py')
-rw-r--r--bitbake/lib/toaster/bldcontrol/localhostbecontroller.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py b/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
index 5df22909d0..aba09e0d27 100644
--- a/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
+++ b/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
@@ -444,8 +444,19 @@ class LocalhostBEController(BuildEnvironmentController):
444 # clean the Toaster to build environment 444 # clean the Toaster to build environment
445 env_clean = 'unset BBPATH;' # clean BBPATH for <= YP-2.4.0 445 env_clean = 'unset BBPATH;' # clean BBPATH for <= YP-2.4.0
446 446
447 # run bitbake server from the clone 447 # run bitbake server from the clone if available
448 # otherwise pick it from the PATH
448 bitbake = os.path.join(self.pokydirname, 'bitbake', 'bin', 'bitbake') 449 bitbake = os.path.join(self.pokydirname, 'bitbake', 'bin', 'bitbake')
450 if not os.path.exists(bitbake):
451 logger.info("Bitbake not available under %s, will try to use it from PATH" %
452 self.pokydirname)
453 for path in os.environ["PATH"].split(os.pathsep):
454 if os.path.exists(os.path.join(path, 'bitbake')):
455 bitbake = os.path.join(path, 'bitbake')
456 break
457 else:
458 logger.error("Looks like Bitbake is not available, please fix your environment")
459
449 toasterlayers = os.path.join(builddir,"conf/toaster-bblayers.conf") 460 toasterlayers = os.path.join(builddir,"conf/toaster-bblayers.conf")
450 if not is_merged_attr: 461 if not is_merged_attr:
451 self._shellcmd('%s bash -c \"source %s %s; BITBAKE_UI="knotty" %s --read %s --read %s ' 462 self._shellcmd('%s bash -c \"source %s %s; BITBAKE_UI="knotty" %s --read %s --read %s '