Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
GHC
GHC
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,268
    • Issues 4,268
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 408
    • Merge Requests 408
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Security & Compliance
    • Security & Compliance
    • Dependency List
    • License Compliance
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #16093

Closed
Open
Opened Dec 23, 2018 by Levent Erkök@LeventErkokReporter

mkPluginUsage: file not found

I have the following TestPlugin.hs file:

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:

{-# 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 a regression from 8.4.2.

Edited Mar 10, 2019 by Levent Erkök
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#16093