
#14382: The 'impossible' happened whilst installing gi-gtk via cabal ----------------------------------+-------------------------------------- Reporter: maartenjacobs | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.1 Resolution: | Keywords: gtk, pango Operating System: Linux | Architecture: x86_64 (amd64) Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | ----------------------------------+-------------------------------------- Comment (by bgamari): Alright, so I managed to reproduce this on `HEAD` as well. The call stack looks like, {{{ ghc-stage2: panic! (the 'impossible' happened) (GHC version 8.3.20171026 for x86_64-unknown-linux): tcIfaceGlobal (local): not found You are in a maze of twisty little passages, all alike. While forcing the thunk for TyThing IsFile which was lazily initialized by initIfaceCheck typecheckLoop, I tried to tie the knot, but I couldn't find IsFile in the current type environment. If you are developing GHC, please read Note [Tying the knot] and Note [Type-checking inside the knot]. Consider rebuilding GHC with profiling for a better stack trace. This little catastrophe occurred while compiling GI.Gio.Interfaces.File Contents of current type environment: [] Call stack: CallStack (from HasCallStack): callStackDoc, called at compiler/utils/Outputable.hs:1147:37 in ghc:Outputable pprPanic, called at compiler/iface/TcIface.hs:1717:23 in ghc:TcIface tcIfaceGlobal, called at compiler/iface/TcIface.hs:1775:19 in ghc:TcIface tcIfaceTyCon, called at compiler/iface/TcIface.hs:1275:21 in ghc:TcIface tcIfaceType, called at compiler/iface/TcIface.hs:878:17 in ghc:TcIface tc_ax_branch, called at compiler/iface/TcIface.hs:866:37 in ghc:TcIface tc_ax_branches, called at compiler/iface/TcIface.hs:819:25 in ghc:TcIface tc_iface_decl, called at compiler/iface/TcIface.hs:640:15 in ghc:TcIface tcIfaceDecl, called at compiler/iface/LoadIface.hs:681:37 in ghc:LoadIface Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug }}} Moreover, I was able to pare down the affected module quite far. Replacing `GI.Gio.Interfaces.File` from `gi-gio-2.0.14` with the following still reproduces the issue, {{{#!hs module GI.Gio.Interfaces.File where import qualified GI.GObject.Objects.Object as GObject.Object import qualified GI.Gio.Callbacks as Gio.Callbacks import {-# SOURCE #-} qualified GI.Gio.Objects.FileEnumerator as Gio.FileEnumerator import {-# SOURCE #-} qualified GI.Gio.Structs.FileAttributeInfoList as Gio.FileAttributeInfoList class GObject o => IsFile o }}} Every line of this seems to be important; removing any one eliminates the panic. I have a repro but it's quite involved. I'm going to try to reduce it further before trying to explain it. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14382#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler