Skip to content

msys native python testsuite support doesn't work in some situations

On a vanilla Windows 8.1, msys2 GHC installation with only msys python installed, the testsuite driver is broken. I know of one other person whose testsuite is also not working. The usual error message is:

cd ./typecheck/should_compile &&  "C:/msys64/home/ezy.exe" -c tc055.hs -fforce-recomp -dcore-lint -dcmm-lib -rtsopts -fno-warn-tabs -fno-ghci-history -fno-warnrr 2>&1
'..\timeout\install-inplace\bin\timeout.exe" "300" "cexternal command,
operable program or batch file.
Compile failed (status 256) errors were:

I have diagnosed the problem to the fact that we are passing a complex command string to cmd with adequately quoting it. In particular, when I inspect the command line that Python is attempting to invoke, it looks something like this:

cmd \c 'timeout.exe 300 "cd . && "inplace/ghc-stage2" -c blah blah"'

Notice, in particular, that the quoted GHC executable was not inside the timeout invocation is not double-quoted, so cmd does NOT parse the command the way you want it to.

Curiously enough, when I remove this fix (introduced by commit 101c62e26286353dd3fac1ef54323529b64c9902), the msys Python runner works fine. So I don't even know what this commit was intended to fix; it seems to have done more harm than good

Here are some details about my configuration:

ezyang@cutlass MSYS ~/ghc-validate/testsuite
$ python2 --version
Python 2.7.9

ezyang@cutlass MSYS ~/ghc-validate/testsuite
$ bash --version
GNU bash, version 4.3.33(3)-release (x86_64-pc-msys)
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

Trac metadata
Trac field Value
Version 7.11
Type Bug
TypeOfFailure OtherFailure
Priority high
Resolution Unresolved
Component Test Suite
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information