Cabal recompiles library for executables

Henning Thielemann lemming at
Mon Dec 4 10:29:33 EST 2006

On Mon, 4 Dec 2006, Simon Marlow wrote:

> Henning Thielemann wrote:
> > If a project consists of both a library and executables, the library
> > modules are re-compiled for each executable. (I use GHC.) That leads to
> > high space and time consumption. Is this a bug or a feature?
> A package that has both a library and executables isn't supported well right
> now, and in fact the intention is to deprecate and remove it.  Actually I'm
> surprised if it works at all.
> The right way is to have a separate package to contain the library code, and
> depend on this package for your executables.

Sounds good. Btw. that's the way the Modula-3 build system handles
packages. Ask Luca Cardelli in Cambridge! :-) Maybe the attached
executables are the interim solution until "the right thing" (compiling
multiple packages easily) is implemented.

More information about the cabal-devel mailing list