<?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>11112</bug_id>
          
          <creation_ts>2017-02-28 21:17:50 +0000</creation_ts>
          <short_desc>Building gcc-source fails when $PATH contains spaces</short_desc>
          <delta_ts>2017-03-02 15:50:17 +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>OE-Core</product>
          <component>devtools / tool chain</component>
          <version>2.2</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Low</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>2.3</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Kai Ruhnau">kai.ruhnau</reporter>
          <assigned_to name="Richard Purdie">richard.purdie</assigned_to>
          <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
          
          
          <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>70997</commentid>
    <comment_count>0</comment_count>
    <who name="Kai Ruhnau">kai.ruhnau</who>
    <bug_when>2017-02-28 21:17:50 +0000</bug_when>
    <thetext>I&apos;m trying to build my distro using Bash on Ubuntu on Windows and it stumbles over the gcc-source_6.2.bb recipe (see below).

The reason is that my PATH contains something like &quot;[...]:/mnt/c/Program Files/Microsoft SQL Server/130/Tools/Binn:[...]&quot; and the missing quoting / escaping before calling gnu-configize.

I have manually added two &quot;s and compilation succeeds, but setting the PATH as seen makes me wonder what it&apos;s for in the first place.



ERROR: gcc-source-6.2.0-6.2.0-r0 do_preconfigure: Error executing a python function in exec_python_func() autogenerated:

The stack trace of python calls that resulted in this exception/failure was:
File: &apos;exec_python_func() autogenerated&apos;, lineno: 2, function: &lt;module&gt;
     0001:
 *** 0002:do_preconfigure(d)
     0003:
File: &apos;/home/kai/source/Target-sg/yocto/poky/meta/recipes-devtools/gcc/gcc-source.inc&apos;, lineno: 24, function: do_preconfigure
     0020:
     0021:python do_preconfigure () {
     0022:    import subprocess
     0023:    cmd = d.expand(&apos;cd ${S} &amp;&amp; PATH=${PATH} gnu-configize&apos;)
 *** 0024:    subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
     0025:    # See 0044-gengtypes.patch, we need to regenerate this file
     0026:    bb.utils.remove(d.expand(&quot;${S}/gcc/gengtype-lex.c&quot;))
     0027:    cmd = d.expand(&quot;sed -i &apos;s/BUILD_INFO=info/BUILD_INFO=/&apos; ${S}/gcc/configure&quot;)
     0028:    subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
File: &apos;/usr/lib/python3.5/subprocess.py&apos;, lineno: 626, function: check_output
     0622:        # empty string. That is maintained here for backwards compatibility.
     0623:        kwargs[&apos;input&apos;] = &apos;&apos; if kwargs.get(&apos;universal_newlines&apos;, False) else b&apos;&apos;
     0624:
     0625:    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
 *** 0626:               **kwargs).stdout
     0627:
     0628:
     0629:class CompletedProcess(object):
     0630:    &quot;&quot;&quot;A process that has finished running.
File: &apos;/usr/lib/python3.5/subprocess.py&apos;, lineno: 708, function: run
     0704:            raise
     0705:        retcode = process.poll()
     0706:        if check and retcode:
     0707:            raise CalledProcessError(retcode, process.args,
 *** 0708:                                     output=stdout, stderr=stderr)
     0709:    return CompletedProcess(process.args, retcode, stdout, stderr)
     0710:
     0711:
     0712:def list2cmdline(seq):
Exception: subprocess.CalledProcessError: Command &apos;cd /home/kai/source/build/tmp/work-shared/gcc-6.2.0-r0/gcc-6.2.0 &amp;&amp; PATH=&quot;{PATH}&quot; gnu-configize&apos; returned non-zero exit status 127

Subprocess output:
/bin/sh: 1: gnu-configize: not found

ERROR: gcc-source-6.2.0-6.2.0-r0 do_preconfigure: Function failed: do_preconfigure
ERROR: Logfile of failure stored in: /home/kai/source/build/tmp/work-shared/gcc-6.2.0-r0/temp/log.do_preconfigure.29057
ERROR: Task (/home/kai/source/Target-sg/yocto/poky/meta/recipes-devtools/gcc/gcc-source_6.2.bb:do_preconfigure) failed with exit code &apos;1&apos;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>70998</commentid>
    <comment_count>1</comment_count>
    <who name="Kai Ruhnau">kai.ruhnau</who>
    <bug_when>2017-02-28 21:19:06 +0000</bug_when>
    <thetext>Sorry, wrong stacktrace:

ERROR: gcc-source-6.2.0-6.2.0-r0 do_preconfigure: Error executing a python function in exec_python_func() autogenerated:

The stack trace of python calls that resulted in this exception/failure was:
File: &apos;exec_python_func() autogenerated&apos;, lineno: 2, function: &lt;module&gt;
     0001:
 *** 0002:do_preconfigure(d)
     0003:
File: &apos;/home/kai/source/Target-sg/yocto/poky/meta/recipes-devtools/gcc/gcc-source.inc&apos;, lineno: 24, function: do_preconfigure
     0020:
     0021:python do_preconfigure () {
     0022:    import subprocess
     0023:    cmd = d.expand(&apos;cd ${S} &amp;&amp; PATH=${PATH} gnu-configize&apos;)
 *** 0024:    subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
     0025:    # See 0044-gengtypes.patch, we need to regenerate this file
     0026:    bb.utils.remove(d.expand(&quot;${S}/gcc/gengtype-lex.c&quot;))
     0027:    cmd = d.expand(&quot;sed -i &apos;s/BUILD_INFO=info/BUILD_INFO=/&apos; ${S}/gcc/configure&quot;)
     0028:    subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
File: &apos;/usr/lib/python3.5/subprocess.py&apos;, lineno: 626, function: check_output
     0622:        # empty string. That is maintained here for backwards compatibility.
     0623:        kwargs[&apos;input&apos;] = &apos;&apos; if kwargs.get(&apos;universal_newlines&apos;, False) else b&apos;&apos;
     0624:
     0625:    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
 *** 0626:               **kwargs).stdout
     0627:
     0628:
     0629:class CompletedProcess(object):
     0630:    &quot;&quot;&quot;A process that has finished running.
File: &apos;/usr/lib/python3.5/subprocess.py&apos;, lineno: 708, function: run
     0704:            raise
     0705:        retcode = process.poll()
     0706:        if check and retcode:
     0707:            raise CalledProcessError(retcode, process.args,
 *** 0708:                                     output=stdout, stderr=stderr)
     0709:    return CompletedProcess(process.args, retcode, stdout, stderr)
     0710:
     0711:
     0712:def list2cmdline(seq):
Exception: subprocess.CalledProcessError: Command &apos;cd /home/kai/source/build/tmp/work-shared/gcc-6.2.0-r0/gcc-6.2.0 &amp;&amp; PATH=/home/kai/source/build/tmp/sysroots-uninative/x86_64-linux/usr/bin:/home/kai/source/Target-sg/yocto/poky/scripts:/home/kai/source/build/tmp/sysroots/x86_64-linux/usr/bin/arm-target-linux-gnueabi:/home/kai/source/build/tmp/sysroots/f500sx/usr/bin/crossscripts:/home/kai/source/build/tmp/sysroots/x86_64-linux/usr/sbin:/home/kai/source/build/tmp/sysroots/x86_64-linux/usr/bin:/home/kai/source/build/tmp/sysroots/x86_64-linux/sbin:/home/kai/source/build/tmp/sysroots/x86_64-linux/bin:/home/kai/source/Target-sg/yocto/poky/scripts:/home/kai/source/Target-sg/yocto/poky/bitbake/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/mnt/c/Windows/System32:/mnt/c/Windows:/mnt/c/Windows/System32/wbem:/mnt/c/Windows/System32/WindowsPowerShell/v1.0:/mnt/c/Program Files/Microsoft SQL Server/130/Tools/Binn:/mnt/c/Program Files/Microsoft DNX/Dnvm:/mnt/c/Program Files/Git/cmd:/mnt/c/Program Files/dotnet:/mnt/c/Users/kairu/AppData/Local/Microsoft/WindowsApps gnu-configize&apos; returned non-zero exit status 127

Subprocess output:
/bin/sh: 1: Files/Microsoft: not found

ERROR: gcc-source-6.2.0-6.2.0-r0 do_preconfigure: Function failed: do_preconfigure
ERROR: Logfile of failure stored in: /home/kai/source/build/tmp/work-shared/gcc-6.2.0-r0/temp/log.do_preconfigure.13810
ERROR: Task (/home/kai/source/Target-sg/yocto/poky/meta/recipes-devtools/gcc/gcc-source_6.2.bb:do_preconfigure) failed with exit code &apos;1&apos;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71041</commentid>
    <comment_count>2</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2017-03-02 15:49:52 +0000</bug_when>
    <thetext>Basically we simply can&apos;t support path names with spaces in. The reason is that autotools itself doesn&apos;t cope with this and much of our software is autotools based.

Whilst this particular case is probably fixable, you&apos;d eventually find cases which were not fixable without rewriting autotools.

I&apos;d suggest instead using a PATH environment without spaces to try and run this build.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71042</commentid>
    <comment_count>3</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2017-03-02 15:50:17 +0000</bug_when>
    <thetext>I would also take a sanity test patch to test for spaces in PATH and erroring in that case btw.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>