cabal executable using local hsc modules

Henning Thielemann lemming at
Mon Mar 25 15:05:46 CET 2013

On Mon, 25 Mar 2013, Andreas Voellmy wrote:

> Hi, 
> I have a library that has some modules written as .hsc files and I want to include some executables that use
> those modules. Cabal doesn't seem to find the modules when it is building the executable. It complains that
> the module used by the executable is in a hidden package (of the same name as the package being built).
> Adding the package as a dependency in the executable section doesn't work since it references a library
> defined in the same package.

This should work since Cabal-1.14. Can you show, how exactly you added the 
dependency to the executable?

If it does not work, you may add Hs-Source-Dirs of the library to the 
executable. However this means that GHC will recompile the library 
modules, yielding more compile time and more disk space consumption.

More information about the Libraries mailing list