#5878: main-is is too conservative
---------------------------------+------------------------------------------
    Reporter:  simonpj           |       Owner:                  
        Type:  bug               |      Status:  new             
    Priority:  normal            |   Milestone:                  
   Component:  Compiler          |     Version:  7.4.1           
    Keywords:                    |          Os:  Unknown/Multiple
Architecture:  Unknown/Multiple  |     Failure:  None/Unknown    
  Difficulty:  Unknown           |    Testcase:                  
   Blockedby:                    |    Blocking:                  
     Related:                    |  
---------------------------------+------------------------------------------
 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
 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?

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5878>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to