multiple cabal files in one directory?

Duncan Coutts duncan.coutts at
Mon Jan 10 19:37:33 CET 2011

On 7 January 2011 22:48, Kathleen Fisher <kathleen.fisher at> wrote:
> Hi,
> Is it possible to have a directory with multiple cabal files, telling cabal which file to use for a given install request by passing in a flag, say something like:
>>cabal install -f pads.cabal
> or
>>cabal install -f forest.cabal
> In other words, something like the -f option in make.
> I looked through the cabal documentation, but didn't see an option for specifying the cabal file to use.  Did I just fail to see the proper flag?  or does it not exist?  If it doesn't, is that just because it hasn't been implemented, or is there a Good Reason?

It's mostly because it has not been implemented yet. It's a little
harder than it looks however because it involves a change in the Cabal
spec, not just in the tools. The Cabal spec describes the interface
between package build systems and the build agent (or user). That will
need to be extended to allow for multiple .cabal files with a single
Setup.hs in one directory. We'll want to do it in such a way that it
does not impose too high costs on all custom build systems, so it'll
have to be optional.

On a related note, I'm currently implementing this:

$ cabal install ./pads/ ./forest/
$ cabal install ./pads/pads.cabal ./forest/forest.cabal

That is, if you can specify local dirs and/or .cabal files as install
targets, though each directory will still have to contain just one
.cabal file. But that syntax will extend naturally once we have
support for multiple .cabal files sharing one Setup.hs in one


$ cabal install ./lib/foo-1.0.tar.gz

That is, local and remote tarballs.


More information about the Libraries mailing list