[commit: packages/Cabal] ghc-head: Improve an error message. (7a8d9c0)
git at git.haskell.org
git at git.haskell.org
Mon Aug 26 23:28:57 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=7a8d9c076d0d9f668326821d352d2e199cff8fdc
>---------------------------------------------------------------
commit 7a8d9c076d0d9f668326821d352d2e199cff8fdc
Author: Mikhail Glushenkov <mikhail.glushenkov at gmail.com>
Date: Wed Jul 24 15:07:26 2013 +0200
Improve an error message.
See #1362.
>---------------------------------------------------------------
7a8d9c076d0d9f668326821d352d2e199cff8fdc
cabal-install/Distribution/Client/Install.hs | 10 +++++++++-
cabal-install/Distribution/Client/Sandbox.hs | 9 ++++++++-
2 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/cabal-install/Distribution/Client/Install.hs b/cabal-install/Distribution/Client/Install.hs
index f1addb4..24068f9 100644
--- a/cabal-install/Distribution/Client/Install.hs
+++ b/cabal-install/Distribution/Client/Install.hs
@@ -173,7 +173,7 @@ install verbosity packageDBs repos comp platform conf useSandbox mSandboxPkgInfo
userTargets0 = do
installContext <- makeInstallContext verbosity args (Just userTargets0)
- installPlan <- foldProgress logMsg die return =<<
+ installPlan <- foldProgress logMsg die' return =<<
makeInstallPlan verbosity args installContext
processInstallPlan verbosity args installContext installPlan
@@ -183,6 +183,14 @@ install verbosity packageDBs repos comp platform conf useSandbox mSandboxPkgInfo
globalFlags, configFlags, configExFlags, installFlags,
haddockFlags)
+ die' message = die (message ++ if isUseSandbox useSandbox
+ then installFailedInSandbox else [])
+ -- TODO: use a better error message, remove duplication.
+ installFailedInSandbox =
+ "Note: when using a sandbox, all packages are required to have \
+ \consistent dependencies. \
+ \Try reinstalling/unregistering the offending packages or \
+ \recreating the sandbox."
logMsg message rest = debugNoWrap verbosity message >> rest
-- TODO: Make InstallContext a proper datatype with documented fields.
diff --git a/cabal-install/Distribution/Client/Sandbox.hs b/cabal-install/Distribution/Client/Sandbox.hs
index b9ef2dc..c99592d 100644
--- a/cabal-install/Distribution/Client/Sandbox.hs
+++ b/cabal-install/Distribution/Client/Sandbox.hs
@@ -542,7 +542,7 @@ reinstallAddSourceDeps verbosity configFlags' configExFlags
-- might want to use some lower-level features this in the future.
withSandboxBinDirOnSearchPath sandboxDir $ do
installContext <- makeInstallContext verbosity args Nothing
- installPlan <- foldProgress logMsg die return =<<
+ installPlan <- foldProgress logMsg die' return =<<
makeInstallPlan verbosity args installContext
processInstallPlan verbosity args installContext installPlan
@@ -551,6 +551,13 @@ reinstallAddSourceDeps verbosity configFlags' configExFlags
readIORef retVal
where
+ die' message = die (message ++ installFailedInSandbox)
+ -- TODO: use a better error message, remove duplication.
+ installFailedInSandbox =
+ "Note: when using a sandbox, all packages are required to have \
+ \consistent dependencies. \
+ \Try reinstalling/unregistering the offending packages or \
+ \recreating the sandbox."
logMsg message rest = debugNoWrap verbosity message >> rest
topHandler' = topHandlerWith $ \_ -> do
More information about the ghc-commits
mailing list