recompilation on --main-is

Evan Laforge qdunkan at
Thu Feb 16 06:10:56 CET 2012

Thanks for bringing this up. I've been having the same problem and was
thinking there was something wrong with my system. I have 3 main files and
one util that they all import. Every build recompiles every file, even if
there were no changes.
On Feb 15, 2012 8:39 PM, "Conrad Parker" <conrad at> wrote:

> Hi,
> We have a project with around 200 Haskell source files, and around 20
> executables which import these (as well as importing third-party
> libraries). We first build all the non-main files using a makefile
> generated with ghc -M. We then build the executables using a separate
> invocation of "ghc --make --main-is foo.hs", for each foo.hs. This
> worked fine with ghc-7.2.1; each final "ghc --make" would simply link
> the pre-built object files -- but with ghc-7.4.1 all these files are
> recompiled for each target executable. As a result our full build
> takes around 10-20x longer with ghc-7.4.1 than ghc-7.2.1.
> Looking at compiler/iface/FlagChecker.hs, it seems that the --main-is
> flag is used as an input to the recompilation checker. It would make
> sense that --main-is should force recompilation of the particular file
> that exports 'main', but it also forces recompilation of its
> dependencies. Is this a bug or is there a good reason to recompile
> everything?
> Conrad.
> _______________________________________________
> Glasgow-haskell-users mailing list
> Glasgow-haskell-users at
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Glasgow-haskell-users mailing list