diff options
| author | Alexandru DAMIAN <alexandru.damian@intel.com> | 2014-10-13 17:10:39 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-10-30 13:39:51 +0000 |
| commit | 2837b110ae8fd5ff0ca3ac5959cadb7d4a5ce6cc (patch) | |
| tree | fca7aba2e90cbcb6f3b11a90bb00665850fa2460 /bitbake/lib/bb/ui | |
| parent | a0660718e6599538dd65cadadbc04c6adc951b57 (diff) | |
| download | poky-2837b110ae8fd5ff0ca3ac5959cadb7d4a5ce6cc.tar.gz | |
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>
Diffstat (limited to 'bitbake/lib/bb/ui')
| -rw-r--r-- | bitbake/lib/bb/ui/buildinfohelper.py | 13 | ||||
| -rw-r--r-- | bitbake/lib/bb/ui/toasterui.py | 5 |
2 files changed, 11 insertions, 7 deletions
diff --git a/bitbake/lib/bb/ui/buildinfohelper.py b/bitbake/lib/bb/ui/buildinfohelper.py index 1f66595887..fcef53b63d 100644 --- a/bitbake/lib/bb/ui/buildinfohelper.py +++ b/bitbake/lib/bb/ui/buildinfohelper.py | |||
| @@ -933,14 +933,17 @@ class BuildInfoHelper(object): | |||
| 933 | self.internal_state['recipes'], | 933 | self.internal_state['recipes'], |
| 934 | ) | 934 | ) |
| 935 | 935 | ||
| 936 | def _store_build_done(self): | 936 | def _store_build_done(self, errorcode): |
| 937 | br_id, be_id = self.brbe.split(":") | 937 | br_id, be_id = self.brbe.split(":") |
| 938 | from bldcontrol.models import BuildEnvironment, BuildRequest | 938 | from bldcontrol.models import BuildEnvironment, BuildRequest |
| 939 | be = BuildEnvironment.objects.get(pk = be_id) | 939 | be = BuildEnvironment.objects.get(pk = be_id) |
| 940 | be.lock = BuildEnvironment.LOCK_LOCK | 940 | be.lock = BuildEnvironment.LOCK_LOCK |
| 941 | be.save() | 941 | be.save() |
| 942 | br = BuildRequest.objects.get(pk = br_id) | 942 | br = BuildRequest.objects.get(pk = br_id) |
| 943 | br.state = BuildRequest.REQ_COMPLETED | 943 | if errorcode == 0: |
| 944 | br.state = BuildRequest.REQ_COMPLETED | ||
| 945 | else: | ||
| 946 | br.state = BuildRequest.REQ_FAILED | ||
| 944 | br.save() | 947 | br.save() |
| 945 | 948 | ||
| 946 | 949 | ||
| @@ -964,7 +967,7 @@ class BuildInfoHelper(object): | |||
| 964 | self.internal_state['backlog'].append(event) | 967 | self.internal_state['backlog'].append(event) |
| 965 | else: # we're under Toaster control, post the errors to the build request | 968 | else: # we're under Toaster control, post the errors to the build request |
| 966 | from bldcontrol.models import BuildRequest, BRError | 969 | from bldcontrol.models import BuildRequest, BRError |
| 967 | br, be = brbe.split(":") | 970 | br, be = self.brbe.split(":") |
| 968 | buildrequest = BuildRequest.objects.get(pk = br) | 971 | buildrequest = BuildRequest.objects.get(pk = br) |
| 969 | brerror = BRError.objects.create(req = buildrequest, errtype="build", errmsg = event.msg) | 972 | brerror = BRError.objects.create(req = buildrequest, errtype="build", errmsg = event.msg) |
| 970 | 973 | ||
| @@ -992,9 +995,9 @@ class BuildInfoHelper(object): | |||
| 992 | log_information['lineno'] = event.lineno | 995 | log_information['lineno'] = event.lineno |
| 993 | self.orm_wrapper.create_logmessage(log_information) | 996 | self.orm_wrapper.create_logmessage(log_information) |
| 994 | 997 | ||
| 995 | def close(self): | 998 | def close(self, errorcode): |
| 996 | if self.brbe is not None: | 999 | if self.brbe is not None: |
| 997 | buildinfohelper._store_build_done() | 1000 | self._store_build_done(errorcode) |
| 998 | 1001 | ||
| 999 | if 'backlog' in self.internal_state: | 1002 | if 'backlog' in self.internal_state: |
| 1000 | for event in self.internal_state['backlog']: | 1003 | for event in self.internal_state['backlog']: |
diff --git a/bitbake/lib/bb/ui/toasterui.py b/bitbake/lib/bb/ui/toasterui.py index d81b8a989c..0c53843149 100644 --- a/bitbake/lib/bb/ui/toasterui.py +++ b/bitbake/lib/bb/ui/toasterui.py | |||
| @@ -219,6 +219,7 @@ def main(server, eventHandler, params ): | |||
| 219 | if isinstance(event, (bb.command.CommandCompleted, | 219 | if isinstance(event, (bb.command.CommandCompleted, |
| 220 | bb.command.CommandFailed, | 220 | bb.command.CommandFailed, |
| 221 | bb.command.CommandExit)): | 221 | bb.command.CommandExit)): |
| 222 | errorcode = 0 | ||
| 222 | if (isinstance(event, bb.command.CommandFailed)): | 223 | if (isinstance(event, bb.command.CommandFailed)): |
| 223 | event.levelno = format.ERROR | 224 | event.levelno = format.ERROR |
| 224 | event.msg = "Command Failed " + event.error | 225 | event.msg = "Command Failed " + event.error |
| @@ -226,10 +227,10 @@ def main(server, eventHandler, params ): | |||
| 226 | event.lineno = 0 | 227 | event.lineno = 0 |
| 227 | buildinfohelper.store_log_event(event) | 228 | buildinfohelper.store_log_event(event) |
| 228 | errors += 1 | 229 | errors += 1 |
| 230 | errorcode = 1 | ||
| 229 | 231 | ||
| 230 | buildinfohelper.update_build_information(event, errors, warnings, taskfailures) | 232 | buildinfohelper.update_build_information(event, errors, warnings, taskfailures) |
| 231 | buildinfohelper.close() | 233 | buildinfohelper.close(errorcode) |
| 232 | |||
| 233 | 234 | ||
| 234 | # we start a new build info | 235 | # we start a new build info |
| 235 | if buildinfohelper.brbe is not None: | 236 | if buildinfohelper.brbe is not None: |
