[commit: packages/Cabal] ghc-head: Unbreak the build on Windows. (51d576a)
git at git.haskell.org
git at git.haskell.org
Wed Oct 16 06:33:07 UTC 2013
Repository : ssh://git@git.haskell.org/Cabal
On branch : ghc-head
Link : http://git.haskell.org/packages/Cabal.git/commitdiff/51d576ab1a17a8446d5758da0be68c18f466e6c0
>---------------------------------------------------------------
commit 51d576ab1a17a8446d5758da0be68c18f466e6c0
Author: Mikhail Glushenkov <mikhail.glushenkov at gmail.com>
Date: Sat Oct 12 20:10:21 2013 +0200
Unbreak the build on Windows.
Broken by #1535.
(cherry picked from commit 940079ca3d25676d978dcd7636bb30569f77e0b8)
>---------------------------------------------------------------
51d576ab1a17a8446d5758da0be68c18f466e6c0
Cabal/Distribution/Simple/Utils.hs | 35 ++++++++++++++++++++---------------
1 file changed, 20 insertions(+), 15 deletions(-)
diff --git a/Cabal/Distribution/Simple/Utils.hs b/Cabal/Distribution/Simple/Utils.hs
index 7fd9a07..fdd5605 100644
--- a/Cabal/Distribution/Simple/Utils.hs
+++ b/Cabal/Distribution/Simple/Utils.hs
@@ -195,20 +195,23 @@ import Distribution.Version
(Version(..))
import Control.Exception (IOException, evaluate, throwIO)
-import System.Process (rawSystem, CreateProcess(..))
+import System.Process (rawSystem)
+import qualified System.Process as Process (CreateProcess(..))
import Control.Concurrent (forkIO)
-import System.Process (runInteractiveProcess, waitForProcess, proc, StdStream(..))
+import System.Process (runInteractiveProcess, waitForProcess, proc,
+ StdStream(..))
#if __GLASGOW_HASKELL__ >= 702
import System.Process (showCommandForUser)
#endif
-#if !mingw32_HOST_OS
-import System.Posix.Signals ( installHandler, sigINT, sigQUIT, Handler(..) )
+#ifndef mingw32_HOST_OS
+import System.Posix.Signals (installHandler, sigINT, sigQUIT, Handler(..))
+import System.Process.Internals (defaultSignal, runGenProcess_)
+#else
+import System.Process (createProcess)
#endif
-import System.Process.Internals ( runGenProcess_, defaultSignal )
-
import Distribution.Compat.CopyFile
( copyFile, copyOrdinaryFile, copyExecutableFile
, setFileOrdinary, setFileExecutable, setDirOrdinary )
@@ -392,7 +395,7 @@ printRawCommandAndArgsAndEnv verbosity path args env
-- The reason we need it is that runProcess doesn't handle ^C in the same
-- way that rawSystem handles it, but rawSystem doesn't allow us to pass
-- an environment.
-syncProcess :: String -> CreateProcess -> IO ExitCode
+syncProcess :: String -> Process.CreateProcess -> IO ExitCode
#if mingw32_HOST_OS
syncProcess _fun c = do
(_,_,_,p) <- createProcess c
@@ -439,10 +442,11 @@ rawSystemExitWithEnv :: Verbosity
-> [String]
-> [(String, String)]
-> IO ()
-rawSystemExitWithEnv verbosity path args env' = do
- printRawCommandAndArgsAndEnv verbosity path args env'
+rawSystemExitWithEnv verbosity path args env = do
+ printRawCommandAndArgsAndEnv verbosity path args env
hFlush stdout
- exitcode <- syncProcess "rawSystemExitWithEnv" (proc path args) { env = Just env' }
+ exitcode <- syncProcess "rawSystemExitWithEnv" (proc path args)
+ { Process.env = Just env }
unless (exitcode == ExitSuccess) $ do
debug verbosity $ path ++ " returned " ++ show exitcode
exitWith exitcode
@@ -461,11 +465,12 @@ rawSystemIOWithEnv verbosity path args mcwd menv inp out err = do
maybe (printRawCommandAndArgs verbosity path args)
(printRawCommandAndArgsAndEnv verbosity path args) menv
hFlush stdout
- exitcode <- syncProcess "rawSystemIOWithEnv" (proc path args) { cwd = mcwd
- , env = menv
- , std_in = mbToStd inp
- , std_out = mbToStd out
- , std_err = mbToStd err }
+ exitcode <- syncProcess "rawSystemIOWithEnv" (proc path args)
+ { Process.cwd = mcwd
+ , Process.env = menv
+ , Process.std_in = mbToStd inp
+ , Process.std_out = mbToStd out
+ , Process.std_err = mbToStd err }
unless (exitcode == ExitSuccess) $ do
debug verbosity $ path ++ " returned " ++ show exitcode
return exitcode
More information about the ghc-commits
mailing list