RFC: Cabal-Configurations patch(es)

Hi, you just received a longish patch bundle, that together implement Cabal configurations. I realized too late that there's a way to combine this mail with the actual patch, so consider this an addendum. The implementation can read all old Cabal-files (and should do the same), but unfortunately, I had to change the interface of the confHook function, which I assume will break some setup files. The documentation states, that you shouldn't depend on that interface, but then again do people have to use them if they have special requirements. The most important change is, that Cabal files are now parsed to 'PreparedPackageDescription' which requires a run of 'finalizePackageDescription' to get to the actual 'PackageDescription'. This resolving process is potentially very slow (exponential in the number of flags), especially if there is no possible flag assignment. I plan to correct this by adding some minimum SAT solving capabilities, which will however still be exponential in the worst case. For now, the current implementation should be sufficient, though. My testing is far from exhaustive, as I haven't yet found a good way of setting up a suitable test environment without endangering to break my current setup. I am setting up a ghc-HEAD installation, but there is currently a build error stopping me from it. Incidentally, Cabal itself now needs configurations to build with ghc-head as well as ghc-6.6.1. That said, I'd like to ask you to review the patches and possibly also test it on your projects. A preliminary HOWTO is at: http://hackage.haskell.org/trac/hackage/wiki/CabalConfigurations Thanks, / Thomas

You can also browse the source at: http://code.haskell.org/~nominolo/src/cabal+configs/ / Thomas On 24 jun 2007, at 12.41, Thomas Schilling wrote:
Hi,
you just received a longish patch bundle, that together implement Cabal configurations. I realized too late that there's a way to combine this mail with the actual patch, so consider this an addendum.
The implementation can read all old Cabal-files (and should do the same), but unfortunately, I had to change the interface of the confHook function, which I assume will break some setup files. The documentation states, that you shouldn't depend on that interface, but then again do people have to use them if they have special requirements.
The most important change is, that Cabal files are now parsed to 'PreparedPackageDescription' which requires a run of 'finalizePackageDescription' to get to the actual 'PackageDescription'. This resolving process is potentially very slow (exponential in the number of flags), especially if there is no possible flag assignment. I plan to correct this by adding some minimum SAT solving capabilities, which will however still be exponential in the worst case. For now, the current implementation should be sufficient, though.
My testing is far from exhaustive, as I haven't yet found a good way of setting up a suitable test environment without endangering to break my current setup. I am setting up a ghc-HEAD installation, but there is currently a build error stopping me from it. Incidentally, Cabal itself now needs configurations to build with ghc-head as well as ghc-6.6.1.
That said, I'd like to ask you to review the patches and possibly also test it on your projects. A preliminary HOWTO is at:
http://hackage.haskell.org/trac/hackage/wiki/CabalConfigurations
Thanks,
/ Thomas

Hi Thomas, On Sun, Jun 24, 2007 at 12:41:32PM +0200, Thomas Schilling wrote:
you just received a longish patch bundle, that together implement Cabal configurations.
Great! Things mostly seem to work in the HEAD. I'm attaching a couple of patches that I needed. I've also moved some of base/Setup.hs into base/base.cabal, although I haven't checked that it works yet. One thing I found is that I needed an IsGHC flag; should there be an impl(GHC) built-in? I guess further down this road is testing the /version/ of the implementation as well, and perhaps even the tags. Also, I'm not sure how to patch up libraries/installPackage.hs. It used to do pdFile <- defaultPackageDesc verbosity pd <- readPackageDescription verbosity pdFile lbi <- getPersistBuildConfig so I think I now want to do pdFile <- defaultPackageDesc verbosity ppd <- readPackageDescription verbosity pdFile lbi <- getPersistBuildConfig pd <- finalizePackageDescription lbi ppd except finalizePackageDescription doesn't work like that. What's the best way to do this? Thanks Ian
participants (2)
-
Ian Lynagh
-
Thomas Schilling