From 1b9175af3fabf12af80c8446af94078afd0832ed Mon Sep 17 00:00:00 2001 From: Alexandru DAMIAN Date: Tue, 15 Jul 2014 19:31:10 +0100 Subject: bitbake: toaster: properly set layers when running a build This patch enables the localhost build controller to properly set the layers before the build runs. It creates the checkout directories under BuildEnvironment sourcedir directory, and runs the build in the buildir directory. Build launch errors are tracked in the newly added BRError table. These are different from build errors, in the sense that the build can't start due to these errors. (Bitbake rev: 1868d5635b517e0fe1b874674ea7a78910b26e2e) Signed-off-by: Alexandru DAMIAN Signed-off-by: Richard Purdie --- .../bldcontrol/management/commands/runbuilds.py | 23 +++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'bitbake/lib/toaster/bldcontrol/management/commands') diff --git a/bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py b/bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py index dd8f84b07a..fa8c1a9906 100644 --- a/bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py +++ b/bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py @@ -1,8 +1,8 @@ from django.core.management.base import NoArgsCommand, CommandError from django.db import transaction from orm.models import Build -from bldcontrol.bbcontroller import getBuildEnvironmentController, ShellCmdException -from bldcontrol.models import BuildRequest, BuildEnvironment +from bldcontrol.bbcontroller import getBuildEnvironmentController, ShellCmdException, BuildSetupException +from bldcontrol.models import BuildRequest, BuildEnvironment, BRError import os class Command(NoArgsCommand): @@ -25,6 +25,7 @@ class Command(NoArgsCommand): return br def schedule(self): + import traceback try: br = None try: @@ -63,15 +64,19 @@ class Command(NoArgsCommand): # cleanup to be performed by toaster when the deed is done - except ShellCmdException as e: - import traceback - print " EE Error executing shell command\n", e - traceback.format_exc(e) except Exception as e: - import traceback - traceback.print_exc() - raise e + print " EE Error executing shell command\n", e + traceback.print_exc(e) + BRError.objects.create(req = br, + errtype = str(type(e)), + errmsg = str(e), + traceback = traceback.format_exc(e)) + br.state = BuildRequest.REQ_FAILED + br.save() + bec.be.lock = BuildEnvironment.LOCK_FREE + bec.be.save() + def cleanup(self): from django.utils import timezone -- cgit v1.2.3-54-g00ecf