<?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>8160</bug_id>
          
          <creation_ts>2015-08-14 10:12:16 +0000</creation_ts>
          <short_desc>bitbake-layers: unable to determine layer when BBFILES points to a subdirectory</short_desc>
          <delta_ts>2015-08-20 07:37:54 +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>BitBake</product>
          <component>bitbake</component>
          <version>1.8</version>
          <rep_platform>All</rep_platform>
          <op_sys>Multiple</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>1.9 M3</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Paul Eggleton">bluelightning</reporter>
          <assigned_to name="Paul Eggleton">bluelightning</assigned_to>
          <cc>liezhi.yang</cc>
    
    <cc>patrick.ohly</cc>
    
    <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>Regression (Used to work)</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>53112</commentid>
    <comment_count>0</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2015-08-14 10:12:16 +0000</bug_when>
    <thetext>In http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=4a09c91ce4a0b040a71a49d741d10fc850e887fa we added an additional check in get_file_layer() on whether the layer directory matched BBFILE_PATTERN. Unfortunately that isn&apos;t correct - BBFILE_PATTERN isn&apos;t meant to match against the layer directory, and if you try that with layers like meta-intel that put all of their recipes in a subdirectory, you&apos;ll find it doesn&apos;t work - e.g. add meta-intel to bblayers.conf and then run &quot;bitbake-layers show-recipes efilinux&quot; - you&apos;ll see ? as the layer.

BBFILE_PATTERN is intended to match against entries added to BBFILES. We could change the function to map back to BBFILES and then use that to match the file. However that will only work for recipes and not classes or conf files, and we are using the get_file_layer() with the latter, so we may have to have the function fall back to the old method if that doesn&apos;t work.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>53113</commentid>
    <comment_count>1</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2015-08-14 10:18:16 +0000</bug_when>
    <thetext>Additionally the get_file_layer() function in lib/bb/utils.py (which is the same function rewritten to be usable from the metadata) will need a similar fix for the same issue. If practical it would be nice if we could have just one function.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>53114</commentid>
    <comment_count>2</comment_count>
    <who name="Patrick Ohly">patrick.ohly</who>
    <bug_when>2015-08-14 10:23:07 +0000</bug_when>
    <thetext>4a09c91ce4a0b040a71a49d741d10fc850e887fa did not add the BBFILE_PATTERN match, that goes back further.

What 4a09c91ce4a0b040a71a49d741d10fc850e887fa adds is the (IMHO) awkward re.match(layerdir, filename) which isn&apos;t really a regular expression match because layerdir is a path name. A better way to write that check would be filename.startswith(layerdir), although that&apos;s also based on an assumption (&quot;a layer must contain its recipe files&quot;).

Technically, a layer may also add files to BBPATH which are elsewhere.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>53116</commentid>
    <comment_count>3</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2015-08-14 10:35:25 +0000</bug_when>
    <thetext>You&apos;re right, the regex.match on layerdir + /test was before that and would have contributed to this.

We do need to map through BBFILES yes or this will continue to have issues, but that&apos;s not the whole picture as I mentioned as that won&apos;t work with classes or conf files that are found through BBPATH.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>53249</commentid>
    <comment_count>4</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2015-08-20 07:37:54 +0000</bug_when>
    <thetext>Fix merged to master:

http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=a3967e2ba531fbc4880c5efe8f9d1683428297e2</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>