Virtual packages

Edward Z. Yang ezyang at MIT.EDU
Fri Dec 2 08:19:07 CET 2011


Hello folks,

I was thinking a little about how build flags that modify functionality
are harmful for dependency resolution (pandoc and xmobar, I'm glaring at you),
but authors will still use this feature because it's a lot easier than maintaining
a bunch of separate packages for each different flag.

It suddenly struck me, then, that what we actually needed was a mechanism
not unlike what you see in traditional package managers, where a single Cabal
file can specify multiple packages.  pandoc.cabal might define 'pandoc'
and 'pandoc-highlighting', and pandoc-highlighting can have different
build dependencies, modules, etc.  Module writers still need to arrange their
APIs so that the extra functionality should be separable, but I don't see
this as being too much of a problem.  Mix-and-matching flags can be achieved
by simply picking the extra virtual models as dependencies as necessary.

What do you think?

Cheers,
Edward



More information about the cabal-devel mailing list