Fix build on windows
This commit is contained in:
parent
544c618473
commit
873dd77a6f
@ -164,8 +164,10 @@ library
|
|||||||
cpp-options: -DIS_WINDOWS
|
cpp-options: -DIS_WINDOWS
|
||||||
other-modules:
|
other-modules:
|
||||||
GHCup.Prelude.File.Windows
|
GHCup.Prelude.File.Windows
|
||||||
GHCup.Prelude.Process.Windows
|
|
||||||
GHCup.Prelude.Windows
|
GHCup.Prelude.Windows
|
||||||
|
-- GHCup.OptParse.Run uses this
|
||||||
|
exposed-modules:
|
||||||
|
GHCup.Prelude.Process.Windows
|
||||||
|
|
||||||
build-depends:
|
build-depends:
|
||||||
, bzlib
|
, bzlib
|
||||||
|
@ -211,8 +211,8 @@ exec exe args chdir env = do
|
|||||||
let paths = ["PATH", "Path"]
|
let paths = ["PATH", "Path"]
|
||||||
curPaths = (\x -> maybe [] splitSearchPath (Map.lookup x cEnv)) =<< paths
|
curPaths = (\x -> maybe [] splitSearchPath (Map.lookup x cEnv)) =<< paths
|
||||||
newPath = intercalate [searchPathSeparator] curPaths
|
newPath = intercalate [searchPathSeparator] curPaths
|
||||||
setEnv "PATH" ""
|
liftIO $ setEnv "PATH" ""
|
||||||
setEnv "Path" newPath
|
liftIO $ setEnv "Path" newPath
|
||||||
cp <- createProcessWithMingwPath ((proc exe args) { cwd = chdir, env = env })
|
cp <- createProcessWithMingwPath ((proc exe args) { cwd = chdir, env = env })
|
||||||
exit_code <- liftIO $ withCreateProcess cp $ \_ _ _ p -> waitForProcess p
|
exit_code <- liftIO $ withCreateProcess cp $ \_ _ _ p -> waitForProcess p
|
||||||
pure $ toProcessError exe args exit_code
|
pure $ toProcessError exe args exit_code
|
||||||
@ -230,8 +230,8 @@ execNoMinGW exe args chdir env = do
|
|||||||
let paths = ["PATH", "Path"]
|
let paths = ["PATH", "Path"]
|
||||||
curPaths = (\x -> maybe [] splitSearchPath (Map.lookup x cEnv)) =<< paths
|
curPaths = (\x -> maybe [] splitSearchPath (Map.lookup x cEnv)) =<< paths
|
||||||
newPath = intercalate [searchPathSeparator] curPaths
|
newPath = intercalate [searchPathSeparator] curPaths
|
||||||
setEnv "PATH" ""
|
liftIO $ setEnv "PATH" ""
|
||||||
setEnv "Path" newPath
|
liftIO $ setEnv "Path" newPath
|
||||||
let cp = (proc exe args) { cwd = chdir, env = env }
|
let cp = (proc exe args) { cwd = chdir, env = env }
|
||||||
exit_code <- liftIO $ withCreateProcess cp $ \_ _ _ p -> waitForProcess p
|
exit_code <- liftIO $ withCreateProcess cp $ \_ _ _ p -> waitForProcess p
|
||||||
pure $ toProcessError exe args exit_code
|
pure $ toProcessError exe args exit_code
|
||||||
|
Loading…
Reference in New Issue
Block a user