main-is is too conservative
Conrad Parker writes: 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
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.
compiler/iface/FlagChecker.hs, it seems that the
flag is used as an input to the recompilation checker. It would make
--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