Ticket #382: CabalInteractive.patch

File CabalInteractive.patch, 108.8 KB (added by batterseapower, 3 years ago)

Implementation of 'cabal interactive' in the Cabal library

Line 
1Thu May 28 01:02:39 BST 2009  Max Bolingbroke <batterseapower@hotmail.com>
2  * Rather ugly patch to add 'cabal interactive' support
3
4New patches:
5
6[Rather ugly patch to add 'cabal interactive' support
7Max Bolingbroke <batterseapower@hotmail.com>**20090528000239] {
8hunk ./Distribution/PackageDescription.hs 62
9-        withLib,
10+        withLib, withLib_,
11hunk ./Distribution/PackageDescription.hs 69
12-        withExe,
13+        withExe, withExe_,
14hunk ./Distribution/PackageDescription.hs 258
15-withLib :: PackageDescription -> (Library -> IO ()) -> IO ()
16-withLib pkg_descr f =
17-   maybe (return ()) f (maybeHasLibs pkg_descr)
18+withLib :: PackageDescription -> a -> (Library -> IO a) -> IO a
19+withLib pkg_descr def f =
20+   maybe (return def) f (maybeHasLibs pkg_descr)
21+
22+withLib_ :: PackageDescription -> (Library -> IO ()) -> IO ()
23+withLib_ pkg_descr f = withLib pkg_descr () f >> return ()
24hunk ./Distribution/PackageDescription.hs 308
25-withExe :: PackageDescription -> (Executable -> IO ()) -> IO ()
26+withExe :: PackageDescription -> (Executable -> IO a) -> IO [a]
27hunk ./Distribution/PackageDescription.hs 310
28-  sequence_ [f exe | exe <- executables pkg_descr, buildable (buildInfo exe)]
29+  sequence [f exe | exe <- executables pkg_descr, buildable (buildInfo exe)]
30+
31+withExe_ :: PackageDescription -> (Executable -> IO a) -> IO ()
32+withExe_ pkg_descr f = withExe pkg_descr f >> return ()
33hunk ./Distribution/Simple/Build.hs 50
34+    interactive,
35hunk ./Distribution/Simple/Build.hs 71
36-         , Library(..), withLib, Executable(..), withExe )
37+         , Library(..), withLib_, Executable(..), withExe_ )
38hunk ./Distribution/Simple/Build.hs 75
39-         ( BuildFlags(..), fromFlag )
40+         ( BuildFlags(..), InteractiveFlags(..), fromFlag )
41hunk ./Distribution/Simple/Build.hs 113
42-  withLib pkg_descr $ \lib -> do
43+  withLib_ pkg_descr $ \lib -> do
44hunk ./Distribution/Simple/Build.hs 118
45-  withExe pkg_descr $ \exe -> do
46+  withExe_ pkg_descr $ \exe -> do
47hunk ./Distribution/Simple/Build.hs 145
48+interactive :: PackageDescription  -- ^mostly information from the .cabal file
49+            -> LocalBuildInfo -- ^Configuration information
50+            -> InteractiveFlags -- ^Flags that the user passed to interactive
51+            -> [ PPSuffixHandler ] -- ^preprocessors to run before compiling
52+            -> IO ()
53+interactive pkg_descr lbi flags suffixes = do
54+  let distPref  = fromFlag (interactiveDistPref flags)
55+      verbosity = fromFlag (interactiveVerbosity flags)
56+  initialBuildSteps distPref pkg_descr lbi verbosity suffixes
57+  setupMessage verbosity "Entering interactive mode" (packageId pkg_descr)
58+  case compilerFlavor (compiler lbi) of
59+    GHC  -> GHC.interactive  pkg_descr lbi flags
60+    _    -> die ("The interactive prompt is not supported for this compiler.")
61+
62hunk ./Distribution/Simple/GHC.hs 67
63+        interactive,
64hunk ./Distribution/Simple/GHC.hs 75
65-         ( CopyFlags(..), fromFlag )
66+         ( CopyFlags(..), InteractiveFlags(..), fromFlag )
67hunk ./Distribution/Simple/GHC.hs 77
68-         ( PackageDescription(..), BuildInfo(..), Executable(..), withExe
69-         , Library(..), libModules, hcOptions )
70+         ( PackageDescription(..), BuildInfo(..)
71+         , Executable(..), hasExes, withExe, withExe_
72+         , Library(..), hasLibs, withLib, libModules, hcOptions )
73hunk ./Distribution/Simple/GHC.hs 666
74+          ++ ["--make"]
75hunk ./Distribution/Simple/GHC.hs 703
76-    filterHcOptions p hcoptss =
77-      [ (hc, if hc == GHC then filter p opts else opts)
78-      | (hc, opts) <- hcoptss ]
79+
80+-- | Filter the "-prof" flag when using GHCi
81+hackProfFlagForGhci :: Verbosity -> BuildInfo -> IO BuildInfo
82+hackProfFlagForGhci verbosity bi
83+  | not ("-prof" `elem` hcOptions GHC bi) = return bi
84+  | otherwise = do
85+    warn verbosity $ "The ghc flag '-prof' is not compatible with GHCi. It will be disabled."
86+    return bi { options = filterHcOptions (/= "-prof") (options bi) }
87+
88+filterHcOptions :: (a -> Bool) -> [(CompilerFlavor, [a])] -> [(CompilerFlavor, [a])]
89+filterHcOptions p hcoptss =
90+  [ (hc, if hc == GHC then filter p opts else opts)
91+  | (hc, opts) <- hcoptss ]
92hunk ./Distribution/Simple/GHC.hs 744
93-        ["--make"]
94-     ++ ghcVerbosityOptions verbosity
95+        ghcVerbosityOptions verbosity
96hunk ./Distribution/Simple/GHC.hs 817
97+-- -----------------------------------------------------------------------------
98+-- Interactive
99+
100+-- |Interactive prompt for GHC.
101+interactive :: PackageDescription -> LocalBuildInfo -> InteractiveFlags -> IO ()
102+interactive pkg_descr lbi flags = do
103+  let verbosity = fromFlag (interactiveVerbosity flags)
104+      pref = buildDir lbi
105+      pkgid = packageId pkg_descr
106+      runGhcProg = rawSystemProgramConf verbosity ghcProgram (withPrograms lbi)
107+     
108+      -- Prepare lib
109+      prepareLib lib = do
110+          info verbosity "Preparing library..."
111+         
112+          let Just clbi = libraryConfig lbi
113+          libBi <- hackProfFlagForGhci verbosity (libBuildInfo lib)
114+         
115+          let libTargetDir = pref
116+          createDirectoryIfMissingVerbose verbosity True libTargetDir
117+          -- TODO: do we need to put hs-boot files into place for mutually recurive modules?
118+         
119+          let args = ["-package-name", display pkgid ]
120+                  ++ constructGHCCmdLine lbi libBi clbi libTargetDir verbosity
121+          return (map display (exposedModules lib), args)
122+     
123+      -- Prepare executable
124+      prepareExe exe@Executable { exeName = exeName', modulePath = modPath } = do
125+          info verbosity $ "Preparing executable: " ++ exeName' ++ "..."
126+         
127+          let Just clbi = lookup exeName' (executableConfigs lbi)
128+          exeBi <- hackProfFlagForGhci verbosity (buildInfo exe)
129+         
130+          let targetDir = pref </> exeName'
131+          let exeDir    = targetDir </> (exeName' ++ "-tmp")
132+          createDirectoryIfMissingVerbose verbosity True targetDir
133+          createDirectoryIfMissingVerbose verbosity True exeDir
134+          -- TODO: do we need to put hs-boot files into place for mutually recursive modules?
135+          -- FIX: what about exeName.hi-boot?
136+         
137+          -- build executables
138+          unless (null (cSources exeBi)) $ do
139+           info verbosity "Building C Sources."
140+           sequence_ [do let (odir,args) = constructCcCmdLine lbi exeBi clbi
141+                                                  exeDir filename verbosity
142+                         createDirectoryIfMissingVerbose verbosity True odir
143+                         runGhcProg args
144+                     | filename <- cSources exeBi]
145+         
146+          srcMainFile <- findFile (exeDir : hsSourceDirs exeBi) modPath
147+         
148+          let cObjs = map (`replaceExtension` objExtension) (cSources exeBi)
149+              args = constructGHCCmdLine lbi exeBi clbi exeDir verbosity
150+                  ++ [exeDir </> x | x <- cObjs]
151+                  ++ ["-optl" ++ opt | opt <- PD.ldOptions exeBi]
152+                  ++ ["-l"++lib | lib <- extraLibs exeBi]
153+                  ++ ["-L"++libDir | libDir <- extraLibDirs exeBi]
154+                  ++ concat [["-framework", f] | f <- PD.frameworks exeBi]
155+          return ([srcMainFile], args)
156+     
157+      prepareExes = do
158+          (defaults, argss) <- fmap unzip $ withExe pkg_descr prepareExe
159+          return (concat defaults, concat argss)
160+     
161+  -- Work out the actual module names that we are going to pass to GHCi.
162+  -- In particular, if we didn't get any module names at all we need to infer some.
163+  let moduleNms = interactiveModules flags
164+  (toLoad, allArguments) <- case moduleNms of
165+      [] -- Default to the first EXE, if available - otherwise use the exposed modules of the library
166+         | hasExes pkg_descr -> prepareExes
167+         | hasLibs pkg_descr -> withLib pkg_descr ([], []) prepareLib
168+         | otherwise         -> die $ "No suitable target for execution with GHCi found - make sure" ++
169+                                      "you have at least one buildable library or executable"
170+      _ -> do -- In general the given flags will refer to both libraries and executable, so prepare both
171+              (_ignore_def1, exeArguments) <- prepareExes
172+              -- Prepare only those libraries that have modules in the list
173+              let conditionallyPrepareLibrary lib | null (libModules lib `intersect` moduleNms) = return ([], [])
174+                                                  | otherwise                                   = prepareLib lib
175+              (_ignore_def2, libArguments) <- withLib pkg_descr ([], []) conditionallyPrepareLibrary
176+              return $ (map display moduleNms, exeArguments ++ libArguments)
177+
178+  -- We're finally ready to run GHCi!
179+  let ghciArgs = ["--interactive"]
180+                 -- Just concatenating the arguments is sort of a hack, as the arguments will
181+                 -- probably contain duplicates and contradictory information in general (as
182+                 -- they may have been gathered from all libraries and executables in the package)
183+                 ++ allArguments
184+                 ++ toLoad
185+  runGhcProg ghciArgs
186+
187hunk ./Distribution/Simple/GHC.hs 922
188-         withExe pkg_descr $ \Executable { exeName = e } -> do
189+         withExe_ pkg_descr $ \Executable { exeName = e } -> do
190hunk ./Distribution/Simple/Haddock.hs 59
191-          Library(..), hasLibs, withLib,
192-          Executable(..), withExe)
193+          Library(..), hasLibs, withLib_,
194+          Executable(..), withExe_)
195hunk ./Distribution/Simple/Haddock.hs 200
196-    withLib pkg_descr $ \lib -> do
197+    withLib_ pkg_descr $ \lib -> do
198hunk ./Distribution/Simple/Haddock.hs 209
199-      withExe pkg_descr $ \exe -> do
200+      withExe_ pkg_descr $ \exe -> do
201hunk ./Distribution/Simple/Haddock.hs 471
202-    withLib pkg_descr $ \lib -> do
203+    withLib_ pkg_descr $ \lib -> do
204hunk ./Distribution/Simple/Haddock.hs 477
205-         withExe pkg_descr $ \exe -> do
206+         withExe_ pkg_descr $ \exe -> do
207hunk ./Distribution/Simple/Hugs.hs 52
208-           Executable(..), withExe, Library(..), withLib, libModules )
209+           Executable(..), withExe_, Library(..), withLib_, libModules )
210hunk ./Distribution/Simple/Hugs.hs 382
211-    withLib pkg_descr $ \ lib ->
212+    withLib_ pkg_descr $ \ lib ->
213hunk ./Distribution/Simple/Hugs.hs 388
214-    withExe pkg_descr $ \ exe -> do
215+    withExe_ pkg_descr $ \ exe -> do
216hunk ./Distribution/Simple/Install.hs 50
217-        hasLibs, withLib, hasExes, withExe )
218+        hasLibs, withLib_, hasExes, withExe_ )
219hunk ./Distribution/Simple/Install.hs 146
220-     GHC  -> do withLib pkg_descr $ \_ ->
221+     GHC  -> do withLib_ pkg_descr $ \_ ->
222hunk ./Distribution/Simple/Install.hs 148
223-                withExe pkg_descr $ \_ ->
224+                withExe_ pkg_descr $ \_ ->
225hunk ./Distribution/Simple/Install.hs 150
226-     LHC  -> do withLib pkg_descr $ \_ ->
227+     LHC  -> do withLib_ pkg_descr $ \_ ->
228hunk ./Distribution/Simple/Install.hs 152
229-                withExe pkg_descr $ \_ ->
230+                withExe_ pkg_descr $ \_ ->
231hunk ./Distribution/Simple/Install.hs 154
232-     JHC  -> do withLib pkg_descr $ JHC.installLib verbosity libPref buildPref pkg_descr
233-                withExe pkg_descr $ JHC.installExe verbosity binPref buildPref (progPrefixPref, progSuffixPref) pkg_descr
234+     JHC  -> do withLib_ pkg_descr $ JHC.installLib verbosity libPref buildPref pkg_descr
235+                withExe_ pkg_descr $ JHC.installExe verbosity binPref buildPref (progPrefixPref, progSuffixPref) pkg_descr
236hunk ./Distribution/Simple/Install.hs 160
237-     NHC  -> do withLib pkg_descr $ NHC.installLib verbosity libPref buildPref (packageId pkg_descr)
238-                withExe pkg_descr $ NHC.installExe verbosity binPref buildPref (progPrefixPref, progSuffixPref)
239+     NHC  -> do withLib_ pkg_descr $ NHC.installLib verbosity libPref buildPref (packageId pkg_descr)
240+                withExe_ pkg_descr $ NHC.installExe verbosity binPref buildPref (progPrefixPref, progSuffixPref)
241hunk ./Distribution/Simple/LHC.hs 74
242-         ( PackageDescription(..), BuildInfo(..), Executable(..), withExe
243+         ( PackageDescription(..), BuildInfo(..), Executable(..), withExe_
244hunk ./Distribution/Simple/LHC.hs 685
245-         withExe pkg_descr $ \Executable { exeName = e } -> do
246+         withExe_ pkg_descr $ \Executable { exeName = e } -> do
247hunk ./Distribution/Simple/PreProcess.hs 65
248-         ( PackageDescription(..), BuildInfo(..), Executable(..), withExe
249-         , Library(..), withLib, libModules )
250+         ( PackageDescription(..), BuildInfo(..), Executable(..), withExe_
251+         , Library(..), withLib_, libModules )
252hunk ./Distribution/Simple/PreProcess.hs 182
253-    withLib pkg_descr $ \ lib -> do
254+    withLib_ pkg_descr $ \ lib -> do
255hunk ./Distribution/Simple/PreProcess.hs 188
256-                  | modu <- libModules lib ]
257+                  | modu <- libModules lib]
258hunk ./Distribution/Simple/PreProcess.hs 191
259-    withExe pkg_descr $ \ theExe -> do
260+    withExe_ pkg_descr $ \ theExe -> do
261hunk ./Distribution/Simple/Setup.hs 61
262-  GlobalFlags(..),   emptyGlobalFlags,   defaultGlobalFlags,   globalCommand,
263-  ConfigFlags(..),   emptyConfigFlags,   defaultConfigFlags,   configureCommand,
264-  CopyFlags(..),     emptyCopyFlags,     defaultCopyFlags,     copyCommand,
265-  InstallFlags(..),  emptyInstallFlags,  defaultInstallFlags,  installCommand,
266-  HaddockFlags(..),  emptyHaddockFlags,  defaultHaddockFlags,  haddockCommand,
267-  HscolourFlags(..), emptyHscolourFlags, defaultHscolourFlags, hscolourCommand,
268-  BuildFlags(..),    emptyBuildFlags,    defaultBuildFlags,    buildCommand,
269-  buildVerbose,
270-  CleanFlags(..),    emptyCleanFlags,    defaultCleanFlags,    cleanCommand,
271-  RegisterFlags(..), emptyRegisterFlags, defaultRegisterFlags, registerCommand,
272-                                                               unregisterCommand,
273-  SDistFlags(..),    emptySDistFlags,    defaultSDistFlags,    sdistCommand,
274-  TestFlags(..),     emptyTestFlags,     defaultTestFlags,     testCommand,
275+  GlobalFlags(..),      emptyGlobalFlags,      defaultGlobalFlags,      globalCommand,
276+  ConfigFlags(..),      emptyConfigFlags,      defaultConfigFlags,      configureCommand,
277+  CopyFlags(..),        emptyCopyFlags,        defaultCopyFlags,        copyCommand,
278+  InstallFlags(..),     emptyInstallFlags,     defaultInstallFlags,     installCommand,
279+  HaddockFlags(..),     emptyHaddockFlags,     defaultHaddockFlags,     haddockCommand,
280+  HscolourFlags(..),    emptyHscolourFlags,    defaultHscolourFlags,    hscolourCommand,
281+  BuildFlags(..),       emptyBuildFlags,       defaultBuildFlags,       buildCommand,
282+  buildVerbose,                                                         
283+  CleanFlags(..),       emptyCleanFlags,       defaultCleanFlags,       cleanCommand,
284+  RegisterFlags(..),    emptyRegisterFlags,    defaultRegisterFlags,    registerCommand,
285+                                                                        unregisterCommand,
286+  SDistFlags(..),       emptySDistFlags,       defaultSDistFlags,       sdistCommand,
287+  TestFlags(..),        emptyTestFlags,        defaultTestFlags,        testCommand,
288+  InteractiveFlags(..), emptyInteractiveFlags, defaultInteractiveFlags, interactiveCommand,
289hunk ./Distribution/Simple/Setup.hs 92
290+import Distribution.ModuleName ( ModuleName )
291hunk ./Distribution/Simple/Setup.hs 1235
292+-- ------------------------------------------------------------
293+-- * Interactive flags
294+-- ------------------------------------------------------------
295+
296+data InteractiveFlags = InteractiveFlags {
297+    interactiveProgramPaths :: [(String, FilePath)],
298+    interactiveProgramArgs :: [(String, [String])],
299+    interactiveDistPref :: Flag FilePath,
300+    interactiveVerbosity :: Flag Verbosity,
301+    interactiveModules :: [ModuleName]
302+  }
303+  deriving Show
304+
305+defaultInteractiveFlags :: InteractiveFlags
306+defaultInteractiveFlags = InteractiveFlags {
307+    interactiveProgramPaths = [],
308+    interactiveProgramArgs = [],
309+    interactiveDistPref = Flag defaultDistPref,
310+    interactiveVerbosity = Flag normal,
311+    interactiveModules = []
312+  }
313+
314+interactiveCommand :: ProgramConfiguration -> CommandUI InteractiveFlags
315+interactiveCommand progConf = CommandUI {
316+    commandName         = "interactive",
317+    commandSynopsis     = "Open a part of the package in the interative prompt",
318+    commandDescription  = Nothing,
319+    commandUsage        = \pname ->
320+         "Usage: " ++ pname ++ " interactive [MODULES]",
321+         -- NB: can't use @makeCommand@ because here we accept [MODULES], not [FLAGS]
322+    commandDefaultFlags = defaultInteractiveFlags,
323+    commandOptions      = \showOrParseArgs ->
324+      [optionVerbosity interactiveVerbosity (\v flags -> flags { interactiveVerbosity = v })
325+      ,optionDistPref
326+          interactiveDistPref (\d flags -> flags { interactiveDistPref = d })
327+          showOrParseArgs
328+      ] ++ programConfigurationPaths progConf showOrParseArgs
329+             interactiveProgramPaths (\v flags -> flags { interactiveProgramPaths = v})
330+        ++ programConfigurationOptions progConf showOrParseArgs
331+             interactiveProgramArgs (\v flags -> flags { interactiveProgramArgs = v})
332+  }
333+
334+emptyInteractiveFlags :: TestFlags
335+emptyInteractiveFlags  = mempty
336+
337+instance Monoid InteractiveFlags where
338+  mempty = InteractiveFlags {
339+    interactiveProgramPaths = mempty,
340+    interactiveProgramArgs  = mempty,
341+    interactiveDistPref     = mempty,
342+    interactiveVerbosity    = mempty,
343+    interactiveModules      = mempty
344+  }
345+  mappend a b = InteractiveFlags {
346+    interactiveProgramPaths = combine interactiveProgramPaths,
347+    interactiveProgramArgs  = combine interactiveProgramArgs,
348+    interactiveDistPref     = combine interactiveDistPref,
349+    interactiveVerbosity    = combine interactiveVerbosity,
350+    interactiveModules      = combine interactiveModules
351+  }
352+    where combine field = field a `mappend` field b
353+
354hunk ./Distribution/Simple/SrcDist.hs 153
355-  withLib $ \Library { exposedModules = modules, libBuildInfo = libBi } ->
356+  withLib_ $ \Library { exposedModules = modules, libBuildInfo = libBi } ->
357hunk ./Distribution/Simple/SrcDist.hs 156
358-  withExe $ \Executable { modulePath = mainPath, buildInfo = exeBi } -> do
359+  withExe_ $ \Executable { modulePath = mainPath, buildInfo = exeBi } -> do
360hunk ./Distribution/Simple/SrcDist.hs 178
361-  withLib $ \ l -> do
362+  withLib_ $ \ l -> do
363hunk ./Distribution/Simple/SrcDist.hs 221
364-    withLib action = maybe (return ()) action (library pkg_descr)
365-    withExe action = mapM_ action (executables pkg_descr)
366+    withLib_ action = maybe (return ()) action (library pkg_descr)
367+    withExe_ action = mapM_ action (executables pkg_descr)
368hunk ./Distribution/Simple/UserHooks.hs 69
369-          HaddockFlags)
370+          HaddockFlags, InteractiveFlags)
371hunk ./Distribution/Simple/UserHooks.hs 109
372+    -- |Hook to run before interactive command.  Second arg indicates verbosity level.
373+    preInteractive  :: Args -> InteractiveFlags -> IO HookedBuildInfo,
374+
375+    -- |Over-ride this hook to get different behavior during interactive.
376+    interactiveHook :: PackageDescription -> LocalBuildInfo -> UserHooks -> InteractiveFlags -> IO (),
377+    -- |Hook to run after interactive command.  Second arg indicates verbosity level.
378+    postInteractive :: Args -> InteractiveFlags -> PackageDescription -> LocalBuildInfo -> IO (),
379+
380hunk ./Distribution/Simple/UserHooks.hs 190
381+      preInteractive = rn,
382+      interactiveHook = ru,
383+      postInteractive = ru,
384hunk ./Distribution/Simple.hs 95
385-import Distribution.Simple.Build        ( build )
386+import Distribution.Simple.Build        ( build, interactive )
387hunk ./Distribution/Simple.hs 118
388-         ( display )
389+         ( display, simpleParse )
390hunk ./Distribution/Simple.hs 183
391-      [configureCommand progs `commandAddAction` configureAction    hooks
392-      ,buildCommand     progs `commandAddAction` buildAction        hooks
393-      ,installCommand         `commandAddAction` installAction      hooks
394-      ,copyCommand            `commandAddAction` copyAction         hooks
395-      ,haddockCommand         `commandAddAction` haddockAction      hooks
396-      ,cleanCommand           `commandAddAction` cleanAction        hooks
397-      ,sdistCommand           `commandAddAction` sdistAction        hooks
398-      ,hscolourCommand        `commandAddAction` hscolourAction     hooks
399-      ,registerCommand        `commandAddAction` registerAction     hooks
400-      ,unregisterCommand      `commandAddAction` unregisterAction   hooks
401-      ,testCommand            `commandAddAction` testAction         hooks
402+      [configureCommand progs   `commandAddAction` configureAction    hooks
403+      ,buildCommand     progs   `commandAddAction` buildAction        hooks
404+      ,installCommand           `commandAddAction` installAction      hooks
405+      ,copyCommand              `commandAddAction` copyAction         hooks
406+      ,haddockCommand           `commandAddAction` haddockAction      hooks
407+      ,cleanCommand             `commandAddAction` cleanAction        hooks
408+      ,sdistCommand             `commandAddAction` sdistAction        hooks
409+      ,hscolourCommand          `commandAddAction` hscolourAction     hooks
410+      ,registerCommand          `commandAddAction` registerAction     hooks
411+      ,unregisterCommand        `commandAddAction` unregisterAction   hooks
412+      ,testCommand              `commandAddAction` testAction         hooks
413+      ,interactiveCommand progs `commandAddAction` interactiveAction  hooks
414hunk ./Distribution/Simple.hs 331
415+interactiveAction :: UserHooks -> InteractiveFlags -> Args -> IO ()
416+interactiveAction hooks flags args = do
417+  let distPref  = fromFlag $ interactiveDistPref flags
418+      verbosity = fromFlag $ interactiveVerbosity flags
419+
420+  lbi <- getBuildConfig hooks distPref
421+  progs <- reconfigurePrograms verbosity
422+             (interactiveProgramPaths flags)
423+             (interactiveProgramArgs flags)
424+             (withPrograms lbi)
425+
426+  let consumeModulePrefix (True, moduleNms, realArgs) currentArg = (True, moduleNms, currentArg : realArgs)
427+      consumeModulePrefix (False, moduleNms, realArgs) currentArg = case simpleParse currentArg of
428+        Just moduleNm -> (False, moduleNm : moduleNms, realArgs)
429+        Nothing       -> (True, moduleNms, currentArg : realArgs)
430+      (_, finalModuleNms, finalRealArgs) = foldl consumeModulePrefix (False, [], []) args
431+      flagsWithMods = flags { interactiveModules = reverse finalModuleNms }
432+
433+  hookedAction preInteractive interactiveHook postInteractive
434+               (return lbi { withPrograms = progs })
435+               hooks flagsWithMods (reverse finalRealArgs)
436+
437hunk ./Distribution/Simple.hs 445
438+       interactiveHook = defaultInteractiveHook,
439hunk ./Distribution/Simple.hs 571
440+defaultInteractiveHook :: PackageDescription -> LocalBuildInfo
441+        -> UserHooks -> InteractiveFlags -> IO ()
442+defaultInteractiveHook pkg_descr localbuildinfo hooks flags = do
443+  interactive pkg_descr localbuildinfo flags (allSuffixHandlers hooks)
444+
445}
446
447Context:
448
449[Use componentPackageDeps, remove packageDeps, add externalPackageDeps
450Duncan Coutts <duncan@haskell.org>**20090527225016
451 So now when building, we actually use per-component set of package deps.
452 There's no actual change in behaviour yet as we're still setting each of
453 the componentPackageDeps to the union of all the package deps.
454]
455[Pass ComponentLocalBuildInfo to the buildLib/Exe
456Duncan Coutts <duncan@haskell.org>**20090527210731
457 Not yet used
458]
459[Simplify writeInstalledConfig slightly
460Duncan Coutts <duncan@haskell.org>**20090527204755]
461[No need to drop dist/installed-pkg-config after every build
462Duncan Coutts <duncan@haskell.org>**20090527204500
463 We generate this file if necessary when registering.
464]
465[Make absoluteInstallDirs only take the package id
466Duncan Coutts <duncan@haskell.org>**20090527203112
467 It doesn't need the entire PackageDescription
468]
469[Rejig calls to per-compiler build functions
470Duncan Coutts <duncan@haskell.org>**20090527195146
471 So it's now a bit clearer what is going on in the generic build code
472 Also shift info calls up to generic code
473]
474[Split nhc and hugs's build action into buildLib and buildExe
475Duncan Coutts <duncan@haskell.org>**20090527194206]
476[Split JHC's build into buildLib and buildExe
477Duncan Coutts <duncan@haskell.org>**20090527192036]
478[Sync LHC module from GHC module
479Duncan Coutts <duncan@haskell.org>**20090527191615]
480[Give withLib and withExe sensible types
481Duncan Coutts <duncan@haskell.org>**20090527185634]
482[Fix types of libModules and exeModules
483Duncan Coutts <duncan@haskell.org>**20090527185108
484 Take a Library/Executable rather than a PackageDescription
485 Means we're more precise in using it, just passing the info we need.
486]
487[Split ghc's build action into buildLib and buildExe
488Duncan Coutts <duncan@haskell.org>**20090527183250]
489[Remove unused ghc-only executable wrapper feature
490Duncan Coutts <duncan@haskell.org>**20090527183245
491 Some kind of shell script wrapper feature might be useful,
492 but we should design it properly.
493]
494[Fixup .cabal file with the removed modules and files
495Duncan Coutts <duncan@haskell.org>**20090527182344]
496[Fix warnings about unused definitions and imports
497Duncan Coutts <duncan@haskell.org>**20090527175253]
498[Remove the makefile generation feature
499Duncan Coutts <duncan@haskell.org>**20090527175002
500 It was an ugly hack and ghc no longer uses it.
501]
502[Add new ComponentLocalBuildInfo
503Duncan Coutts <duncan@haskell.org>**20090527174418
504 We want to have each component have it's own dependencies,
505 rather than using the union of deps of the whole package.
506]
507[Ticket #89 part 2: Dependency-related test cases and a simple test harness
508rubbernecking.trumpet.stephen@blacksapphire.com**20090526133509
509 Ignore-this: 830dd56363c34d8edff65314cd8ccb2
510 The purpose of these tests is mostly to pin down some existing behaviour to
511 ensure it doesn't get broken by the ticket #89 changes.
512]
513[Ticket #89 part 1: add targetBuildDepends field to PackageDescription's target-specific BuildInfos
514rubbernecking.trumpet.stephen@blacksapphire.com**20090526133729
515 Ignore-this: 96572adfad12ef64a51dce2f7c5f738
516 This provides dependencies specifically for each library and executable target.
517 buildDepends is calculated as the union of the individual targetBuildDepends,
518 giving a result that's exactly equivalent to the old behaviour.
519]
520[LHC: register the external core files.
521Lemmih <lemmih@gmail.com>**20090521021511
522 Ignore-this: d4e484d7b8e541c3ec4cb35ba8aba4d0
523]
524[Update the support for LHC.
525Lemmih <lemmih@gmail.com>**20090515211659
526 Ignore-this: 2884d3eca0596a441e3b3c008e16fd6f
527]
528[Print a more helpful message when haddock's ghc version doesn't match
529Duncan Coutts <duncan@haskell.org>**20090422093240
530 Eg now says something like:
531 cabal: Haddock's internal GHC version must match the configured GHC version.
532 The GHC version is 6.8.2 but haddock is using GHC version 6.10.1
533]
534[use -D__HADDOCK__ only when preprocessing for haddock < 2
535Andrea Vezzosi <sanzhiyan@gmail.com>**20090302015137
536 Ignore-this: d186a5dbebe6d7fdc64e6414493c6271
537 haddock-2.x doesn't define any additional macros.
538]
539[Make die use an IOError that gets handled at the top level
540Duncan Coutts <duncan@haskell.org>**20090301195143
541 Rather than printing the error there and then and throwing an
542 exit exception. The top handler now catches IOErrors and
543 formats and prints them before throwing an exit exception.
544 Fixes ticket #512.
545]
546[rewrite of Distribution.Simple.Haddock
547Andrea Vezzosi <sanzhiyan@gmail.com>**20090219153738
548 Ignore-this: 5b465b2b0f5ee001caa0cb19355d6fce
549 In addition to (hopefully) making clear what's going on
550 we now do the additional preprocessing for all the versions of haddock
551 (but not for hscolour) and we run cpp before moving the files.
552]
553[Allow --with-ghc to be specified when running Cabal
554Ian Lynagh <igloo@earth.li>**20090225172249]
555[fix imports for non-GHC
556Ross Paterson <ross@soi.city.ac.uk>**20090221164939
557 Ignore-this: 12756e3863e312352d5f6c69bba63b92
558]
559[Fix user guide docs about --disable-library-vanilla
560Duncan Coutts <duncan@haskell.org>**20090219165539
561 It is not default. Looks like it was a copy and paste error.
562]
563[Specify a temp output file for the header/lib checks
564Duncan Coutts <duncan@haskell.org>**20090218233928
565 Otherwise we litter the current dir with a.out and *.o files.
566]
567[Final changelog updates for 1.6.0.2
568Duncan Coutts <duncan@haskell.org>**20090218222106]
569[Use more cc options when checking for header files and libs
570Duncan Coutts <duncan@haskell.org>**20090218110520
571 Use -I. to simulate the search path that gets used when we tell ghc
572 to -#include something. Also use the include dirs and cc options of
573 dependent packages. These two changes fix about 3 packages each.
574]
575[Validate the docbook xml before processing.
576Duncan Coutts <duncan@haskell.org>**20090213134136
577 Apparently xsltproc does not validate against the dtd.
578 This should stop errors creaping back in.
579]
580[Make documentation validate
581Samuel Bronson <naesten@gmail.com>**20090212235057]
582[Folly the directions for docbook-xsl
583Samuel Bronson <naesten@gmail.com>**20090213022615
584 As it says in http://docbook.sourceforge.net/release/xsl/current/README:
585 
586   - Use the base canonical URI in combination with one of the
587     pathnames below. For example, for "chunked" HTML, output:
588 
589     http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl
590 
591]
592[Fix compat functions for setting file permissions on windows
593Duncan Coutts <duncan@haskell.org>**20090205224415
594 Spotted by Dominic Steinitz
595]
596[Only print message about ignoring -threaded if its actually present
597Duncan Coutts <duncan@haskell.org>**20090206174707]
598[Don't build ghci lib if we're not making vanilla libs
599Duncan Coutts <duncan@haskell.org>**20090206173914
600 As the .o files will not exist.
601]
602[Correct docdir -> mandir in InstallDirs
603Samuel Bronson <naesten@gmail.com>**20090203043338]
604[Fix message suggesting the --executables flag
605Samuel Bronson <naesten@gmail.com>**20090201010708]
606[Remove #ifdefery for windows, renameFile now works properly
607Duncan Coutts <duncan@haskell.org>**20090202004450
608 It's even atomic on windows so we don't need the workaround.
609]
610[Make withTempDirectory create a new secure temp dir
611Duncan Coutts <duncan@haskell.org>**20090201233318
612 Rather than taking a specific dir to create.
613 Update the one use of the function.
614]
615[Add createTempDirectory to Compat.TempFile module
616Duncan Coutts <duncan@haskell.org>**20090201233213
617 Also clean up imports
618]
619[Improve the error message for missing foreign libs and make it fatal
620Duncan Coutts <duncan@haskell.org>**20090131184813
621 The check should now be accurate enough that we can make it an
622 error rather than just a warning.
623]
624[Use the cc, cpp and ld options when checking foreign headers and libs
625Duncan Coutts <duncan@haskell.org>**20090131184016
626 In partiular this is needed for packages that use ./configure
627 scripts to write .buildinfo files since they typically do not
628 split the cpp/cc/ldoptions into the more specific fields.
629]
630[Do the check for foreign libs after running configure
631Duncan Coutts <duncan@haskell.org>**20090131182213
632 This lets us pick up build info discovered by the ./configure script
633]
634[move imports outside ifdef GHC
635Ross Paterson <ross@soi.city.ac.uk>**20090130153505]
636[Document most of the new file utility functions
637Duncan Coutts <duncan@haskell.org>**20090130151640]
638[#262 iterative tests for foreign dependencies
639Gleb Alexeyev <gleb.alexeev@gmail.com>**20090130120228
640 Optimize for succesful case. First try all libs and includes in one command,
641 proceed with further tests only if the first test fails. The same goes for libs
642 and headers: look for an offending one only when overall test fails.
643 
644]
645[Misc minor comment and help message changes
646Duncan Coutts <duncan@haskell.org>**20090129233455]
647[Deprecate smartCopySources and copyDirectoryRecursiveVerbose
648Duncan Coutts <duncan@haskell.org>**20090129233234
649 Also use simplified implementation in terms of recently added functions.
650]
651[Switch copyFileVerbose to use compat copyFile
652Duncan Coutts <duncan@haskell.org>**20090129233125
653 All remaining uses of it do not require copying permissions
654]
655[Let the setFileExecutable function work with hugs too
656Duncan Coutts <duncan@haskell.org>**20090129232948]
657[Switch hugs wrapper code to use setFileExecutable
658Duncan Coutts <duncan@haskell.org>**20090129232542
659 instead of get/setPermissions which don't really work properly.
660]
661[Switch last uses of copyFile to copyFileVerbose
662Duncan Coutts <duncan@haskell.org>**20090129232429]
663[Stop using smartCopySources or copyDirectoryRecursiveVerbose
664Duncan Coutts <duncan@haskell.org>**20090129231656
665 Instead if copyDirectoryRecursiveVerbose use installDirectoryContents
666 and for smartCopySources use findModuleFiles and installExecutableFiles
667 In both cases the point is so that we use functions for installing
668 files rather than functions to copy files.
669]
670[Use installOrdinaryFile and installExecutableFile in various places
671Duncan Coutts <duncan@haskell.org>**20090129231321
672 instead of copyFileVerbose
673]
674[Make the Compat.CopyFile module with with old and new ghc
675Duncan Coutts <duncan@haskell.org>**20090129225423]
676[Add a bunch of utility functions for installing files
677Duncan Coutts <duncan@haskell.org>**20090129180243
678 We want to separate the functions that do ordinary file copies
679 from the functions that install files because in the latter
680 case we have to do funky things with file permissions.
681]
682[Use setFileExecutable instead of copyPermissions
683Duncan Coutts <duncan@haskell.org>**20090129180130
684 This lets us get rid of the Compat.Permissions module
685]
686[Export setFileOrdinary and setFileExecutable from Compat.CopyFile
687Duncan Coutts <duncan@haskell.org>**20090129173413]
688[Warn if C dependencies not found (kind of fixes #262)
689gleb.alexeev@gmail.com**20090126185832
690 
691 This is just a basic check - generate a sample program and check if it compiles and links with relevant flags. Error messages (warning messages,
692 actually) could use some improvement.
693]
694[Pass include directories to LHC
695Samuel Bronson <naesten@gmail.com>**20090127220021]
696[Add Distribution.Compat.CopyFile module
697Duncan Coutts <duncan@haskell.org>**20090128181115
698 This is to work around the file permissions problems with the
699 standard System.Directory.copyFile function. When installing
700 files we do not want to copy permissions or attributes from the
701 source files. On unix we want to use specific permissions and
702 on windows we want to inherit default permissions. On unix:
703 copyOrdinaryFile   sets the permissions to -rw-r--r--
704 copyExecutableFile sets the permissions to -rwxr-xr-x
705]
706[Remove unused support for installing dynamic exe files
707Duncan Coutts <duncan@haskell.org>**20090128170421
708 No idea why this was ever added, they've never been built.
709]
710[Check for ghc-options: -threaded in libraries
711Duncan Coutts <duncan@haskell.org>**20090125161226
712 It's totally unnecessary and messes up profiling in older ghc versions.
713]
714[Filter ghc-options -threaded for libs too
715Duncan Coutts <duncan@haskell.org>**20090125145035]
716[New changelog entries for 1.7.x
717Duncan Coutts <duncan@haskell.org>**20090123175645]
718[Update changelog for 1.6.0.2
719Duncan Coutts <duncan@haskell.org>**20090123175629]
720[Fix openNewBinaryFile on Windows with ghc-6.6
721Duncan Coutts <duncan@haskell.org>**20090122172100
722 fdToHandle calls fdGetMode which does not work with ghc-6.6 on
723 windows, the workaround is not to call fdToHandle, but call
724 openFd directly. Bug reported by Alistair Bayley, ticket #473.
725]
726[filter -threaded when profiling is on
727Duncan Coutts <duncan@haskell.org>**20090122014425
728 Fixes #317. Based on a patch by gleb.alexeev@gmail.com
729]
730[Move installDataFiles out of line to match installIncludeFiles
731Duncan Coutts <duncan@haskell.org>**20090122005318]
732[Fix installIncludeFiles to create target directories properly
733Duncan Coutts <duncan@haskell.org>**20090122004836
734 Previously for 'install-includes: subdir/blah.h' we would not
735 create the subdir in the target location.
736]
737[Typo in docs for source-repository
738Joachim Breitner <mail@joachim-breitner.de>**20090121220747]
739[Make 'ghc-options: -O0' a warning rather than an error
740Duncan Coutts <duncan@haskell.org>**20090118141949]
741[Improve runE parse error message
742Duncan Coutts <duncan@haskell.org>**20090116133214
743 Only really used in parsing config files derived from command line flags.
744]
745[The Read instance for License and InstalledPackageInfo is authoritative
746Duncan Coutts <duncan@haskell.org>**20090113234229
747 It is ghc's optimised InstalledPackageInfo parser that needs updating.
748 
749 rolling back:
750 
751 Fri Dec 12 18:36:22 GMT 2008  Ian Lynagh <igloo@earth.li>
752   * Fix Show/Read for License
753   We were ending up with things like
754       InstalledPackageInfo {
755           ...
756           license = LGPL Nothing,
757           ...
758       }
759   i.e. "LGPL Nothing" rather than "LGPL", which we couldn't then read.
760 
761     M ./Distribution/License.hs -2 +14
762]
763[Swap the order of global usage messages
764Duncan Coutts <duncan@haskell.org>**20090113191810
765 Put the more important one first.
766]
767[Enable the global command usage to be set
768Duncan Coutts <duncan@haskell.org>**20090113181303
769 extend it rather than overriding it.
770 Also rearrange slightly the default global --help output.
771]
772[On Windows, if gcc isn't where we expect it then keep looking
773Ian Lynagh <igloo@earth.li>**20090109153507]
774[Ban ghc-options: --make
775Duncan Coutts <duncan@haskell.org>**20081223170621
776 I dunno, some people...
777]
778[Update changelog for 1.6.0.2 release
779Duncan Coutts <duncan@haskell.org>**20081211142202]
780[Make the compiler PackageDB stuff more flexible
781Duncan Coutts <duncan@haskell.org>**20081211141649
782 We support using multiple package dbs, however the method for
783 specifying them is very limited. We specify a single package db
784 and that implicitly specifies any other needed dbs. For example
785 the user or a specific db require the global db too. We now
786 represent that stack explicitly. The user interface still uses
787 the single value method and we convert internally.
788]
789[Fix Show/Read for License
790Ian Lynagh <igloo@earth.li>**20081212183622
791 We were ending up with things like
792     InstalledPackageInfo {
793         ...
794         license = LGPL Nothing,
795         ...
796     }
797 i.e. "LGPL Nothing" rather than "LGPL", which we couldn't then read.
798]
799[Un-deprecate Distribution.ModuleName.simple for now
800Ian Lynagh <igloo@earth.li>**20081212164540
801 Distribution/Simple/PreProcess.hs uses it, so this causes build failures
802 with -Werror.
803]
804[Use the first three lhc version digits
805Duncan Coutts <duncan@haskell.org>**20081211224048
806 Rather than two, and do it in a simpler way.
807]
808[Remove obsolete test code
809Duncan Coutts <duncan@haskell.org>**20081211142054]
810[Update the VersionInterval properties which now all pass
811Duncan Coutts <duncan@haskell.org>**20081210145653]
812[Eliminate NoLowerBound, Versions do have a lower bound of 0.
813Duncan Coutts <duncan@haskell.org>**20081210145433
814 This eliminates the duplicate representation of ">= 0" vs "-any"
815 and makes VersionIntervals properly canonical.
816]
817[Update and extend the Version quickcheck properties
818Duncan Coutts <duncan@haskell.org>**20081210143251
819 One property fails. The failure reveals that the VersionInterval type
820 is not quite a canonical representation of the VersionRange semantics.
821 This is because the lowest Version is [0] and not -infinity, so for
822 example the intervals (.., 0] and [0,0] are equivalent.
823]
824[Add documentation for VersionRange functions
825Duncan Coutts <duncan@haskell.org>**20081210140632
826 With properties.
827]
828[Export withinVersion and deprecate betweenVersionsInclusive
829Duncan Coutts <duncan@haskell.org>**20081210140411]
830[Add checking of Version validity to the VersionIntervals invariant
831Duncan Coutts <duncan@haskell.org>**20081210134100
832 Version numbers have to be a non-empty sequence of non-negataive ints.
833]
834[Fix implementation of withinIntervals
835Duncan Coutts <duncan@haskell.org>**20081210000141]
836[Fix configCompilerAux to consider user-supplied program flags
837Duncan Coutts <duncan@haskell.org>**20081209193320
838 This fixes a bug in cabal-install
839]
840[Add ModuleName.fromString and deprecate ModuleName.simple
841Duncan Coutts <duncan@haskell.org>**20081209151232
842 Also document the functions in the ModuleName module.
843]
844[Check for absolute, outside-of-tree and dist/ paths
845Duncan Coutts <duncan@haskell.org>**20081208234312]
846[Export more VersionIntervals operations
847Duncan Coutts <duncan@haskell.org>**20081208222420
848 and check internal invariants
849]
850[Check for use of cc-options: -O
851Duncan Coutts <duncan@haskell.org>**20081208182047]
852[Fake support for NamedFieldPuns in ghc-6.8
853Duncan Coutts <duncan@haskell.org>**20081208180018
854 Implement it in terms of the -XRecordPuns which was accidentally
855 added in ghc-6.8 and deprecates in 6.10 in favor of NamedFieldPuns
856 So this is for compatability so we can tell package authors always
857 to use NamedFieldPuns instead.
858]
859[Make getting ghc supported language extensions its own function
860Duncan Coutts <duncan@haskell.org>**20081208175815]
861[Check for use of deprecated extensions
862Duncan Coutts <duncan@haskell.org>**20081208175441]
863[Add a list of deprecated extenstions
864Duncan Coutts <duncan@haskell.org>**20081208175337
865 Along with possibly another extension that replaces it.
866]
867[Change the checking of new language extensions
868Duncan Coutts <duncan@haskell.org>**20081207202315
869 Check for new language extensions added in Cabal-1.2 and also 1.6.
870 Simplify the checking of -X ghc flags. Now always suggest using
871 the extensions field, as we separately warn about new extenssons.
872]
873[Tweak docs for VersionRange and VersionIntervals
874Duncan Coutts <duncan@haskell.org>**20081207184749]
875[Correct and simplify checkVersion
876Duncan Coutts <duncan@haskell.org>**20081205232845]
877[Make users of VersionIntervals use the new view function
878Duncan Coutts <duncan@haskell.org>**20081205232707]
879[Make VersionIntervals an abstract type
880Duncan Coutts <duncan@haskell.org>**20081205232041
881 Provide asVersionIntervals as the view function for a VersionRange
882 This will let us enforce the internal data invariant
883]
884[Slight clarity improvement in compiler language extension handling
885Duncan Coutts <duncan@haskell.org>**20081205210747]
886[Slightly simplify the maintenance burden of adding new language extensions
887Duncan Coutts <duncan@haskell.org>**20081205210543]
888[Distributing a package with no synopsis and no description is inexcusable
889Duncan Coutts <duncan@haskell.org>**20081205160719
890 Previously if one or the other or both were missing we only warned.
891 Now if neither are given it's an error. We still warn about either
892 missing.
893]
894[Add Test.Laws module for checking class laws
895Duncan Coutts <duncan@haskell.org>**20081204144238
896 For Functor, Monoid and Traversable.
897]
898[Add QC Arbitrary instances for Version and VersionRange
899Duncan Coutts <duncan@haskell.org>**20081204144204]
900[Remove accidentally added bianry file
901Duncan Coutts <duncan@haskell.org>**20081203000824]
902[Fix #396 and add let .Haddock find autogen modules
903Andrea Vezzosi <sanzhiyan@gmail.com>**20081201114853]
904[Add checks for new and unknown licenses
905Duncan Coutts <duncan@haskell.org>**20081202172742]
906[Add MIT and versioned GPL and LGPL licenses
907Duncan Coutts <duncan@haskell.org>**20081202171033
908 Since Cabal-1.4 we've been able to parse versioned licenses
909 and unknown licenses without the parser falling over.
910]
911[Don't nub lists of dependencies
912Duncan Coutts <duncan@haskell.org>**20081202162259
913 It's pretty meaningless since it's only a syntactic check.
914 The proper thing is to maintain a dependency set or to
915 simplify dependencies before printing them.
916]
917[Fix the date in the LICENSE file
918Duncan Coutts <duncan@haskell.org>**20081202161457]
919[Fix the version number in the makefile
920Duncan Coutts <duncan@haskell.org>**20081202161441]
921[Use VersionRange abstractly
922Duncan Coutts <duncan@haskell.org>**20081202160321]
923[Do the cabal version check properly.
924Duncan Coutts <duncan@haskell.org>**20081202155410
925 Instead of matching on the actual expression ">= x.y" we use the
926 sematic view of the version range so we can do it precisely.
927 Also use foldVersionRange to simplify a couple functions.
928]
929[Drop support for ghc-6.4 era OPTIONS pragmas
930Duncan Coutts <duncan@haskell.org>**20081202154744
931 It's still possible to build with ghc-6.4 but you have to pass
932 extra flags like "ghc --make -cpp -fffi Setup.hs" We could not
933 keep those OPTIONS pragmas and make it warning-free with ghc-6.10.
934 See http://hackage.haskell.org/trac/ghc/ticket/2800 for details.
935]
936[Almost make the VersionRange type abstract
937Duncan Coutts <duncan@haskell.org>**20081202154307
938 Export constructor functions and deprecate all the real constructors
939 We should not be pattern matching on this type because it's just
940 syntax. For meaningful questions we should be matching on the
941 VersionIntervals type which represents the semantics.
942]
943[Change isAnyVersion to be a semantic rather than syntactic test
944Duncan Coutts <duncan@haskell.org>**20081202142123
945 Also add simplify and isNoVersion.
946]
947[Add VersionIntervals, a view of VersionRange
948Duncan Coutts <duncan@haskell.org>**20081202141040
949 as a sequence of non-overlapping intervals. This provides a canonical
950 representation for the semantics of a VersionRange. This makes several
951 operations easier.
952]
953[Fix pretty-printing of version wildcards, was missing leading ==
954Duncan Coutts <duncan@haskell.org>**20081202135949]
955[Add a fold function for the VersionRange
956Duncan Coutts <duncan@haskell.org>**20081202135845
957 Use it to simplify the eval / withinRange function
958]
959[Improve the error on invalid file globs slightly
960Duncan Coutts <duncan@haskell.org>**20081202135335]
961[Use commaSep everywhere in the Check module
962Duncan Coutts <duncan@haskell.org>**20081202135208]
963[Fix message in the extra-source-files field check
964Duncan Coutts <duncan@haskell.org>**20081202135000]
965[Add checks for file glob syntax
966Duncan Coutts <duncan@haskell.org>**20081202133954
967 It requires cabal-version: >= 1.6 to be specified
968]
969[Add check for use of "build-depends: foo == 1.*" syntax
970Duncan Coutts <duncan@haskell.org>**20081202131459
971 It requires Cabal-1.6 or later.
972]
973[Distinguish version wild cards in the VersionRange AST
974Duncan Coutts <duncan@haskell.org>**20081128170513
975 Rather than encoding them in existing constructors.
976 This will enable us to check that uses of the new syntax
977 are flagged in .cabal files with cabal-version: >= 1.6
978]
979[Fix comment in LHC module
980Duncan Coutts <duncan@haskell.org>**20081123100710
981 Yes, LHC really does use ghc-pkg (with a different package.conf)
982]
983[Use the new bug-reports and source-repository info in the .cabal file
984Duncan Coutts <duncan@haskell.org>**20081123100041]
985[Simplify build-depends and base3/4 flags
986Duncan Coutts <duncan@haskell.org>**20081123100003]
987[Simplify default global libdir for LHC
988Duncan Coutts <duncan@haskell.org>**20081123095802
989 So it uses libdir=$prefix/lib rather than libdir=/usr/local/lib
990]
991[Simplify the compat exceptions stuff
992Duncan Coutts <duncan@haskell.org>**20081123095737]
993[Fix warnings in the LHC module
994Duncan Coutts <duncan@haskell.org>**20081122224011]
995[Distribution/Simple/GHC.hs: remove tabs for whitespace to eliminate warnings in cabal-install
996gwern0@gmail.com**20081122190011
997 Ignore-this: 2fd54090af86e67e25e51ade42992b53
998]
999[Warn about use of tabs
1000Duncan Coutts <duncan@haskell.org>**20081122154134]
1001[Bump Cabal HEAD version to 1.7.x development series
1002Duncan Coutts <duncan@haskell.org>**20081122145817
1003 Support for LHC is the first divergence between 1.7
1004 and the stable 1.6.x series.
1005]
1006[Update changelog for 1.6.0.x fixes
1007Duncan Coutts <duncan@haskell.org>**20081122145758]
1008[LHC: Don't use --no-user-package-conf. It doesn't work with ghc-6.8.
1009Lemmih <lemmih@gmail.com>**20081122012341
1010 Ignore-this: 88a837b38cf3e897cc5ed4bb22046cee
1011]
1012[Semi-decent lhc support.
1013Lemmih <lemmih@gmail.com>**20081121034138]
1014[Make auto-generated *_paths.hs module warning-free.
1015Thomas Schilling <nominolo@googlemail.com>**20081106142734
1016 
1017 On newer GHCs using {-# OPTIONS_GHC -fffi #-} gives a warning which
1018 can lead to a compile failure when -Werror is activated.  We therefore
1019 emit this option if we know that the LANGUAGE pragma is supported
1020 (ghc >= 6.6.1).
1021]
1022[Escape ld-options with the -optl prefix when passing them to ghc
1023Duncan Coutts <duncan@haskell.org>**20081103151931
1024 Fixes ticket #389
1025]
1026[Simplify previous pkg-config fix
1027Duncan Coutts <duncan@haskell.org>**20081101200309]
1028[Fix bug where we'd try to configure an empty set of pkg-config packages
1029Duncan Coutts <duncan@haskell.org>**20081101195512
1030 This happened when the lib used pkg-config but the exe did not.
1031 It cropped up in hsSqlite3-0.0.5.
1032]
1033[Add GHC 6.10.1's extensions to the list in Language.Haskell.Extension
1034Ian Lynagh <igloo@earth.li>**20081019141408]
1035[Ensure that the lib target directory is present when installing
1036Duncan Coutts <duncan@haskell.org>**20081017004437
1037 Variant on a patch from Bryan O'Sullivan
1038]
1039[Release kind is now rc
1040Duncan Coutts <duncan@haskell.org>**20081011183201]
1041[TAG 1.6.0.1
1042Duncan Coutts <duncan@haskell.org>**20081011182516]
1043[Bump version to 1.6.0.1
1044Duncan Coutts <duncan@haskell.org>**20081011182459]
1045[Do not use the new meta-data fields yet
1046Duncan Coutts <duncan@haskell.org>**20081011182307
1047 Avoid chicken and egg problem. We cannot upload Cabsl-1.6 to
1048 hackage until hackage is using Cabal-1.6 if it uses features
1049 that are introduced in 1.6. So just comment them out for now.
1050]
1051[Export a compat function for older Setup.hs scripts
1052Duncan Coutts <duncan@haskell.org>**20081011182131
1053 Makes it possible for alex and happy to work with cabal-1.2 -> 1.6
1054]
1055[Fix instructions in README for building with 6.6 and filepath
1056Duncan Coutts <duncan@haskell.org>**20081011002819]
1057[Update release procedure in Makefile
1058Duncan Coutts <duncan@haskell.org>**20081010181445
1059 Building the haddock docs requires building first. Arguably this is
1060 a Cabal bug. It should probably generate the "autogen" files for
1061 haddock and not just for build.
1062]
1063[TAG 1.6.0.0
1064Duncan Coutts <duncan@haskell.org>**20081010061435]
1065[Bump version number to 1.6.0.0
1066Duncan Coutts <duncan@haskell.org>**20081010052409]
1067[Update changelog
1068Duncan Coutts <duncan@haskell.org>**20081010052354]
1069[Remove the releaseNotes file
1070Duncan Coutts <duncan@haskell.org>**20081010052101
1071 It did not actually contain any release notes and just
1072 duplicated information in the README which was confusing.
1073]
1074[Merge the info from the releaseNotes file into the README file
1075Duncan Coutts <duncan@haskell.org>**20081010052020]
1076[Fix haddock comment for haddock-0.8
1077Duncan Coutts <duncan@haskell.org>**20081010050913]
1078[Fix parsing of ld,cc,cpp-options for flags containing ','
1079Duncan Coutts <duncan@haskell.org>**20081010050829
1080 The ',' character is not used as a separator and is allowed
1081 within flag tokens. Fixes at least HsPerl5.
1082]
1083[Update versions in regression check script
1084Duncan Coutts <duncan@haskell.org>**20081009223429]
1085[Bump devel version number to 1.5.6
1086Duncan Coutts <duncan@haskell.org>**20081009223350
1087 To make easier to track recent Cabal / cabal-install changes
1088]
1089[Update changelog
1090Duncan Coutts <duncan@haskell.org>**20081009223330]
1091[Update the README
1092Duncan Coutts <duncan@haskell.org>**20081009221851]
1093[Make sdist work for libs that use the Paths_pkgname module
1094Duncan Coutts <duncan@haskell.org>**20081009214507
1095 Do it by just filtering that module out of the package
1096 description before running sdist etc. This isn't lovely
1097 because it steals that module name from the module namespace
1098 but at least it now works. Thanks to Jean-Philippe Bernardy
1099 for the first iteration of this patch.
1100]
1101[xargs -s breaks solaris
1102Duncan Coutts <duncan@haskell.org>**20081008185041
1103 Hopefully we can figure out a better fix for recent cygwin
1104 versions of xargs which are apparently broken.
1105 
1106 rolling back:
1107 
1108 Wed Oct  8 08:44:10 PDT 2008  Clemens Fruhwirth <clemens@endorphin.org>
1109   * Also respect the max. command line size in Makefile driven builds
1110 
1111     M ./Distribution/Simple/GHC.hs -7 +13
1112     M ./Distribution/Simple/GHC/Makefile.hs -1 +1
1113     M ./Distribution/Simple/GHC/Makefile.in -1 +1
1114]
1115[Also respect the max. command line size in Makefile driven builds
1116Clemens Fruhwirth <clemens@endorphin.org>**20081008154410]
1117[add missing exeExtension when stripping an executable
1118Simon Marlow <marlowsd@gmail.com>**20081007134757]
1119[Add a few type sigs to help hugs and as documentation
1120Duncan Coutts <duncan@haskell.org>**20081007214120
1121 Thanks to Dimitry and Ross for identifying the problem.
1122]
1123[Add -no-auto-link-packages also to Makefile driven build
1124Clemens Fruhwirth <clemens@endorphin.org>**20081007095454]
1125[Also install dynamically linked executable (when present)
1126Clemens Fruhwirth <clemens@endorphin.org>**20081006095107]
1127[Use "-no-auto-link-packages" when using GHC to link
1128Ian Lynagh <igloo@earth.li>**20081004111103
1129 When making packages like ghc-prim we need GHC to not automatically
1130 try to link with base and haskell98.
1131]
1132[Relax dependencyInconsistencies to allow the base-3,4 thing
1133Duncan Coutts <duncan@haskell.org>**20081002074142
1134 Previously we said a package graph was inconsistent if two
1135 dependencies on the same package name specified different
1136 versions. Now we say that two such dependencies on different
1137 versions are ok if there is a direct dependency between those
1138 two package versions. So if your package graph ends up with
1139 both base 3 and base 4 in it, then that's ok because base 3
1140 directly depends on base 4, so we declare it not to be an
1141 inconsistency. This removes the scary warnings at configure
1142 time (fixing ticket #366) and also adjusts the invariant and
1143 assertion of the InstallPlan ADT in cabal-install.
1144]
1145[Document the bug-reports field
1146Duncan Coutts <duncan@haskell.org>**20081001042635]
1147[Add bug-reports field to Cabal.cabal
1148Duncan Coutts <duncan@haskell.org>**20081001035605]
1149[Add bug-reports url field
1150Duncan Coutts <duncan@haskell.org>**20081001035516
1151 Ticket #323
1152]
1153[Update the package description a bit
1154Duncan Coutts <duncan@haskell.org>**20081001034350]
1155[Specify a source repository for Cabal in Cabal.cabal
1156Duncan Coutts <duncan@haskell.org>**20081001034325]
1157[Document the source-repository stuff
1158Duncan Coutts <duncan@haskell.org>**20081001033928]
1159[Add some checks on the repository sections
1160Duncan Coutts <duncan@haskell.org>**20081001033755]
1161[Use unknown rather than specific other repo kinds
1162Duncan Coutts <duncan@haskell.org>**20081001033637
1163 We can still add more as necessary
1164]
1165[Add support for specifying source repos in .cabal files
1166Duncan Coutts <duncan@haskell.org>**20080930222708
1167 Ticket #58. Does not yet include checking.
1168]
1169[Simplify parsing sections in the .cabal file
1170Duncan Coutts <duncan@haskell.org>**20080930215509
1171 Allow flags, lib and exes in any order and handle unknown sections better.
1172]
1173[Treat "cabal --flag command" as "cabal command --flag"
1174Duncan Coutts <duncan@haskell.org>**20080928070627
1175 eg "cabal -v configure" to mean "cabal configure -v"
1176 For flags that are not recognised as global flags,
1177 pass them on to the sub-command.
1178]
1179[Fix how Cabal makes the value for __GLASGOW_HASKELL__
1180Ian Lynagh <igloo@earth.li>**20080920212207
1181 6.10.x was giving us 601 rather than 610.
1182]
1183[Update the version number in the Makefile
1184Ian Lynagh <igloo@earth.li>**20080920175306]
1185[Correct the version number in the Makefile
1186Ian Lynagh <igloo@earth.li>**20080920175105]
1187[Update build-deps
1188Ian Lynagh <igloo@earth.li>**20080920175053]
1189[Fix building with GHC 6.6
1190Ian Lynagh <igloo@earth.li>**20080920162927]
1191[TAG 6.10 branch has been forked
1192Ian Lynagh <igloo@earth.li>**20080919123438]
1193[Rename --distdir flag to --builddir
1194Duncan Coutts <duncan@haskell.org>**20080920180326
1195 Old aliases kept for compatibility
1196]
1197[TAG 1.5.5
1198Duncan Coutts <duncan@haskell.org>**20080919142307]
1199[Bump version number to 1.5.5
1200Duncan Coutts <duncan@haskell.org>**20080919140130
1201 Ready to make the 1.6 branch
1202]
1203[filter mingw include directories out of rts's installDirs
1204Ian Lynagh <igloo@earth.li>**20080918142958
1205 GHC < 6.10 put "$topdir/include/mingw" in rts's installDirs. This
1206 breaks when you want to use a different gcc, so we need to filter
1207 it out.
1208]
1209[Tell gcc on Windows where include/mingw is
1210Ian Lynagh <igloo@earth.li>**20080918135718
1211 We need to tell the gcc bundled with GHC on Windows where its mingw
1212 include directory is
1213]
1214[On windows, fail if ghc's gcc or ld are not found
1215Duncan Coutts <duncan@haskell.org>**20080917235745]
1216[Allow addKnownProgram to be used as an update, not just insert
1217Duncan Coutts <duncan@haskell.org>**20080917225856
1218 ie preserves any existing user-supplied path and args
1219]
1220[Cope with gcc.exe and ld.exe not being where ex expect on Windows
1221Ian Lynagh <igloo@earth.li>**20080917221228]
1222[Implement openNewBinaryFile in a Compat module
1223Ian Lynagh <igloo@earth.li>**20080917171257
1224 This is like openBinaryTempFile except it doesn't mark the permissions
1225 with 600. This means datafailes get the right permissions when they are
1226 installed.
1227 
1228 This should really be in the base package.
1229]
1230[Generalise the type of onException
1231Ian Lynagh <igloo@earth.li>**20080917171233
1232 Now it matches Control.Exception's type
1233]
1234[Yet another go at making gcc -B work properly on windows
1235Duncan Coutts <duncan@haskell.org>**20080916232553
1236 This time it should work on linux too! But more significantly
1237 it should work when the user specifies a particular gcc. It
1238 would be very bad if the user gave an alternative gcc but we
1239 still gave it -B for the lib files of ghc's gcc. This go is
1240 rather cleaner as it uses the new program post-conf system.
1241]
1242[Pass any additional gcc options through to gcc when calling hsc2hs
1243Duncan Coutts <duncan@haskell.org>**20080916232502]
1244[Add an additional program post-conf action
1245Duncan Coutts <duncan@haskell.org>**20080916210642
1246 The post-conf action gets given the configured program and is
1247 allowed to do more IO and can add any extra required program
1248 args. Should make it easier to do the gcc -B thing or ld -x
1249]
1250[Make the new permissions compat module compile
1251Duncan Coutts <duncan@haskell.org>**20080916210550
1252 Needs cpp pragma as it has to work with just ghc --make
1253 Did I ever mention I that hate cpp and compat modules?
1254]
1255[Fix the env var names used in the Paths module
1256Duncan Coutts <duncan@haskell.org>**20080916093525
1257 Convert any '-' in the package name to '_' when generating the
1258 path env var as most shells do not allow '-' in env var names.
1259]
1260[Check for -optl-s as well as an alias of the more common -optl-Wl,-s
1261Duncan Coutts <duncan@haskell.org>**20080913005432]
1262[pass -B flag to help gcc find libraries on Windows
1263dias@eecs.harvard.edu**20080827124436]
1264[workaround for nhc98, which does not have System.Posix.Internals
1265Malcolm.Wallace@cs.york.ac.uk**20080915092747]
1266[Set GHCI_LIB to "" in "Setup makefile" if GHC libs are disabled
1267Ian Lynagh <igloo@earth.li>**20080913144040]
1268[In "Setup makefile", don't build the vanilla way if it's disabled
1269Ian Lynagh <igloo@earth.li>**20080913143132
1270 This needs a bit of a kludge, as the vanilla way doesn't really exist
1271 as far as the build system is concerned. It's just the absence of way.
1272]
1273[Fix the permission that we give wrapper scripts
1274Ian Lynagh <igloo@earth.li>**20080913124445]
1275[Documentation only: more typos/punctuation
1276Tim Chevalier <chevalier@alum.wellesley.edu>**20080914051331]
1277[Documentation only: grammar fix in comment
1278Tim Chevalier <chevalier@alum.wellesley.edu>**20080914051008]
1279[Documentation only: fix typo in comment
1280Tim Chevalier <chevalier@alum.wellesley.edu>**20080913214843]
1281[Remove unused 'breaks' util function
1282Duncan Coutts <duncan@haskell.org>**20080910235804]
1283[follow library changes
1284Ian Lynagh <igloo@earth.li>**20080903223608]
1285[Fix to compile with base-1.0:Data.List
1286Duncan Coutts <duncan@haskell.org>**20080904233126
1287 which did not have isInfixOf
1288]
1289[Fix cabal_macros.h for package names containing '-'
1290Duncan Coutts <duncan@haskell.org>**20080903220116
1291 As with the Paths_pkgname module, we map '-' to '_' as the
1292 former is not a valid character in cpp macro identifiers.
1293 Fixes cpp redefinition warnings. First reported by gwern.
1294]
1295[Pass the interfaces for the transitive set of dependencies to haddock
1296Ian Lynagh <igloo@earth.li>**20080903123813
1297 Otherwise we don't get links to types from packages that we don't
1298 directly depend on.
1299]
1300[Update CPP-Options in Cabal.cabal to define CABAL_VERSION=1,5,4
1301Ian Lynagh <igloo@earth.li>**20080902170348
1302 It was still defining CABAL_VERSION=1,5,3
1303]
1304[Add more detail to the -Werror and -fvia-C checks
1305Duncan Coutts <duncan@haskell.org>**20080902171413
1306 Also, ban rather than just warn about the -optl-Wl,-s hack
1307 now that Cabal strips exes by default.
1308]
1309[Haddock 2: #include <cabal_macros.h>
1310Simon Marlow <marlowsd@gmail.com>**20080901145843]
1311[package concurrent not available in nhc98
1312Malcolm.Wallace@cs.york.ac.uk**20080902092802]
1313[Display the right message for sdist --snapshot
1314Duncan Coutts <duncan@haskell.org>**20080831221756]
1315[Bump the version number to 1.5.4
1316Duncan Coutts <duncan@haskell.org>**20080831220418
1317 due to the PackageSet/Index api changes
1318]
1319[Use a hopefully more robust method of determining the gcc version
1320Duncan Coutts <duncan@haskell.org>**20080831220145]
1321[Simplify the handling of --with-prog= in build/haddock commands.
1322Duncan Coutts <duncan@haskell.org>**20080831215551
1323 We allow extra rgs and the location of programs to be given to
1324 the build and haddock commands, not just at configure time. The
1325 code to do this is now simpler and more general. This should not
1326 be the default use mode however since it involves configuring
1327 the programs each time where as doing it at configure time allows
1328 it to be done once and saved. Further, specifying a different
1329 version of the program at build time than at configure time is
1330 likely to fail, especially for the compiler programs. Changing
1331 the compiler really requires reconfiguring.
1332]
1333[Update the haddock command help text
1334Duncan Coutts <duncan@haskell.org>**20080831215325
1335 The haddock command now supports --haddock-options=
1336]
1337[Add flags to build command for specifying program paths
1338Duncan Coutts <duncan@haskell.org>**20080831215135
1339 So we're going to allow --with-PROG for the build and haddock
1340 commands, in addition to the existing --PROG-options= flags.
1341]
1342[Use the new Program utils to simplify code in Configure
1343Duncan Coutts <duncan@haskell.org>**20080831215054]
1344[Add some more handy Program utils
1345Duncan Coutts <duncan@haskell.org>**20080831214813
1346 Mostly for dealing with lists of programs so that client
1347 code doesn't need quite to much flip foldl' (flip thing)
1348 Add specific helpers for reconfiguring programs and
1349 restoring a full ProgramConfiguration after usign read.
1350]
1351[Don't redundantly pass programArgs in when calling programs.
1352Duncan Coutts <duncan@haskell.org>**20080831212526
1353 That's already done by the Program framework so we were passing
1354 those extra args in twice.
1355]
1356[Merge PackageSet and PackageIndex
1357Duncan Coutts <duncan@haskell.org>**20080830130250
1358 Have just a single module that provides both the case sensitive and
1359 insensitive operations. Turns out we hardly use the case insensitive
1360 operations, and the places where we do are not performance sensitive
1361 at all. So we use the PackageSet implementation which stores the
1362 packages case sensitively and tack on the case insensitive operations
1363 but with linear time implementations rather than log time. For the
1364 merged module/type name use PackageIndex because that is what older
1365 released versions exported, so less needless client breakage.
1366]
1367[Add checkPackageFileNames function to check portability of file names
1368Duncan Coutts <duncan@haskell.org>**20080827082349
1369 Windows has restrictions on names of files and portable
1370 tar archives have some weird length restrictions too.
1371 Not yet used but should be used in sdist and hackage.
1372]
1373[In wrappers, $executablename needs to expand to something with DESTDIR
1374Ian Lynagh <igloo@earth.li>**20080828155554
1375 The installed wrapper needs to call the executable in its final place,
1376 not inside the DESTDIR where we are constructing a package.
1377]
1378[Allow passing haddock's location and options to "Setup haddock"
1379Ian Lynagh <igloo@earth.li>**20080828142424]
1380[We need to pass the CPP options to haddock 2
1381Ian Lynagh <igloo@earth.li>**20080828142303]
1382[Add support for manually en/disabled flags
1383Ian Lynagh <igloo@earth.li>**20080827170105
1384 The immediate use for these is so that, in haddock, we can require
1385 ghc-paths normally, but in the GHC build we can manually turn off a flag
1386 so that this dependency isn't needed. We can't use a normal flag, or
1387 in the normal build Cabal would infer that the flag needs to be turned
1388 off if ghc-paths isn't available.
1389]
1390[Add release date of 1.4.0.2
1391Duncan Coutts <duncan@haskell.org>**20080826204810]
1392[Ban package names that are not valid windows file names
1393Duncan Coutts <duncan@haskell.org>**20080826005502
1394 At least for the purposes of distribution. So if you're on unix
1395 then you can call your package 'LPT1' if you feel you must, but
1396 you cannot distribute a package with this name.
1397]
1398[Separate out and export installDirsOptions
1399Duncan Coutts <duncan@haskell.org>**20080826003240
1400 The InstallDirs is a separate type so it's handy to have the
1401 command line and config file options for it available
1402 separately. It'd be useful in cabal-install for one thing.
1403]
1404[Note the per-user install path on Windows in the README
1405Duncan Coutts <duncan@haskell.org>**20080824203923]
1406[More changelog updates for 1.4.0.2
1407Duncan Coutts <duncan@haskell.org>**20080824203744]
1408[Teach Cabal about the PackageImports extension
1409Ian Lynagh <igloo@earth.li>**20080825132352]
1410[Rename --distpref to --distdir
1411Duncan Coutts <duncan@haskell.org>**20080825164258
1412 It's more consistent with the other flag names for dirs.
1413 Kept the old name too, but it's not shown by --help.
1414]
1415[We now depend on concurrent (split off from base)
1416Ian Lynagh <igloo@earth.li>**20080824135145]
1417[Bump version number to 1.5.3
1418Duncan Coutts <duncan@haskell.org>**20080822160918]
1419[Update changelog for recent 1.5.x changes
1420Duncan Coutts <duncan@haskell.org>**20080822160828]
1421[Update changelog
1422Duncan Coutts <duncan@haskell.org>**20080802135452]
1423[Fix for #333, "Setup sdist --snapshot fails"
1424Duncan Coutts <duncan@haskell.org>**20080821154913
1425 Credit to Spencer Janssen. This is just a slight alternative
1426 to the fix he proposed. It simplifies prepareSnapshotTree.
1427]
1428[Don't pass cc-options to Haskell compilations
1429Simon Marlow <marlowsd@gmail.com>**20080821133421
1430 This has no effect with GHC 6.9, and with earlier GHC's it was a
1431 misuse of cc-options.
1432]
1433[Don't propagate cc-options to the InstalledPackageInfo
1434Simon Marlow <marlowsd@gmail.com>**20080821132551
1435 cc-options is for options to be passed to C compilations in the
1436 current package.  If we propagate those options to the
1437 InstalledPackageInfo, they get passed to C compilations in any package
1438 that depends on this one, which could be disastrous.  I've seen
1439 cc-options like these:
1440 
1441    cc-options:      -optc-std=c99
1442    cc-options:         -D_FILE_OFFSET_BITS=64
1443    Cc-options:      -Wall
1444 
1445 these are all clearly intended to be local, but are in fact currently
1446 propagated to all dependent packages.
1447]
1448[Fix spelling of compatibility
1449Duncan Coutts <duncan@haskell.org>**20080818194951
1450 At request of gwern who found that it was driving him nuts.
1451]
1452[Minor info and help message improvements
1453Duncan Coutts <duncan@haskell.org>**20080813124957]
1454[unbreak for non-GHC
1455Malcolm.Wallace@cs.york.ac.uk**20080814182558]
1456[Catch exit exceptions as well as IO exceptions after running programs
1457Ian Lynagh <igloo@earth.li>**20080813213035
1458 We need to catch IO exceptions for things like "couldn't find the program",
1459 but we also need to catch exit exceptions as Cabal uses them to signal
1460 what the program returned.
1461]
1462[Move Paths_pkgname and cabal_macros.h generation into their own modules
1463Duncan Coutts <duncan@haskell.org>**20080813193245]
1464[Add util rewriteFile :: FilePath -> String -> IO ()
1465Duncan Coutts <duncan@haskell.org>**20080813192017
1466 Write a file but only if it would have new content.
1467 If we would be writing the same as the existing content
1468 then leave the file as is so that we do not update the
1469 file's modification time.
1470]
1471[fix imports for nhc98
1472Malcolm.Wallace@cs.york.ac.uk**20080813132112]
1473[Don't warn about missing strip.exe on Windows
1474Duncan Coutts <duncan@haskell.org>**20080812220415
1475 We don't expect Windows systems to have the strip program anyway.
1476]
1477[Flush stdout when printing debugging messages
1478Duncan Coutts <duncan@haskell.org>**20080812212236]
1479[Fix warnings in Windows Paths_pkgname module
1480Duncan Coutts <duncan@haskell.org>**20080812211349]
1481[Fix the config-file field name of the install command's packagedb option
1482Duncan Coutts <duncan@haskell.org>**20080812171207]
1483[Add alias type PackageId = PackageIdentifier
1484Duncan Coutts <duncan@haskell.org>**20080812171006]
1485[Add data Platform = Platform Arch OS
1486Duncan Coutts <duncan@haskell.org>**20080812160941
1487 Since we tend to pass them around together rather a lot.
1488 Also add a Text instance with a format like "i386-linux"
1489]
1490[Don't use tab characters in the generated Paths module
1491Duncan Coutts <duncan@haskell.org>**20080812160731]
1492[Add auto-generated CPP macros for package version testing
1493Simon Marlow <marlowsd@gmail.com>**20080811173016
1494 
1495 Now when using CPP you get
1496 
1497    MIN_VERSION_<package>(A,B,C)
1498 
1499 for each <package> in build-depends, which is true if the version of
1500 <package> in use is >= A.B.C, using the normal ordering on version
1501 numbers.
1502 
1503 This is done by auto-generating a header file
1504 dist/build/autogen/cabal_macros.h, and passing a -include flag when
1505 running CPP.
1506]
1507[allow Cabal to use base-4
1508Simon Marlow <marlowsd@gmail.com>**20080806130512]
1509[Make binary-dist do nothing in doc/Makefile, for now
1510Ian Lynagh <igloo@earth.li>**20080810005135]
1511[When running "Setup makefile", put "default: all" at the top of the Makefile
1512Ian Lynagh <igloo@earth.li>**20080809211148
1513 This make "make" work even if Makefile.local contains any targets.
1514]
1515[Use 'ghc-pkg dump' instead of 'ghc-pkg describe *'
1516David Waern**20080807190307
1517 
1518 Does not implement lazy parsing of the output of ghc-pkg dump, so this
1519 is only a partial fix of #311.
1520   
1521 For more information about why we want to use ghc-pkg dump, see GHC
1522 ticket #2201.
1523]
1524[Simplify InstalledPackageInfo parser and pretty printer
1525Duncan Coutts <duncan@haskell.org>**20080806122807
1526 Using the new utils in ParseUtils.
1527]
1528[Add parsse utils for simple flat formats.
1529Duncan Coutts <duncan@haskell.org>**20080806122613
1530 Should help to simplify the InstalledPackageInfo parser
1531 and also for similar formats in cabal-install.
1532]
1533[Tidy up the ppFields function and uses
1534Duncan Coutts <duncan@haskell.org>**20080806121315
1535 Put the arguments in a more sensible order:
1536 ppFields :: [FieldDescr a] -> a -> Doc
1537 and make the implementation clearer.
1538 clean up the use of it in the PackageDescription.Parse module
1539]
1540[Windows fixes
1541Ian Lynagh <igloo@earth.li>**20080803201253]
1542[setup makefile: put the source-dir suffix rules after the distdir suffix rules
1543Simon Marlow <marlowsd@gmail.com>**20080806130309
1544 This matches the behaviour of 'setup build' works, and is robust to
1545 people accidentally having old preprocessed sources lying around in the
1546 source dir.
1547]
1548[Generalise checkPackageFiles to any monad, not just IO
1549Duncan Coutts <duncan@haskell.org>**20080806001547
1550 This is to let us use the same checks for virtual or
1551 in-memory file systems, like tarball contents.
1552]
1553[Move parseFreeText into ParseUtils and use it more widely
1554Duncan Coutts <duncan@haskell.org>**20080806001352]
1555[Document and refactor 'parsePackageDescription'.
1556Thomas Schilling <nominolo@googlemail.com>**20080804190324
1557 
1558 Hopefully this makes this function more understandable and easier to
1559 modify.
1560]
1561[Adjust registration to allow packages with no modules or objects
1562Duncan Coutts <duncan@haskell.org>**20080804155826
1563 So ghc-pkg does not complain about missing files and dirs.
1564]
1565[Don't try to install libHSfoo.a if the lib had no object files
1566Duncan Coutts <duncan@haskell.org>**20080804143817
1567 To allow meta-packages.
1568]
1569[Fix instance Monoid ConfigFlags for configStripExes
1570Duncan Coutts <duncan@haskell.org>**20080802002045]
1571[Document the "exposed" .cabal file field
1572Duncan Coutts <duncan@haskell.org>**20080731162807]
1573[Fix the Windows build
1574Ian Lynagh <igloo@earth.li>**20080731194841]
1575[Remove unused imports
1576Ian Lynagh <igloo@earth.li>**20080730194526]
1577[Make Cabal compatible with extensible exceptions
1578Ian Lynagh <igloo@earth.li>**20080730183910
1579 The code is now also more correct, e.g. when we are ignoring IO exceptions
1580 while trying to delete something, we don't also ignore timeout exceptions.
1581]
1582[Remove unused imports
1583Duncan Coutts <duncan@haskell.org>**20080730182957]
1584[Remove unused inDir util function
1585Duncan Coutts <duncan@haskell.org>**20080730165031]
1586[Add an "exposed" field to the .cabal file library section
1587Duncan Coutts <duncan@haskell.org>**20080730164516
1588 It's a bool flag that says if by default the library should
1589 be registered with the compiler as exposed/unhidden (for
1590 compilers which have such a concept, ie ghc). You might want
1591 to do this for packages which would otherwise pollute the
1592 module namespace or clash with other common packages.
1593 It should be very rarely used. The only current examples we
1594 know of are the ghc api package and the dph packages.
1595]
1596[Rearrange the Monoid instances for Library, Executable, BuildInfo
1597Duncan Coutts <duncan@haskell.org>**20080730163432
1598 No functional change, just moving code about.
1599 We now define the Monoid methods directly rather than in
1600 terms of emptyLibrary, unionLibrary etc.
1601]
1602[Do the ghc rts ldOptions hack in a slightly more hygenic way
1603Duncan Coutts <duncan@haskell.org>**20080729195714]
1604[Fix uses of verbosity > deafening to use >=
1605Duncan Coutts <duncan@haskell.org>**20080729191855
1606 The maximum verbosity value is deafening so >= the correct test.
1607 This primarily affected haddock.
1608]
1609[Do not use ',' as a list separator for the cpp/cc/ld-options fields
1610Duncan Coutts <duncan@haskell.org>**20080729170556
1611 It breaks for some options like "ld-options: -Wl,-z,now"
1612 No existing .cabal files on hackage were using ',' as a
1613 list separator so this should not break anything.
1614]
1615[Pass the right -F and --framework flags when running hsc2hs on OS X
1616Ian Lynagh <igloo@earth.li>**20080729172757]
1617[Tweak a test to not go via the pretty printer
1618Ian Lynagh <igloo@earth.li>**20080729172750]
1619[Fix linking with hsc2hs on OS X
1620Ian Lynagh <igloo@earth.li>**20080729170215
1621 We don't tell hsc2hs to link the actual Haskell packages, so with GHC's
1622 rts package we need to also filter out the -u flags.
1623]
1624[Tweak whitespace
1625Ian Lynagh <igloo@earth.li>**20080729163729]
1626[Move docs for build-depends into the build information section
1627Duncan Coutts <duncan@haskell.org>**20080729162024
1628 Since it is shared between libs and exes. Extend the documentation
1629 to describe the syntax of version constraints, including the new
1630 version range syntax "build-depends: foo ==1.2.*".
1631]
1632[Remove references to cabal-setup from the documentation
1633Duncan Coutts <duncan@haskell.org>**20080729160950
1634 Change to runhaskell Setup or cabal-install as appropriate.
1635]
1636[Move the docs for the buildable field to a better place.
1637Duncan Coutts <duncan@haskell.org>**20080729160808
1638 It doesn't need to be right up near the top.
1639]
1640[Document more clearly that every modules must be listed
1641Duncan Coutts <duncan@haskell.org>**20080729160308
1642 in one of the fields exposed-modules, other-modules or main-is
1643 Add an extra note to the section on the Paths_pkgname module
1644 as the fact that it's automatically generated confuses people.
1645]
1646[Document the wildcard behaviour in data-files and extra-source-files fields
1647Duncan Coutts <duncan@haskell.org>**20080729155920]
1648[Document the $os and $arch install path vars
1649Duncan Coutts <duncan@haskell.org>**20080729155654]
1650[File globs must match at least one file or it's an error.
1651Duncan Coutts <duncan@haskell.org>**20080729154050]
1652[Fix the semantics of the simple file globbing to be sane
1653Duncan Coutts <duncan@haskell.org>**20080729152624
1654 I realised when I started to document it that the behaviour
1655 was not terribly consistent or sensible. The meaning now is:
1656   The limitation is that * wildcards are only allowed in
1657   place of the file name, not in the directory name or
1658   file extension. In particular, wildcards do not include
1659   directories contents recursively. Furthermore, if a
1660   wildcard is used it must be used with an extension, so
1661   "data-files: data/*" is not allowed. When matching a
1662   wildcard plus extension, a file's full extension must
1663   match exactly, so "*.gz" matches "foo.gz" but not
1664   "foo.tar.gz".
1665 The reason for providing only a very limited form of wildcard
1666 is to concisely express the common case of a large number of
1667 related files of the same file type without making it too easy
1668 to accidentally include unwanted files.
1669]
1670[Allow $arch and $os in install paths.
1671Duncan Coutts <duncan@haskell.org>**20080729151952
1672 Fixes ticket #312. For example a user could use:
1673   cabal configure --libsubdir="$pkgid/$compiler/$arch"
1674 if they wanted to have packages for multiple architectures
1675 co-exist in the same filestore area.
1676]
1677[Use "pkg == 1.2.*" as the version wildcard syntax
1678Duncan Coutts <duncan@haskell.org>**20080729151612
1679 Rather than "pkg ~ 1.2.*". This seemed to be the consensus.
1680 The syntax "pkg == 1.2.*" means "pkg >= 1.2 && < 1.3" and it
1681 is to encourage people to put upper bounds on api versions.
1682]
1683[Pass -no-user-package-conf to ghc when not using UserPackageDB
1684Duncan Coutts <duncan@haskell.org>**20080729145040
1685 Should eliminate the corner case where we're doing a global
1686 install but the user package db contains the exact same
1687 version as in the global package db. Perhaps we should warn
1688 in that case anyway since it's likely to go wrong later.
1689]
1690[disambiguate Control.Exception.catch for nhc98
1691Malcolm.Wallace@cs.york.ac.uk**20080728164506]
1692[more import qualification to help nhc98
1693Malcolm.Wallace@cs.york.ac.uk**20080728153629]
1694[help nhc98's module disambiguator a bit
1695Malcolm.Wallace@cs.york.ac.uk**20080724165753]
1696[Substitute for $topdir when we read GHC's InstalledPackageInfo's
1697Ian Lynagh <igloo@earth.li>**20080723112232]
1698[Fix the location of gcc.exe in a Windows GHC installation
1699Ian Lynagh <igloo@earth.li>**20080723101848]
1700[Don't need the complex code in detecting hsc2hs anymore
1701Duncan Coutts <duncan@haskell.org>**20080720234019
1702 Since we do not need to know if hsc2hs uses ghc or gcc as cc
1703 by default since in either case we now tell it to use gcc.
1704]
1705[Always use gcc as cc with hsc2hs
1706Duncan Coutts <duncan@haskell.org>**20080720233759
1707 Lookup what flags to use from the package index. Previously this
1708 was done by calling ghc as cc and passing -package flags to ghc.
1709 ghc would then lookup what extra flags to pass to gcc. We now do
1710 that ourselves directly and it's a good deal simpler and it's
1711 portable to the other haskell implementations. This is only a
1712 first go, the flags may not all be exactly right. Needs testing.
1713]
1714[Add gccProgram
1715Duncan Coutts <duncan@haskell.org>**20080720232818
1716 on Windows we have to find ghc's private copy of gcc.exe
1717]
1718[Add PackageSet.topologicalOrder and reverseTopologicalOrder
1719Duncan Coutts <duncan@haskell.org>**20080720223731
1720 with type :: PackageFixedDeps pkg => PackageSet pkg -> [pkg]
1721]
1722[Change some PackageSet functions to return the package rather than the id
1723Duncan Coutts <duncan@haskell.org>**20080720221702
1724 dependencyGraph and reverseDependencyClosure now return the
1725 full package rather than just the PackageIdentifier
1726]
1727[Convert from PackageIndex to PackageSet
1728Duncan Coutts <duncan@haskell.org>**20080720194924
1729 Turns out the feature to do case-insensitive lookups was only
1730 needed in cabal-install (and only in one little part) and
1731 elsewhere it causes problems. So use PackageSet instead.
1732]
1733[If we have GHC >= 6.9 then use the new -optdep replacement flags
1734Ian Lynagh <igloo@earth.li>**20080722163346]
1735[And exitcode of 2 from ghc-pkg when doing describe '*' means no packages
1736Ian Lynagh <igloo@earth.li>**20080722125759
1737 This is a bit of a kludge around GHC's #2201, until Cabal is updated to
1738 use ghc-pkg dump.
1739]
1740[Fix warnings and add a comment explaining why we pass -x to strip on OS X
1741Ian Lynagh <igloo@earth.li>**20080720220851]
1742[Pass -x to strip on OSX
1743Duncan Coutts <duncan@haskell.org>**20080720204609]
1744[Generate expanded makefile rules directly, rather than using $(eval ...)
1745Ian Lynagh <igloo@earth.li>**20080720194801
1746 We used to do this with $(eval ...) and $(call ...) in the
1747 Makefile, but make 3.79.1 (which is what comes with msys)
1748 doesn't understand $(eval ...), so now we just stick the
1749 expanded loop directly into the Makefile we generate.
1750]
1751[Put GHC's programArgs in GHC_OPTS when making a Makefile
1752Ian Lynagh <igloo@earth.li>**20080715132429]
1753[Pass -package-conf foo when using GHC as CC
1754Ian Lynagh <igloo@earth.li>**20080713123958]
1755[If we are using ghc as hsc2hs's cc, then tell it where package.conf is
1756Ian Lynagh <igloo@earth.li>**20080713110548
1757 if we have been told to use a specific one with --package-db
1758]
1759[Fix installing datafiles
1760Ian Lynagh <igloo@earth.li>**20080712173934
1761 If datadir is foo and the datafile is bar then we should install it to
1762 $datadir/bar, not $datadir/foo/bar.
1763]
1764[Fix the "Setup makefile" rules for C files
1765Ian Lynagh <igloo@earth.li>**20080712173851]
1766[If install is given a distPref, pass it on to copy and register
1767Ian Lynagh <igloo@earth.li>**20080712121916]
1768[derive Eq for ConfiguredProgram
1769Duncan Coutts <duncan@haskell.org>**20080711160138
1770 a request from Saizan
1771]
1772[Simplify ghc version test slightly
1773Duncan Coutts <duncan@haskell.org>**20080711142026]
1774[Add a hack to copy .hs-boot files into dist/...
1775Ian Lynagh <igloo@earth.li>**20080711000826
1776 When a preprocessor generates a .hs file we need to put the .hs-boot
1777 file next to it so that GHC can find it.
1778]
1779[Teach "Setup makefile" how to cope with multiple hs-source-dirs
1780Ian Lynagh <igloo@earth.li>**20080711000726]
1781[Fix some whitespace in Makefile.in
1782Ian Lynagh <igloo@earth.li>**20080710231519]
1783[In Makefile.in, put all the rules that mentions srcdir together
1784Ian Lynagh <igloo@earth.li>**20080710231415]
1785[Fix haddocking (with old haddocks?)
1786Ian Lynagh <igloo@earth.li>**20080703154714]
1787[Correct the order of args given by --PROG-options
1788Duncan Coutts <duncan@haskell.org>**20080710181437
1789 They were getting reversed. Problem located by Igloo.
1790]
1791[Remove the need for a compat Data.Map module
1792Duncan Coutts <duncan@haskell.org>**20080710154600
1793 Stop using Map.alter, use the same solution as the PackageIndex module.
1794]
1795[fix #if __GLASGOW_HASKELL__ test
1796Ross Paterson <ross@soi.city.ac.uk>**20080705105048
1797 
1798 The problem is that
1799 
1800 #if __GLASGOW_HASKELL__ < NNN
1801 
1802 is also true for non-GHC.  It should be
1803 
1804 #if __GLASGOW_HASKELL__ && __GLASGOW_HASKELL__ < NNN
1805]
1806[help nhc98's import overlap resolver
1807Malcolm.Wallace@cs.york.ac.uk**20080704140613]
1808[massage a pattern-with-context around nhc98's typechecker
1809Malcolm.Wallace@cs.york.ac.uk**20080704140541]
1810[Fix using specified package databases
1811Ian Lynagh <igloo@earth.li>**20080703001216
1812 If we are using a specified package database, we need to tell GHC what
1813 it is when building
1814]
1815[Fix the build with GHC 6.4.2: Data.Map.alter doesn't exist
1816Ian Lynagh <igloo@earth.li>**20080703001151]
1817[Allow installing executables in-place, and using shell script wrappers
1818Ian Lynagh <igloo@earth.li>**20080629164939
1819 GHC-only currently.
1820]
1821[haddock typo
1822Ian Lynagh <igloo@earth.li>**20080629114342]
1823[Fix a haddock typo
1824Ian Lynagh <igloo@earth.li>**20080629114239]
1825[Update .darcs-boring
1826Ian Lynagh <igloo@earth.li>**20080627182013]
1827[TAG 2008-05-28
1828Ian Lynagh <igloo@earth.li>**20080528004259]
1829[Remove the SetupWrapper module
1830Duncan Coutts <duncan@haskell.org>**20080628173010
1831 It's not used in Cabal itself and while cabal-install used
1832 it previously, it now has its own extended implementation.
1833]
1834[Update module headers
1835Duncan Coutts <duncan@haskell.org>**20080628172550
1836 Use cabal-devel@haskell.org as the maintainer in most cases except for
1837 a few which were pre-existing modules copied from elsewhere or modules
1838 like L.H.Extension which really belong to libraries@haskell.org
1839 Remove the useless stability module. We have more detailed information
1840 on stability elsewhere (in the version number and user guide).
1841 Add more top level module documentation, taken from the source guide.
1842]
1843[Whitespace changes, convert tabs to spaces
1844Duncan Coutts <duncan@haskell.org>**20080626200933]
1845[Remove a couple old deprecated empty modules
1846Duncan Coutts <duncan@haskell.org>**20080626195204]
1847[Add ModuleName as a new type instead of using String everywhere
1848Duncan Coutts <duncan@haskell.org>**20080626192939]
1849[Tweaks to the readme, hopefully will reduce confusion
1850Duncan Coutts <duncan@haskell.org>**20080625232051]
1851[Add compat InstalledPackageInfo types for older GHCs
1852Duncan Coutts <duncan@haskell.org>**20080621013727
1853 We need these types for their Read instances so that we
1854 can still read older GHCs package db files when we make
1855 changes to the current InstalledPackageInfo type, or the
1856 types contained in it, like PackageIdentifier or License.
1857]
1858[Add simple file name globbing (*) to data-files and extra-source-files
1859Duncan Coutts <duncan@haskell.org>**20080626171424]
1860[Use conservative render style for display
1861Duncan Coutts <duncan@haskell.org>**20080619222258]
1862[Include trailing newline in hscolour command description
1863Duncan Coutts <duncan@haskell.org>**20080619220940]
1864[Add PackageSet, like PackageIndex but case sensitive
1865Duncan Coutts <duncan@haskell.org>**20080614003705
1866 Actually it turns out that we don't need case insensitivity in many
1867 cases, mosty just for simple lookups in the UI. For everything else
1868 the ordinary Ord instance is much simpler. The fact that listing the
1869 contents of a PackageIndex doesn't come out in Ord order actually
1870 causes real problems in cabal-install and necessitates re-sorting.
1871 So we should move to using PackageSet in most cases and just leave
1872 the search and lookup operations in PackageIndex.
1873]
1874[Add PackageName as a newtype
1875Duncan Coutts <duncan@haskell.org>**20080614002926]
1876[No more need for the distinction between null and emptyBuildInfo
1877Duncan Coutts <duncan@haskell.org>**20080614001654
1878 Now that we have removed the hsSourceDirs = [currentDir] default
1879 from emptyBuildInfo it is now equal to nullBuildInfo.
1880]
1881[Add version wildcard syntax
1882Duncan Coutts <duncan@haskell.org>**20080619175006
1883   build-depends: foo ~1.2.*
1884 means:
1885   build-depends: foo >=1.2 && <1.3
1886 It's also valid everywhere else version ranges are used.
1887]
1888[haddock-2.2 and later do now support the --hoogle flag
1889Duncan Coutts <duncan@haskell.org>**20080613205445]
1890['.' should not always be in hs-source dirs
1891Duncan Coutts <duncan@haskell.org>**20080613230352
1892 We changed the parsing of list fields in the .cabal file so that it
1893 adds to the current value rather than replacing it. This allows you
1894 to put multiple entries for a list field and they all get
1895 concatenated. However that means that the '.' in the hsSourceDirs of
1896 emptyBuildInfo is always added to and not replaced like we did
1897 previously. That's not what we want in this case. We want to use '.'
1898 for hsSourceDirs *only* if hsSourceDirs is otherwise null. As it
1899 happens, due to the way the configurations code works, we're already
1900 filling in the default if it'd otherwise be null so we do not need
1901 '.' in the emptyBuildInfo at all.
1902]
1903[Fix css location in generation of user guide
1904Duncan Coutts <duncan@haskell.org>**20080617133811]
1905[Update changelog for 1.4.0.1
1906Duncan Coutts <duncan@haskell.org>**20080617130434]
1907[Makefile tweak, setup depends on Setup.hs
1908Duncan Coutts <duncan@haskell.org>**20080616175446]
1909[construct InstalledPackageInfo from scratch rather than by overriding
1910Duncan Coutts <duncan@haskell.org>**20080616171505
1911 It means we catch any fields that get added. As it happens we were
1912 missing a field, though its value is supposed to be just [] which is
1913 the same value as we got from the default emptyInstalledPackageInfo.
1914]
1915[force results inside withHaskellFile
1916Ross Paterson <ross@soi.city.ac.uk>**20080614160707
1917 
1918 withUTF8FileContents now closes the file, so we need to force what we're
1919 computing from the contents before it's gone.
1920]
1921[Include the readme and the changelog in the tarball
1922Duncan Coutts <duncan@haskell.org>**20080612190558]
1923[Move the mkGHCMakefile.sh out of the root dir
1924Duncan Coutts <duncan@haskell.org>**20080612190317
1925 Having it there confuses people.
1926 They think they have to run it as part of the install process.
1927]
1928[Put upper bounds on all the build-depends
1929Duncan Coutts <duncan@haskell.org>**20080612174958]
1930[Add the 1.4.0.0 release to the changelog
1931Duncan Coutts <duncan@haskell.org>**20080612164242]
1932[Add the 1.2.4.0 release to the changelog
1933Duncan Coutts <duncan@haskell.org>**20080612164144]
1934[Update the README and convert it to markdown syntax
1935Duncan Coutts <duncan@haskell.org>**20080612162906]
1936[Update the release notes
1937Duncan Coutts <duncan@haskell.org>**20080612154624]
1938[Update copyright and authors list in the .cabal file
1939Duncan Coutts <duncan@haskell.org>**20080612154444]
1940[base-1.0 does not have Data.Map.alter so use insertWith instead
1941Duncan Coutts <duncan@haskell.org>**20080612154309]
1942[Lift the restriction that libraries must have exposed-modules
1943Duncan Coutts <duncan@haskell.org>**20080612092924
1944 This allows libs that have only private modules or C code. This
1945 might be used to make libs that have non-exposed modules and only
1946 export C APIs. It could also be used to make packages that consist
1947 only of C code. That might be useful for bindings where it may
1948 make sense to split the C and Haskell code into separate packages.
1949]
1950[Use the standard autogenModulesDir rather than a local copy
1951Duncan Coutts <duncan@haskell.org>**20080612092855]
1952[Fix the register --gen-pkg-config flag
1953Duncan Coutts <duncan@haskell.org>**20080612092425
1954 When specified without any file name it is supposed to use
1955 a default file name rather than be ignored completely.
1956]
1957[Filter out the Paths_pkgname file in sdist
1958Duncan Coutts <duncan@haskell.org>**20080612091810
1959 Fixes ticket #187 finally (I hope).
1960]
1961[Switch the hugs code to safe file reading and writing
1962Duncan Coutts <duncan@haskell.org>**20080610180947]
1963[Use writeFileAtomic everywhere instead of writeFile
1964Duncan Coutts <duncan@haskell.org>**20080610180727]
1965[Switch to scoped file reading rather than lazy readFile
1966Duncan Coutts <duncan@haskell.org>**20080610180528]
1967[Close the package.conf file after reading it
1968Duncan Coutts <duncan@haskell.org>**20080610180217
1969 We had a bug on windows where we open and read ghc's package.conf
1970 database but because we did not consume the final newline we did
1971 not close the file. Then when we called ghc-pkg to register a
1972 package it failed because it could not rename the open file.
1973]
1974[Add withFileContents and withUTF8FileContents
1975Duncan Coutts <duncan@haskell.org>**20080610180150
1976 Safe block scoped reading of files.
1977 These guarantee that the file gets closed.
1978]
1979[Fix pre-processing for haddock and executables
1980Duncan Coutts <duncan@haskell.org>**20080609233609
1981 Now look in the right place to find the pre-processed source
1982 files belongign to executables. Fixes ticket #252.
1983]
1984[Fail better when using haddock 2.x and the --hoogle flag
1985Duncan Coutts <duncan@haskell.org>**20080609190555
1986 Fixes ticket #249
1987]
1988[Install haddock interface only when generated
1989Duncan Coutts <duncan@haskell.org>**20080609190251
1990 This is actually Andrea Rossato's patch but it didn't merge
1991 cleanly due to more recent changes. Fixes ticket #250.
1992]
1993[Install license file into the right place
1994Duncan Coutts <duncan@haskell.org>**20080609185840
1995 even if the license file was kept in a subdir of the src tree.
1996 The canonical example was: license-file: debian/copyright
1997 It was being installed into $docdir/debian/ and failing since
1998 that dir did not exist. It's now installed into just $docdir.
1999]
2000[Note compatability issue in deprecation message for defaultUserHooks
2001Duncan Coutts <duncan@haskell.org>**20080527135830]
2002[Bump version due to api changes
2003Duncan Coutts <duncan@haskell.org>**20080529104714]
2004[Put spaces round || and && when displaying version range expressions
2005Duncan Coutts <duncan@haskell.org>**20080529104214
2006 This makes them much more readable.
2007]
2008[Change the PackageIndex invariant so the buckets are ordered
2009Duncan Coutts <duncan@haskell.org>**20080529095346
2010 Each bucket holds packages with the same name case-insensitively.
2011 Previously each buckets was internally unordered. Now they're
2012 ordered by the full package id which means first by package name
2013 case-sensitively and then by version.
2014]
2015[Add thisPackageVersion and notThisPackageVersion
2016Duncan Coutts <duncan@haskell.org>**20080529092607
2017 Util functions for makeing dependencies from package identifiers.
2018 thisPackageVersion    (foo-1.0) = foo ==1.0
2019 notThisPackageVersion (foo-1.0) = foo /=1.0
2020 The latter is handy as a constraint in dependency resolution.
2021]
2022[Add notThisVersion :: Version -> VersionRange
2023Duncan Coutts <duncan@haskell.org>**20080529092244
2024 Opposite of ThisVersion, it means /= x.y but is actually implemented
2025 as > x.y || < x.y as we do not have not or not equal as primitives.
2026]
2027[Write out Bool config values correctly
2028Duncan Coutts <duncan@haskell.org>**20080521153420
2029 Used by cabal-install when writing the default ~/.cabal/config file.
2030 Previously it was using show for type Maybe Bool and writing out
2031 "Just True" when of course it should just be "True".
2032]
2033[Rename doc/fptools.css to avoid the ghc build system cleaning it
2034Duncan Coutts <duncan@haskell.org>**20080520191700
2035 The user guide gets built in two different ways. There's a target
2036 in Cabal's the top level Makefile and there is also the stuff that
2037 the ghc build system uses. The ghc build system expects to copy in
2038 doc/fptools.css and then delete it again on make clean. We want a
2039 persistent copy so that we can make the docs when we've just got a
2040 standalone Cabal build tree, so that's now kept as doc/Cabal.css.
2041]
2042[Remove gnerated file (doc/fptools.css)
2043Ian Lynagh <igloo@earth.li>*-20080511130035]
2044[document data-dir field
2045Bertram Felgenhauer <int-e@gmx.de>**20080509131306]
2046[add data-dir field to package config
2047Bertram Felgenhauer <int-e@gmx.de>**20080509130448
2048 Cabal will look for data files to install relative to the directory given
2049 in the data-dir field, allowing package authors to better structure their
2050 source tree. There's no behavioural change by default.
2051]
2052[Allow the bindir, libdir and libexec dir to be specified via env vars too
2053Duncan Coutts <duncan@haskell.org>**20080519173808
2054 Same as for the datadir. Eg for package Foo, you'd use
2055 Foo_bindir=... Foo_datadir=... Foo_libexecdir=... ./Foo
2056 The next step would be generating a wrapper script that allows
2057 running the program inplace. It should also work for a library.
2058]
2059[Remove unused import
2060Duncan Coutts <duncan@haskell.org>**20080513094301]
2061[Do not display version tags
2062Duncan Coutts <duncan@haskell.org>**20080509094455]
2063[Remove Distribution.Compat.Exception from other-modules
2064Duncan Coutts <duncan@haskell.org>**20080514171822]
2065[Add PackageIndex.lookupPackageName and extra deletion functions
2066Duncan Coutts <duncan@haskell.org>**20080514162954]
2067[Check invariant on every construction and elide on lookups
2068Duncan Coutts <duncan@haskell.org>**20080514154104]
2069[Remove redundant Char test in parseBuildToolName
2070Duncan Coutts <duncan@haskell.org>**20080514153343
2071 It was made redundant after the isSymbol test was removed.
2072 Spotted by Igloo.
2073]
2074[Eliminate use of bracketOnError, use handle instead
2075Duncan Coutts <duncan@haskell.org>**20080514153206
2076 It's actually more appropriate anyway.
2077 This means we don't need any Distribution.Compat.Exception.
2078]
2079[Define bracketOnError in compat; fixes the build for GHC 6.4
2080Ian Lynagh <igloo@earth.li>*-20080514003919]
2081[Add in {-# OPTIONS #-} for the benefit of ghc-6.4.x
2082Duncan Coutts <duncan@haskell.org>**20080514144728
2083 Which do not grok OPTIONS_GHC or LANGUAGE pragmas
2084]
2085[fix scope errors in non-GHC branch of an #ifdef
2086Malcolm.Wallace@cs.york.ac.uk**20080514112530]
2087[Prefix the datadir env var with the package name
2088Duncan Coutts <duncan@haskell.org>**20080514094203
2089 Partly as it is more likely not to clash with other users and since
2090 in general different libs within a program may need different paths.
2091]
2092[Made it possible to run executeables with data files in place.
2093Johan Tibell <johan.tibell@gmail.com>**20080413134155
2094 Added an environment variable, DATA_DIR, that is checked before the
2095 installation data directory is used.
2096]
2097[Don't use Data.Char.isSymbol as it doesn't exist in base-1.0
2098Duncan Coutts <duncan@haskell.org>**20080514083405
2099 This is an alternative fix to creating a Distribution.Compat.Char
2100]
2101[Modules that use cpp have to have cpp language prama to say so
2102Duncan Coutts <duncan@haskell.org>**20080514082913
2103 Otherwise we cannot compile with just ghc --make
2104 which is actually essential for bootstrapping.
2105]
2106[Make Distribution.Compat.Char for isSymbol; fixes the build with GHC 6.4
2107Ian Lynagh <igloo@earth.li>*-20080514004703]
2108[Add new compat modules to Cabal file
2109Ian Lynagh <igloo@earth.li>**20080514022119]
2110[Make Distribution.Compat.Char for isSymbol; fixes the build with GHC 6.4
2111Ian Lynagh <igloo@earth.li>**20080514004703]
2112[Hack around lack of Read for Map in GHC 6.4
2113Ian Lynagh <igloo@earth.li>**20080514004400
2114 This is made worse by Show on Map being strange in GHC 6.4.
2115 The code could be better, but it works, and all the ugliness is in
2116 #if's that we can remove at some point down the line.
2117]
2118[Define bracketOnError in compat; fixes the build for GHC 6.4
2119Ian Lynagh <igloo@earth.li>**20080514003919]
2120[Print exit code and stderr for failing progs at debug level verbosity
2121Duncan Coutts <duncan@haskell.org>**20080513094055
2122 Also adjust the verbosity level we get during configure at -v3
2123 Should make it a bit easier to track down failing calls.
2124]
2125[Remove a hardcoded "dist"
2126Ian Lynagh <igloo@earth.li>**20080511181305]
2127[Make the "dist" directory configurable
2128Ian Lynagh <igloo@earth.li>**20080511155640]
2129[Remove gnerated file (doc/fptools.css)
2130Ian Lynagh <igloo@earth.li>**20080511130035]
2131[Fix a bug in the unlitter
2132Ian Lynagh <igloo@earth.li>**20080510233852
2133 If we see a birdtrack while we are in latex mode, then we stay in latex
2134 mode - don't change into bird mode!
2135]
2136[Display Cabal version in configure output with -v
2137Duncan Coutts <duncan@haskell.org>**20080509163507
2138 eg "Using Cabal-1.5.1 compiled by ghc-6.8"
2139 Annoyingly ghc doesn't give us its full version number.
2140]
2141[Add PackageIndex.reverseDependencyClosure
2142Duncan Coutts <duncan@haskell.org>**20080506234902
2143 It's similar to dependencyClosure but looks at reverse dependencies.
2144 For example it's useful to find all packages that depend on broken
2145 packages and are thus themselves broken.
2146]
2147[Improve style and performance of PackageIndex.dependencyClosure
2148Duncan Coutts <duncan@haskell.org>**20080506234447
2149 Keep the completed set as another PackageIndex rather than a list.
2150 We want to return an index at the end anyway and in the mean time
2151 we want to do lots of lookups to see if we've visited previously.
2152]
2153[Add PackageIndex.dependencyGraph that builds a Graph
2154Duncan Coutts <duncan@haskell.org>**20080506234326
2155 Useful for some more tricky queries.
2156]
2157[Add PackageIndex.delete
2158Duncan Coutts <duncan@haskell.org>**20080506131603
2159 We occasionally need to remove packages from an index
2160 eg to restrict the choices of a dependency resolver.
2161]
2162[Remove a test for the specific kind of exception for nhc98 compatibility
2163Duncan Coutts <duncan@haskell.org>**20080506102804
2164 This was the check for ghc-pkg failing. We cannot check for the
2165 exception being an ExitException since that assumes ghc's
2166 representation of the Exception type, whereas nhc98 defines:
2167 type Exception = IOError
2168]
2169[Cope better with ghc bug #2201, display a better error message
2170Duncan Coutts <duncan@haskell.org>**20080505085746
2171 Otherwise it can (and does) really confuse people.
2172 The problem is that the command $ ghc-pkg-6.9 describe '*' --user
2173 returns a non-zero exit code if the user package db is empty.
2174 ghc-pkg intends this exit code to tell us if the query returned
2175 any results (one can use more complex queries as tests) but Cabal
2176 interprets it as failure. Indeed we cannot distinguish it from
2177 any other kind of failure from ghc-pkg.
2178]
2179[Add PackageIndex.dependencyCycles
2180Duncan Coutts <duncan@haskell.org>**20080504131626
2181 Finds any cycles (strongly connected components) in the dependencies
2182 of set of packages. This is useful for checking the correctness of
2183 installation plans.
2184]
2185[Change dependencyInconsistencies to not take the pseudo top package
2186Duncan Coutts <duncan@haskell.org>**20080504130802
2187 The one case where we need the pseudo top package we can use
2188 PackageIndex.insert instead to get the same effect and there
2189 are other cases in cabal-install where we do not want a pseudo
2190 top package.
2191]
2192[Reverse the order of the args to PackageIndex.insert
2193Duncan Coutts <duncan@haskell.org>**20080504130317
2194 To take the index last like the other functions and like Data.Map.
2195 It is actually more convenient that way round.
2196]
2197[Revert the change about the --internal flag and a warning about haddock
2198Duncan Coutts <duncan@haskell.org>**20080501223131
2199 Just a bit of confusion over the behaviour of the --executable flag.
2200]
2201[Document --internal in Cabal.xml
2202Joachim Breitner <mail@joachim-breitner.de>**20080501153356]
2203[With --executable, --internal just adds --ignore-all-exports
2204Joachim Breitner <mail@joachim-breitner.de>**20080501152544]
2205[Implement --internal flag
2206Joachim Breitner <mail@joachim-breitner.de>**20080501152421
2207 Passing --internal to the haddock stage does these things:
2208  * Does not pass --hide parameter to haddock
2209  * Passes --ignore-all-exports parameter
2210  * Appends "(internal documentation)" to the title
2211]
2212[Add an --internal flag to HaddockFlags
2213Joachim Breitner <mail@joachim-breitner.de>**20080501145103]
2214[Revert the other `fmap` to (.)
2215Malcolm.Wallace@cs.york.ac.uk**20080501110006
2216 To avoid needing a non-H'98 instance of Functor for (->).
2217]
2218[Revert one change of (.) to fmap. It was not necessary and broke nhc98.
2219Duncan Coutts <duncan@haskell.org>**20080501104620
2220 The other one was needed as we changed a type from Bool to Maybe Bool.
2221]
2222[Add help command as per ticket #272
2223Duncan Coutts <duncan@haskell.org>**20080430133740
2224 "cabal help" behaves like "cabal --help"
2225 "cabal help cmd" behaves like "cabal cmd --help"
2226 Should still work with command line completion.
2227]
2228[Change handling of bool command line args to allow an unset state
2229Duncan Coutts <duncan@haskell.org>**20080429201123
2230 For bool valued flags we were always producing the command line
2231 string corresponding to a false flag value, even if the flag was
2232 not set. For example we'd always get "--disable-shared".
2233 It is important for cabal-install to be able to take an empty set
2234 of flags, override a few flags and turn the flags back into
2235 command line strings without getting a lot of extra defaults.
2236 Partly this is because we have to work with older versions of the
2237 Cabal library command line which does not recognise the new options.
2238]
2239[Remove the feature for highlighting the default cases in --help output
2240Duncan Coutts <duncan@haskell.org>**20080429191206
2241 Turns out it doesn't help us much because in many cases the initial/default
2242 flags are actually empty so we cannot identify the default values.
2243]
2244[Make the old test code compile
2245Duncan Coutts <duncan@haskell.org>**20080428225729
2246 Still a lot of bit rot, many of the full tests fail due to changed paths
2247]
2248[Fix license parsing
2249Duncan Coutts <duncan@haskell.org>**20080428192255
2250 Spotted by the testsuite which I'm trying to resurrect.
2251]
2252[Fix fix for #224.
2253Thomas Schilling <nominolo@gmail.com>**20080426164537
2254 
2255 Changing from list of Dependencies to Maps resulted in the wrong Monoid
2256 instance being used.  I'd still like to be able to run a test suite on
2257 this but that'd require a lot more work to do properly...
2258]
2259[When multiple specifying list fields in the same section combine them
2260Duncan Coutts <duncan@haskell.org>**20080423201519
2261 eg if you had:
2262 extensions: Foo
2263 extensions: Bar, Baz
2264 then previously we only ended up with [Bar, Baz]. Now we get them all.
2265 Only applies to list fields, for single fields the second value is taken
2266 and the first is silently discarded. This isn't good of course but the
2267 fix is harder since we're not in a context where we can report errors.
2268 Really we should just declare up front what kind of field it is and
2269 inherit the right behaviour automagically, either duplicates disallowed
2270 or allowed and combined with mappend.
2271]
2272[Normalise file names in warning messages
2273Duncan Coutts <duncan@haskell.org>**20080423190457
2274 We already do this for error messages.
2275]
2276[Fix the check for -XFooBar ghc-options flags to be more permissive
2277Duncan Coutts <duncan@haskell.org>**20080423190243
2278 Previously we rejected all such flags but that posed the problem that older
2279 versions of Cabal, like 1.1.6 did not understand new extensions so we
2280 could not actually follow the advice and use the extenion. So now we only
2281 warn about -X flags if they refer to old extensions that Cabal 1.1.6 knew
2282 about. If the .cabal file specifies cabal-version: >= 1.2 or similar
2283 (anything that excludes 1.1.6) then we warn about all -X flags.
2284]
2285[Add checks for unknown OS Arch and Compiler names
2286Duncan Coutts <duncan@haskell.org>**20080423151410
2287 They're ok locally but for distribution they need to be known.
2288]
2289[Package check now take a GenericPackageDescription
2290Duncan Coutts <duncan@haskell.org>**20080423150354
2291 Unfortunately in some cases we only have a already-configured
2292 PackageDescription to we have to expose a checkConfiguredPackage.
2293 We should refactor things so that we keep all the information
2294 even in a configured PackageDescription.
2295]
2296[Make warning messages show the file name
2297Duncan Coutts <duncan@haskell.org>**20080422141909]
2298[Update UTF8 code
2299Duncan Coutts <duncan@haskell.org>**20080422141539
2300 Some code and test cases taken from the utf8-string package.
2301 Updated copyright notice appropriately (I think).
2302]
2303[fix import for nhc98
2304Malcolm.Wallace@cs.york.ac.uk**20080422133009]
2305[Don't nub extra-libs in unionBuildInfo
2306Duncan Coutts <duncan@haskell.org>**20080420192312
2307 It's possible that we sometimes need to list the same library
2308 more than once if there are circular symbol references.
2309]
2310[Fix unionBuildInfo
2311Duncan Coutts <duncan@haskell.org>**20080420180520
2312 Fix ticket #264 to use nub only on the fields which are treated as sets.
2313 Probably we should be using the right types and mappend for each field.
2314 Change to construct a new value from scratch rather than overriding one
2315 of the two args. This helps to make sure we're updating all the field
2316 as we get a warning if we miss any. Turns out we were missing the ghc
2317 profiling and shared libs options which meant they were getting dropped.
2318 That had the effect of ghc-prof-options: in .cabal files being ignored.
2319 Thanks to 'midfield' from #haskell for spotting this.
2320]
2321[Add newtype FlagName and FlagAssignment type alias
2322Duncan Coutts <duncan@haskell.org>**20080415204854
2323 and use them in the appropriate places.
2324]
2325[Add PackageIndex.insert and reverse merge/mappend
2326Duncan Coutts <duncan@haskell.org>**20080415203637
2327 Packages in the second argument to merge now mask those in the first.
2328]
2329[Make finalizePackageDescription use CompilerId type
2330Duncan Coutts <duncan@haskell.org>**20080413224111
2331 Use the proper data type rather than a tuple (CompilerFlavor, Version)
2332]
2333[Fix #224.  We do not yet warn if the user specified a dependency that
2334Thomas Schilling <nominolo@gmail.com>**20080413182659
2335 did not occur in the package (it is just silently ignored.)
2336]
2337[Add 'readP_to_E' function that takes the longest parse.
2338Thomas Schilling <nominolo@gmail.com>**20080413182042]
2339[Add simple test case for the dependency resolution case.  This should
2340Thomas Schilling <nominolo@gmail.com>**20080413132002
2341 go into the test suite one day.
2342]
2343[Fix/Add documentation.
2344Thomas Schilling <nominolo@gmail.com>**20080413131839]
2345[Change dependency resolution algorithm.
2346Thomas Schilling <nominolo@gmail.com>**20080413131807
2347 
2348 There were two reasons to do this.  Firstly, this formulation makes it
2349 easier to add the --constraint command line flag that adds additional
2350 constraints on the packages that should be used.
2351 
2352 Secondly, with the orgininal algorithm it was possible to satisfy the
2353 constraint "foo < 1, foo > 2" if we had two versions of package "foo"
2354 which each satisfy one constraint.  This patch fixes this by requiring
2355 the same package to satisfy both constraints (which of course is
2356 impossible in this case).
2357]
2358[expose ghcOptions
2359jeanphilippe.bernardy@gmail.com**20080417211221
2360 This helps finding the options to pass to GHC API in various tools
2361]
2362[expose tryGetConfigStateFile
2363jeanphilippe.bernardy@gmail.com**20080417180248
2364 This is needed by Yi to (try to) load an arbitrary
2365 project.
2366]
2367[fix for #187 -- directory of Paths_packagename is included when looking for source files
2368Andres Loeh <mail@andres-loeh.de>**20080412204904]
2369[Check for the required cabal version early in parsing
2370Duncan Coutts <duncan@haskell.org>**20080409154655
2371 Previously we only checked the "cabal-version" field after parsing
2372 and all other configure processing. If the package really needs a
2373 later Cabal version it is of course highly likely that parsing or
2374 configure are going to fail and the user is not going to get the
2375 helpful error message about the version of Cabal required. So now
2376 we do the check early during parsing. If a later version is
2377 required and parsing subsequently fails, we now report the version
2378 issue, not the subsequent parse error. If parsing succeeds we
2379 still issue a warning which should be a useful hint to the user if
2380 subsequent configure processing fails.
2381]
2382[Use relative file paths in .cabal parse error messages
2383Duncan Coutts <duncan@haskell.org>**20080409154030
2384 Do this by normalising the file path in the error message
2385 and when looking for .cabal files, by looking in '.' rather
2386 than the absolute path of the current directory.
2387]
2388[Remove unused import
2389Duncan Coutts <duncan@haskell.org>**20080409073352]
2390[Fix for detecting ~/.cabal/ dir as a .cabal file
2391Duncan Coutts <duncan@haskell.org>**20080409073236
2392 Which happened if you use cabal configure in your home dir.
2393 Now produced the right error message, or if you actually put
2394 a cabal project in your home dir, it might actually work.
2395 Also, do the same fix for findHookedPackageDesc.
2396]
2397[Fix spelling in error message
2398Duncan Coutts <duncan@haskell.org>**20080408134610]
2399[Fix names of profiling libs
2400Duncan Coutts <duncan@haskell.org>**20080407013449
2401 I broke this recently when refactoring. Restore the original behaviour.
2402 Was generating "libHSfoo_p-1.0.a" when it should be "libHSfoo-1.0_p.a".
2403]
2404[TAG 1.5.1
2405Duncan Coutts <duncan@haskell.org>**20080329181329]
2406Patch bundle hash:
2407c349b3cb2413c999b8836bbe0520300e66e1a4f5