From 12deea33d0b3c4090abe47ec5f30ae57217e10d0 Mon Sep 17 00:00:00 2001 From: tchakkazulu Date: Wed, 23 Apr 2014 02:14:39 +0200 Subject: [PATCH] Platform dependent search path separator When using cabal exec on Windows, it would give an error such as: ghc.exe: can't find a package database at C:\Users\tchakkazulu\path\to\dir\.cabal-sandbox\i386-windows-ghc-7.6.3-packages.conf.d:C:\Program Files (x86)\Haskell Platform\2013.2.0.0\lib\package.conf.d --- cabal-install/Main.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cabal-install/Main.hs b/cabal-install/Main.hs index be1d5d1b4e3..301e14939e4 100644 --- a/cabal-install/Main.hs +++ b/cabal-install/Main.hs @@ -145,7 +145,7 @@ import qualified Paths_cabal_install (version) import System.Environment (getArgs, getProgName) import System.Exit (exitFailure) -import System.FilePath (splitExtension, takeExtension) +import System.FilePath (splitExtension, takeExtension, searchPathSeparator) import System.IO ( BufferMode(LineBuffering), hSetBuffering #ifdef mingw32_HOST_OS , stderr @@ -1061,7 +1061,8 @@ execAction execFlags extraArgs globalFlags = do exitFailure Just ghcProg -> do g <- ghcGlobalPackageDB verbosity ghcProg - getEffectiveEnvironment [("GHC_PACKAGE_PATH", Just $ s ++ ":" ++ g)] + getEffectiveEnvironment + [("GHC_PACKAGE_PATH", Just $ s ++ [searchPathSeparator] ++ g)] -- | See 'Distribution.Client.Install.withWin32SelfUpgrade' for details. --