[commit: ghc] master: Testsuite Windows: don't use forward slashes in topdir path (ae4acbd)

git at git.haskell.org git at git.haskell.org
Tue Oct 20 14:31:54 UTC 2015


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/ae4acbd1ba4168b867a1b5fe8de50c0199dfc1f4/ghc

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

commit ae4acbd1ba4168b867a1b5fe8de50c0199dfc1f4
Author: Thomas Miedema <thomasmiedema at gmail.com>
Date:   Mon Oct 19 17:23:44 2015 +0200

    Testsuite Windows: don't use forward slashes in topdir path
    
    Changing backwards slashes to forward slashes apparently confuses
    msys2/mingw magic path handling. I don't quite understand why, but this
    fixes it.
    
    Test Plan: on Windows, make sure PATH does not contain
    'inplace/mingw/bin' (let the testsuite driver add it), then run: make
    TEST='ghcilink003 ghcilink006'. Before this patch, it would fail.
    
    Reviewed by: Phyx, bgamari, austin
    
    Differential Revision: https://phabricator.haskell.org/D1343


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

ae4acbd1ba4168b867a1b5fe8de50c0199dfc1f4
 testsuite/config/ghc         | 3 +--
 testsuite/driver/runtests.py | 5 ++++-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/testsuite/config/ghc b/testsuite/config/ghc
index 07ac975..55a6a73 100644
--- a/testsuite/config/ghc
+++ b/testsuite/config/ghc
@@ -165,8 +165,7 @@ def get_compiler_info():
     s = re.sub('[\r\n]', '', s)
     rtsInfoDict = dict(eval(s))
 
-    # We use a '/'-separated path for libdir, even on Windows
-    config.libdir = re.sub('\\\\','/',compilerInfoDict['LibDir'])
+    config.libdir = compilerInfoDict['LibDir']
 
     v = compilerInfoDict["Project version"].split('-')
     config.compiler_version = v[0]
diff --git a/testsuite/driver/runtests.py b/testsuite/driver/runtests.py
index efadb03..491335d 100644
--- a/testsuite/driver/runtests.py
+++ b/testsuite/driver/runtests.py
@@ -217,7 +217,10 @@ if windows or darwin:
         if line.startswith('library-dirs:'):
             path = line.rstrip()
             path = re.sub('^library-dirs: ', '', path)
-            path = re.sub('\\$topdir', topdir, path)
+            # Use string.replace instead of re.sub, because re.sub
+            # interprets backslashes in the replacement string as
+            # escape sequences.
+            path = path.replace('$topdir', topdir)
             if path.startswith('"'):
                 path = re.sub('^"(.*)"$', '\\1', path)
                 path = re.sub('\\\\(.)', '\\1', path)



More information about the ghc-commits mailing list