[GHC] #12567: `ghc --make` recompiles unchanged files when using `-fplugin` OPTIONS

GHC ghc-devs at haskell.org
Sat Sep 3 13:33:37 UTC 2016


#12567: `ghc --make` recompiles unchanged files when using `-fplugin` OPTIONS
-------------------------------------+-------------------------------------
           Reporter:  heisenbug      |             Owner:
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  7.10.3
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 Consider this bare-bones module

 {{{#!hs
 {-# OPTIONS -fplugin GHC.TypeLits.Normalise #-}

 module A where
 }}}

 compiling it will always say

 {{{
 $ ghc --make A.hs
 [1 of 1] Compiling A                ( A.hs, A.o ) [GHC.TypeLits.Normalise
 changed]
 }}}
 even when the module was compiled before.


 {{{
 $ ghc A.hs -c -ddump-if-trace -ddump-hi-diffs
 }}}

 will give the reason:

 {{{
 imported module ‘GHC.TypeLits.Normalise’ is from package ‘ghc-typelits-
 natnormalise-0.5’, which is not among previous dependencies
 }}}
 Which is the probable cause: when writing the `.hi` file, the used
 plugins' package dependencies should be also written out. AFAICS they are
 extracted fron the `DynFlags` but for this comparison in
 {{{
 checkDependencies :: HscEnv -> ModSummary -> ModIface -> IfG
 RecompileRequired
 }}}
 but not found in the `ModSummary` that was originally written to disk.

 This is pretty nasty for `clash` compilations and the suspected bug is
 documented here: https://github.com/clash-lang/ghc-typelits-
 natnormalise/issues/2

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


More information about the ghc-tickets mailing list