]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
bitbake: toaster: handle early exceptions
authorDavid Reyna <David.Reyna@windriver.com>
Fri, 8 Sep 2017 04:50:47 +0000 (21:50 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 11 Sep 2017 16:19:37 +0000 (17:19 +0100)
Stop the pending build and report to the user if there is
an internal exception due to a git error, a bitbake server
error, or if the server-only mode halts due to for example
a user syntax error in a layer or recipe.

These exceptions were not caught because they occure before
the normal toastergui processing was started.

[YOCTO #12056]

(Bitbake rev: 2cd664097c29ad07b08c82d07a239ca199abbc9a)

Signed-off-by: David Reyna <David.Reyna@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py

index 8eacb5e89608d578d55fe52d4449cb4e7ffaa855..791e53eabf6ab90baa3e29e5e3d59f0814384cc3 100644 (file)
@@ -79,6 +79,14 @@ class Command(BaseCommand):
             br.save()
             bec.be.lock = BuildEnvironment.LOCK_FREE
             bec.be.save()
+            # Cancel the pending build and report the exception to the UI
+            log_object = LogMessage.objects.create(
+                            build = br.build,
+                            level = LogMessage.EXCEPTION,
+                            message = errmsg)
+            log_object.save()
+            br.build.outcome = Build.FAILED
+            br.build.save()
 
     def archive(self):
         for br in BuildRequest.objects.filter(state=BuildRequest.REQ_ARCHIVE):