<?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>8402</bug_id>
          
          <creation_ts>2015-09-25 19:06:54 +0000</creation_ts>
          <short_desc>LAYERDIR is used as-is in BBFILE_PATTERN, when it should be regex escaped</short_desc>
          <delta_ts>2016-05-19 16:32:33 +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>unspecified</version>
          <rep_platform>x86</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>minor</bug_severity>
          <target_milestone>2.2</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Christopher Larson">kergoth</reporter>
          <assigned_to name="Christopher Larson">kergoth</assigned_to>
          <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
    
    <cc>ross.burton</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Don&apos;t know</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>54697</commentid>
    <comment_count>0</comment_count>
    <who name="Christopher Larson">kergoth</who>
    <bug_when>2015-09-25 19:06:54 +0000</bug_when>
    <thetext>I think bitbake should set a variable which is just re.escape(LAYERDIR), for us to use in BBFILE_PATTERN, i.e. LAYERDIR_ESCAPED or LAYERDIR_RE or so. Doing it purely in layer.conf could be problematic since the re module isn&apos;t imported. This would avoid issues with regex special characters in paths causing breakage, at least at this level. Other parts of the build can hit problems in certain cases, but we should at least handle this correctly ourselves.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54698</commentid>
    <comment_count>1</comment_count>
    <who name="Christopher Larson">kergoth</who>
    <bug_when>2015-09-25 19:13:45 +0000</bug_when>
    <thetext>(In reply to comment #0)
&gt; I think bitbake should set a variable which is just re.escape(LAYERDIR), for
&gt; us to use in BBFILE_PATTERN, i.e. LAYERDIR_ESCAPED or LAYERDIR_RE or so.
&gt; Doing it purely in layer.conf could be problematic since the re module isn&apos;t
&gt; imported. This would avoid issues with regex special characters in paths
&gt; causing breakage, at least at this level. Other parts of the build can hit
&gt; problems in certain cases, but we should at least handle this correctly
&gt; ourselves.

Another option would be for bitbake to be a bit smarter about its LAYERDIR expansions. Assume that a LAYERDIR ref in BBFILE_PATTERN has to be escaped, whereas any other expansions don&apos;t, but that&apos;s likely too implicit / too much magic :)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>60936</commentid>
    <comment_count>2</comment_count>
    <who name="Christopher Larson">kergoth</who>
    <bug_when>2016-04-07 18:46:09 +0000</bug_when>
    <thetext>https://github.com/kergoth/poky/commit/14d521b is the implementation I proposed in comment #1, and https://github.com/kergoth/poky/commit/d24c6d5 the one from comment #2. Thoughts? I dislike how implicit the latter is, but trying to get every layer to modify their layer.conf seems like a losing proposition, and they&apos;d need to add LAYERDIR_RE ?= &quot;${LAYERDIR}&quot; to be compatible with previous bitbake versions, so I&apos;m inclined to say we should go with the latter instead.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>60977</commentid>
    <comment_count>3</comment_count>
    <who name="Christopher Larson">kergoth</who>
    <bug_when>2016-04-08 16:29:54 +0000</bug_when>
    <thetext>Having discussed this with Richard, we&apos;re on the same page on this, we should go with route #1 and just deal with the migration rather than adding more magic. I&apos;ll submit the patch for 2.2.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>62340</commentid>
    <comment_count>4</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2016-05-19 16:32:33 +0000</bug_when>
    <thetext>Fixed in bitbake 72900522778b6ff08b135bf8bb97dff3f1a20bd9.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>