aboutsummaryrefslogtreecommitdiff
path: root/CabalHelper
diff options
context:
space:
mode:
authorDaniel Gröber <dxld@darkboxed.org>2015-06-19 12:25:09 +0200
committerDaniel Gröber <dxld@darkboxed.org>2015-06-19 12:30:31 +0200
commit73edf0fccfe8119be7b8c3d6269f9825b56598ad (patch)
tree8453d46f150f13df3ae5a783e5a6ef5c45ca45bf /CabalHelper
parentf69f35bc4af49b3a25ed6407375c03f5b7569432 (diff)
Don't try to remove inplace deps in unrelated places
Doing that causes the unintended side effect of also adding the package flags to the option set.
Diffstat (limited to 'CabalHelper')
-rw-r--r--CabalHelper/Main.hs9
1 files changed, 5 insertions, 4 deletions
diff --git a/CabalHelper/Main.hs b/CabalHelper/Main.hs
index 528d891..4fe4da8 100644
--- a/CabalHelper/Main.hs
+++ b/CabalHelper/Main.hs
@@ -178,7 +178,7 @@ main = do
return $ Just $ ChResponseCompList (res ++ [(ChSetupHsName, [])])
"ghc-src-options":flags -> do
- res <- componentOptions lvd flags $ \opts -> mempty {
+ res <- componentOptions lvd False flags $ \opts -> mempty {
-- Not really needed but "unexpected package db stack: []"
ghcOptPackageDBs = [GlobalPackageDB, UserPackageDB],
@@ -192,7 +192,7 @@ main = do
return $ Just $ ChResponseCompList (res ++ [(ChSetupHsName, [])])
"ghc-pkg-options":flags -> do
- res <- componentOptions lvd flags $ \opts -> mempty {
+ res <- componentOptions lvd True flags $ \opts -> mempty {
ghcOptPackageDBs = ghcOptPackageDBs opts,
ghcOptPackages = ghcOptPackages opts,
ghcOptHideAllPackages = ghcOptHideAllPackages opts
@@ -218,7 +218,7 @@ main = do
Just . ChResponseList <$> renderGhcOptions' lbi v res'
"ghc-lang-options":flags -> do
- res <- componentOptions lvd flags $ \opts -> mempty {
+ res <- componentOptions lvd False flags $ \opts -> mempty {
ghcOptPackageDBs = [GlobalPackageDB, UserPackageDB],
ghcOptLanguage = ghcOptLanguage opts,
@@ -286,11 +286,12 @@ componentsMap lbi v distdir f = do
reverse <$> readIORef lr
-componentOptions (lbi, v, distdir) flags f = do
+componentOptions (lbi, v, distdir) inplaceFlag flags f = do
let pd = localPkgDescr lbi
componentsMap lbi v distdir $ \c clbi bi -> let
outdir = componentOutDir lbi c
(clbi', adopts) = case flags of
+ _ | not inplaceFlag -> (clbi, mempty)
["--with-inplace"] -> (clbi, mempty)
[] -> removeInplaceDeps v lbi pd clbi
opts = componentGhcOptions normal lbi bi clbi' outdir