<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>11149</bug_id>
          
          <creation_ts>2017-03-13 21:55:13 +0000</creation_ts>
          <short_desc>buildinfohelper.py Could not match layer dependency</short_desc>
          <delta_ts>2017-06-24 05:13:56 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>Toaster</product>
          <component>toaster</component>
          <version>2.2.1</version>
          <rep_platform>x86</rep_platform>
          <op_sys>x86_64</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>2.4 M1</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ferry">ferry.toth</reporter>
          <assigned_to name="David Reyna">david.reyna</assigned_to>
          <cc>ferry.toth</cc>
    
    <cc>jessica.zhang</cc>
    
    <cc>stanciux.mihail</cc>
          
          <qa_contact name="Libertad">libertad.gonzalez.de.la.cruz</qa_contact>
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>71237</commentid>
    <comment_count>0</comment_count>
    <who name="Ferry">ferry.toth</who>
    <bug_when>2017-03-13 21:55:13 +0000</bug_when>
    <thetext>I start a new Morty project with Toaster (on master b1f09df0f664052e39d939b759a63b05d767b8ec  ), add meta-intel, select machine intel-corei7-64 then:

&lt;SNIP&gt;
Build Configuration:
BB_VERSION        = &quot;1.32.0&quot;
BUILD_SYS         = &quot;x86_64-linux&quot;
NATIVELSBSTRING   = &quot;Ubuntu-16.10&quot;
TARGET_SYS        = &quot;x86_64-poky-linux&quot;
MACHINE           = &quot;intel-corei7-64&quot;
DISTRO            = &quot;poky&quot;
DISTRO_VERSION    = &quot;2.2.1&quot;
TUNE_FEATURES     = &quot;m64 corei7&quot;
TARGET_FPU        = &quot;&quot;
meta              
meta-poky         
meta-yocto-bsp    = &quot;master:6a1f33cc40bfac33cf030fe41e1a8efd1e5fad6f&quot;
_git___git.yoctoproject.org_meta-intel_morty = &quot;master:6add41510412ca196efb3e4f949d403a8b6f35d7&quot;

NOTE: Fetching uninative binary shim from http://downloads.yoctoproject.org/releases/uninative/1.4/x86_64-nativesdk-libc.tar.bz2;sha256sum=101ff8f2580c193488db9e76f9646fb6ed38b65fb76f403acb0e2178ce7127ca
WARNING: Could not match layer dependency for path ^/home/ferry/tmp/edison-intel/my/edison-morty/poky/_toaster_clones/_git___git.yoctoproject.org_meta-intel_morty/common : [&lt;Layer_Version: 1 openembedded-core (morty)&gt;, &lt;Layer_Version: 4 meta-poky (morty)&gt;, &lt;Layer_Version: 269 meta-intel (morty)&gt;, &lt;Layer_Version: 7 meta-yocto-bsp (morty)&gt;]
ERROR: 
Traceback (most recent call last):
  File &quot;/home/ferry/tmp/edison-intel/my/edison-morty/poky/bitbake/lib/bb/ui/toasterui.py&quot;, line 456, in main
    buildinfohelper.store_dependency_information(event)
  File &quot;/home/ferry/tmp/edison-intel/my/edison-morty/poky/bitbake/lib/bb/ui/buildinfohelper.py&quot;, line 1399, in store_dependency_information
    assert layer_version_obj is not None
AssertionError

After this the build continues, with building the image at the end</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71257</commentid>
    <comment_count>1</comment_count>
    <who name="Ferry">ferry.toth</who>
    <bug_when>2017-03-14 16:24:39 +0000</bug_when>
    <thetext>Eh sorry, I mean withOUT building the image (not all tasks completed due to the error)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71343</commentid>
    <comment_count>2</comment_count>
    <who name="Ferry">ferry.toth</who>
    <bug_when>2017-03-16 08:50:39 +0000</bug_when>
    <thetext>What can I do to help debug this?

Strangely, when I don&apos;t add meta-intel and select qemu (32 or 64bits) it build until completion.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72366</commentid>
    <comment_count>3</comment_count>
    <who name="David Reyna">david.reyna</who>
    <bug_when>2017-04-12 01:55:49 +0000</bug_when>
    <thetext>Ok, I have done some debugging.

The error happens when the layer_version path from the &quot;DepTreeGenerated&quot; event cannot be found in the database&apos;s &apos;orm_layer_version&apos; table. 

Instrumenting &apos;store_dependency_information&apos; I see:
	NOTE: FOO1:^/opt/dreyna/yp-2.2/poky/meta/,5
	NOTE: FOO2:OK
	NOTE: FOO1:^/opt/dreyna/yp-2.2/poky/meta-poky/,5
	NOTE: FOO2:OK
	NOTE: FOO1:^/opt/dreyna/yp-2.2/poky/meta-yocto-bsp/,5
	NOTE: FOO2:OK
	NOTE: FOO1:^/opt/dreyna/yp-2.2/poky/meta-intel/common/,5
	&lt;assert fails&gt;

When I look at &apos;orm_layer_version&apos; table directly via the SQLite Database Browser app I see that all instances of the &quot;meta-intel&quot; layer have a local path of &quot;/opt/dreyna/yp-2.2/poky/meta-intel/&quot;, which is indeed where it was installed.

The problem is that the &quot;meta-intel&quot; layer people have done a trick of having a layer within a layer, specifically &quot;meta-intel/common&quot;, which is not found by the code in &quot;buildinfohelper.py&quot;.

New code will need to added to resolve these cases.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72418</commentid>
    <comment_count>4</comment_count>
    <who name="David Reyna">david.reyna</who>
    <bug_when>2017-04-12 22:49:55 +0000</bug_when>
    <thetext>Here is the patch for Morty and YP-2.3:

diff --git a/bitbake/lib/bb/ui/buildinfohelper.py b/bitbake/lib/bb/ui/buildinfohelper.py
index 3ddcb2ac6d..f79df9dbc2 100644
--- a/bitbake/lib/bb/ui/buildinfohelper.py
+++ b/bitbake/lib/bb/ui/buildinfohelper.py
@@ -995,6 +995,7 @@ class BuildInfoHelper(object):
 
         # we don&apos;t care if we match the trailing slashes
         p = re.compile(re.sub(&quot;/[^/]*?$&quot;,&quot;&quot;,pathRE))
+        path=re.sub(r&apos;[$^]&apos;,r&apos;&apos;,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=_sort_longest_path):
             if p.fullmatch(lvo.local_path):
@@ -1002,6 +1003,10 @@ class BuildInfoHelper(object):
             if lvo.layer.local_source_dir:
                 if p.fullmatch(lvo.layer.local_source_dir):
                     return lvo
+            if 0 == path.find(lvo.local_path):
+                # sub-layer path inside existing layer
+                return lvo
+</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>