
On Fri, 2008-03-07 at 12:21 +0000, Malcolm Wallace wrote:
Wed Mar 5 02:36:26 GMT 2008 Duncan Coutts
* 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, Hmm, although you may not know, there is a way to find out. :-) On nhc98 at least, a simple directory listing of
A simple directory listing is absolutely fine!
include/packages/*.cabal
That tells us what package names and versions are installed but it doesn't help with finding out what the installed packages depend on or what cpp flags they used or anything else. For that we need the InstalledPackageInfo rather than the unconfigured .cabal files.
will tell you what is installed. I agree that this is not the friendliest interface in the world, so I have now made it easier, by adding the 'nhc98-pkg list' command (in darcs). For instance:
$ nhc98-pkg list array-0.1 base-3.0 bytestring-0.9 Cabal-1.3.6 containers-0.1 directory-1.0 filepath-1.1 fps-0.8 haskell-src-1.0.1.1 haskell98-1.0.1 HaXml-1.19.2 html-1.0.1.1 HUnit-1.2.0.0 old-locale-1.0 old-time-1.0 packedstring-0.1 parsec-2.1.0.0 polyparse-1.1 pretty-1.0 process-1.0 QuickCheck-1.1.0.0 random-1.0 xhtml-3000.0.2.1
So what we now use with ghc is to call 'ghc-pkg describe *' and it gives us the concatenation of the InstalledPackageInfo for every installed package. It's not at all a problem to go look in a dir, so long as it's always clear what dir to look in (eg nhc98 --print-libdir or equivalent), the most important thing for top-notch cabal support is knowing all the info about all the installed packages. It'll allows us to do pre-processing correctly, where installed packages provide header files or need certain cpp flags or use C libs. It'll allow cabal-install to generating correct install plans that respect the dependencies of existing installed packages. Duncan