[GHC] #14217: Interface-file decls for large tuples

#14217: Interface-file decls for large tuples -------------------------------------+------------------------------------- Reporter: crockeea | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.1 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: Compile-time Unknown/Multiple | crash or panic Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- I'm in the process of updating a large code base for GHC 8.2, and I have the following error (with -ddump-if-trace): {{{ ... Starting fork { Declaration for $fCT2 Loading decl for $fCT2 updating EPS_ Considering whether to load GHC.Prim {- SYSTEM -} Considering whether to load GHC.Prim {- SYSTEM -} } ending fork Declaration for $fCT2 Need decl for (%,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,%) Considering whether to load GHC.Classes {- SYSTEM -} Considering whether to load GHC.Types {- SYSTEM -} checkWiredInTyCon Double Crypto.Lol.Applications.Tests.SHETests Considering whether to load GHC.Types {- SYSTEM -} Starting fork { Class op ip a ty } ending fork Class op ip a ty ... Can't find interface-file declaration for type constructor or class ghc- prim-0.5.1.0:GHC.Classes.(%,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,%) Probable cause: bug in .hi-boot file, or inconsistent .hi file Use -ddump-if-trace to get an idea of which file caused the error }}} The code in question involves a poly-kinded, promoted 8-tuple, though I have no idea where GHC is coming up with a 64-tuple. Since I'm updating a large library, I've been unable to produce a small example so far. I can make the code compile by simplifying it in various ways, so aside from this problem, the code works with 8.2.1. This issue is currently preventing me from updating my code base to 8.2.1. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14217 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14217: Interface-file decls for large tuples -------------------------------------+------------------------------------- Reporter: crockeea | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by RyanGlScott): Until a simplified version of this code emerges, can you post a link to the failing code as-is? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14217#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14217: Interface-file decls for large tuples -------------------------------------+------------------------------------- Reporter: crockeea | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): For the record, the tuple in question isn't a "regular" tuple but rather a constraint tuple. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14217#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14217: Interface-file decls for large tuples -------------------------------------+------------------------------------- Reporter: crockeea | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by crockeea): Here's the code in question. {{{ {-# LANGUAGE DataKinds #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE PartialTypeSignatures #-} {-# LANGUAGE PolyKinds #-} {-# LANGUAGE RebindableSyntax #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-} {-# OPTIONS_GHC -fno-warn-partial-type-signatures #-} module Crypto.Lol.Applications.Tests.SHETests (tunnelTests) where import Control.Monad.Random import Crypto.Lol import Crypto.Lol.Applications.SymmSHE import Crypto.Lol.Tests import qualified Test.Framework as TF tunnelTests :: forall t r r' s s' zp zq gad . (_) => Proxy '(r,r',s,s',zp,zq) -> Proxy gad -> Proxy t -> TF.Test tunnelTests _ _ _ = let ptmr = Proxy::Proxy '(t,r,r',s,s',zp,zq,gad) in TF.testGroup (showType ptmr) [genTestArgs "Tunnel" prop_ringTunnel ptmr] prop_ringTunnel :: (TunnelHintCtx t e r s e' r' s' z zp zq gad, EncryptCtx t r r' z zp zq, DecryptUCtx t s s' z zp zq, e ~ FGCD r s) => PT (Cyc t r zp) -> SK (Cyc t r' z) -> SK (Cyc t s' z) -> Test '(t,r,r',s,s',zp,zq,gad) prop_ringTunnel x skin skout = undefined }}} bgamari: That's useful to know! The constraints on `prop_ringTunnel` (`TunnelHintCtx`, `EncryptCtx`, and `DecryptCtx`) are all (large) constraint synonyms. The offending line is actually `tunnelTests _ _ _ =`. Although the error in this ticket is killing compilation before I get a warning about the partial type signature (which would include the entire constraint list for `tunnelTests`), I know that the list is heinous -- that's why I'm using PTSs in the first place! It wouldn't surprise me at all to know it had 64 items in it. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14217#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14217: Interface-file decls for large tuples -------------------------------------+------------------------------------- Reporter: crockeea | Owner: (none) Type: bug | Status: new Priority: high | Milestone: 8.2.2 Component: Compiler | Version: 8.2.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * priority: normal => high * milestone: => 8.2.2 Comment: Thanks crockeea, thanks was tremendously helpful. It turns out you can also trigger this error with this program (which has no external dependencies): {{{#!hs {-# LANGUAGE PartialTypeSignatures #-} {-# OPTIONS_GHC -Wno-partial-type-signatures #-} module Bug where data Foo a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 a17 a18 a19 a20 a21 a22 a23 a24 a25 a26 a27 a28 a29 a30 a31 a32 a33 a34 a35 a36 a37 a38 a39 a40 a41 a42 a43 a44 a45 a46 a47 a48 a49 a50 a51 a52 a53 a54 a55 a56 a57 a58 a59 a60 a61 a62 a63 = MkFoo a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 a17 a18 a19 a20 a21 a22 a23 a24 a25 a26 a27 a28 a29 a30 a31 a32 a33 a34 a35 a36 a37 a38 a39 a40 a41 a42 a43 a44 a45 a46 a47 a48 a49 a50 a51 a52 a53 a54 a55 a56 a57 a58 a59 a60 a61 a62 a63 deriving Eq eqFoo :: _ => Foo a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 a17 a18 a19 a20 a21 a22 a23 a24 a25 a26 a27 a28 a29 a30 a31 a32 a33 a34 a35 a36 a37 a38 a39 a40 a41 a42 a43 a44 a45 a46 a47 a48 a49 a50 a51 a52 a53 a54 a55 a56 a57 a58 a59 a60 a61 a62 a63 -> Foo a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 a17 a18 a19 a20 a21 a22 a23 a24 a25 a26 a27 a28 a29 a30 a31 a32 a33 a34 a35 a36 a37 a38 a39 a40 a41 a42 a43 a44 a45 a46 a47 a48 a49 a50 a51 a52 a53 a54 a55 a56 a57 a58 a59 a60 a61 a62 a63 -> Bool eqFoo = (==) }}} {{{ $ /opt/ghc/8.2.1/bin/ghci Bug.hs GHCi, version 8.2.1: http://www.haskell.org/ghc/ :? for help Loaded GHCi configuration from /home/rgscott/.ghci [1 of 1] Compiling Bug ( Bug.hs, interpreted ) Bug.hs:37:1: error: Can't find interface-file declaration for type constructor or class GHC.Classes.(%,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,%) Probable cause: bug in .hi-boot file, or inconsistent .hi file Use -ddump-if-trace to get an idea of which file caused the error | 37 | eqFoo = (==) | ^^^^^^^^^^^^ }}} As you observed, this error does not occur in GHC 8.0.1 or 8.0.2, so this is a regression. I'll bump the priority accordingly. (Interestingly, 63 appears to be the minimum constraint tuple size that GHC complains about, since removing `a63` from `Foo` causes it to compile again.) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14217#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14217: Interface-file decls for large tuples -------------------------------------+------------------------------------- Reporter: crockeea | Owner: (none) Type: bug | Status: new Priority: high | Milestone: 8.2.2 Component: Compiler | Version: 8.2.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * cc: simonpj (added) Comment: This regression first emerged in commit 15b9bf4ba4ab47e6809bf2b3b36ec16e502aea72 (`Improve typechecking of let- bindings`). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14217#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14217: Interface-file decls for large tuples -------------------------------------+------------------------------------- Reporter: crockeea | Owner: (none) Type: bug | Status: new Priority: high | Milestone: 8.2.2 Component: Compiler | Version: 8.2.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by RyanGlScott): Simon, you appear to have fixed (?) this bug in commit 3c74a51232813eb733b27c43c94ce005112a0ddb (`Deal with large extra- contraints wildcards`). Does that mean that this issue is resolved, and that we should merge 3c74a51232813eb733b27c43c94ce005112a0ddb to GHC 8.2.2? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14217#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14217: Interface-file decls for large tuples
-------------------------------------+-------------------------------------
Reporter: crockeea | Owner: (none)
Type: bug | Status: merge
Priority: high | Milestone: 8.2.2
Component: Compiler | Version: 8.2.1
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
Type of failure: Compile-time | Unknown/Multiple
crash or panic | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Changes (by simonpj):
* status: new => merge
Comment:
Ah yes. I failed to mention the ticket, sorry. The commit is
{{{
commit 3c74a51232813eb733b27c43c94ce005112a0ddb
Author: Simon Peyton Jones

#14217: Interface-file decls for large tuples -------------------------------------+------------------------------------- Reporter: crockeea | Owner: (none) Type: bug | Status: closed Priority: high | Milestone: 8.2.2 Component: Compiler | Version: 8.2.1 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: merge => closed * resolution: => fixed Comment: Merged to `ghc-8.2` as 2e17259c57ff598ec87db545fb33702d86859462. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14217#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC