[GHC] #10449: Out-of-tree tests broken on MinGW + native Python due to quoting of config.compiler

GHC ghc-devs at haskell.org
Tue May 26 22:12:54 UTC 2015


#10449: Out-of-tree tests broken on MinGW + native Python due to quoting of
config.compiler
-------------------------------+-------------------------------------------
        Reporter:  Rufflewind  |                   Owner:
            Type:  bug         |                  Status:  new
        Priority:  normal      |               Milestone:
       Component:  Test Suite  |                 Version:  7.10.1
      Resolution:              |                Keywords:
Operating System:  Windows     |            Architecture:  Unknown/Multiple
 Type of failure:  Other       |               Test Case:
      Blocked By:              |                Blocking:
 Related Tickets:  #10441      |  Differential Revisions:
-------------------------------+-------------------------------------------
Description changed by Rufflewind:

Old description:

> Ever since commit 5258566ee5c89aa757b0cf1433169346319c018f it seems that
> out-of-tree tests will not run on MinGW anymore.  Note that I am using
> MinGW tools with a native Windows build of Python, which is the main
> cause of the problem.
>
> The apparent error is something along the lines of "cannot eval an empty
> string":
>
> {{{
> Traceback (most recent call last):
>   File "testsuite/driver/runtests.py", line 196, in <module>
>     get_compiler_info()
>   File "<string>", line 166, in get_compiler_info
>   File "<string>", line 0
>     ^
> SyntaxError: unexpected EOF while parsing
> }}}
>
> But this error is quite misleading.  What really happened was that it
> tried to run GHC with the `--info` argument but failed silently and
> returned an empty string.  If you apply D908, it becomes a lot more
> obvious: Python is failing to run `/c/programs/ghc/bin/ghc --info`
> because `/c/programs/ghc/bin/ghc` "does not exist" as Python does not
> understand MinGW-style paths.
>
> The funny thing is that it worked just fine before 525856, so you have to
> wonder why quoting the paths caused this.  It turns out that MinGW does
> some magic behind the scenes, automagically converting MinGW-style paths
> into ordinary Python paths when a native Windows program is invoked.  In
> particular, it means running this in MinGW shell
>
> {{{
> python run-tests.py -e 'config.compiler=/c/programs/ghc/ghc'
> }}}
>
> will actually invoke Python with `config.compiler=C:/programs/ghc/ghc`.
> However, if it's explicitly quoted like this:
>
> {{{
> python run-tests.py -e 'config.compiler="/c/programs/ghc/ghc"'
> }}}
>
> the magic doesn't work anymore.

New description:

 Ever since commit 5258566ee5c89aa757b0cf1433169346319c018f it seems that
 out-of-tree tests will not run on MinGW anymore.  Note that I am using
 MinGW tools with a native Windows build of Python, which is the main cause
 of the problem.

 The apparent error is something along the lines of "cannot eval an empty
 string":

 {{{
 Traceback (most recent call last):
   File "testsuite/driver/runtests.py", line 196, in <module>
     get_compiler_info()
   File "<string>", line 166, in get_compiler_info
   File "<string>", line 0
     ^
 SyntaxError: unexpected EOF while parsing
 }}}

 But this error is quite misleading.  What really happened was that it
 tried to run GHC with the `--info` argument but failed silently and
 returned an empty string.  If you apply D908, it becomes a lot more
 obvious: Python is failing to run `/c/programs/ghc/bin/ghc --info` because
 `/c/programs/ghc/bin/ghc` "does not exist" as Python does not understand
 MinGW-style paths.

 The funny thing is that it worked just fine before 525856, so you have to
 wonder why quoting the paths caused this.  It turns out that MinGW does
 some magic behind the scenes, automagically converting MinGW-style paths
 into ordinary Python paths when a native Windows program is invoked.  In
 particular, it means running this in MinGW shell

 {{{
 python run-tests.py -e 'config.compiler=/c/programs/ghc/ghc'
 }}}

 will actually invoke Python with `config.compiler=C:/programs/ghc/ghc`.
 However, if it's explicitly quoted (''edit:'' and also escaped with
 backslashes) like this

 {{{
 python run-tests.py -e 'config.compiler="\"/c/programs/ghc/ghc\""'
 }}}

 the magic doesn't work anymore.

--

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10449#comment:3>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list