[commit: ghc] wip/nfs-locking: #189, clear PWD so we can be sure it has the Unix-style path even on Windows (fce6921)

git at git.haskell.org git at git.haskell.org
Thu Oct 26 23:58:15 UTC 2017


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

On branch  : wip/nfs-locking
Link       : http://ghc.haskell.org/trac/ghc/changeset/fce6921fca6c3dd14f9a1b0a4c0940db2a8f7841/ghc

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

commit fce6921fca6c3dd14f9a1b0a4c0940db2a8f7841
Author: Neil Mitchell <ndmitchell at gmail.com>
Date:   Mon Feb 1 20:57:56 2016 +0000

    #189, clear PWD so we can be sure it has the Unix-style path even on Windows


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

fce6921fca6c3dd14f9a1b0a4c0940db2a8f7841
 src/Environment.hs | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/Environment.hs b/src/Environment.hs
index fd207ed..e674f83 100644
--- a/src/Environment.hs
+++ b/src/Environment.hs
@@ -11,6 +11,11 @@ setupEnvironment = do
     -- ghc-cabal refuses to work when GHC_PACKAGE_PATH is set (e.g. by Stack)
     unsetEnv "GHC_PACKAGE_PATH"
 
+    -- in MinGW if PWD is set to a Windows "C:\\" style path then configure
+    -- `pwd` will return the Windows path, and then modifying $PATH will fail.
+    -- See https://github.com/snowleopard/shaking-up-ghc/issues/189 for details.
+    unsetEnv "PWD"
+
     -- On Windows, some path variables start a prefix like "C:\\" which may
     -- lead to failures of scripts such as autoreconf. One particular variable
     -- which causes issues is ACLOCAL_PATH. At the moment we simply reset it



More information about the ghc-commits mailing list