Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id F3487E006E3; Thu, 20 Oct 2016 09:57:48 -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=-1.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM autolearn=no version=3.3.1 X-Spam-HAM-Report: * 0.5 RCVD_IN_SORBS_SPAM RBL: SORBS: sender is a spam source * [209.85.192.172 listed in dnsbl.sorbs.net] * -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no * trust * [209.85.192.172 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-f172.google.com (mail-pf0-f172.google.com [209.85.192.172]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 5AEDFE00509 for ; Thu, 20 Oct 2016 09:57:44 -0700 (PDT) Received: by mail-pf0-f172.google.com with SMTP id 128so40550100pfz.0 for ; Thu, 20 Oct 2016 09:57:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=M+ur8UqcgAUd7vlxEqLudFotfZpEywou6e9A/KAt4A4=; b=h5S8exFz1Zwj+170GTwiJyCutX4tu8AkfvbxSQSNgitmREY/h4bSX2Keui768zxJXS dtS/P4DbeUnGpAzeUykPVcrkbXUDZDVPzrvECQrGPKStYlqjJV0Ya+RBTCGuzBgkyfQQ +JMrjTVHSZs6PBrWKq03CZB4nPS6kO8kKGa5G5wxEegNejnoDzFMGQQCPc4sNweodc7a vdaDmoKfMHjV8Zf0yPRvpEGcFqFcbWHJM3/NZxu24Jt33ZSUkxcKy2+Sdf+e8xpV1QFp wmkW6EvcKu8sxrXLBsGdqIgU0g2BYaFYg2aGFdXlSFy+h22VaOJyS59yOwiRd+wQL+46 ETsw== 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:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=M+ur8UqcgAUd7vlxEqLudFotfZpEywou6e9A/KAt4A4=; b=Mdygfz/kMREiWpJs9aDGv4CEFrZvIoheQ3o3DxbXgbLMLcU/Qno+Xvy4JySQ1T82JW hKK9pj8FtqX3sKQ/Tl4yI5Xy++NRhkWT5B201L6pvXwI5l4c1DIcXIeXeeC/q0t6G9nc 8hLmyxiAnPnDRjV6O3ju2hOoIq0BVbyhgXmkqrvfs+V4/IUCV3lXEaGjE6yvL8NhHUis gkTEYyRrAeVSRQ+T3AfHJnRPB3svOkVxoWVplW9SaQePYrGWPKaIid2qR93Ldg08bVYv pX79UsJkTlP8onWctaYh5LWiwI8jk+nraIm2K3HIdzzr6ZVkqtZNzgzk9HwJe59+qikz efYw== X-Gm-Message-State: AA6/9RkHKY6VcRbzEdp8dXz3Qvt/BB4upokz8FPIqG5rs2mVtvdK2fN5r8Nugno2OBUYehC7 X-Received: by 10.99.173.3 with SMTP id g3mr2467472pgf.12.1476982663900; Thu, 20 Oct 2016 09:57:43 -0700 (PDT) Received: from [192.168.0.78] (host31-48-249-102.range31-48.btcentralplus.com. [31.48.249.102]) by smtp.googlemail.com with ESMTPSA id c5sm72930518pfj.71.2016.10.20.09.57.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Oct 2016 09:57:43 -0700 (PDT) To: toaster@yoctoproject.org References: <1476974166-8004-1-git-send-email-michael.g.wood@intel.com> From: Michael Wood Message-ID: Date: Thu, 20 Oct 2016 17:57:40 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <1476974166-8004-1-git-send-email-michael.g.wood@intel.com> Cc: brian avery Subject: Re: [PATCH] toaster: buildinfohelper Handle regex pattern paths 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: Thu, 20 Oct 2016 16:57:49 -0000 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit On 20/10/16 15:36, Michael Wood wrote: > From: brian avery > > We were presuming that all the layer dependency information was of the > form "^/path/to/layer" to we were just stripping the leading "^" off of > the layer information when we were matching the layer priorities to the > toaster database. This patch splits out the priorities layer match which > gets a regex from the task/recipe match which is gets a path. > > Signed-off-by: brian avery > --- > bitbake/lib/bb/ui/buildinfohelper.py | 23 ++++++++++++++++++++++- > 1 file changed, 22 insertions(+), 1 deletion(-) > > diff --git a/bitbake/lib/bb/ui/buildinfohelper.py b/bitbake/lib/bb/ui/buildinfohelper.py > index 5b69660..30adfc8 100644 > --- a/bitbake/lib/bb/ui/buildinfohelper.py > +++ b/bitbake/lib/bb/ui/buildinfohelper.py > @@ -982,6 +982,27 @@ class BuildInfoHelper(object): > pass > return task_information > > + def _get_layer_version_for_dependency(self, pathRE): As this is quite an obscure issue to the toaster developer could you add a doc string into the new function to explain what a pathRE is > + self._ensure_build() > + > + def _slkey_interactive(layer_version): > + assert isinstance(layer_version, Layer_Version) > + return len(layer_version.local_path) I know this naming is just from the _get_layer_version_for_path but while we're there we may as well make the function name make sense, something like _sort_longest_path? > + > + # we don't care if we match the trailing slashes > + p = re.compile(re.sub("/[^/]*?$","",pathRE)) > + # Heuristics: we always match recipe to the deepest layer path in the discovered layers > + for lvo in sorted(self.orm_wrapper.layer_version_objects, reverse=True, key=_slkey_interactive): > + if p.fullmatch(lvo.local_path): > + return lvo > + if lvo.layer.local_source_dir: > + if p.fullmatch(lvo.layer.local_source_dir): > + return lvo > + #if we get here, we didn't read layers correctly; dump whatever information we have on the error log > + logger.warning("Could not match layer dependency for path %s : %s", path, self.orm_wrapper.layer_version_objects) > + > + > + > def _get_layer_version_for_path(self, path): > self._ensure_build() > > @@ -1372,7 +1393,7 @@ class BuildInfoHelper(object): > if 'layer-priorities' in event._depgraph.keys(): > for lv in event._depgraph['layer-priorities']: > (_, path, _, priority) = lv > - layer_version_obj = self._get_layer_version_for_path(path[1:]) # paths start with a ^ > + layer_version_obj = self._get_layer_version_for_dependency(path) > assert layer_version_obj is not None > layer_version_obj.priority = priority > layer_version_obj.save() I've tested this and it works for me, my test setup was having meta-mel in the project's layers and then building core-image-minimal, with this patch I no longer see 'unidentified layer' and the correct recipe information gets logged. Thanks, Michael