[GHC] #12204: Weird import cycle when using plugins

GHC ghc-devs at haskell.org
Sat Jun 18 12:08:28 UTC 2016


#12204: Weird import cycle when using plugins
-------------------------------------+-------------------------------------
           Reporter:  osa1           |             Owner:
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.1
           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:
-------------------------------------+-------------------------------------
 Here's a demo:

 {{{
 $ ghc Plugin.hs
 [1 of 1] Compiling Plugin           ( Plugin.hs, Plugin.o )
 $ ghc Main.hs
 [1 of 1] Compiling Main             ( Main.hs, Main.o )
 Linking Main ...


 $ rm Main.hi Main.o
 $ ghc Main.hs -fplugin=Plugin
 Module imports form a cycle:
   module ‘Plugin’ (./Plugin.hs) imports itself


 $ cat Plugin.hs
 module Plugin (plugin) where

 plugin = undefined

 $ cat Main.hs
 module Main (main) where

 main :: IO ()
 main = return ()
 }}}

 Tried with 8.0.1, HEAD.

 I don't know why installing plugins using Cabal works but this doesn't. I
 can't add plugin tests because of this.

 I can try fixing this myself if someone points me to the right direction
 -- I have no idea which part of the compiler could be doing this.

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


More information about the ghc-tickets mailing list