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

GHC ghc-devs at haskell.org
Sat Sep 3 21:19:09 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
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by heisenbug):

 Following patch seems to fix the problem:

 {{{#!diff
 diff --git a/compiler/iface/MkIface.hs b/compiler/iface/MkIface.hs
 index 8115583..f6856ae 100644
 --- a/compiler/iface/MkIface.hs
 +++ b/compiler/iface/MkIface.hs
 @@ -1112,6 +1112,12 @@ checkDependencies hsc_env summary iface
                           return (RecompBecause reason)
                   else
                           return UpToDate
 +          | moduleName mod `elem` pluginModNames (hsc_dflags hsc_env)
 +                  ->  do traceHiDiffs $
 +                           text "imported module " <> quotes (ppr mod) <>
 +                           text " is from package " <> quotes (ppr pkg)
 <>
 +                           text ", and is a plugin"
 +                         return UpToDate
            | otherwise
             -> if pkg `notElem` (map fst prev_dep_pkgs)
                   then do traceHiDiffs $
 }}}
 Of course I am playing fast and loose with other checks. I should e.g.
 make sure that it is not regularly found first.

 Anyway, can somebody review this, so that I know I am going in the right
 general direction?

 For example as suggested above, the plugin modules' packages could be
 saved into the `.hi` files. But I did not find a way to do that, as the
 DynFlags don't track the packages of plugins, only their `ModuleName`s.

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


More information about the ghc-tickets mailing list