summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorAwais Belal <awais_belal@mentor.com>2018-09-05 22:26:41 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-09-10 12:15:04 +0100
commitc1f5ec8f4310fb4a53aca34c841b7353fdfb8e28 (patch)
tree23236ecd86f859913736bb1c6a0d33d775c51f0f /bitbake
parente44bb5b5c8c20af0a87f9c2498c391f764195c32 (diff)
downloadpoky-c1f5ec8f4310fb4a53aca34c841b7353fdfb8e28.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: 15340edce23e63b060c75114d508e1f76757239c) 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')
-rw-r--r--bitbake/lib/toaster/bldcontrol/localhostbecontroller.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py b/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
index f960a389c4..38503342cb 100644
--- a/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
+++ b/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
@@ -351,6 +351,19 @@ class LocalhostBEController(BuildEnvironmentController):
351 # clean the Toaster to build environment 351 # clean the Toaster to build environment
352 env_clean = 'unset BBPATH;' # clean BBPATH for <= YP-2.4.0 352 env_clean = 'unset BBPATH;' # clean BBPATH for <= YP-2.4.0
353 353
354 # run bitbake server from the clone if available
355 # otherwise pick it from the PATH
356 bitbake = os.path.join(self.pokydirname, 'bitbake', 'bin', 'bitbake')
357 if not os.path.exists(bitbake):
358 logger.info("Bitbake not available under %s, will try to use it from PATH" %
359 self.pokydirname)
360 for path in os.environ["PATH"].split(os.pathsep):
361 if os.path.exists(os.path.join(path, 'bitbake')):
362 bitbake = os.path.join(path, 'bitbake')
363 break
364 else:
365 logger.error("Looks like Bitbake is not available, please fix your environment")
366
354 # run bitbake server from the clone 367 # run bitbake server from the clone
355 bitbake = os.path.join(self.pokydirname, 'bitbake', 'bin', 'bitbake') 368 bitbake = os.path.join(self.pokydirname, 'bitbake', 'bin', 'bitbake')
356 toasterlayers = os.path.join(builddir,"conf/toaster-bblayers.conf") 369 toasterlayers = os.path.join(builddir,"conf/toaster-bblayers.conf")