Skip to content


Subversion checkout URL

You can clone with
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: haskell/cabal
head fork: haskell/cabal
This comparison is big! We’re only showing the most recent 250 commits
Commits on Feb 11, 2008
@dcoutts dcoutts Note the form of jhc --version output 07e977f
@dcoutts dcoutts Move ppField(s) utils into ParseUtils module
and stop exporting various internal stuff from PackageDescription.Parse
which was previously being used by the sanity checking code.
@dcoutts dcoutts Bump version to 1.3.4
Various recent api changes
@dcoutts dcoutts Document main-is behaviour with preprocessors 887b9f7
@dcoutts dcoutts Add lots of new package checks
Check that Setup.(l)hs exists.
Check for ./configure file if build-type: Configure
Check for duplicate modules in library and executables.
Check ghc-options and cc-options for -I -l -L flags that should be elsewhere
Check for lots of insane ghc-options that people have used in real packages.
Check for old ghc -f flags that correspond to extensions
@nominolo nominolo Allow lower-case spellings for boolean fields. eb0ef08
Commits on Feb 12, 2008
@phigley phigley Moved --program-prefix and --program-suffix out of InstallDirs
The program prefix and suffix have been moved out of InstallDirs so that InstallDirs is now all directories.  The prefix and suffix have been moved into LocalBuildInfo as stand-alone PathTemplate flags.
@byorgey byorgey Add x-* extension field parsing (trac #210) 9fddd98
Commits on Feb 13, 2008
@dcoutts dcoutts Don't re-export Compiler from Distribution.Simple.Setup e224d0e
Commits on Feb 15, 2008
@dcoutts dcoutts getInstalledPackages now returns full InstalledPackageInfo
rather than just PackageIdentifier. This will enable us to do lots more in
future, for example detecting inconsistent package depends, doing our
own cpp pre-processing or module chasing.
@dcoutts dcoutts Add some more common utils we'll need in a sec and make use of interc…

Have to define it locally since it only appeared in Data.List recently.
@dcoutts dcoutts Simplify configure code by relying on ghc >= 6.4
We changed to require ghc >= 6.4 a while ago, this is just a simplification
that was missed at the time.
@dcoutts dcoutts Add InstalledPackageIndex type and use it in place of [InstalledPacka…

The new index module is adapted from the similar module in cabal-install but
with renamed functions and extended to work with full InstalledPackageInfo
rather than just PackageIdentifier. So the getInstalledPackages functions now
return an InstalledPackageIndex.
@dcoutts dcoutts Make the GHC.Makefile private ef742a4
@dcoutts dcoutts Bump version to 1.3.5 due to more api changes 6f0f094
Commits on Feb 16, 2008
@shelarcy shelarcy Fix: Distribution.Make's configure doesn't work on Windows. c79c402
Commits on Feb 18, 2008
Malcolm.Wallace help nhc98 to disambiguate imports c892009
@dcoutts dcoutts Eliminate use of cpp in Distribution.Compiler 85313ff
@dcoutts dcoutts Add warnings about missing and out-of-tree relative paths 3183b25
@dcoutts dcoutts Save horazontal space in the --help output by omitting options to sho…
…rt flags

So instead of "-f FLAGS --flags=FLAGS" we get just "-f --flags=FLAGS"
This makes rather better use of 80 cols and means the flag descriptsion
are not squeesed into such a narrow column.
Commits on Feb 19, 2008
@dcoutts dcoutts Detect broken and inconsistent package deps
We now check for packages that are broken due to their dependencies having
been unregistered. We fail and print a fairly sensible message in this case.
We also check for inconsistent dependencies and give a warning saying which
packages are depending on inconsistent versions of a third. This is a warning
not an error because it does not always lead to failure. Hopefully it'll help
people who are otherwise just running into random compile errors.
This fixes ticket #220.
@dcoutts dcoutts Add the InstalledPackageIndex to the LocalBuildInfo
So now all the info about installed packages is available to all the
verious build phases.
@dcoutts dcoutts Use the InstalledPackageIndex rather than calling ghc-pkg in Haddock …

Previously we made two calls to ghc-pkg per-dependent package which starts
to get very slow once you have 100's of installed packages and the package
you're building depends on several of them. Now we use the cached information
about the installed packages. Also refactored the code to generate the haddock
package flags so we can export it and use it elsewhere more easily.
@dcoutts dcoutts Fix haddock markup 80d430a
Commits on Feb 20, 2008
@dcoutts dcoutts Generalise InstalledPackageIndex over all Package instances
New Package class of things that can be identified by a PackageIdentifier
so that covers at least PackageIdentifier, PackageDescription and
InstalledPackageInfo. Most PackageIndex operations work for any package type.
@dcoutts dcoutts generalise remaining PackageIndex functions over class of pkgs with f…
…ixed deps

Add a class for packages with fixed deps, like InstalledPackageInfo and
generalise the few functions that used PackageIndex InstalledPackageInfo
specifically to use PackageFixedDeps pkg => PackageIndex pkg
This will be helpful in cabal-install for configured but not-yet-installed
@dcoutts dcoutts Use PackageIndex in finalisePackageDescription
rather than [PackageIdentifier]
Commits on Feb 21, 2008
Malcolm.Wallace more import/qualified name hints to help nhc98 6852fc6
@dcoutts dcoutts Remove a coule unused imports a71ea02
@dcoutts dcoutts Avoid a rare problem where we fail to find the haddock program 809cc13
@dcoutts dcoutts Export the PackageFixedDeps class
and make GenericPackageDescription an instance of the Package class
Commits on Feb 22, 2008
@dcoutts dcoutts Move Package class to Distribution.Package a675703
@dcoutts dcoutts Use packageId from the Package class in more places
Using 'packageId' seems a bit clearer that it's just the PackageIdentifier 
rather than 'package' which might indicate something containing more info.
@dcoutts dcoutts Import ReadP qualified and factor out parseFreeText 210360d
@dcoutts dcoutts Remove some more ghc pre-6.4 support and common up some showPackageId…
… uses
@dcoutts dcoutts Use withTempFile for the prelude file we pass to haddock b4108a8
@dcoutts dcoutts Add writeFileAtomic to and use it everywhere in place of ordinary wri…

It uses the renaming trick to make the write atomic.
Not yet tested on Windows.
@dcoutts dcoutts Remove the old attic file f053569
Commits on Feb 23, 2008
@dcoutts dcoutts Make the user guide docbook xml validate a2d7e2c
@dcoutts dcoutts First pass at parsing .cabal files as UTF8
Also print output and error messages etc in UTF8.
@dcoutts dcoutts Bump version to 1.3.6
Due to recent api changes
Commits on Feb 24, 2008
@dcoutts dcoutts Fix oversight in imports bee5fe2
@dcoutts dcoutts Switch all file read/writes and process output to use UTF8
Added readTextFile and writeTextFile which use UTF8. rawSystemStdout now
assumes the programs are producing output in UTF8 encoding.
Commits on Feb 25, 2008
Malcolm.Wallace help nhc98 by hinting an import decl 41998c7
@dcoutts dcoutts Don't warn about missing license file for public domain packages
Fixes ticket #247.
The whole concept of public domain as a license is also rather dodgy. In
many legal jurisdictions it has no legal meaning and where it does one
usually has to disclaim any copyright interest explicitly.
@dcoutts dcoutts Specify in the user guide that .cabal files must be valid UTF-8 7db70d3
@dcoutts dcoutts Don't include the version number in the xsl-stylesheets path
This is still shockingly platform dependent. Sigh.
@dcoutts dcoutts Check for invalid UTF8 when parsing .cabal files
This assumes a permissive UTF8 decoder has inserted '\xfffd' as a replacement
character. We should check strictly for errors when we decode instead, though
it's nice to do that where we have some kind of error reporting infrastructure
which is why I've added it to the parser for the moment. The current error
message is not too bad, as it reports the line number.
@dcoutts dcoutts GHC's package db files are actually ascii, not UTF8
Because they're in Haskell Read/Show format which escapes non-ascii chars
in Strings.
Commits on Feb 26, 2008
@dcoutts dcoutts Add liftOption for making derived command parsers
liftOption :: (b -> a) -> (a -> (b -> b)) -> Option a -> Option b
For example:
liftOption fst (\a (_,b) -> (a,b)) :: Option a -> Option (a,b)
Needed to be able to make a CommandUI (a, b) using an existing CommandUI a.
That's what we want to do in cabal-install where the 'install' command
to support all the 'configure' flags and some extra of it's own, for example
--dry-run and probably several more in future.
Commits on Feb 27, 2008
@dcoutts dcoutts Revert some of the UTF8 changes, use UTF8 only for files we know are …

So we use ordinary read/writeFile for ordinary text files. For console
output we use ordinary putStr etc and we'll just hope that haskell
implementations catch up and deal with that sensibly. Don't assume
captured program output is UTF8, use the default encoding.
So we use binary mode IO along with UTF8 encoding and decoding only for 
file types that we specify to be UTF8, which are .cabal files and
.hs/.lhs files only.
@dcoutts dcoutts Fix typos reported by Satoshi Kodama
Not applying that patch as a whole since part of it
needs to be done differently.
@dcoutts dcoutts Read captured process output as text
So we get windows cr/lf conversion and don't need a special lines'
implementation to deal with it. I'm guessing this is the problem that
Satoshi Kodama encountered with ghc-6.9 on Windows.
@dcoutts dcoutts Don't yet treat package registration files as UTF8
Though we'll probably need to do so eventually because they contain many of
the same fields as the .cabal files which are UTF8. This will need agreement
with ghc-pkg.
@dcoutts dcoutts Add optional 'n' parameter to configure -O flag, ie -O0 -O1 -O2
No change to the defaults.
@dcoutts dcoutts Document the new parameter to configure -O 2172261
Commits on Feb 28, 2008
Malcolm.Wallace fix import-breakage for non-GHC ff91ad1
Commits on Feb 29, 2008
@dcoutts dcoutts Reformat License declaration and add related TODOs
The real difficulty with changing the license stuff is the parser in current
and older cabal versions is very fragile, it parses using Read so only
recognises those exact enum values and if parsing fails, then parsing the
whole .cabal file fails. We really need to make this more permissive for all
the enumerations so that we can make changes in future.
@dcoutts dcoutts Document configure --package-db flag f27278a
@dcoutts dcoutts -Wall clean, remove unused import d5f0d41
Commits on Mar 01, 2008
@dcoutts dcoutts Warn about use of the BSD4 license a057ca3
Commits on Mar 03, 2008
@dcoutts dcoutts Wrap the output of the logging functions
So we'll not have to keep adjusting newline breaks.
@dcoutts dcoutts Extend and use the OS data type in the package description
Rather than just using a string. This makes comparing OSs easier since
we can normalise them once when we parse rather than every time we compare.
Also makes it easy to discover when a package mentions an unknown OS since
it's marked as Other "whatever".
@dcoutts dcoutts Put a header in the dist/setup-config file and check it on loading
This should fix ticket #120 in future which is the problem where you do
something like "sudo runghc Setup install" and you accidentally end up
using a different version of the compiler or of the Cabal lib and you get
an unhelpful error message:
> Setup.hs: error reading ./.setup-config; run "setup configure" command?
Well now you'll get a helpful error message:
> setup: You need to re-run the 'configure' command. The version of Cabal
> being used has changed (was Cabal-1.3.6, now Cabal-1.3.7).
If the compiler version being used has changed too we get the extra helpful:
> setup: You need to re-run the 'configure' command. The version of Cabal
> being used has changed (was Cabal-1.3.6, now Cabal-1.3.7). Additionally
> the compiler is different (was ghc-6.8, now ghc-6.9) which is probably
> the cause of the problem.
Of course this does not help for older versions of Cabal but there's not a
lot we can do about that.
@dcoutts dcoutts Bump version to 1.3.7
Keep up with recent minor api changes
@dcoutts dcoutts Actually we don't need wrapText'
Any users of custom wrapText versions can go from the underlying wrapLine
@nominolo nominolo Clarify commenting rule for package description files. d18f94f
@nominolo nominolo Fix speling. 690aaa0
Commits on Mar 04, 2008
@dcoutts dcoutts Include .hs-boot files into the sdist tarball
Tested using Agda which uses several .hs-boot files.
@dcoutts dcoutts Make an Arch enum like we have for OS and use it
We get more robust parsing and comparisons of arch names this way
and it'll allows us to detect and warn about unknown arches.
@dcoutts dcoutts Rename Distribution.System.os to .buildOS and eliminate Windows sub-type 474950a
Commits on Mar 05, 2008
@dcoutts dcoutts Restore using 30k max command line sizes when linking 5a8165f
@dcoutts dcoutts Fix configure for hugs where we don't know what packages are installed
For Hugs, nhc98 and other compilers we do not know what packages are
already installed, so we just make some up, pretend that they do exist
and just hope for the best. We make them up based on what other package
the package we're currently building happens to depend on.
See inventBogusPackageId. Let's hope they really are installed... :-)
One could see this as all rather redundant - carefully making up bogus
information to satisfy a careful check. I prefer to see it as making
explicit something that was previously implicit. The proper solution is
to discover what packages are currently installed.
@dcoutts dcoutts Add read/show for CompilerFlavour like for OS and Arch
Also add YHC compiler flavour.
@dcoutts dcoutts Use CompilerFlavor rather than String in configurations expressions
Better type safety and more robust parsing.
Commits on Mar 06, 2008
@dcoutts dcoutts Check that the --prefix is always specified as an absolute path
Should eliminate confusion with doing: cabal configure --prefix=~/local
Instead use --prefix ~/local or --prefix=$HOME/local
@dcoutts dcoutts Use the right program config when reporting found programs 3036eb0
@Saizan Saizan move inDir to Distribution.Simple.Utils 1cda110
Commits on Mar 07, 2008
@dcoutts dcoutts Fix sdist to ignore the buildable attribute
Fixes ticket #257
@dcoutts dcoutts Add test for ticket #257
Not automated yet, the testsuite needs resurrecting first.
@dcoutts dcoutts When generating default Setup.hs use defaultMain
not defaultMainWithHooks defaultUserHooks since the latter is deprecated
@dcoutts dcoutts Make BuildInfo an instance of Monoid 9a700c7
@dcoutts dcoutts Add packageName, packageVersion and use them
(pkgName . packageId) and (pkgVersion . packageId)
turn out to be very common so give them names.
Commits on Mar 08, 2008
@dcoutts dcoutts Fix rejection of non-ambigious options
This GetOpt patch was sent the the libraries list by Eelis van der Weegen
with the explanation:
There is a bug in System.Console.GetOpt causing it to mistakenly reject
options as ambiguous. Example:
  optsDesc = [Option "" ["color", "colour"] (ReqArg id "color") ""]
  option `--col' is ambiguous; could be one of:
      --color=color, --colour=color  Foreground color
      --color=color, --colour=color  Foreground color
This error is silly, because the two alternatives listed are the same option.
Commits on Mar 10, 2008
@dcoutts dcoutts Import Data.Tree rather than defining it locally
Since we've dropped ghc-6.2 compatibility we can now use Data.Tree directly.
@dcoutts dcoutts Reorganise and prune tests/
Split them into unit tests and system tests. Also remove the rather large
bundled HSQL and HUnit packages. We can just depend on HUnit for the tests
rather than bundling it. HSQL is very large for a system test and we can
just as easily get it and others from hackage.
@dcoutts dcoutts Rearange unit tests some more add extract more tests from the other m…
@dcoutts dcoutts Use the same ReadP for all compilers, remove CPP hacks
If we're bundling a whole copy of ReadP then why bother trying to use
the version from the base package, especially when that requires hacks
to use the H98 version with some compilers and the non-H98 version in
base. It just makes testing harder because we're using different versions
with different compilers.
As a bonus, hugs should no longer need the -98 flag to use Cabal.
Added all the type signatures back in and fixed some warnings.
@dcoutts dcoutts Remove the #ifdef'ed unit test code from several modules
They have all been moved to tests/UnitTest/
So we don't need so much CPP in the ordinary modules now.
Commits on Mar 11, 2008
@dcoutts dcoutts Remove manual formatting and line breaking from error messages
It now gets line wrapped automatically by the logging functions
Commits on Mar 12, 2008
@dcoutts dcoutts Fix search dirs used for pre-processing executables
It was combining the executable's hs-source-dirs with the library's
hs-source-dirs when pre-processing executables. This was inconsistent
with the search path used for finding ordinary .hs files and with
sdist and lead to confusing behaviour. See ticket #161.
If an executable needs source files from the library then it must specify
the right hs-source-dirs, including '.' if appropriate.
The behaviour is that if hs-source-dirs is not specified then the default
is '.' however if hs-source-dirs is specified then '.' is not implicitly
added. If it's needed then it must be added explicitly. This was always
the case for ordinary .hs files, this patch just brings things into line
for files that need pre-processing.
@dcoutts dcoutts Move Dependency and it's show and parser into Package module
Rather than having it in Version and its parser elsewhere.
The Package module already imports the Version module which exports the
VersionRange type.
@dcoutts dcoutts Add a CompilerId type and use it in appropriate places
Especially instead of abusing a PackageIdentifier for the purpose.
Commits on Mar 17, 2008
@dcoutts dcoutts Strip executables during installation for ghc
Does not yet have a configure flag to turn this behaviour on and off.
That can wait until after the command line flag infrastructure changes.
@dcoutts dcoutts Move the call to ranlib out into a separate function
It's a bit more readable that way.
@pepeiborra pepeiborra #221: specific include and library search paths options
  This patch adds two new command line options to configure,
  --extra-include-dirs and extra-lib-dirs.
  These have effect over all the buildables in a project.

  What is missing now is support for reading these from the .cabal/config file.
  That will be done as part of ticket #223.
@dcoutts dcoutts Change mkLibName and friends to take a package id and not take the dir
So now it really gives just the lib name and not its location as well.
It turned out that we more often want just the name since we're copying
the same named file from one directory to another.
Taking a PackageIdentifier means we do the conversion to string in one
place rather than all over the place.
It also means we're chaning the lib names for nhc98 to include the lib
version number. This should not make any real difference to nhc98.
@pepeiborra pepeiborra #223 part 1: Extend Distribution.Command.Simple.Option
     so that it really represents an option and not just a flag.
     It's been renamed to OptionField as it models a field in a flags-like data structure. 
        data OptionField a = OptionField {
          optionName        :: Name,
          optionDescr       :: [OptDescr a] }
        data OptDescr a  = ReqArg Description OptFlags ArgDescr (ReadE (a->a))         (a -> [String])
                         | OptArg Description OptFlags ArgDescr (ReadE (a->a)) (a->a)  (a -> [Maybe String])
                         | ChoiceOpt [(Description, OptFlags, a->a, a -> Bool)]
			 | BoolOpt Description OptFlags{-True-} OptFlags{-False-} (Bool -> a -> a) (a -> Bool)
      An option field can expand to several command line options, which are all defined together.
      For example, the compiler flag is defined as follows.
            option [] ["compiler"] "compiler"
               configHcFlavor (\v flags -> flags { configHcFlavor = v })
               (choiceOpt [ (Flag GHC, ("g", ["ghc"]), "compile with GHC")
                          , (Flag NHC, ([] , ["nhc98"]), "compile with NHC")
                          , (Flag JHC, ([] , ["jhc"]), "compile with JHC")
                          , (Flag Hugs,([] , ["hugs"]), "compile with Hugs")])
      We can need to use several kinds of OptDescr for the same option, as in the 
      optimization Option (really a extreme case):
            ,multiOption "optimization"
               configOptimization (\v flags -> flags { configOptimization = v })
               [optArg' "n" (Flag . flagToOptimisationLevel)
                        "Build with optimization (n is 0--2, default is 1)",
                noArg (Flag NoOptimisation) []
Commits on Mar 18, 2008
@dcoutts dcoutts Document the --extra-include-dirs and --extra-lib-dirs options
Though they actually only take one dir each so perhaps they should be
renamed to just --extra-include-dir and --extra-lib-dir. You can of
course use them multiple times to get a list of dirs.
@Saizan Saizan fix 'clean' bug on windows caused by leaked Handle.
Using readFile to read dist/setup-config keeps the Handle open when we try to delete the file, causing an error. 
So we instead read the file strictly and close the Handle early.
@dcoutts dcoutts Refactor sdist code a bit
Separate the phases of sdist better so that they can be reused in
cabal-install. This part is similar to Andrea Vezzosi's patch.
Separate the snapshot code rather than mixing it all in with prepareTree.
Use a proper withTempDirectory which fixes one FIXME.
Better separate UI code from actions, move the notices to sdist.
@pepeiborra pepeiborra Wibbles c442095
Commits on Mar 19, 2008
@dcoutts dcoutts Allow '_' char in buld tool names
eg we have build-tools like "pg_config"
@dcoutts dcoutts Add --enable/disable-executable-stripping option
The default is enabled
@dcoutts dcoutts Documentation the --enable/disable-executable-stripping options 88a8993
@dcoutts dcoutts Update a couple things in the README and update changelog cd9dce9
@dcoutts dcoutts Bump version number due to recent api changes 75fff68
@pepeiborra pepeiborra Fix a non-total function definition warning ded2668
Commits on Mar 20, 2008
@pepeiborra pepeiborra wibbles (some more) ef82ba0
Commits on Mar 21, 2008
@dcoutts dcoutts Add Text class for displaying and parsing values
This is intended to replace all these showFoo read/parseFoo functions
we have all over the place. It's like the Read/Show classes but uses
a half decent parser and pretty printer:
class Text a where
  disp  :: a -> Doc
  parse :: ReadP a
This patch just adds the class and an instance for Bool, replacing
the parseBool function used in a few places. More to follow...
@dcoutts dcoutts Add Text instances for Version and VersionRange
The instance for Version is in the Text module itself because the
Version type is defined in base. This avoids an orphan instance.
@dcoutts dcoutts Add Text instances for PackageIdentifier and Dependency
And change all uses.
@dcoutts dcoutts Add Text instances for OS and Arch 4212e65
@dcoutts dcoutts Add Text instance for CompilerFlavor and CompilerId
This is a tad subtle since we actually have two ways of parsing
compiler flavours. One expects, or at least allows lower case names
like "ghc" and "nhc98", the other uses Read/Show which gives "GHC"
and "NHC". What we're doing here is only changing the first variety.
The cases where we parse using Read (and display using Show) are not
changed. At some point we'll switch those over to the more liberal
parser, but not yet as we don't want to cause compatibility problems.
@dcoutts dcoutts Add Text instance for License
Initially it's exactly the same format as Read/Show.
We can make it more liberal later.
@pepeiborra pepeiborra Automatically highlight default options of a CommandUI when convertin…
…g it to a list of GetOpts

I shamelessly stole some code from GHCi for the highlighting.
@dcoutts dcoutts -Wall police b9de60f
@dcoutts dcoutts Make parsing of licenses more robust
Added an UnknownLicense String constructor so that we can remember
unknown license names and report them and prevent them from being
uploaded to hackage, but not fail hard with a parse error upon
encountering an unknown license. This does not add any new licesnes
or and new valid parses of existing licenses. The parsing phase
now allows an optional version like "GPL-3" however that would still
be classified as an unknown license at the moment. The point is it's
no longer a parse error but a semantic error instead.
Commits on Mar 23, 2008
@Saizan Saizan FIX #166 by setting the right buildDir when preprocessing in sdist a23926a
Commits on Mar 24, 2008
@dcoutts dcoutts Add Text instance for BuildType and add UnknownBuildType constructor
Drop parseReadSQ as that was the last use of it.
Still need to add a build warning for UnknownBuildTypes
@dcoutts dcoutts Remove another reminant of support for ghc-6.2 b143dc1
@dcoutts dcoutts Add Text instance for Extension and add UnknownExtension constructor
The parse function is ~15x faster than using reads by using a simple
hash table :: Array Char [(String, Extension)]. The hash function is
then just 'head' -- the first letter of the extension name.
@dcoutts dcoutts Convert a couple uses of read/reads in the GHC module
Read the ghc --supported-languages list using simpleParse rather than
reads. It now parses extensions that GHC recognises but Cabal does
not as (UnknownExtension theExtensionName). For example this allows
people to use the PArr extension which ghc currently supports but
which is not a finalised registered extension.
@dcoutts dcoutts Improve the warning message about unsupported extensions.
That is, extensions the compiler does not support, as opposed to
extensions that are unknown to Cabal.
@dcoutts dcoutts Parse extension names in .cabal files using Text rather than Read
This means we can now parse unknown extensions without falling over.
Indeed if the compiler supports the unknown extension then we can
even successfully use it. This gives us some forwards compatability
for new extensions.
@dcoutts dcoutts Check for unknown build-type, extensions, licenses and compilers 75e0146
@dcoutts dcoutts Add warning about the use of ghc-options: -optl-Wl,-s 941bede
@dcoutts dcoutts Prserve case when parsing unknown/other enum values for OS,Arch and C…
@dcoutts dcoutts Add parseCompilerFlavorCompat and use it instead of parseReadS
So it accepts the same valid values as parseReadS did, but doesn't
fall over on unknown values, returning (OtherCompiler "the_name").
@dcoutts dcoutts Remove last uses of parseReadS
One use was for parsing bools in the installed package info. We can
go with the more liberal Text instance for that. The other use is for
parsing Haskell strings in quoted string fields. So we keep it for
that purpose but restrict the type and rename to parseHaskellString.
Commits on Mar 25, 2008
@dcoutts dcoutts Use disp/display in a couple more places instead of show 4feaf34
@dcoutts dcoutts Switch a few debug Show instances to use derived Show
The pretty printer version should be using Text but I've left them as
comments for the moment as they do not have corresponding parsers yet.
Malcolm.Wallace make indentation H'98 compliant 3c41f5f
Malcolm.Wallace help nhc98 decipher ambiguous class methods 7ebce88
Malcolm.Wallace needs an import of non-H'98 instance Functor ((->) r) 9080f7b
Malcolm.Wallace disambiguate some imports 42bee20
Malcolm.Wallace help nhc98 to disambiguate class methods 019fd4a
Malcolm.Wallace cpp language pragmas required c980f18
Malcolm.Wallace remove ugly nhc98 cpp+defaulting hack - use explicit typesig instead a083fc1
@dcoutts dcoutts Remove the need for instance Functor ((->) r)
I think. It's hard to test since with base as it is we cannot
easily compile without that instance being in scope.
Commits on Mar 26, 2008
Malcolm.Wallace help nhc98 to find Ix(inRange) ed455db
@dcoutts dcoutts Replace three separate copies of no_extra_flags with one version 463065c
@dcoutts dcoutts It appears that the ReadS variants reqArg'' and optArg'' are unused 389357e
@dcoutts dcoutts Bump version to 1.3.9 c77ab79
@RossPaterson RossPaterson allow underscores in arch names
Stops it barfing on arch(x86_64).
Commits on Mar 27, 2008
@dcoutts dcoutts Arch and OS names were previously allowed to contain "_-", restore that.
That is the arch and os strings in conditionals in .cabal files, like:
  if arch(x86_64)
Previously the parser used isAlphaNum c || (c `elem` "_-"). This is
crucial for arch names like "x86_64". So make the new parser for OS
and Arch types use the same string parser as before (there is a string
parse part and a separate classification of known OS/Arch values).
@dcoutts dcoutts Separate the OS/Arch classifiation used for different purposes
We have to classify System.Info.{os,arch} strings into the OS and Arch
enums. For that purpose we have to be quite permissive since there are
lots of ailases that the various Haskell implementations use. However
for parsing os and arch names in .cabal files we'd prefer to use
canonical names, though we do have to allow the couple aliases already
in common use.
@dcoutts dcoutts Make UTF-8 decoding errors in .cabal files non-fatal
Previously we checked for invalid UTF-8 in the first phase of the
parser, which splitting the file up into nested sections and fields.
This meant the whole parser falls over if there is invalid UTF-8
anywhere in the file. Sadly there are already packages on hackage
with invalid UTF-8 so we would fail when parsing the hackage index.
The solution is to move the check into the parsing of the individual
fields and making it a warning not an error. We most typically get
invalid UTF-8 in free text fields like author name, copyright,
description etc so this should work out ok usually.
We now get pretty decent error messages, like:
  Warning: hsx.cabal:5: Invalid UTF-8 text in the 'author' field.
The warning type is now structured so that hackage will be able to
distinguish general non-fatal warnings from UTF-8 decoding problems
which really should be fatal errors for package uploads.
@dcoutts dcoutts Rename various *Verbose fields to *Verbosity instead
Despite appearances this is actually not completely pointless.
For the Cabal-1.4 branch we need the *Verbose fields to have the
same types as they did in Cabal-1.2, becuase lots of Setup.hs
scripts use them and our change to make them all have type Flag
makes many Setup.hs scripts fail. A solution for the 1.4 branch
is to rename the real field and to add the old field back in.
To keep as much similarity as possible between the HEAD and 1.4
branches I'm applying the name change in both.
On the plus side it's a better name anyway.
@dcoutts dcoutts Add in a few small functions that some Setup.hs scripts use
All marked as deprecated so hopefully people will stop using them.
@dcoutts dcoutts Go back to conditionally using Text.ParserCombinators.ReadP
Some Setup.hs scripts import Text.ParserCombinators.ReadP
directly and try to use it with the parsers defined by Cabal.
@dcoutts dcoutts Add *Verbose flags back in with the old type
Abuse the Monoid instances for the flags types to keep the extra
non-Flag type field up-to-date wrt the real Flag Verbosity field.
Here's the pattern:
copyVerbose   = fromFlagOrDefault (copyVerbose a) (copyVerbosity b),
copyVerbosity = combine copyVerbosity
We update copyVerbosity normally and we transfer the new value of
(copyVerbosity b) to the copyVerbose field, unless the new value
is NoFlag in which case the old value remains. To make this actually
work we have to make sure the set of flags are `mappend`ed to the
default set of flag rather than merely accumulated on top of them
field by field. So we now accumulate on top of mempty and `mappend`
to the default flags. We do this in the command line handling code.
@dcoutts dcoutts Apply the same renaming trick to the copyDest flag
Rename the real field to copyDest' and add copyDest with the same
type as it had in Cabal-1.2. Use the Monoid's mappend again to keep
the flag updated.
@dcoutts dcoutts Fix merge mistake, remove duplicate record field definition e9f54a1
@dcoutts dcoutts Parse Bool fields using more cunning, allow new parses with a warning
We want to allow case-insensitive parsing however we don't want
packages being uploaded to hackage that will break older versions of
Cabal. If we allow new valid parses then we will end up breaking
stuff. So what we really want to do is allow new parses but warn if
they're not ones that older versions of Cabal would have allowed. So
long as hackage rejects pakcages that have parse warnings then we can
prevent new .cabal files appearing on hackage that would break older
Cabal versions. Our current parser (ReadP) does not support warnings
so we have to handle the bool fields specially in the parser wrapper
layer that we added to handle errors and warnings. This can go away
when we use a parser with support for error and warning messages.
@dcoutts dcoutts Use the Text Bool instance for parsing literals in conditions
Since it exactly matches what the previous condition parser did.
So we have two different ways of parsing Bool depending on
context. Sigh. Both match exactly what was done in Cabal-1.2.
@dcoutts dcoutts We do not show the field value on a parse error so don't pretend we do.
Drop the trailing ": " on the error message. We could provide the field
value but they're often multi-line and we cannot pin-point where the
error is exactly.
@dcoutts dcoutts Simplify the parser for flags in conditions
It's a bit more consistent.
@dcoutts dcoutts Add scripts for testing compatability with hackage packages
So far just a test that all the non-trivial Setup.(l)hs scripts
compile. This only tests the latest versions, though if one were
to download a complete archive then one could test them all.
To speed up the check we skip Setup.hs scripts that have fewer
than 22 words. Below this cutoff there are no custom hooks and
it catches the great majority of scripts which greatly speeds up
the check.
Commits on Mar 28, 2008
@dcoutts dcoutts Tweak warning message about bool fields to include the field name
Warning: The 'buildable' field is case sensitive, use 'True' or 'False'.
@dcoutts dcoutts Adding the command parsing monoid hack broke another hack, fix it.
Just goes to show Monoid instances should follow the laws. As soon
as we can break UserHooks compatabilty we'll be able to restore the
monoid property by removing configPrograms from the ConfigFlags.
@RossPaterson RossPaterson factor out showPWarning function 72d4b90
Commits on Mar 29, 2008
@dcoutts dcoutts Bump version to 1.3.10
First release candidate for 1.4.0
@dcoutts dcoutts TAG 1.3.10 dba1650
Commits on Apr 07, 2008
@dcoutts dcoutts Fix names of profiling libs
I broke this recently when refactoring. Restore the original behaviour.
Was generating "libHSfoo_p-1.0.a" when it should be "libHSfoo-1.0_p.a".
Commits on Apr 08, 2008
@dcoutts dcoutts Fix spelling in error message b2b3411
Commits on Apr 09, 2008
@dcoutts dcoutts Fix for detecting ~/.cabal/ dir as a .cabal file
Which happened if you use cabal configure in your home dir.
Now produced the right error message, or if you actually put
a cabal project in your home dir, it might actually work.
Also, do the same fix for findHookedPackageDesc.
@dcoutts dcoutts Remove unused import de758d9
@dcoutts dcoutts Use relative file paths in .cabal parse error messages
Do this by normalising the file path in the error message
and when looking for .cabal files, by looking in '.' rather
than the absolute path of the current directory.
@dcoutts dcoutts Check for the required cabal version early in parsing
Previously we only checked the "cabal-version" field after parsing
and all other configure processing. If the package really needs a
later Cabal version it is of course highly likely that parsing or
configure are going to fail and the user is not going to get the
helpful error message about the version of Cabal required. So now
we do the check early during parsing. If a later version is
required and parsing subsequently fails, we now report the version
issue, not the subsequent parse error. If parsing succeeds we
still issue a warning which should be a useful hint to the user if
subsequent configure processing fails.
Commits on Apr 12, 2008
@kosmikus kosmikus fix for #187 -- directory of Paths_packagename is included when looki…
…ng for source files
Commits on Apr 13, 2008
@nominolo nominolo Change dependency resolution algorithm.
There were two reasons to do this.  Firstly, this formulation makes it
easier to add the --constraint command line flag that adds additional
constraints on the packages that should be used.

Secondly, with the orgininal algorithm it was possible to satisfy the
constraint "foo < 1, foo > 2" if we had two versions of package "foo"
which each satisfy one constraint.  This patch fixes this by requiring
the same package to satisfy both constraints (which of course is
impossible in this case).
@nominolo nominolo Fix/Add documentation. b889553
@nominolo nominolo Add simple test case for the dependency resolution case. This should
go into the test suite one day.
@nominolo nominolo Add 'readP_to_E' function that takes the longest parse. 7ef3b9a
@nominolo nominolo Fix #224. We do not yet warn if the user specified a dependency that
did not occur in the package (it is just silently ignored.)
@dcoutts dcoutts Make finalizePackageDescription use CompilerId type
Use the proper data type rather than a tuple (CompilerFlavor, Version)
@tibbe tibbe Made it possible to run executeables with data files in place.
Added an environment variable, DATA_DIR, that is checked before the
installation data directory is used.
Commits on Apr 15, 2008
@dcoutts dcoutts Add PackageIndex.insert and reverse merge/mappend
Packages in the second argument to merge now mask those in the first.
@dcoutts dcoutts Add newtype FlagName and FlagAssignment type alias
and use them in the appropriate places.
Commits on Apr 17, 2008
@jyp jyp expose tryGetConfigStateFile
This is needed by Yi to (try to) load an arbitrary
@jyp jyp expose ghcOptions
This helps finding the options to pass to GHC API in various tools
Commits on Apr 20, 2008
@dcoutts dcoutts Fix unionBuildInfo
Fix ticket #264 to use nub only on the fields which are treated as sets.
Probably we should be using the right types and mappend for each field.
Change to construct a new value from scratch rather than overriding one
of the two args. This helps to make sure we're updating all the field
as we get a warning if we miss any. Turns out we were missing the ghc
profiling and shared libs options which meant they were getting dropped.
That had the effect of ghc-prof-options: in .cabal files being ignored.
Thanks to 'midfield' from #haskell for spotting this.
@dcoutts dcoutts Don't nub extra-libs in unionBuildInfo
It's possible that we sometimes need to list the same library
more than once if there are circular symbol references.
Commits on Apr 22, 2008
@dcoutts dcoutts Update UTF8 code
Some code and test cases taken from the utf8-string package.
Updated copyright notice appropriately (I think).
@dcoutts dcoutts Make warning messages show the file name eea10fc
Malcolm.Wallace fix import for nhc98 27792bf
@dcoutts dcoutts Merge changes in the 1.4 branch 6944f12
Commits on Apr 23, 2008
@dcoutts dcoutts Package check now take a GenericPackageDescription
Unfortunately in some cases we only have a already-configured
PackageDescription to we have to expose a checkConfiguredPackage.
We should refactor things so that we keep all the information
even in a configured PackageDescription.
@dcoutts dcoutts Add checks for unknown OS Arch and Compiler names
They're ok locally but for distribution they need to be known.
@dcoutts dcoutts Fix the check for -XFooBar ghc-options flags to be more permissive
Previously we rejected all such flags but that posed the problem that older
versions of Cabal, like 1.1.6 did not understand new extensions so we
could not actually follow the advice and use the extenion. So now we only
warn about -X flags if they refer to old extensions that Cabal 1.1.6 knew
about. If the .cabal file specifies cabal-version: >= 1.2 or similar
(anything that excludes 1.1.6) then we warn about all -X flags.
@dcoutts dcoutts Normalise file names in warning messages
We already do this for error messages.
@dcoutts dcoutts When multiple specifying list fields in the same section combine them
eg if you had:
extensions: Foo
extensions: Bar, Baz
then previously we only ended up with [Bar, Baz]. Now we get them all.
Only applies to list fields, for single fields the second value is taken
and the first is silently discarded. This isn't good of course but the
fix is harder since we're not in a context where we can report errors.
Really we should just declare up front what kind of field it is and
inherit the right behaviour automagically, either duplicates disallowed
or allowed and combined with mappend.
Commits on Apr 26, 2008
@nominolo nominolo Fix fix for #224.
Changing from list of Dependencies to Maps resulted in the wrong Monoid 
instance being used.  I'd still like to be able to run a test suite on 
this but that'd require a lot more work to do properly...
Commits on Apr 28, 2008
@dcoutts dcoutts Fix license parsing
Spotted by the testsuite which I'm trying to resurrect.
Commits on Apr 29, 2008
@dcoutts dcoutts Remove the feature for highlighting the default cases in --help output
Turns out it doesn't help us much because in many cases the initial/default
flags are actually empty so we cannot identify the default values.
@dcoutts dcoutts Change handling of bool command line args to allow an unset state
For bool valued flags we were always producing the command line
string corresponding to a false flag value, even if the flag was
not set. For example we'd always get "--disable-shared".
It is important for cabal-install to be able to take an empty set
of flags, override a few flags and turn the flags back into
command line strings without getting a lot of extra defaults.
Partly this is because we have to work with older versions of the
Cabal library command line which does not recognise the new options.
Commits on Apr 30, 2008
@dcoutts dcoutts Add help command as per ticket #272
"cabal help" behaves like "cabal --help"
"cabal help cmd" behaves like "cabal cmd --help"
Should still work with command line completion.
Commits on May 01, 2008
@dcoutts dcoutts Revert one change of (.) to fmap. It was not necessary and broke nhc98.
The other one was needed as we changed a type from Bool to Maybe Bool.
Malcolm.Wallace Revert the other `fmap` to (.)
To avoid needing a non-H'98 instance of Functor for (->).
@nomeata nomeata Add an --internal flag to HaddockFlags c316296
@nomeata nomeata Implement --internal flag
Passing --internal to the haddock stage does these things:
 * Does not pass --hide parameter to haddock
 * Passes --ignore-all-exports parameter
 * Appends "(internal documentation)" to the title
@nomeata nomeata With --executable, --internal just adds --ignore-all-exports 1b9d422
@nomeata nomeata Document --internal in Cabal.xml a1eefe1
@dcoutts dcoutts Revert the change about the --internal flag and a warning about haddock
Just a bit of confusion over the behaviour of the --executable flag.
Commits on May 04, 2008
@dcoutts dcoutts Reverse the order of the args to PackageIndex.insert
To take the index last like the other functions and like Data.Map.
It is actually more convenient that way round.
@dcoutts dcoutts Change dependencyInconsistencies to not take the pseudo top package
The one case where we need the pseudo top package we can use
PackageIndex.insert instead to get the same effect and there
are other cases in cabal-install where we do not want a pseudo
top package.
@dcoutts dcoutts Add PackageIndex.dependencyCycles
Finds any cycles (strongly connected components) in the dependencies
of set of packages. This is useful for checking the correctness of
installation plans.
Commits on May 05, 2008
@dcoutts dcoutts Cope better with ghc bug #2201, display a better error message
Otherwise it can (and does) really confuse people.
The problem is that the command $ ghc-pkg-6.9 describe '*' --user
returns a non-zero exit code if the user package db is empty.
ghc-pkg intends this exit code to tell us if the query returned
any results (one can use more complex queries as tests) but Cabal
interprets it as failure. Indeed we cannot distinguish it from
any other kind of failure from ghc-pkg.
Commits on May 06, 2008
@dcoutts dcoutts Remove a test for the specific kind of exception for nhc98 compatibility
This was the check for ghc-pkg failing. We cannot check for the
exception being an ExitException since that assumes ghc's
representation of the Exception type, whereas nhc98 defines:
type Exception = IOError
@dcoutts dcoutts Add PackageIndex.delete
We occasionally need to remove packages from an index
eg to restrict the choices of a dependency resolver.
@dcoutts dcoutts Add PackageIndex.dependencyGraph that builds a Graph
Useful for some more tricky queries.
@dcoutts dcoutts Improve style and performance of PackageIndex.dependencyClosure
Keep the completed set as another PackageIndex rather than a list.
We want to return an index at the end anyway and in the mean time
we want to do lots of lookups to see if we've visited previously.
@dcoutts dcoutts Add PackageIndex.reverseDependencyClosure
It's similar to dependencyClosure but looks at reverse dependencies.
For example it's useful to find all packages that depend on broken
packages and are thus themselves broken.
Commits on May 09, 2008
@dcoutts dcoutts Do not display version tags 4095dc4
@dcoutts dcoutts Display Cabal version in configure output with -v
eg "Using Cabal-1.5.1 compiled by ghc-6.8"
Annoyingly ghc doesn't give us its full version number.
@int-e int-e add data-dir field to package config
Cabal will look for data files to install relative to the directory given
in the data-dir field, allowing package authors to better structure their
source tree. There's no behavioural change by default.
@int-e int-e document data-dir field 371f9a4
Commits on May 10, 2008
@igfoo igfoo Fix a bug in the unlitter
If we see a birdtrack while we are in latex mode, then we stay in latex
mode - don't change into bird mode!
Commits on May 11, 2008
@igfoo igfoo Remove gnerated file (doc/fptools.css) 903ffbe
@igfoo igfoo Make the "dist" directory configurable 7768e2c
@igfoo igfoo Remove a hardcoded "dist" 1560a7c
@igfoo igfoo Remove gnerated file (doc/fptools.css) 51733e0
Commits on May 13, 2008
@dcoutts dcoutts Print exit code and stderr for failing progs at debug level verbosity
Also adjust the verbosity level we get during configure at -v3
Should make it a bit easier to track down failing calls.
@dcoutts dcoutts Remove unused import c6595a8
Commits on May 14, 2008
@igfoo igfoo Define bracketOnError in compat; fixes the build for GHC 6.4 fb0c0b1
@igfoo igfoo Hack around lack of Read for Map in GHC 6.4
This is made worse by Show on Map being strange in GHC 6.4.
The code could be better, but it works, and all the ugliness is in
#if's that we can remove at some point down the line.
@igfoo igfoo Make Distribution.Compat.Char for isSymbol; fixes the build with GHC 6.4 a650e95
@igfoo igfoo Add new compat modules to Cabal file 7579968
@igfoo igfoo Make Distribution.Compat.Char for isSymbol; fixes the build with GHC 6.4 ea17410
@dcoutts dcoutts Modules that use cpp have to have cpp language prama to say so
Otherwise we cannot compile with just ghc --make
which is actually essential for bootstrapping.
@dcoutts dcoutts Don't use Data.Char.isSymbol as it doesn't exist in base-1.0
This is an alternative fix to creating a Distribution.Compat.Char
@dcoutts dcoutts Prefix the datadir env var with the package name
Partly as it is more likely not to clash with other users and since
in general different libs within a program may need different paths.
Malcolm.Wallace fix scope errors in non-GHC branch of an #ifdef 5bc38af
@dcoutts dcoutts Add in {-# OPTIONS #-} for the benefit of ghc-6.4.x
Which do not grok OPTIONS_GHC or LANGUAGE pragmas
@igfoo igfoo Define bracketOnError in compat; fixes the build for GHC 6.4 981b32c
@dcoutts dcoutts Eliminate use of bracketOnError, use handle instead
It's actually more appropriate anyway.
This means we don't need any Distribution.Compat.Exception.
@dcoutts dcoutts Remove redundant Char test in parseBuildToolName
It was made redundant after the isSymbol test was removed.
Spotted by Igloo.
@dcoutts dcoutts Check invariant on every construction and elide on lookups f9e4e70
@dcoutts dcoutts Add PackageIndex.lookupPackageName and extra deletion functions f5097f0
@dcoutts dcoutts Remove Distribution.Compat.Exception from other-modules cd9761a
Commits on May 19, 2008
@dcoutts dcoutts Allow the bindir, libdir and libexec dir to be specified via env vars…
… too

Same as for the datadir. Eg for package Foo, you'd use
Foo_bindir=... Foo_datadir=... Foo_libexecdir=... ./Foo
The next step would be generating a wrapper script that allows
running the program inplace. It should also work for a library.
Commits on May 20, 2008
@dcoutts dcoutts Rename doc/fptools.css to avoid the ghc build system cleaning it
The user guide gets built in two different ways. There's a target
in Cabal's the top level Makefile and there is also the stuff that
the ghc build system uses. The ghc build system expects to copy in
doc/fptools.css and then delete it again on make clean. We want a
persistent copy so that we can make the docs when we've just got a
standalone Cabal build tree, so that's now kept as doc/Cabal.css.
Commits on May 21, 2008
@dcoutts dcoutts Write out Bool config values correctly
Used by cabal-install when writing the default ~/.cabal/config file.
Previously it was using show for type Maybe Bool and writing out
"Just True" when of course it should just be "True".
Commits on May 29, 2008
@dcoutts dcoutts Merge the addition of the distpref flag with the verbosity changes
The Cabal-1.4 branch happened to have the verbosity flag changes in
exactly the same place where distpref change landed.
@dcoutts dcoutts Add notThisVersion :: Version -> VersionRange
Opposite of ThisVersion, it means /= x.y but is actually implemented
as > x.y || < x.y as we do not have not or not equal as primitives.
@dcoutts dcoutts Add thisPackageVersion and notThisPackageVersion
Util functions for makeing dependencies from package identifiers.
thisPackageVersion    (foo-1.0) = foo ==1.0
notThisPackageVersion (foo-1.0) = foo /=1.0
The latter is handy as a constraint in dependency resolution.
@dcoutts dcoutts Change the PackageIndex invariant so the buckets are ordered
Each bucket holds packages with the same name case-insensitively.
Previously each buckets was internally unordered. Now they're
ordered by the full package id which means first by package name
case-sensitively and then by version.
@dcoutts dcoutts Put spaces round || and && when displaying version range expressions
This makes them much more readable.
@dcoutts dcoutts Bump version to 1.3.11 due to api changes 259c7c4