[GHC] #16093: mkPluginUsage: file not found

GHC ghc-devs at haskell.org
Sun Dec 23 23:08:34 UTC 2018


#16093: mkPluginUsage: file not found
-------------------------------------+-------------------------------------
        Reporter:  lerkok            |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.6.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:                    |
-------------------------------------+-------------------------------------
Description changed by lerkok:

Old description:

> I've been trying to track down another plugin issue when I ran into this
> one.
>
> I have the following `TestPlugin.hs` file:
>
> {{{#!hs
> module TestPlugin (plugin) where
>
> import GhcPlugins
>
> plugin :: Plugin
> plugin = defaultPlugin {installCoreToDos = install}
>   where install _ todos = return (test : todos)
>
>         test = CoreDoPluginPass "Test" return
> }}}
>
> And the following `Test.hs` file:
>
> {{{#!hs
> {-# OPTIONS_GHC -fplugin TestPlugin #-}
>
> main :: IO ()
> main = return ()
> }}}
>
> They are both in the same directory. With ghc 8.4.2, I have:
>
> {{{
> $ ghci-8.4.2 -package ghc Test.hs
> GHCi, version 8.4.2: http://www.haskell.org/ghc/  :? for help
> [1 of 2] Compiling TestPlugin       ( TestPlugin.hs, interpreted )
> [2 of 2] Compiling Main             ( Test.hs, interpreted )
> Ok, two modules loaded.
> }}}
>
> But with ghc 8.6.3, I get:
>
> {{{
> $ ghci-8.6.3 -package ghc Test.hs
> GHCi, version 8.6.3: http://www.haskell.org/ghc/  :? for help
> [1 of 2] Compiling TestPlugin       ( TestPlugin.hs, interpreted )
> [2 of 2] Compiling Main             ( Test.hs, interpreted )
> ghc: panic! (the 'impossible' happened)
>   (GHC version 8.6.3 for x86_64-apple-darwin):
>         mkPluginUsage: file not found
>   TestPlugin ./TestPlugin.o
>   Call stack:
>       CallStack (from HasCallStack):
>         callStackDoc, called at compiler/utils/Outputable.hs:1160:37 in
> ghc:Outputable
>         pprPanic, called at compiler/deSugar/DsUsage.hs:234:15 in
> ghc:DsUsage
>
> Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug
> }}}
>
> The problem goes away if I first compile `TestPlugin.hs` and create a
> `.o` file; but nonetheless this seems to be an issue.

New description:

 I've been trying to track down another plugin issue when I ran into this
 one.

 I have the following `TestPlugin.hs` file:

 {{{#!hs
 module TestPlugin (plugin) where

 import GhcPlugins

 plugin :: Plugin
 plugin = defaultPlugin {installCoreToDos = install}
   where install _ todos = return (test : todos)

         test = CoreDoPluginPass "Test" return
 }}}

 And the following `Test.hs` file:

 {{{#!hs
 {-# OPTIONS_GHC -fplugin TestPlugin #-}

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

 They are both in the same directory. With ghc 8.4.2, I have:

 {{{
 $ ghci-8.4.2 -package ghc Test.hs
 GHCi, version 8.4.2: http://www.haskell.org/ghc/  :? for help
 [1 of 2] Compiling TestPlugin       ( TestPlugin.hs, interpreted )
 [2 of 2] Compiling Main             ( Test.hs, interpreted )
 Ok, two modules loaded.
 }}}

 But with ghc 8.6.3, I get:

 {{{
 $ ghci-8.6.3 -package ghc Test.hs
 GHCi, version 8.6.3: http://www.haskell.org/ghc/  :? for help
 [1 of 2] Compiling TestPlugin       ( TestPlugin.hs, interpreted )
 [2 of 2] Compiling Main             ( Test.hs, interpreted )
 ghc: panic! (the 'impossible' happened)
   (GHC version 8.6.3 for x86_64-apple-darwin):
         mkPluginUsage: file not found
   TestPlugin ./TestPlugin.o
   Call stack:
       CallStack (from HasCallStack):
         callStackDoc, called at compiler/utils/Outputable.hs:1160:37 in
 ghc:Outputable
         pprPanic, called at compiler/deSugar/DsUsage.hs:234:15 in
 ghc:DsUsage

 Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug
 }}}

 The problem goes away if I first compile `TestPlugin.hs` and create a `.o`
 file; but nonetheless this seems to be at least "unexpected" by ghci.

--

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


More information about the ghc-tickets mailing list