<?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>12380</bug_id>
          
          <creation_ts>2017-11-24 03:29:29 +0000</creation_ts>
          <short_desc>Variable definition: leading spaces stripping behavior is not consistent</short_desc>
          <delta_ts>2019-02-13 09:06:03 +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>2.5</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>normal</bug_severity>
          <target_milestone>2.7 M2</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Jackie Huang">jackie.huang</reporter>
          <assigned_to name="Robert Yang">liezhi.yang</assigned_to>
          <cc>liezhi.yang</cc>
    
    <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
    
    <cc>randy.macleod</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>78344</commentid>
    <comment_count>0</comment_count>
    <who name="Jackie Huang">jackie.huang</who>
    <bug_when>2017-11-24 03:29:29 +0000</bug_when>
    <thetext>When I define variable over multiple lines with backslash character (&quot;\&quot;), I found that the leading spaces stripping behavior is not consistent:

The leading spaces will be stripped when definition is in .conf file, but they will be preserved when the definition is in .inc, .bb, .bbclass.

e.g.

I added the following definitions in different files:
1) meta/conf/bitbake.conf
+ARF = &quot;bitbake1&quot;
+
+ARF_append = &quot;\
+    bitbake2 \
+&quot;

2) meta/classes/autotools.bbclass
+ARF_append = &quot;\
+    class1 \
+&quot;

3) meta/conf/distro/include/default-versions.inc
+ARF_append = &quot;\
+    inc1 \
+&quot;

4) meta/recipes-core/ncurses/ncurses.inc
+ARF_append = &quot;\
+    inc2 \
+&quot;

5) meta/recipes-core/ncurses/ncurses_6.0+20170715.bb
+ARF_append = &quot;\
+    bb1 \
+&quot;


Then run &quot;bitbake -e&quot; to see the result:
$ bitbake -e ncurses

# $ARF [7 operations]
#   _append /ala-lpggp51/jhuang0/builds/yp/y_all_171124/conf/local.conf:241
#     &quot;local1 &quot;
#   _append /ala-lpggp51/jhuang0/builds/yp/poky/meta/conf/distro/include/default-versions.inc:11
#     &quot;    inc1 &quot;
#   set /ala-lpggp51/jhuang0/builds/yp/poky/meta/conf/bitbake.conf:879
#     &quot;bitbake1&quot;
#   _append /ala-lpggp51/jhuang0/builds/yp/poky/meta/conf/bitbake.conf:883
#     &quot;bitbake2 &quot;
#   _append /ala-lpggp51/jhuang0/builds/yp/poky/meta/classes/autotools.bbclass:260
#     &quot;    class1 &quot;
#   _append /ala-lpggp51/jhuang0/builds/yp/poky/meta/recipes-core/ncurses/ncurses.inc:318
#     &quot;    inc2 &quot;
#   _append /ala-lpggp51/jhuang0/builds/yp/poky/meta/recipes-core/ncurses/ncurses_6.0+20170715.bb:16
#     &quot;    bb1 &quot;
# pre-expansion value:
#   &quot;bitbake1local1     inc1 bitbake2     class1     inc2     bb1 &quot;
ARF=&quot;bitbake1local1     inc1 bitbake2     class1     inc2     bb1 &quot;

According to the doc:
http://www.yoctoproject.org/docs/2.4/bitbake-user-manual/bitbake-user-manual.html#line-joining

&quot;&quot;&quot;
Both the &quot;\&quot; character and the newline character that follow it are removed when joining lines.
&quot;&quot;&quot;

leading spaces stripping/removing is not mentioned in the bitbake user manual, so
I don&apos;t know which behavior is expected, but I think at least they should have the same behavior.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>78422</commentid>
    <comment_count>1</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2017-11-30 16:05:19 +0000</bug_when>
    <thetext>There are two different parsers for the two difference sets of filetypes. I suspect this is some inconsistency between ConfHandler.py and BBHandler.py</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82985</commentid>
    <comment_count>2</comment_count>
    <who name="Robert Yang">liezhi.yang</who>
    <bug_when>2019-02-13 09:06:03 +0000</bug_when>
    <thetext>Fixed on master branch:

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

    </bug>

</bugzilla>