Configurations proposal

Brian Smith brianlsmith at
Wed Oct 25 14:20:35 EDT 2006

On 10/25/06, Duncan Coutts <duncan.coutts at> wrote:
> On Wed, 2006-10-25 at 09:39 -0500, Brian Smith wrote:
> >     Name: foo
> >     Version: 1.0
> >
> >     configuration: flag(debug)
> >     Name: foo-debug
> >
> > Otherwise, how can I have a debug and an optimized configuration of a
> > given library installed at the same time?
> You can't. No current Haskell implementation supports this (without
> doing things manually like using separate package databases / search
> paths).
> What you want is what the ghc build system refers to as a 'way'. It's a
> whole other discussion I think.

Yes, I am interested in building with different "ways" as you say. But, I
think one of your examples used -DDEBUG. I think it is reasonable  to want
to install regular and debug versions of a package together.

You said that no current Haskell implementation supports what I proposed.
But, isn't this purely a Cabal issue. If I give a -debug flag to Cabal, and
Cabal allows me to rename the package to foo-debug (by allowing me to put a
name entry in the configuration stanza, like in my example), then foo and
foo-debug can sit right next to each other in GHC or Hugs (at least). The
user would do:

     runhaskell Setup.lhs configure -debug
     runhaskell Setup.lhs build
     runhaskell Setup.lhs install

Now, foo-debug is installed. Then:

     runhaskell Setup.lhs configure
     runhaskell Setup.lhs build
     runhaskell Setup.lhs install

Now, foo is installed too. Then, we can make packages that depend on either
foo or foo-debug using the mechanism you proposed.

     Configuration: flag(debug)
     Name: bar-debug
     Build-depends: foo-debug || foo

     Configuration: !flag(debug)
     Name: bar
     Build-depends: foo

The only extension to your idea is being able to change the name of the
installed package in the configuration. I think that this is a very
desirable feature because it allows people to build packages with names that
uniquely identify the configuration, if the choose to do so.

-------------- next part --------------
An HTML attachment was scrubbed...

More information about the cabal-devel mailing list