Extending the dependency syntax

Brian Smith brianlsmith at gmail.com
Fri Aug 12 10:25:31 EDT 2005


On 8/10/05, Simon Marlow <simonmar at microsoft.com> wrote:

> On 10 August 2005 06:56, Brian Smith wrote:
> > > On 8/9/05, Simon Marlow <simonmar at microsoft.com> wrote:
> 
> I'm not wildly excited about "true ? true", but we could add special
> syntax for that if it turns out to be used often.
> 
> > Can configurations contain their own "Build-depends", like this?:
> >
> >     [windows]
> >     Build-depends: Win32
> >     extra-libraries: gnome
> 
> The problem I have with this is that it means you can only decide
> dependencies based on the settings of flags, rather than the other way
> around.  We use both in the above example - [ghc64] is decided based on
> the availability of ghc versions, whereas [mozilla] is chosen based on a
> configuration flag.  You had to hack it in your example:
> 
> > I think it would be clearer to specify the configuration seperately,
> > like this:
> >
> >     configuration:
> >           ghc >= 6.4 ? [ghc64] | ghc >= 5.04 ? [ghc-old]) | hugs?
> >           [hugs], debug enabled ? [debug] | [release],
> >           gnome enabled ? [gnome],
> >           mozilla enabled ? [mozilla],
> >           doc enabled ? [doc]
> >     -- the "global" Build-depends applies to everything
> >     Build-depends: base >= 1.0, haskell98 >= 1.0
> 
> So configuration contains dependencies like ghc >= 6.4.  I think it's
> clearer to put all the dependencies in one place.

Fair enough. But, you doesn't answer the original part of my question:
can each configuration stanza contain its own "Build-depends" section
too? Like I said, if a configuration stanza can contain _foreign
library_ dependencies (e.g. Extra-libraries: shell32, libxml2) then it
seems like we should be able to put _native library_ dependencies in
the configuration stanzas too.

Also, don't we need a way to version native library dependencies too?
e.g. Extra-libraries: libxml2 >= 2.6.1. And then, do you want to allow
conditional dependencies based on native library dependencies? And, if
so, do you want them integrated into the Build-depends: field too?

- Brian


More information about the Libraries mailing list