diff options
author | David Reyna <David.Reyna@windriver.com> | 2017-11-30 00:55:23 -0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-12-18 15:05:29 +0000 |
commit | 7f7154dda9c6c342b7e671a7916659238453d661 (patch) | |
tree | c0b6e90b06aab0f8e81617964d1714d93955f58f /bitbake/lib/toaster/bldcontrol | |
parent | b73e96e7f3f5d1ba3a221d99792a7a3c7ef42c21 (diff) | |
download | poky-7f7154dda9c6c342b7e671a7916659238453d661.tar.gz |
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: 21dde782c049108dd9455ffbf431de214437e800)
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')
-rw-r--r-- | bitbake/lib/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 83cb7039fc..23b2792ed6 100644 --- a/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py +++ b/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py | |||
@@ -332,15 +332,18 @@ class LocalhostBEController(BuildEnvironmentController): | |||
332 | conf.write('%s="%s"\n' % (var.name, var.value)) | 332 | conf.write('%s="%s"\n' % (var.name, var.value)) |
333 | conf.write('INHERIT+="toaster buildhistory"') | 333 | conf.write('INHERIT+="toaster buildhistory"') |
334 | 334 | ||
335 | # clean the Toaster to build environment | ||
336 | env_clean = 'unset BBPATH;' # clean BBPATH for <= YP-2.4.0 | ||
337 | |||
335 | # run bitbake server from the clone | 338 | # run bitbake server from the clone |
336 | bitbake = os.path.join(self.pokydirname, 'bitbake', 'bin', 'bitbake') | 339 | bitbake = os.path.join(self.pokydirname, 'bitbake', 'bin', 'bitbake') |
337 | toasterlayers = os.path.join(builddir,"conf/toaster-bblayers.conf") | 340 | toasterlayers = os.path.join(builddir,"conf/toaster-bblayers.conf") |
338 | self._shellcmd('bash -c \"source %s %s; BITBAKE_UI="knotty" %s --read %s --read %s ' | 341 | self._shellcmd('%s bash -c \"source %s %s; BITBAKE_UI="knotty" %s --read %s --read %s ' |
339 | '--server-only -B 0.0.0.0:0\"' % (oe_init, | 342 | '--server-only -B 0.0.0.0:0\"' % (env_clean, oe_init, |
340 | builddir, bitbake, confpath, toasterlayers), self.be.sourcedir) | 343 | builddir, bitbake, confpath, toasterlayers), self.be.sourcedir) |
341 | 344 | ||
342 | # read port number from bitbake.lock | 345 | # read port number from bitbake.lock |
343 | self.be.bbport = "" | 346 | self.be.bbport = -1 |
344 | bblock = os.path.join(builddir, 'bitbake.lock') | 347 | bblock = os.path.join(builddir, 'bitbake.lock') |
345 | # allow 10 seconds for bb lock file to appear but also be populated | 348 | # allow 10 seconds for bb lock file to appear but also be populated |
346 | for lock_check in range(10): | 349 | for lock_check in range(10): |
@@ -352,6 +355,9 @@ class LocalhostBEController(BuildEnvironmentController): | |||
352 | break | 355 | break |
353 | logger.debug("localhostbecontroller: waiting for bblock content to appear") | 356 | logger.debug("localhostbecontroller: waiting for bblock content to appear") |
354 | time.sleep(1) | 357 | time.sleep(1) |
358 | else: | ||
359 | raise BuildSetupException("Cannot find bitbake server lock file '%s'. Aborting." % bblock) | ||
360 | |||
355 | with open(bblock) as fplock: | 361 | with open(bblock) as fplock: |
356 | for line in fplock: | 362 | for line in fplock: |
357 | if ":" in line: | 363 | if ":" in line: |
@@ -359,7 +365,7 @@ class LocalhostBEController(BuildEnvironmentController): | |||
359 | logger.debug("localhostbecontroller: bitbake port %s", self.be.bbport) | 365 | logger.debug("localhostbecontroller: bitbake port %s", self.be.bbport) |
360 | break | 366 | break |
361 | 367 | ||
362 | if not self.be.bbport: | 368 | if -1 == self.be.bbport: |
363 | raise BuildSetupException("localhostbecontroller: can't read bitbake port from %s" % bblock) | 369 | raise BuildSetupException("localhostbecontroller: can't read bitbake port from %s" % bblock) |
364 | 370 | ||
365 | self.be.bbaddress = "localhost" | 371 | self.be.bbaddress = "localhost" |
@@ -380,10 +386,10 @@ class LocalhostBEController(BuildEnvironmentController): | |||
380 | log = os.path.join(builddir, 'toaster_ui.log') | 386 | log = os.path.join(builddir, 'toaster_ui.log') |
381 | local_bitbake = os.path.join(os.path.dirname(os.getenv('BBBASEDIR')), | 387 | local_bitbake = os.path.join(os.path.dirname(os.getenv('BBBASEDIR')), |
382 | 'bitbake') | 388 | 'bitbake') |
383 | self._shellcmd(['bash -c \"(TOASTER_BRBE="%s" BBSERVER="0.0.0.0:%s" ' | 389 | self._shellcmd(['%s bash -c \"(TOASTER_BRBE="%s" BBSERVER="0.0.0.0:%s" ' |
384 | '%s %s -u toasterui --read %s --read %s --token="" >>%s 2>&1;' | 390 | '%s %s -u toasterui --read %s --read %s --token="" >>%s 2>&1;' |
385 | 'BITBAKE_UI="knotty" BBSERVER=0.0.0.0:%s %s -m)&\"' \ | 391 | 'BITBAKE_UI="knotty" BBSERVER=0.0.0.0:%s %s -m)&\"' \ |
386 | % (brbe, self.be.bbport, local_bitbake, bbtargets, confpath, toasterlayers, log, | 392 | % (env_clean, brbe, self.be.bbport, local_bitbake, bbtargets, confpath, toasterlayers, log, |
387 | self.be.bbport, bitbake,)], | 393 | self.be.bbport, bitbake,)], |
388 | builddir, nowait=True) | 394 | builddir, nowait=True) |
389 | 395 | ||