From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id B7D40E00928; Wed, 10 Feb 2016 10:36:41 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low * trust * [74.125.82.45 listed in list.dnswl.org] * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily * valid * -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Received: from mail-wm0-f45.google.com (mail-wm0-f45.google.com [74.125.82.45]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 6C4EBE008B4 for ; Wed, 10 Feb 2016 10:36:24 -0800 (PST) Received: by mail-wm0-f45.google.com with SMTP id 128so38775183wmz.1 for ; Wed, 10 Feb 2016 10:36:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-type:content-transfer-encoding; bh=+0cIN5G8DEamOGDYty9bu4AusAJpVT0/66uVAmZ4v1s=; b=rFOMWEbnrIAmV5ujgAc7y7BKu+kjqoni5GGKKiqEelEYrGdJfk2V8k5UE0AVSPBpNe zJJpx6Z1yB6r7lA6vAeemD9ZWmOnnyuuSjLgcrh9vew6ZR3RnYkYD4rp/1/mdbUWP+Is RDrIw3rGvmJK/PSJ4XmvhOvtMIDX9uAlkBk6doW1uH+FpSUE7BDMVa1tPjzTUKBsfmTg BB077r8z+XzPpl2QKyxhUBekeXG2pEA4V/XtALJBgAzs/g4d0dbyuTNRDJLbfcXsOCFW KDIMIsb9/So4rU6dtCra1pouD/vzMp514EbOxioLLmozzeaK5a03pvgTKqW/AyqPvsHa OS0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=+0cIN5G8DEamOGDYty9bu4AusAJpVT0/66uVAmZ4v1s=; b=Kz4ryrLpwHmgOqLRsiXKCOJFo1W4sKNo4+SVPUk6KVgMylhpjiI8MjJcPfj+DD5SHc 6k8BDlLirtZk45mWvsFdNkyN35EHvNOiSKkCpq/1EG6ncpy4s72BQORq7iIxqqU0Qcj9 o3PL4HgeUU52qi86Br0FCnWBue9l0DFvfGdN+oMs7vtWrPfGYxz/87WNlgtEaP4kIiew FyupbbEmDQ5jQgSatJyMoHefp7yBcKZ6peULgun5rXJBY81YrioXcMq1hiW2ZUL3JQ2u K2P2Pm5xZmELHYS8sh4yt8kYzeqiOfvTkRf4yDsXyLMPmgIT8T5sbG3UJTWG+c4uqj3J Eyvg== X-Gm-Message-State: AG10YOQoYG0ec1vXlH8hKi6YqNbxSvyVZAxm3p9mAlnFbKwuNmQd/gjH3GU3oh3mCs7yUMSB X-Received: by 10.194.76.144 with SMTP id k16mr40753057wjw.78.1455129383292; Wed, 10 Feb 2016 10:36:23 -0800 (PST) Received: from [192.168.2.24] ([83.217.123.106]) by smtp.googlemail.com with ESMTPSA id di1sm4131765wjc.3.2016.02.10.10.36.22 for (version=TLSv1/SSLv3 cipher=OTHER); Wed, 10 Feb 2016 10:36:22 -0800 (PST) To: toaster@yoctoproject.org References: <1454504055-25648-1-git-send-email-elliot.smith@intel.com> From: Michael Wood Message-ID: <56BB8325.5060300@intel.com> Date: Wed, 10 Feb 2016 18:36:21 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: Subject: Re: [review-request][PATCH] buildinfohelper: unset brbe variable when build finishes X-BeenThere: toaster@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Web based interface for BitBake List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2016 18:36:41 -0000 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit Thanks sent upstream and to toaster-next Michael On 04/02/16 11:29, Barros Pena, Belen wrote: > > On 03/02/2016 12:54, "toaster-bounces@yoctoproject.org on behalf of Elliot > Smith" elliot.smith@intel.com> wrote: > >> The brbe variable is set on the bitbake server when the Toaster >> UI starts. This enables Toaster to associate events with the >> correct build and build environment. >> >> However, the brbe variable is also used when a build starts to >> identify whether a new build needs to be created, or an existing >> one looked up. This causes a bug for command-line builds which >> happen after a Toaster-triggered build: because the brbe variable >> is never unset on the server or the buildinfohelper, the new >> command-line build events are treated as originating from the >> previous build. >> >> Ensure the brbe variable is reset when the buildinfohelper "closes" >> a build, so that each build then either sets the brbe variable >> (Toaster-triggered builds) or leaves it blank (command-line builds). >> >> Also modify the localhostbecontroller so that the brbe variable >> is not set on the server and not looked up from the server. This >> ensures that it is only set when the triggerBuild() method is >> called, and that it remains as None for command-line builds. >> >> [YOCTO #9021] > This fixes the problem for me. > > Thanks! > > Belén > >> Signed-off-by: Elliot Smith >> --- >> bitbake/lib/bb/ui/buildinfohelper.py | 19 >> ++++++++++++------- >> .../lib/toaster/bldcontrol/localhostbecontroller.py | 9 +++++++-- >> 2 files changed, 19 insertions(+), 9 deletions(-) >> >> diff --git a/bitbake/lib/bb/ui/buildinfohelper.py >> b/bitbake/lib/bb/ui/buildinfohelper.py >> index 0cb6f68..9469cbb 100644 >> --- a/bitbake/lib/bb/ui/buildinfohelper.py >> +++ b/bitbake/lib/bb/ui/buildinfohelper.py >> @@ -778,8 +778,13 @@ class BuildInfoHelper(object): >> self.orm_wrapper = ORMWrapper() >> self.has_build_history = has_build_history >> self.tmp_dir = self.server.runCommand(["getVariable", >> "TMPDIR"])[0] >> - self.brbe = self.server.runCommand(["getVariable", >> "TOASTER_BRBE"])[0] >> - self.project = self.server.runCommand(["getVariable", >> "TOASTER_PROJECT"])[0] >> + >> + # this is set for Toaster-triggered builds by >> localhostbecontroller >> + # via toasterui >> + self.brbe = None >> + >> + self.project = None >> + >> logger.debug(1, "buildinfohelper: Build info helper inited %s" % >> vars(self)) >> >> >> @@ -789,8 +794,6 @@ class BuildInfoHelper(object): >> >> def _get_build_information(self, build_log_path): >> build_info = {} >> - # Generate an identifier for each new build >> - >> build_info['machine'] = self.server.runCommand(["getVariable", >> "MACHINE"])[0] >> build_info['distro'] = self.server.runCommand(["getVariable", >> "DISTRO"])[0] >> build_info['distro_version'] = >> self.server.runCommand(["getVariable", "DISTRO_VERSION"])[0] >> @@ -799,9 +802,7 @@ class BuildInfoHelper(object): >> build_info['cooker_log_path'] = build_log_path >> build_info['build_name'] = >> self.server.runCommand(["getVariable", "BUILDNAME"])[0] >> build_info['bitbake_version'] = >> self.server.runCommand(["getVariable", "BB_VERSION"])[0] >> - build_info['brbe'] = self.server.runCommand(["getVariable", >> "TOASTER_BRBE"])[0] >> build_info['project'] = self.project = >> self.server.runCommand(["getVariable", "TOASTER_PROJECT"])[0] >> - >> return build_info >> >> def _get_task_information(self, event, recipe): >> @@ -913,7 +914,6 @@ class BuildInfoHelper(object): >> build_information = self._get_build_information(build_log_path) >> >> # Update brbe and project as they can be changed for every build >> - self.brbe = build_information['brbe'] >> self.project = build_information['project'] >> >> build_obj = >> self.orm_wrapper.create_build_object(build_information, self.brbe, >> self.project) >> @@ -1425,3 +1425,8 @@ class BuildInfoHelper(object): >> >> if not connection.features.autocommits_when_autocommit_is_off: >> transaction.set_autocommit(True) >> + >> + # unset the brbe; this is to prevent subsequent command-line >> builds >> + # being incorrectly attached to the previous Toaster-triggered >> build; >> + # see https://bugzilla.yoctoproject.org/show_bug.cgi?id=9021 >> + self.brbe = None >> diff --git a/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py >> b/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py >> index 2215d7af2..0c2dede 100644 >> --- a/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py >> +++ b/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py >> @@ -290,12 +290,17 @@ class >> LocalhostBEController(BuildEnvironmentController): >> # get the bb server running with the build req id and build env >> id >> bbctrl = self.getBBController() >> >> - # set variables >> + # set variables; TOASTER_BRBE is not set on the server, as this >> + # causes events from command-line builds to be attached to the >> last >> + # Toaster-triggered build; instead, TOASTER_BRBE is fired as an >> event so >> + # that toasterui can set it on the buildinfohelper; >> + # see https://bugzilla.yoctoproject.org/show_bug.cgi?id=9021 >> for var in variables: >> - bbctrl.setVariable(var.name, var.value) >> if var.name == 'TOASTER_BRBE': >> bbctrl.triggerEvent('bb.event.MetadataEvent("SetBRBE", >> "%s")' \ >> % var.value) >> + else: >> + bbctrl.setVariable(var.name, var.value) >> >> # Add 'toaster' and 'buildhistory' to INHERIT variable >> inherit = {item.strip() for item in >> bbctrl.getVariable('INHERIT').split()} >> -- >> Elliot Smith >> Software Engineer >> Intel OTC >> >> --------------------------------------------------------------------- >> Intel Corporation (UK) Limited >> Registered No. 1134945 (England) >> Registered Office: Pipers Way, Swindon SN3 1RJ >> VAT No: 860 2173 47 >> >> This e-mail and any attachments may contain confidential material for >> the sole use of the intended recipient(s). Any review or distribution >> by others is strictly prohibited. If you are not the intended >> recipient, please contact the sender and delete all copies. >> >> -- >> _______________________________________________ >> toaster mailing list >> toaster@yoctoproject.org >> https://lists.yoctoproject.org/listinfo/toaster