brainstorming ways to stabalize Cabal interface?
ross at soi.city.ac.uk
Wed Feb 1 12:20:36 EST 2006
On Thu, Jan 19, 2006 at 09:35:32AM +0000, Duncan Coutts wrote:
> On Wed, 2006-01-18 at 22:57 -0800, Isaac Jones wrote:
> > I'm keen to try to stabilize more of the Cabal interface,
> The problem as many people have noted is that Haskell source code in the
> form of Setup.lhs is quite brittle in the face of changes to the Cabal
> API and the .cabal file format.
Indeed. I think the best hope for stability is to make setup scripts
optional, and to seek to reduce the situations where they're needed.
The vast majority of scripts are
main = defaultMain
main = defaultMainWithHooks defaultUserHooks
(Incidentally hackage and packages repository contain very few
exceptions to this; it seems Gentoo has a much larger collection.)
If we were to rely on an external tool like Duncan's hs-pkg, we'd need
a field saying which of these (or future ones) to use. We'd also need
version numbers for the file format, which might be expected to change
less often than Cabal package versions.
Reducing the need for setup scripts involves identifying the missing
bits people are working around and implementing general facilities.
Eliminating the boilerplate scripts will help, if only by flagging the
packages of interest.
If we're happy with the idea of a wrapper script running another
Haskell program, we could also have a different optional program for
each function, instead of always calling setup -- a bit like hooks at the
program level. This would make it easier to see what special treatment a
package needs, and for the wrapper to do the simple thing in other cases.
For example, a package might need a hook for testing, so that testing
might be brittle, but everything else could be handled by the wrapper.
I imagine that major changes to the interface weren't what Isaac had
in mind when he asked for stabilization ideas, but I think downplaying
Setup.lhs is the best bet for longer term stability.
More information about the Libraries