Opened 11 years ago

Closed 10 years ago

Last modified 3 years ago

#1001 closed bug (fixed)

"ghc-6.6: panic! (the 'impossible' happened) interactiveUI:flush" when hiding haskell98 and importing IO

Reported by: benjamin.franksen@… Owned by: igloo
Priority: normal Milestone: 6.6.1
Component: Compiler Version: 6.6
Keywords: Cc:
Operating System: Linux Architecture: x86_64 (amd64)
Type of failure: None/Unknown Test Case: ghci017
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


I was trying to compile John Macheam's "GetOptions" with ghc-6.6. It failed saying

ben@sarun: .../repos/GetOptions > runhaskell Setup.hs build    
Preprocessing library GetOptions-1.0...
Building GetOptions-1.0...

    Could not find module `IO':
      it is a member of package haskell98, which is hidden

I exposed haskell98:

ben@sarun: .../repos/GetOptions > sudo ghc-pkg expose haskell98
Saving old package config file... done.
Writing new package config file... done.

But still no luck... Anyway then I said to myself "forget it, just use the hierarchical library stuff", hid haskell98 package again, and changed the import stuff a bit (see below). Result:

ben@sarun: .../repos/GetOptions > runhaskell Setup.hs build

    Failed to load interface for `IO':
      it is a member of package haskell98, which is hidden
ghc-6.6: panic! (the 'impossible' happened)
  (GHC version 6.6 for x86_64-unknown-linux):

Please report this as a GHC bug:

This is the "fix" I applied:

ben@sarun: .../repos/GetOptions > darcs whatsnew
hunk ./GetOptions.hs 27
-import List
+import Data.List
hunk ./GetOptions.hs 30
-import System
-import IO
+import System.IO
+--import IO

Here is the repo I pulled from, so maybe you can reproduce the bug:

ben@sarun: .../repos/GetOptions > cat _darcs/prefs/defaultrepo

I could be that my ghc installation is completely screwed up but I wouldn't know how or why.


Change History (4)

comment:1 Changed 11 years ago by benjamin.franksen@…

Architecture: Unknownx86_64 (amd64)
Operating System: UnknownLinux

comment:2 Changed 11 years ago by igloo

Milestone: 6.6.1
Owner: set to igloo
Summary: Failed to load interface for `IO'"ghc-6.6: panic! (the 'impossible' happened) interactiveUI:flush" when hiding haskell98 and importing IO

Hi Ben,

The first half of your bug report is as expected: When cabal is compiling, it tells GHC to hide all packages that are not explicitly listed in the build-depends field of the cabal file. haskell98 is exposed by default, so your ghc-pkg expose haskell98 did nothing.

However, in hiding the haskell98 package it looks like you have exposed a bug. I suspect the problem is runhaskell is trying to use IO.hFlush but is tripping over because the package is hidden. I'll look into it!

Thanks Ian

comment:3 Changed 10 years ago by igloo

Resolution: fixed
Status: newclosed
Test Case: ghci017

It turns out ghci was actually trying to use IO.stderr, but the same idea applies.

I've changed it to use System.IO.stderr instead, so hiding haskell98 now works.

Thanks Ian

comment:4 Changed 3 years ago by Ian Lynagh <igloo@…>

In f70f94264ac724721c540a2e60175f551f8103b3/ghc:

Check running ghci with -hide-package haskell98 works. Tests trac #1001.
Note: See TracTickets for help on using tickets.