From 73edf0fccfe8119be7b8c3d6269f9825b56598ad Mon Sep 17 00:00:00 2001 From: Daniel Gröber Date: Fri, 19 Jun 2015 12:25:09 +0200 Subject: 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. --- CabalHelper/Main.hs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'CabalHelper/Main.hs') 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 -- cgit v1.2.3