From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 33F23E00C3C; Mon, 21 Mar 2016 08:24:47 -0700 (PDT) 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 * [209.85.192.180 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-pf0-f180.google.com (mail-pf0-f180.google.com [209.85.192.180]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id AD50EE00951 for ; Mon, 21 Mar 2016 08:24:42 -0700 (PDT) Received: by mail-pf0-f180.google.com with SMTP id n5so268128239pfn.2 for ; Mon, 21 Mar 2016 08:24:42 -0700 (PDT) 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-transfer-encoding; bh=k9f9XlPgSZMbvXOOcu74/rVzL9ycEleLlBxYyTYpSz8=; b=FqLqYY07ZbF57hgaNqsdQ/L2dFYDes9v2pCvNztbA3GHJM0fhrppoZXuCgBPHMjOsi P27tLjzwSgfYZq1gSKtUkr9DL+X3R04fPQOTzXbh7zq3OfQGFHxvNjpKnQ3+rwzHrpK4 qZ806sv5NnyT4QOBU6plouA4Det+63BhFpsxIRf72pBe36a+8kgCtTf9pW9TAfCbpv0n Db2X972lFUaPvxpiWBe+apuNXOgBVYQLu93IN2lhve+v5mS1JfVfbxzJPBm6Il1sTRTk Afdl0JXsOPUUtDvRtCpAskv7Hp6easX1znFofEwlFfKn2J6BRbX/4gkktWox5XyH4eM2 bKqA== 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-transfer-encoding; bh=k9f9XlPgSZMbvXOOcu74/rVzL9ycEleLlBxYyTYpSz8=; b=Des1l5UqmusKVrccmoyu1ipzU/4vuh2Icwij0dy8+/DchpP7YoBAWv9fW/Awi9xvWE fFXS1mjndTVlkPX5nHlg3Jau95nsTYPe0MEFZw1WP3eoEABbx10/770Mc/jjugpb1sGM TTMf95dO5racbX1cppNk4NvazIbAJtxvJJZSRrc3GyN8rby9eyjLVZWvG1c06r7ZkLeU aptVxOwVuEUBtA1vPh8oJ5j/gcVORbYqwxfFBd9UEybz/8xnMoaBYlYIkASz1bLPkzjM EKlTDNSCmVuB8ggn23HOjclEc6WNPKboPGxysxxKLgWpvwX15+gRlLHVx52cs028yM/N Zdsw== X-Gm-Message-State: AD7BkJIDb0OuJeP02PoR5sDmqHgVIvPoxEaj9bBd5asoCoG/DSKoQ5jbuYMv+iGOa013YFGi X-Received: by 10.98.74.209 with SMTP id c78mr45556279pfj.90.1458573881954; Mon, 21 Mar 2016 08:24:41 -0700 (PDT) Received: from [192.168.0.44] (host109-153-236-140.range109-153.btcentralplus.com. [109.153.236.140]) by smtp.googlemail.com with ESMTPSA id n66sm41525713pfj.39.2016.03.21.08.24.40 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 21 Mar 2016 08:24:41 -0700 (PDT) To: "Barros Pena, Belen" , "toaster@yoctoproject.org" References: <1457620109-9496-2-git-send-email-michael.g.wood@intel.com> <1458239222-12383-1-git-send-email-michael.g.wood@intel.com> From: Michael Wood Message-ID: <56F01237.1020806@intel.com> Date: Mon, 21 Mar 2016 15:24:39 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: Subject: Re: [v2 PATCH] toaster: buildinfohelper Add additional metadata to the built layer 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: Mon, 21 Mar 2016 15:24:47 -0000 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit On 21/03/16 14:58, Barros Pena, Belen wrote: > > On 17/03/2016 18:27, "toaster-bounces@yoctoproject.org on behalf of > Michael Wood" michael.g.wood@intel.com> wrote: > >> Add additional metadata to the layer created for build history to be >> able to identify the layer and recipe later on. Specifically this is the >> branch and release to which the recipe and layer are associated with >> enabling differentiation of two recipes which are local release and >> master and 'master' release. >> >> [YOCTO #8528] >> [YOCTO #8545] > This totally works: > > * Images now come up in the image recipes page of local projects after you > build them > * The build information includes the layer branch > > But it prompts the question of why we are seeing different branches for > the core layers: meta-poky and meta-yocto-bsp show master, but my > openembedded-core shows a different brach (a development one I was using > previously). I know this has nothing to do with this patch, but just > wondering why this is happening, and whether is a toaster thing or a > bitbake thing. I guess you can check in the toaster cloned layers directory to see if what it's reporting is correct first off. Secondly I suspect that this is caused by cloning 'self', if you do a new poky git clone and switch branches to contrib/catdog and then ask it to build something in openembedded-core it will go 'oh I don't need to go and clone openembedded-core from the internet because I know there is a copy in my directory /meta/ so I will copy myself/this instead' and of course it copies it as-is which probably means the git repo is still checked out as contrib/catdog. Michael > Thanks! > > Belén > >> Signed-off-by: Michael Wood >> --- >> bitbake/lib/bb/ui/buildinfohelper.py | 34 >> +++++++++++++++++++++++----------- >> 1 file changed, 23 insertions(+), 11 deletions(-) >> >> diff --git a/bitbake/lib/bb/ui/buildinfohelper.py >> b/bitbake/lib/bb/ui/buildinfohelper.py >> index 28c7353..80ac800 100644 >> --- a/bitbake/lib/bb/ui/buildinfohelper.py >> +++ b/bitbake/lib/bb/ui/buildinfohelper.py >> @@ -355,12 +355,17 @@ class ORMWrapper(object): >> >> # create a new copy of this layer version as a snapshot for >> # historical purposes >> - layer_copy, c = >> Layer_Version.objects.get_or_create(build=build_obj, >> - layer=layer_obj.layer, >> - commit=layer_version_information['commit'], >> - local_path = >> layer_version_information['local_path'], >> - ) >> - logger.info("created new historical layer version %d", >> layer_copy.pk) >> + layer_copy, c = Layer_Version.objects.get_or_create( >> + build=build_obj, >> + layer=layer_obj.layer, >> + up_branch=layer_obj.up_branch, >> + branch=layer_version_information['branch'], >> + commit=layer_version_information['commit'], >> + local_path=layer_version_information['local_path'], >> + ) >> + >> + logger.info("created new historical layer version %d", >> + layer_copy.pk) >> >> self.layer_version_built.append(layer_copy) >> >> @@ -581,11 +586,15 @@ class ORMWrapper(object): >> >> packagedict[p]['object'].package_dependencies_target.all().delete() >> >> packagedict[p]['object'].package_dependencies_source.all().delete() >> try: >> - recipe = self._cached_get(Recipe, >> - name=built_recipe.name, >> - layer_version__build=None, >> - >> file_path=built_recipe.file_path, >> - >> version=built_recipe.version) >> + recipe = self._cached_get( >> + Recipe, >> + name=built_recipe.name, >> + layer_version__build=None, >> + layer_version__up_branch= >> + built_recipe.layer_version.up_branch, >> + file_path=built_recipe.file_path, >> + version=built_recipe.version >> + ) >> except (Recipe.DoesNotExist, >> Recipe.MultipleObjectsReturned) as e: >> logger.info("We did not find one recipe for the" >> @@ -1293,6 +1302,9 @@ class BuildInfoHelper(object): >> for cls in event._depgraph['pn'][pn]['inherits']: >> if cls.endswith('/image.bbclass'): >> recipe.is_image = True >> + recipe_info['is_image'] = True >> + # Save the is_image state to the relevant recipe >> objects >> + >> self.orm_wrapper.get_update_recipe_object(recipe_info) >> break >> if recipe.is_image: >> for t in self.internal_state['targets']: >> -- >> 2.1.4 >> >> -- >> _______________________________________________ >> toaster mailing list >> toaster@yoctoproject.org >> https://lists.yoctoproject.org/listinfo/toaster