cabal executable using local hsc modules

Henning Thielemann lemming at
Mon Mar 25 18:22:33 CET 2013

On Mon, 25 Mar 2013, Andreas Voellmy wrote:

> Yes, If I rename A.hsc to A.hs, it works fine (without the "build-depends: foo" in the cabal file).

Then it may work by accident, since GHC finds the module A in the same 
directory as B. Am I right that GHC recompiles A when it compiles B? This 
should not happen, since GHC should only use the modules the are 
explicitly listed in a section (library or executable). However Cabal 
calls 'ghc --make' and this fetches modules automatically even if Cabal 
does not tell it to do so.

If library and executable would use different directories 
(Hs-source-dirs), it might not work, as expected.

More information about the Libraries mailing list