[commit: packages/Cabal] ghc-head: Revert "Try harder to pick the correct version in cabalLibVersionToUse." (b45d0c2)
git at git.haskell.org
git at git.haskell.org
Mon Aug 26 23:29:09 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=b45d0c2506ad43ae16c49b9d785f2d991b83ff42
>---------------------------------------------------------------
commit b45d0c2506ad43ae16c49b9d785f2d991b83ff42
Author: Mikhail Glushenkov <mikhail.glushenkov at gmail.com>
Date: Mon Jul 29 13:02:19 2013 +0200
Revert "Try harder to pick the correct version in cabalLibVersionToUse."
This reverts commit a17491d70741d28d9b6037640e6fb2b041fc81bc.
That commit made the logic much more convoluted and broke the following use case
(for sandboxed packages with build-type Custom):
$ cabal configure -w /path/to/ghc
$ cabal build
>---------------------------------------------------------------
b45d0c2506ad43ae16c49b9d785f2d991b83ff42
cabal-install/Distribution/Client/SetupWrapper.hs | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/cabal-install/Distribution/Client/SetupWrapper.hs b/cabal-install/Distribution/Client/SetupWrapper.hs
index c4cb43b..e33eee2 100644
--- a/cabal-install/Distribution/Client/SetupWrapper.hs
+++ b/cabal-install/Distribution/Client/SetupWrapper.hs
@@ -237,18 +237,12 @@ externalSetupMethod verbosity options pkg bt mkargs = do
cabalLibVersionToUse :: IO (Version, SetupScriptOptions)
cabalLibVersionToUse = do
savedVersion <- savedCabalVersion
- let versionRangeToUse = useCabalVersion options
case savedVersion of
- Just version | version `withinRange` versionRangeToUse
- -- If the Cabal lib version that cabal-install was compiled
- -- with can be used instead of the cached version,
- -- double-check that we really want to use the cached one.
- && (version == cabalVersion
- || not (cabalVersion `withinRange` versionRangeToUse))
+ Just version | version `withinRange` useCabalVersion options
-> return (version, options)
_ -> do (comp, conf, options') <- configureCompiler options
version <- installedCabalVersion options' comp conf
- rewriteFile setupVersionFile (show version ++ "\n")
+ writeFile setupVersionFile (show version ++ "\n")
return (version, options')
savedCabalVersion = do
More information about the ghc-commits
mailing list