3 patches for repository http://darcs.haskell.org/cabal: Wed Sep 28 11:55:43 BST 2011 Max Bolingbroke * Only use -i. when compiling the Cabal package Wed Sep 28 22:08:59 BST 2011 Max Bolingbroke * Use the configured proxy even for uploading build reports Wed Sep 28 22:09:17 BST 2011 Max Bolingbroke * Allow haddock command flags to be supplied to 'cabal install' New patches: [Only use -i. when compiling the Cabal package Max Bolingbroke **20110928105543 Ignore-this: 846a3dce85b181e6ff56b131c9b918dc ] { hunk ./cabal-install/Distribution/Client/SetupWrapper.hs 295 ghcVerbosityOptions verbosity ++ ["--make", setupHsFile, "-o", setupProgFile ,"-odir", setupDir, "-hidir", setupDir - ,"-i", "-i" ++ workingDir ] + ,"-i" ] ++ ghcPackageDbOptions (usePackageDB options') ++ if packageName pkg == PackageName "Cabal" hunk ./cabal-install/Distribution/Client/SetupWrapper.hs 298 - then [] + then ["-i" ++ workingDir] else ["-package", display cabalPkgid] where cabalPkgid = PackageIdentifier (PackageName "Cabal") cabalLibVersion } [Use the configured proxy even for uploading build reports Max Bolingbroke **20110928210859 Ignore-this: 189a21577bfe5a651850feda891955e2 ] { hunk ./cabal-install/Distribution/Client/BuildReports/Upload.hs 32 type BuildLog = String uploadReports :: URI -> [(BuildReport, Maybe BuildLog)] - -> BrowserAction (HandleStream String) () -> BrowserAction (HandleStream BuildLog) () hunk ./cabal-install/Distribution/Client/BuildReports/Upload.hs 33 -uploadReports uri reports auth = do - auth +uploadReports uri reports = do forM_ reports $ \(report, mbBuildLog) -> do buildId <- postBuildReport uri report case mbBuildLog of hunk ./cabal-install/Distribution/Client/HttpUtils.hs 8 module Distribution.Client.HttpUtils ( downloadURI, getHTTP, + cabalBrowse, proxy, isOldHackageURI ) where hunk ./cabal-install/Distribution/Client/HttpUtils.hs 21 import Network.Stream ( Result, ConnError(..) ) import Network.Browser - ( Proxy (..), Authority (..), browse - , setOutHandler, setErrHandler, setProxy, request) + ( Proxy (..), Authority (..), BrowserAction, browse + , setOutHandler, setErrHandler, setProxy, setAuthorityGen, request) import Control.Monad hunk ./cabal-install/Distribution/Client/HttpUtils.hs 24 - ( mplus, join, liftM2 ) + ( mplus, join, liftM, liftM2 ) import qualified Data.ByteString.Lazy.Char8 as ByteString import Data.ByteString.Lazy (ByteString) #ifdef WIN32 hunk ./cabal-install/Distribution/Client/HttpUtils.hs 155 -- |Carry out a GET request, using the local proxy settings getHTTP :: Verbosity -> URI -> IO (Result (Response ByteString)) -getHTTP verbosity uri = do - p <- proxy verbosity - let req = mkRequest uri - (_, resp) <- browse $ do - setErrHandler (warn verbosity . ("http error: "++)) - setOutHandler (debug verbosity) - setProxy p - request req - return (Right resp) +getHTTP verbosity uri = liftM (\(_, resp) -> Right resp) $ + cabalBrowse verbosity (return ()) (request (mkRequest uri)) + +cabalBrowse :: Verbosity + -> BrowserAction s () + -> BrowserAction s a + -> IO a +cabalBrowse verbosity auth act = do + p <- proxy verbosity + browse $ do + setProxy p + setErrHandler (warn verbosity . ("http error: "++)) + setOutHandler (debug verbosity) + auth + setAuthorityGen (\_ _ -> return Nothing) + act downloadURI :: Verbosity -> URI -- ^ What to download hunk ./cabal-install/Distribution/Client/Upload.hs 7 module Distribution.Client.Upload (check, upload, report) where import Distribution.Client.Types (Username(..), Password(..),Repo(..),RemoteRepo(..)) -import Distribution.Client.HttpUtils (proxy, isOldHackageURI) +import Distribution.Client.HttpUtils (isOldHackageURI, cabalBrowse) import Distribution.Simple.Utils (debug, notice, warn, info) import Distribution.Verbosity (Verbosity) hunk ./cabal-install/Distribution/Client/Upload.hs 18 import qualified Distribution.Client.BuildReports.Upload as BuildReport import Network.Browser - ( BrowserAction, browse, request - , Authority(..), addAuthority, setAuthorityGen - , setOutHandler, setErrHandler, setProxy ) + ( BrowserAction, request + , Authority(..), addAuthority ) import Network.HTTP ( Header(..), HeaderName(..), findHeader , Request(..), RequestMethod(..), Response(..) ) hunk ./cabal-install/Distribution/Client/Upload.hs 108 Left errs -> do warn verbosity $ "Errors: " ++ errs -- FIXME Right report' -> do info verbosity $ "Uploading report for " ++ display (BuildReport.package report') - browse $ BuildReport.uploadReports (remoteRepoURI remoteRepo) [(report', Just buildLog)] auth + cabalBrowse verbosity auth $ BuildReport.uploadReports (remoteRepoURI remoteRepo) [(report', Just buildLog)] return () Right{} -> return () where hunk ./cabal-install/Distribution/Client/Upload.hs 124 -> FilePath -> IO () handlePackage verbosity uri auth path = do req <- mkRequest uri path - p <- proxy verbosity debug verbosity $ "\n" ++ show req hunk ./cabal-install/Distribution/Client/Upload.hs 125 - (_,resp) <- browse $ do - setProxy p - setErrHandler (warn verbosity . ("http error: "++)) - setOutHandler (debug verbosity) - auth - setAuthorityGen (\_ _ -> return Nothing) - request req + (_,resp) <- cabalBrowse verbosity auth $ request req debug verbosity $ show resp case rspCode resp of (2,0,0) -> do notice verbosity "Ok" } [Allow haddock command flags to be supplied to 'cabal install' Max Bolingbroke **20110928210917 Ignore-this: 89540d1841969ef97a03d102ecdc8b94 ] { hunk ./cabal-install/Distribution/Client/Install.hs 87 import qualified Distribution.Client.PackageIndex as PackageIndex import Distribution.Client.PackageIndex (PackageIndex) import Distribution.Simple.Setup - ( haddockCommand, HaddockFlags(..), emptyHaddockFlags + ( haddockCommand, HaddockFlags(..) , buildCommand, BuildFlags(..), emptyBuildFlags , toFlag, fromFlag, fromFlagOrDefault, flagToMaybe ) import qualified Distribution.Simple.Setup as Cabal hunk ./cabal-install/Distribution/Client/Install.hs 148 -> ConfigFlags -> ConfigExFlags -> InstallFlags + -> HaddockFlags -> [UserTarget] -> IO () install verbosity packageDBs repos comp conf hunk ./cabal-install/Distribution/Client/Install.hs 152 - globalFlags configFlags configExFlags installFlags userTargets0 = do + globalFlags configFlags configExFlags installFlags haddockFlags userTargets0 = do installedPkgIndex <- getInstalledPackages verbosity comp packageDBs conf sourcePkgDb <- getSourcePackages verbosity repos hunk ./cabal-install/Distribution/Client/Install.hs 183 where context :: InstallContext context = (packageDBs, repos, comp, conf, - globalFlags, configFlags, configExFlags, installFlags) + globalFlags, configFlags, configExFlags, installFlags, haddockFlags) dryRun = fromFlag (installDryRun installFlags) logMsg message rest = debug verbosity message >> rest hunk ./cabal-install/Distribution/Client/Install.hs 189 -upgrade _ _ _ _ _ _ _ _ _ _ = die $ +upgrade _ _ _ _ _ _ _ _ _ _ _ = die $ "Use the 'cabal install' command instead of 'cabal upgrade'.\n" ++ "You can install the latest version of a package using 'cabal install'. " ++ "The 'cabal upgrade' command has been removed because people found it " hunk ./cabal-install/Distribution/Client/Install.hs 209 , GlobalFlags , ConfigFlags , ConfigExFlags - , InstallFlags ) + , InstallFlags + , HaddockFlags ) -- ------------------------------------------------------------ -- * Installation planning hunk ./cabal-install/Distribution/Client/Install.hs 389 -> InstallPlan -> IO () postInstallActions verbosity - (packageDBs, _, comp, conf, globalFlags, configFlags, _, installFlags) + (packageDBs, _, comp, conf, globalFlags, configFlags, _, installFlags, _) targets installPlan = do unless oneShot $ hunk ./cabal-install/Distribution/Client/Install.hs 582 -> IO InstallPlan performInstallations verbosity (packageDBs, _, comp, conf, - globalFlags, configFlags, configExFlags, installFlags) + globalFlags, configFlags, configExFlags, installFlags, haddockFlags) installedPkgIndex installPlan = do executeInstallPlan installPlan $ \cpkg -> hunk ./cabal-install/Distribution/Client/Install.hs 592 installLocalPackage verbosity (packageId pkg) src' $ \mpath -> installUnpackedPackage verbosity (setupScriptOptions installedPkgIndex) - miscOptions configFlags' installFlags + miscOptions configFlags' installFlags haddockFlags compid pkg mpath useLogFile where hunk ./cabal-install/Distribution/Client/Install.hs 749 -> InstallMisc -> ConfigFlags -> InstallFlags + -> HaddockFlags -> CompilerId -> PackageDescription -> Maybe FilePath -- ^ Directory to change to before starting the installation. hunk ./cabal-install/Distribution/Client/Install.hs 756 -> Maybe (PackageIdentifier -> FilePath) -- ^ File to log output to (if any) -> IO BuildResult installUnpackedPackage verbosity scriptOptions miscOptions - configFlags installConfigFlags + configFlags installConfigFlags haddockFlags compid pkg workingDir useLogFile = -- Configure phase hunk ./cabal-install/Distribution/Client/Install.hs 796 buildVerbosity = toFlag verbosity' } shouldHaddock = fromFlag (installDocumentation installConfigFlags) - haddockFlags _ = emptyHaddockFlags { - haddockDistPref = configDistPref configFlags, + haddockFlags' _ = haddockFlags { haddockVerbosity = toFlag verbosity' } installFlags _ = Cabal.emptyInstallFlags { hunk ./cabal-install/Distribution/Client/Setup.hs 51 import Distribution.Simple.Command hiding (boolOpt) import qualified Distribution.Simple.Command as Command import qualified Distribution.Simple.Setup as Cabal - ( configureCommand, sdistCommand ) + ( configureCommand, sdistCommand, haddockCommand ) import Distribution.Simple.Setup hunk ./cabal-install/Distribution/Client/Setup.hs 53 - ( ConfigFlags(..), SDistFlags(..) ) + ( ConfigFlags(..), SDistFlags(..), HaddockFlags(..) ) import Distribution.Simple.Setup ( Flag(..), toFlag, fromFlag, flagToList, flagToMaybe , optionVerbosity, trueArg, falseArg ) hunk ./cabal-install/Distribution/Client/Setup.hs 228 -- older Cabal does not grok the constraints flag: | otherwise = flags { configConstraints = [] } - -- ------------------------------------------------------------ -- * Config extra flags -- ------------------------------------------------------------ hunk ./cabal-install/Distribution/Client/Setup.hs 358 commandOptions = \_ -> [optionVerbosity id const] } -upgradeCommand :: CommandUI (ConfigFlags, ConfigExFlags, InstallFlags) +upgradeCommand :: CommandUI (ConfigFlags, ConfigExFlags, InstallFlags, HaddockFlags) upgradeCommand = configureCommand { commandName = "upgrade", commandSynopsis = "(command disabled, use install instead)", hunk ./cabal-install/Distribution/Client/Setup.hs 364 commandDescription = Nothing, commandUsage = usagePackages "upgrade", - commandDefaultFlags = (mempty, mempty, mempty), + commandDefaultFlags = (mempty, mempty, mempty, mempty), commandOptions = commandOptions installCommand } hunk ./cabal-install/Distribution/Client/Setup.hs 607 where docIndexFile = toPathTemplate ("$datadir" "doc" "index.html") -installCommand :: CommandUI (ConfigFlags, ConfigExFlags, InstallFlags) +installCommand :: CommandUI (ConfigFlags, ConfigExFlags, InstallFlags, HaddockFlags) installCommand = CommandUI { commandName = "install", commandSynopsis = "Installs a list of packages.", hunk ./cabal-install/Distribution/Client/Setup.hs 626 ++ " Specific version of a package\n" ++ " " ++ pname ++ " install 'foo < 2' " ++ " Constrained package version\n", - commandDefaultFlags = (mempty, mempty, mempty), + commandDefaultFlags = (mempty, mempty, mempty, mempty), commandOptions = \showOrParseArgs -> liftOptions get1 set1 (filter ((/="constraint") . optionName) $ configureOptions showOrParseArgs) hunk ./cabal-install/Distribution/Client/Setup.hs 632 ++ liftOptions get2 set2 (configureExOptions showOrParseArgs) ++ liftOptions get3 set3 (installOptions showOrParseArgs) + ++ liftOptions get4 set4 (haddockOptions showOrParseArgs) } where hunk ./cabal-install/Distribution/Client/Setup.hs 635 - get1 (a,_,_) = a; set1 a (_,b,c) = (a,b,c) - get2 (_,b,_) = b; set2 b (a,_,c) = (a,b,c) - get3 (_,_,c) = c; set3 c (a,b,_) = (a,b,c) + get1 (a,_,_,_) = a; set1 a (_,b,c,d) = (a,b,c,d) + get2 (_,b,_,_) = b; set2 b (a,_,c,d) = (a,b,c,d) + get3 (_,_,c,_) = c; set3 c (a,b,_,d) = (a,b,c,d) + get4 (_,_,_,d) = d; set4 d (a,b,c,_) = (a,b,c,d) + + haddockOptions = filter ((`elem` ["hoogle", "html", "html-location", + "executables", "internal", "css", + "hyperlink-source", "hyperlink-sources", + "hscolour-css"]) . optionName) . + commandOptions Cabal.haddockCommand installOptions :: ShowOrParseArgs -> [OptionField InstallFlags] installOptions showOrParseArgs = hunk ./cabal-install/Main.hs 187 (configPackageDB' configFlags') (globalRepos globalFlags') comp conf configFlags' configExFlags' extraArgs -installAction :: (ConfigFlags, ConfigExFlags, InstallFlags) +installAction :: (ConfigFlags, ConfigExFlags, InstallFlags, HaddockFlags) -> [String] -> GlobalFlags -> IO () hunk ./cabal-install/Main.hs 189 -installAction (configFlags, _, installFlags) _ _globalFlags +installAction (configFlags, _, installFlags, _) _ _globalFlags | fromFlagOrDefault False (installOnly installFlags) = let verbosity = fromFlagOrDefault normal (configVerbosity configFlags) in setupWrapper verbosity defaultSetupScriptOptions Nothing hunk ./cabal-install/Main.hs 195 installCommand (const mempty) [] -installAction (configFlags, configExFlags, installFlags) +installAction (configFlags, configExFlags, installFlags, haddockFlags) extraArgs globalFlags = do let verbosity = fromFlagOrDefault normal (configVerbosity configFlags) targets <- readUserTargets verbosity extraArgs hunk ./cabal-install/Main.hs 209 (comp, conf) <- configCompilerAux' configFlags' install verbosity (configPackageDB' configFlags') (globalRepos globalFlags') - comp conf globalFlags' configFlags' configExFlags' installFlags' + comp conf globalFlags' configFlags' configExFlags' installFlags' haddockFlags targets listAction :: ListFlags -> [String] -> GlobalFlags -> IO () hunk ./cabal-install/Main.hs 253 let globalFlags' = savedGlobalFlags config `mappend` globalFlags update verbosity (globalRepos globalFlags') -upgradeAction :: (ConfigFlags, ConfigExFlags, InstallFlags) +upgradeAction :: (ConfigFlags, ConfigExFlags, InstallFlags, HaddockFlags) -> [String] -> GlobalFlags -> IO () hunk ./cabal-install/Main.hs 255 -upgradeAction (configFlags, configExFlags, installFlags) +upgradeAction (configFlags, configExFlags, installFlags, haddockFlags) extraArgs globalFlags = do let verbosity = fromFlagOrDefault normal (configVerbosity configFlags) targets <- readUserTargets verbosity extraArgs hunk ./cabal-install/Main.hs 269 (comp, conf) <- configCompilerAux' configFlags' upgrade verbosity (configPackageDB' configFlags') (globalRepos globalFlags') - comp conf globalFlags' configFlags' configExFlags' installFlags' + comp conf globalFlags' configFlags' configExFlags' installFlags' haddockFlags targets fetchAction :: FetchFlags -> [String] -> GlobalFlags -> IO () } Context: [Use a PVP-style version as the default for cabal init Duncan Coutts **20110925021722 Ignore-this: 58c054d082254c4bcf26cd4601317f2 ] [Filter autogenerated modules from test suite build info when doing sdist. Thomas Tuegel **20110923201806 Ignore-this: 6f1eb9a1af8fad0442544d05d2568db9 ] [Change extension name to "ConstraintKinds" Duncan Coutts **20110908220819 Ignore-this: a5faf4ded03ba1394278c810a8136bf2 For consistency with the rest of the extensions. Requested by SPJ. ] [Fix a typo in a QA message Duncan Coutts **20110905001515 Ignore-this: e906b589e4acea1121ac193998696751 ] [Better error message for unknown build types Duncan Coutts **20110901114046 Ignore-this: 91989561ff78edbe3d72b7d569db4561 ] [Add the ConstraintKind extension Max Bolingbroke **20110906094145 Ignore-this: 838aa67afada51bc8f023a24531a0d0d ] [Consistent import of Text.PrettyPrint David Terei **20110825180411 Ignore-this: 785b7c0aaad8b997678c1e68b90502f8 ] [Drop assertion checking in the old solver Duncan Coutts **20110818172118 Ignore-this: a516461e7f19e2aa2109fc905ac85 Make it a bit faster. ] [Update version constraint on the Cabal library, for 1.12 release. Duncan Coutts **20110818171955 Ignore-this: 870a523382e1e0cec2b5cd033c778359 ] [Add cabal sdist --zip flag for creating zip archives Duncan Coutts **20110818171721 Ignore-this: 86469c0f4f4b72d58b6278c3ef692901 Handy if you want to send sources to people who do not grok .tar.gz Requires that the 'zip' program be installed (unlike for .tar.gz where we do it internally so that it works on all systems). ] [Relax cabal-install's deps for ghc-7.2 Duncan Coutts **20110812110846 Ignore-this: 1524732bffa5cc04e5d475ec4c4f12d8 ] [Fix the repo location Duncan Coutts **20110812110820 Ignore-this: 1ed9152864fc3336c82495904b1e5612 ] [Improve the error message emitted when multiple .cabal files are found Duncan Coutts **20110508223014 Ignore-this: 1c96d4f42fe55094f07b0573bb80fda1 ] [Add Safe Haskell flags to known extensions David Terei **20110810201543 Ignore-this: 9e0a42de1539e1a56d72f9a7ecdf554c ] [Change trusted property to be true by default David Terei **20110808223228 Ignore-this: c46cf169c46b809cf457678f77e02b20 ] [Fix for intra-package build-tools dependencies Duncan Coutts **20110808165045 Ignore-this: 83f148981c7d8d3c616027975ee8f59a ] [Simplify some code in Program.Hpc slightly Duncan Coutts **20110726001531 Ignore-this: d7ea77d1f072f7071fc709e0c9a38ded ] [Added Distribution.Simple.Program.Hpc. Thomas Tuegel **20110719004251 Ignore-this: a988f4262e4f52c8ae0a3ca5715a636e ] [Restore graceful failure upon invoking "cabal test" before "cabal build". Thomas Tuegel **20110719002218 Ignore-this: 2096a4cfad17eb67ef26bb15a8b3a066 ] [Fix executable test suite unit test for improved HPC interface. Thomas Tuegel **20110718033150 Ignore-this: b543b01721940b23aac7bd46282425b1 ] [Generate aggregate coverage statistics from all test suites in package. Thomas Tuegel **20110718050448 Ignore-this: bff5f3167ab61da015b8fcb7c4f77cdc ] [Invoke HPC using D.S.Program utilities. Thomas Tuegel **20110718045949 Ignore-this: 37e1f01f594dd522c5328b397ac0e94d This patch also reorganizes the HPC output directories for consistency. All files related to HPC are now located in the "dist/hpc" directory. ] [Fix cabal haddock for packages with internal dependencies Duncan Coutts **20110718235728 Ignore-this: 86cdab6325a86875e9ae592881b4f54f ] [Update cabal sdist to follow the changes in the Cabal lib Duncan Coutts **20110717223648 Ignore-this: 1136aa98cb024a10250ea75ec8633a2c ] [Added unit test for test options. Thomas Tuegel **20110521164529 Ignore-this: 3dc94c06cdfacf20cf000682370fbf3 ] [Fixed crash on Windows due to file handle leak. Thomas Tuegel **20110518030422 Ignore-this: c94eb903aef9ffcf52394a821d245dda Ticket #843. Cabal test crashed when trying to delete a temporary log file because 'readFile' reads unnecessarily lazily and was keeping a file handle open during attempted deletion. This patch forces the entire file to be read so the handle will be closed. ] [Stop cabal-install from duplicating test options. Thomas Tuegel **20110521232047 Ignore-this: 55b98ab47306178e355cacedc7a5a6d2 ] [Fix use of multiple test options. Thomas Tuegel **20110521223029 Ignore-this: c694ad21faab23abb7157ccec700ccf2 ] [Don't prefix test output with ">>>". Thomas Tuegel **20110708035007 Ignore-this: a9d417eb836c641339a0203d1c36e82e Ticket #848. Removing the prefix brings "cabal test" in line with other cabal commands, which do not prefix their output, either. Prior to this patch, the summary notices which appear before and after each test suite were written to the temporary log file along with the stdio from the test executable; this would lead to duplicate notices when the contents of the temporary log file are read onto the console. After this patch, the summary notices are never written to the temporary log file, only to the console and the final log file (which is never read by Cabal), removing the confusing duplicate notices. ] [Fail gracefully when running "setup test" before "setup build". Thomas Tuegel **20110303164611 Ignore-this: a4d818cd7702ddbbbbffc8679abeb85d ] [Bump cabal-install version Duncan Coutts **20110708013248 Ignore-this: 16626faad564787fc5ae3808d1e6ccc9 ] [Bump Cabal lib version Duncan Coutts **20110708013245 Ignore-this: e01c7efbb68856167c227ba118ddce33 ] [Couple of trivial code changes Duncan Coutts **20110708013012 Ignore-this: b98aaac9e33f8c684cefedcd05d37ee2 ] [Fix withComponentsLBI and move Components to LocalBuildInfo module Duncan Coutts **20110708012122 Ignore-this: 57217119f7825c9bcd3824a34ecd0c8f An annoyance of the current Simple build system is that each phase (build, install, etc) can be passed additional HookedBuildInfo which gets merged into the PackageDescription. This means that we cannot process the PackageDescription up front at configure time and just store and reuse it later, we have to work from it each time afresh. The recent addition of Components (libs, exes, test suites) and a topoligical sort of the components in the LocalBuildInfo fell foul of this annoyance. The LocalBuildInfo stored the entire component which meant they were not updated with the HookedBuildInfo. This broke packages with custom Setup.hs scripts that took advantage of the HookedBuildInfo feature, including those with configure scripts. The solution is to store not the list of whole components but the list of component names. Then withComponentsLBI retrieves the actual components from the PackageDescription which thus includes the HookedBuildInfo. Also moved the Components into an internal module because (for the moment at least) it is part of the Simple build system, not part of the package description. ] [Relax some dependencies Ian Lynagh **20110706192619 Ignore-this: 6353c1d64a2fff3cef3ca0d8a9f2e95e ] [Add files needed by the GHC build system Ian Lynagh **20110624003654 Ignore-this: a40dd98104e994d1a1648c3ce2676a45 ] [Add a dash separator for pid in createTempDirectory and openBinaryTempFile too Jens Petersen **20110519021658 Ignore-this: ee0c842388212326579309ac6f93408f ] [Update changelog for 1.10.2.0 Duncan Coutts **20110618190748 Ignore-this: 64129f45dd16d2d93c82097530dc15d1 ] [TAG cabal-install merged Duncan Coutts **20110619135228 Ignore-this: 58d670de46a24046d0b869dc2b88e13a We now have both the Cabal library and the cabal-install tool together in the same repo, each in a subdir. The idea is that this will make splitting packages and moving code between package rather easier in future. ] Patch bundle hash: 028d9680e54884d2942b71a47a1e1ed7b6271c54