From: Ian Lynagh Date: Wed, 3 Dec 2008 12:32:08 +0000 (+0000) Subject: We need to tell cabal-bin which version of Cabal to use X-Git-Tag: 2009-03-13~363 X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=a7ccc4e6878c9256d4634a91776f2f09ad60b117 We need to tell cabal-bin which version of Cabal to use Otherwise, if the bootstrapping compiler has a newer version, we get a mismatch between the version used to compile ghc-prim's Setup.hs and the version that installPackage uses. --- diff --git a/libraries/cabal-bin.hs b/libraries/cabal-bin.hs index ed72a1e..664480f 100644 --- a/libraries/cabal-bin.hs +++ b/libraries/cabal-bin.hs @@ -23,12 +23,12 @@ main = do unprocessedArgs <- getArgs let verbosity = verbose case unprocessedArgs of - ghc : packageConf : args -> - doit verbosity ghc packageConf args + ghc : packageConf : useCabalVersion : args -> + doit verbosity ghc packageConf useCabalVersion args _ -> die "Bad args" -doit :: Verbosity -> FilePath -> FilePath -> [String] -> IO () -doit verbosity ghc packageConf args = do +doit :: Verbosity -> FilePath -> FilePath -> String -> [String] -> IO () +doit verbosity ghc packageConf useCabalVersion args = do exists <- doesFileExist setupProg if exists then rawSystemExit verbosity setupProg args else do @@ -42,16 +42,19 @@ doit verbosity ghc packageConf args = do _ | packageName pd == PackageName "Cabal" -> -- Cabal is special...*sigh* Simple.defaultMainArgs args - | otherwise -> runSetup verbosity ghc packageConf args + | otherwise -> + runSetup verbosity ghc packageConf useCabalVersion args -runSetup :: Verbosity -> FilePath -> FilePath -> [String] -> IO () -runSetup verbosity ghc packageConf args = do +runSetup :: Verbosity -> FilePath -> FilePath -> String -> [String] -> IO () +runSetup verbosity ghc packageConf useCabalVersion args = do -- Don't bother building Setup if we are cleaning. If we need to -- build Setup in order to build, and Setup isn't built already, -- then there shouldn't be anything to clean anyway. unless cleaning $ rawSystemExit verbosity ghc ["-package-conf", packageConf, - "--make", "Setup", "-o", "Setup"] + "--make", "Setup", + "-package", "Cabal-" ++ useCabalVersion, + "-o", "Setup"] rawSystemExit verbosity "./Setup" args where cleaning = case args of "clean" : _ -> True diff --git a/mk/cabal-flags.mk b/mk/cabal-flags.mk index bfa11a8..e1ef084 100644 --- a/mk/cabal-flags.mk +++ b/mk/cabal-flags.mk @@ -7,7 +7,7 @@ GHC_PKG_INSTALL_PROG = $(FPTOOLS_TOP_ABS)/utils/ghc-pkg/dist-install/build/ghc-p LIBRARIES_ABS = $(FPTOOLS_TOP_ABS)/libraries UTILS_ABS = $(FPTOOLS_TOP_ABS)/utils -CABAL = $(LIBRARIES_ABS)/cabal-bin $(GHC) $(LIBRARIES_ABS)/bootstrapping.conf +CABAL = $(LIBRARIES_ABS)/cabal-bin $(GHC) $(LIBRARIES_ABS)/bootstrapping.conf $(CABAL_DOTTED_VERSION) INSTALL_PACKAGE = \ $(UTILS_ABS)/installPackage/install-inplace/bin/installPackage STAGE3_PACKAGE_CONF = $(FPTOOLS_TOP_ABS)/stage3.package.conf