aboutsummaryrefslogtreecommitdiff
path: root/CabalHelper
diff options
context:
space:
mode:
Diffstat (limited to 'CabalHelper')
-rw-r--r--CabalHelper/Wrapper.hs8
1 files changed, 8 insertions, 0 deletions
diff --git a/CabalHelper/Wrapper.hs b/CabalHelper/Wrapper.hs
index b827de6..ef20a2e 100644
--- a/CabalHelper/Wrapper.hs
+++ b/CabalHelper/Wrapper.hs
@@ -373,6 +373,7 @@ installCabal opts ver = do
\Building Cabal %s ...\n" appdir sver sver sver
db <- createPkgDb opts ver
+ cabalInstallVer <- cabalInstallVersion opts
cabal_opts <- return $ concat
[
[ "--package-db=clear"
@@ -381,6 +382,9 @@ installCabal opts ver = do
, "--prefix=" ++ db </> "prefix"
, "--with-ghc=" ++ ghcProgram opts
]
+ , if cabalInstallVer >= Version [1,20,0,0] []
+ then ["--no-require-sandbox"]
+ else []
, if ghcPkgProgram opts /= ghcPkgProgram defaultOptions
then [ "--with-ghc-pkg=" ++ ghcPkgProgram opts ]
else []
@@ -402,6 +406,10 @@ ghcPkgVersion :: Options -> IO Version
ghcPkgVersion Options {..} = do
parseVer . trim . dropWhile (not . isDigit) <$> readProcess ghcPkgProgram ["--version"] ""
+cabalInstallVersion :: Options -> IO Version
+cabalInstallVersion Options {..} = do
+ parseVer . trim <$> readProcess cabalProgram ["--numeric-version"] ""
+
trim :: String -> String
trim = dropWhileEnd isSpace