1
0
mirror of https://git.yoctoproject.org/poky synced 2026-06-03 01:40:07 +00:00

bitbake: toaster: change startup parameter passing to avoid race

We avoid a race between the setting the TOASTER_BRBE variable
and reading the variable in toaster ui by supplying the variable
at server startup time through the toaster.conf post-read file.

Additional small changes are included, including marking the
build request with the environment id of where the build took place.

(Bitbake rev: 7c333350418c4140e6c988c5272940f8057d327d)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Alexandru DAMIAN
2014-10-13 17:10:39 +01:00
committed by Richard Purdie
parent a0660718e6
commit 2837b110ae
10 changed files with 219 additions and 38 deletions
+8 -5
View File
@@ -933,14 +933,17 @@ class BuildInfoHelper(object):
self.internal_state['recipes'],
)
def _store_build_done(self):
def _store_build_done(self, errorcode):
br_id, be_id = self.brbe.split(":")
from bldcontrol.models import BuildEnvironment, BuildRequest
be = BuildEnvironment.objects.get(pk = be_id)
be.lock = BuildEnvironment.LOCK_LOCK
be.save()
br = BuildRequest.objects.get(pk = br_id)
br.state = BuildRequest.REQ_COMPLETED
if errorcode == 0:
br.state = BuildRequest.REQ_COMPLETED
else:
br.state = BuildRequest.REQ_FAILED
br.save()
@@ -964,7 +967,7 @@ class BuildInfoHelper(object):
self.internal_state['backlog'].append(event)
else: # we're under Toaster control, post the errors to the build request
from bldcontrol.models import BuildRequest, BRError
br, be = brbe.split(":")
br, be = self.brbe.split(":")
buildrequest = BuildRequest.objects.get(pk = br)
brerror = BRError.objects.create(req = buildrequest, errtype="build", errmsg = event.msg)
@@ -992,9 +995,9 @@ class BuildInfoHelper(object):
log_information['lineno'] = event.lineno
self.orm_wrapper.create_logmessage(log_information)
def close(self):
def close(self, errorcode):
if self.brbe is not None:
buildinfohelper._store_build_done()
self._store_build_done(errorcode)
if 'backlog' in self.internal_state:
for event in self.internal_state['backlog']:
+3 -2
View File
@@ -219,6 +219,7 @@ def main(server, eventHandler, params ):
if isinstance(event, (bb.command.CommandCompleted,
bb.command.CommandFailed,
bb.command.CommandExit)):
errorcode = 0
if (isinstance(event, bb.command.CommandFailed)):
event.levelno = format.ERROR
event.msg = "Command Failed " + event.error
@@ -226,10 +227,10 @@ def main(server, eventHandler, params ):
event.lineno = 0
buildinfohelper.store_log_event(event)
errors += 1
errorcode = 1
buildinfohelper.update_build_information(event, errors, warnings, taskfailures)
buildinfohelper.close()
buildinfohelper.close(errorcode)
# we start a new build info
if buildinfohelper.brbe is not None: