Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
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 27, 2008
@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.
f2f570a
@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.
0445edc
@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".
1ff75da
@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.
f94785e
@dcoutts dcoutts Bump version to 1.3.7
Keep up with recent minor api changes
dfb6d5b
@dcoutts dcoutts Actually we don't need wrapText'
Any users of custom wrapText versions can go from the underlying wrapLine
07ae9c4
@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.
4196c76
@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.
6ceb309
@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.
3176b6d
@dcoutts dcoutts Add read/show for CompilerFlavour like for OS and Arch
Also add YHC compiler flavour.
a784c86
@dcoutts dcoutts Use CompilerFlavor rather than String in configurations expressions
Better type safety and more robust parsing.
8fd86e8
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
0383446
@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
e82fc50
@dcoutts dcoutts Add test for ticket #257
Not automated yet, the testsuite needs resurrecting first.
9043ce0
@dcoutts dcoutts When generating default Setup.hs use defaultMain
not defaultMainWithHooks defaultUserHooks since the latter is deprecated
b75e248
@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.
72b43c4
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") ""]
Output:
  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.
a4bf733
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.
6fc0161
@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.
501a602
@dcoutts dcoutts Rearange unit tests some more add extract more tests from the other m…
…odules
1814ce2
@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.
f2f29db
@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.
74f6f35
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
925d549
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.
0d66e76
@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.
9831cba
@dcoutts dcoutts Add a CompilerId type and use it in appropriate places
Especially instead of abusing a PackageIdentifier for the purpose.
468443d
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.
f495084
@dcoutts dcoutts Move the call to ranlib out into a separate function
It's a bit more readable that way.
dedfc62
@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.
4a6367c
@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.
aa0383a
@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) []
261a19e
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.
674785a
@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.
55614e5
@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.
2ea8d38
@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"
2d0f086
@dcoutts dcoutts Add --enable/disable-executable-stripping option
The default is enabled
f066373
@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...
4c714f1
@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.
c116b59
@dcoutts dcoutts Add Text instances for PackageIdentifier and Dependency
And change all uses.
7152d0d
@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.
aa185b5
@dcoutts dcoutts Add Text instance for License
Initially it's exactly the same format as Read/Show.
We can make it more liberal later.
9ecda4e
@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.
04d7a7a
@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.
7df7c8f
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
4004ec6
@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.
e313f77
@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.
1a2807d
@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.
d6a22e3
@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.
d893554
@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…
…ompiler
ada6097
@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").
a989a94
@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.
9949b33
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.
68cfe5f
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.
f426934
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).
37fb5cd
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).
4725f43
@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.
81d1043
@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.
528041c
@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.
c69aa63
@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.
8595f78
@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.
4bbd87d
@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.
bdd5b71
@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.
892383d
@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.
67bd294
@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.
499a38f
@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.
e2616ea
@dcoutts dcoutts Simplify the parser for flags in conditions
It's a bit more consistent.
5aa7512
@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.
dbcc369
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'.
96397e2
@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.
9366ec4
@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
402ed9a
@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".
8cca3ab
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.
38b2602
@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.
a6412c2
@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.
13d4b4f
Commits on Apr 12, 2008
@kosmikus kosmikus fix for #187 -- directory of Paths_packagename is included when looki…
…ng for source files
6bc049c
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).
29e7627
@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.
d87db74
@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.)
34583bd
@dcoutts dcoutts Make finalizePackageDescription use CompilerId type
Use the proper data type rather than a tuple (CompilerFlavor, Version)
8a18ab0
@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.
809f085
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.
d237e85
@dcoutts dcoutts Add newtype FlagName and FlagAssignment type alias
and use them in the appropriate places.
0ecdf4d
Commits on Apr 17, 2008
@jyp jyp expose tryGetConfigStateFile
This is needed by Yi to (try to) load an arbitrary
project.
22f884d
@jyp jyp expose ghcOptions
This helps finding the options to pass to GHC API in various tools
1b11120
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.
1a49413
@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.
cb8c33b
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).
fe9114e
@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.
c9e9037
@dcoutts dcoutts Add checks for unknown OS Arch and Compiler names
They're ok locally but for distribution they need to be known.
faeedf2
@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.
2705d5f
@dcoutts dcoutts Normalise file names in warning messages
We already do this for error messages.
136d5c1
@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.
b556bd5
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...
4656036
Commits on Apr 28, 2008
@dcoutts dcoutts Fix license parsing
Spotted by the testsuite which I'm trying to resurrect.
aca0f62
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.
91ec843
@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.
2537d2e
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.
3df686a
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.
54dbab0
Malcolm.Wallace Revert the other `fmap` to (.)
To avoid needing a non-H'98 instance of Functor for (->).
8a39627
@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
2eaaf5c
@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.
cfde858
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.
de4f77a
@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.
f9ef0a3
@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.
b900d61
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.
0f0b7ce
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
a56c539
@dcoutts dcoutts Add PackageIndex.delete
We occasionally need to remove packages from an index
eg to restrict the choices of a dependency resolver.
6bcd6cc
@dcoutts dcoutts Add PackageIndex.dependencyGraph that builds a Graph
Useful for some more tricky queries.
b339b31
@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.
587cfeb
@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.
6603684
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.
314c721
@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.
dc4c272
@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!
79a39d2
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.
1f2e551
@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.
e740aa5
@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.
300e685
@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
25e445e
@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.
0409a73
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
d09a44d
@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.
a8a29cb
@dcoutts dcoutts Remove redundant Char test in parseBuildToolName
It was made redundant after the isSymbol test was removed.
Spotted by Igloo.
31aa407
@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.
d540786
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.
adce885
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".
45c6888
Commits on May 26, 2008
@dcoutts dcoutts Don't deprecate defaultUserHooks in Cabal-1.4 for sake of compatability
If lots of people start changing from using defaultUserHooks to the
alternatives then we'll get lots of packages that no longer work with
Cabal-1.2 when they otherwise might work fine. We can encourage people
to switch once Cabal-1.4 is widely deployed.
08db020
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.
c028558
@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.
726dcfd
@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.
4c967c1
@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.
c17be3d
@dcoutts dcoutts Put spaces round || and && when displaying version range expressions
This makes them much more readable.
8ccc35e
@dcoutts dcoutts Bump version to 1.3.11 due to api changes 259c7c4
Commits on Jun 06, 2008
@dcoutts dcoutts Put D.P.Parse back into Distribution.PackageDescription
Some Setup.hs script rely on things that were exported from
Distribution.PackageDescription that we'd moved into
Distribution.PackageDescription.Parse. We cannot re-export them from
the expected place without using recursive modules so just merge the
modules back together again. Sigh.
b4a7f7a
@dcoutts dcoutts Bump version 6f4286f
@dcoutts dcoutts dervie Read for FlagAssignment e68c2cf
@dcoutts dcoutts TAG 1.3.12 14dbb45
Commits on Jun 09, 2008
@dcoutts dcoutts Install license file into the right place
even if the license file was kept in a subdir of the src tree.
The canonical example was: license-file: debian/copyright
It was being installed into $docdir/debian/ and failing since
that dir did not exist. It's now installed into just $docdir.
ad1deca
@dcoutts dcoutts Install haddock interface only when generated
This is actually Andrea Rossato's patch but it didn't merge
cleanly due to more recent changes. Fixes ticket #250.
eb5b9d9
@dcoutts dcoutts Fail better when using haddock 2.x and the --hoogle flag
Fixes ticket #249
69696eb
@dcoutts dcoutts Fix pre-processing for haddock and executables
Now look in the right place to find the pre-processed source
files belongign to executables. Fixes ticket #252.
5c74698
Commits on Jun 10, 2008
@dcoutts dcoutts Add withFileContents and withUTF8FileContents
Safe block scoped reading of files.
These guarantee that the file gets closed.
b45120a
@dcoutts dcoutts Close the package.conf file after reading it
We had a bug on windows where we open and read ghc's package.conf
database but because we did not consume the final newline we did
not close the file. Then when we called ghc-pkg to register a
package it failed because it could not rename the open file.
4dc76cc
Commits on Jun 12, 2008
@dcoutts dcoutts Filter out the Paths_pkgname file in sdist
Fixes ticket #187 finally (I hope).
5643bcf
@dcoutts dcoutts Fix the register --gen-pkg-config flag
When specified without any file name it is supposed to use
a default file name rather than be ignored completely.
0cf660e
@dcoutts dcoutts Lift the restriction that libraries must have exposed-modules
This allows libs that have only private modules or C code. This
might be used to make libs that have non-exposed modules and only
export C APIs. It could also be used to make packages that consist
only of C code. That might be useful for bindings where it may
make sense to split the C and Haskell code into separate packages.
205fd73
@dcoutts dcoutts base-1.0 does not have Data.Map.alter so use insertWith instead 728c28a
@dcoutts dcoutts Update copyright and authors list in the .cabal file ec20605
@dcoutts dcoutts Update the release notes 221af0e
@dcoutts dcoutts Update the README and convert it to markdown syntax 6d68d09
@dcoutts dcoutts Add the 1.2.4.0 release to the changelog d40a39a
@dcoutts dcoutts Add the 1.4.0.0 release to the changelog 3e56e3f
@dcoutts dcoutts Put upper bounds on all the build-depends 2e8f514
@dcoutts dcoutts Bump version to stable release 1.4.0.0 f438ecf
@dcoutts dcoutts Move the mkGHCMakefile.sh out of the root dir
Having it there confuses people.
They think they have to run it as part of the install process.
d913bc2
@dcoutts dcoutts Include the readme and the changelog in the tarball 08c85a0
@dcoutts dcoutts TAG 1.4.0.0 f4ed52b
Commits on Jun 13, 2008
@dcoutts dcoutts haddock-2.2 and later do now support the --hoogle flag 8c8d07a
@dcoutts dcoutts '.' should not always be in hs-source dirs
We changed the parsing of list fields in the .cabal file so that it
adds to the current value rather than replacing it. This allows you
to put multiple entries for a list field and they all get
concatenated. However that means that the '.' in the hsSourceDirs of
emptyBuildInfo is always added to and not replaced like we did
previously. That's not what we want in this case. We want to use '.'
for hsSourceDirs *only* if hsSourceDirs is otherwise null. As it
happens, due to the way the configurations code works, we're already
filling in the default if it'd otherwise be null so we do not need
'.' in the emptyBuildInfo at all.
68a21d1
@dcoutts dcoutts Bump micro version number 0339d4f
Commits on Jun 17, 2008
@dcoutts dcoutts Update changelog for 1.4.0.1 5c3d825
@dcoutts dcoutts Remove unused import. be6c7e8
@dcoutts dcoutts Fix css location in generation of user guide a968e90
@dcoutts dcoutts TAG 1.4.0.1 c53e7a2
Commits on Jun 19, 2008
@dcoutts dcoutts Include trailing newline in hscolour command description 4e49fd0
Commits on Jun 25, 2008
@dcoutts dcoutts Tweaks to the readme, hopefully will reduce confusion a5e4472
Commits on Jul 03, 2008
@igfoo igfoo Fix using specified package databases
If we are using a specified package database, we need to tell GHC what
it is when building
a2df9dc
Commits on Jul 10, 2008
@dcoutts dcoutts Correct the order of args given by --PROG-options
They were getting reversed. Problem located by Igloo.
04768da
Commits on Jul 11, 2008
@igfoo igfoo Add a hack to copy .hs-boot files into dist/...
When a preprocessor generates a .hs file we need to put the .hs-boot
file next to it so that GHC can find it.
92a7981
Commits on Jul 20, 2008
@dcoutts dcoutts Pass -x to strip on OSX 7134eac
@igfoo igfoo Fix warnings and add a comment explaining why we pass -x to strip on …
…OS X
72d37ef
Commits on Jul 29, 2008
@dcoutts dcoutts Pass -no-user-package-conf to ghc when not using UserPackageDB
Should eliminate the corner case where we're doing a global
install but the user package db contains the exact same
version as in the global package db. Perhaps we should warn
in that case anyway since it's likely to go wrong later.
3112d6b
@dcoutts dcoutts Document more clearly that every modules must be listed
in one of the fields exposed-modules, other-modules or main-is
Add an extra note to the section on the Paths_pkgname module
as the fact that it's automatically generated confuses people.
c579efd
@dcoutts dcoutts Move the docs for the buildable field to a better place.
It doesn't need to be right up near the top.
236106b
@dcoutts dcoutts Remove references to cabal-setup from the documentation
Change to runhaskell Setup or cabal-install as appropriate.
16dd4a9
@dcoutts dcoutts Fix uses of verbosity > deafening to use >=
The maximum verbosity value is deafening so >= the correct test.
This primarily affected haddock.
398f436
Commits on Aug 02, 2008
@dcoutts dcoutts Fix instance Monoid ConfigFlags for configStripExes 8451a33
@dcoutts dcoutts Update changelog 0edfa77
Commits on Aug 04, 2008
@dcoutts dcoutts Don't try to install libHSfoo.a if the lib had no object files
To allow meta-packages.
(Backport of equivalent patch in Cabal HEAD)
9b22f2d
@dcoutts dcoutts Adjust registration to allow packages with no modules or objects
So ghc-pkg does not complain about missing files and dirs.
2568f71
Commits on Aug 12, 2008
@dcoutts dcoutts Fix warnings in Windows Paths_pkgname module 03072ff
@dcoutts dcoutts Don't warn about missing strip.exe on Windows
We don't expect Windows systems to have the strip program anyway.
9076783
Commits on Aug 22, 2008
@dcoutts dcoutts Backport of Fix for #333, "Setup sdist --snapshot fails"
This is a somewhat inelegant backport that does not change the API.
cd6151f
Commits on Aug 24, 2008
@dcoutts dcoutts More changelog updates for 1.4.0.2 ae09926
@dcoutts dcoutts Note the per-user install path on Windows in the README 62f3c0c
Commits on Aug 26, 2008
@dcoutts dcoutts Add release date of 1.4.0.2 a6b0b98
@dcoutts dcoutts Bump version to 1.4.0.2 0c552ad