[commit: ghc] ghc-7.10: Revert "The test runner now also works under the msys-native Python." (49201ed)

git at git.haskell.org git at git.haskell.org
Tue Jun 9 11:37:08 UTC 2015


Repository : ssh://git@git.haskell.org/ghc

On branch  : ghc-7.10
Link       : http://ghc.haskell.org/trac/ghc/changeset/49201ed15372b132b362c639cf23b89fa169834e/ghc

>---------------------------------------------------------------

commit 49201ed15372b132b362c639cf23b89fa169834e
Author: Thomas Miedema <thomasmiedema at gmail.com>
Date:   Thu Jun 4 10:49:51 2015 +0200

    Revert "The test runner now also works under the msys-native Python."
    
    To make the test runner work under msys-native Python...
    
    Commit 5258566ee5c89aa757b0cf1433169346319c018f broke the msys testsuite
    driver (#10441). It changed the quoting of `config.compiler` from single
    quotes to double quote, which turns out to not be compatible with what
    the function `passThroughCmd` expected.
    
    We could fix `passThroughCmd` to handle the case where `config.compiler`
    is double quoted, and scatter some notes around to make sure the quoting
    done in various places of the testsuite driver stay compatible.
    
    Instead, this commit reverts 101c62e26286353dd3fac1ef54323529b64c9902,
    which introdced the function `passThroughCmd` in the first place
    (#9626). ezyang reports that doing this revert fixes the testsuite
    driver for him using the the following version of msys2:
    
      msys2-keyring r8.3864337-1
      msys2-runtime 2.1.0.16351.cd3184b-1
      msys2-runtime-devel 2.1.0.16351.cd3184b-1
      msys2-w32api-headers 5.0.0.4456.c8b6742-1
      msys2-w32api-runtime 5.0.0.4455.32db221-1
    
    Ideally we'd know what minimum version of msys2 we require, but for now
    this fix is better than nothing.
    
    Only gintas ever reported the original problem, and he actually
    mentioned shortly afterwards: "This may have been fixed by a recent
    release of msys2, but I am not sure."
    
    Differential Revision: https://phabricator.haskell.org/D952
    
    (cherry picked from commit bb9967121f2383b857680b47b6bc20607f8fd1ff)


>---------------------------------------------------------------

49201ed15372b132b362c639cf23b89fa169834e
 testsuite/driver/testlib.py | 16 ----------------
 testsuite/mk/test.mk        |  2 ++
 2 files changed, 2 insertions(+), 16 deletions(-)

diff --git a/testsuite/driver/testlib.py b/testsuite/driver/testlib.py
index 65ff8ba..9556298 100644
--- a/testsuite/driver/testlib.py
+++ b/testsuite/driver/testlib.py
@@ -1786,25 +1786,9 @@ def rawSystem(cmd_and_args):
     else:
         return os.spawnv(os.P_WAIT, cmd, cmd_and_args)
 
-# When running under native msys Python, any invocations of non-msys binaries,
-# including timeout.exe, will have their arguments munged according to some
-# heuristics, which leads to malformed command lines (#9626).  The easiest way
-# to avoid problems is to invoke through /usr/bin/cmd which sidesteps argument
-# munging because it is a native msys application.
-def passThroughCmd(cmd_and_args):
-    args = []
-    # cmd needs a Windows-style path for its first argument.
-    args.append(cmd_and_args[0].replace('/', '\\'))
-    # Other arguments need to be quoted to deal with spaces.
-    args.extend(['"%s"' % arg for arg in cmd_and_args[1:]])
-    return ["cmd", "/c", " ".join(args)]
-
 # Note that this doesn't handle the timeout itself; it is just used for
 # commands that have timeout handling built-in.
 def rawSystemWithTimeout(cmd_and_args):
-    if config.os == 'mingw32' and sys.executable.startswith('/usr'):
-        # This is only needed when running under msys python.
-        cmd_and_args = passThroughCmd(cmd_and_args)
     r = rawSystem(cmd_and_args)
     if r == 98:
         # The python timeout program uses 98 to signal that ^C was pressed
diff --git a/testsuite/mk/test.mk b/testsuite/mk/test.mk
index 2522b11..46eeb7e 100644
--- a/testsuite/mk/test.mk
+++ b/testsuite/mk/test.mk
@@ -213,6 +213,8 @@ RUNTEST_OPTS +=  \
 # function) would require another pair of (escaped) quotes, which interfers
 # with MinGW's magic path handling (see #10449, and
 # http://www.mingw.org/wiki/Posix_path_conversion).
+# We use double instead of single quotes, which may or may not be important
+# when using msys2 (#9626, #10441).
 quote_path = $(if $1,"$1")
 RUNTEST_OPTS +=  \
 	--config 'compiler=$(call quote_path,$(TEST_HC))' \



More information about the ghc-commits mailing list