[commit: packages/Cabal] ghc-head: Use a non-default build dir when building add-source deps. (b272b3c)
git at git.haskell.org
git at git.haskell.org
Mon Aug 26 23:24:26 CEST 2013
Repository : ssh://git@git.haskell.org/Cabal
On branch : ghc-head
Link : http://git.haskell.org/?p=packages/Cabal.git;a=commit;h=b272b3c4b970ebf80ce7719b6d96f2bad736efd5
>---------------------------------------------------------------
commit b272b3c4b970ebf80ce7719b6d96f2bad736efd5
Author: Mikhail Glushenkov <mikhail.glushenkov at gmail.com>
Date: Sun May 5 01:03:42 2013 +0200
Use a non-default build dir when building add-source deps.
Fixes #1281.
>---------------------------------------------------------------
b272b3c4b970ebf80ce7719b6d96f2bad736efd5
cabal-install/Distribution/Client/Sandbox.hs | 4 +++-
cabal-install/Main.hs | 9 +++++++--
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/cabal-install/Distribution/Client/Sandbox.hs b/cabal-install/Distribution/Client/Sandbox.hs
index 7c460d4..5a7d45a 100644
--- a/cabal-install/Distribution/Client/Sandbox.hs
+++ b/cabal-install/Distribution/Client/Sandbox.hs
@@ -440,8 +440,10 @@ reinstallAddSourceDeps :: Verbosity
-> InstallFlags -> GlobalFlags
-> FilePath
-> IO WereDepsReinstalled
-reinstallAddSourceDeps verbosity config configFlags configExFlags
+reinstallAddSourceDeps verbosity config configFlags' configExFlags
installFlags globalFlags sandboxDir = do
+ let configFlags = configFlags'
+ { configDistPref = Flag "sandbox-dist" }
indexFile <- tryGetIndexFilePath config
buildTreeRefs <- Index.listBuildTreeRefs verbosity
Index.DontListIgnored indexFile
diff --git a/cabal-install/Main.hs b/cabal-install/Main.hs
index 6d1a860..79a2d1b 100644
--- a/cabal-install/Main.hs
+++ b/cabal-install/Main.hs
@@ -75,7 +75,7 @@ import Distribution.Client.Sandbox (sandboxInit
,dumpPackageEnvironment
,UseSandbox(..)
- ,whenUsingSandbox
+ ,isUseSandbox, whenUsingSandbox
,ForceGlobalInstall(..)
,maybeForceGlobalInstall
,loadConfigOrSandboxConfig
@@ -458,7 +458,12 @@ installAction (configFlags, configExFlags, installFlags, haddockFlags)
(configUserInstall configFlags)
targets <- readUserTargets verbosity extraArgs
- let configFlags' = savedConfigureFlags config `mappend` configFlags
+ let configFlags' =
+ let flags = savedConfigureFlags config `mappend` configFlags
+ in if isUseSandbox useSandbox
+ then flags {configDistPref = Flag "sandbox-dist"}
+ else flags
+
configExFlags' = defaultConfigExFlags `mappend`
savedConfigureExFlags config `mappend` configExFlags
installFlags' = defaultInstallFlags `mappend`
More information about the ghc-commits
mailing list