[GHC] #12132: Type representations missing for promoted boxed tuples

#12132: Type representations missing for promoted boxed tuples -------------------------------------+------------------------------------- Reporter: bgamari | Owner: bgamari Type: bug | Status: new Priority: normal | Milestone: 8.0.2 Component: Compiler | Version: 8.0.1 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- This is a continuation of #11120. It seems there is something odd happening with type representations for boxed tuples, {{{ $ inplace/bin/ghc-stage2 --interactive GHCi, version 8.1.20160528: http://www.haskell.org/ghc/ :? for help Prelude> :set -XDataKinds Prelude> :m + Data.Typeable Data.Proxy Prelude Data.Typeable Data.Proxy> typeOf (Proxy :: Proxy (Int,Int)) Proxy * (Int,Int) Prelude Data.Typeable Data.Proxy> typeOf (Proxy :: Proxy '(Int,Int)) GHC error in desugarer lookup in Ghci2: Can't find interface-file declaration for variable $tc'(,) 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 ghc-stage2: panic! (the 'impossible' happened) (GHC version 8.1.20160528 for x86_64-unknown-linux): initDs IOEnv failure Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug Prelude Data.Typeable Data.Proxy> }}} This is odd since the `$tc'(,)` binding is present in the interface file for `GHC.Tuple`, {{{ $ inplace/bin/ghc-stage2 --show-iface libraries/ghc-prim/dist- install/build/GHC/Tuple.dyn_hi |less ... 14e44400752f4580e52ed2a760b9633f $tc'(,) :: TyCon {- HasNoCafRefs, Strictness: m, Unfolding: (TyCon 14407099369839560749## 10712746223293009168## $trModule $tc'(,)1) -} 543be63d698612591d2e75b0b60ad643 $tc'(,)1 :: TrName {- HasNoCafRefs, Strictness: m1, Unfolding: (TrNameS "'(,)"#) -} 469b4ffe716da12a5be1f5ab03864791 $tc'(,,) :: TyCon {- HasNoCafRefs, Strictness: m, Unfolding: (TyCon 3540448346642256323## 9150387332266490903## $trModule $tc'(,,)1) -} ... }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12132 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12132: Type representations missing for promoted boxed tuples -------------------------------------+------------------------------------- Reporter: bgamari | Owner: bgamari Type: bug | Status: new Priority: normal | Milestone: 8.0.2 Component: Compiler | Version: 8.0.1 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 bgamari: @@ -40,8 +40,0 @@ - 469b4ffe716da12a5be1f5ab03864791 - $tc'(,,) :: TyCon - {- HasNoCafRefs, Strictness: m, - Unfolding: (TyCon - 3540448346642256323## - 9150387332266490903## - $trModule - $tc'(,,)1) -} New description: This is a continuation of #11120. It seems there is something odd happening with type representations for boxed tuples, {{{ $ inplace/bin/ghc-stage2 --interactive GHCi, version 8.1.20160528: http://www.haskell.org/ghc/ :? for help Prelude> :set -XDataKinds Prelude> :m + Data.Typeable Data.Proxy Prelude Data.Typeable Data.Proxy> typeOf (Proxy :: Proxy (Int,Int)) Proxy * (Int,Int) Prelude Data.Typeable Data.Proxy> typeOf (Proxy :: Proxy '(Int,Int)) GHC error in desugarer lookup in Ghci2: Can't find interface-file declaration for variable $tc'(,) 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 ghc-stage2: panic! (the 'impossible' happened) (GHC version 8.1.20160528 for x86_64-unknown-linux): initDs IOEnv failure Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug Prelude Data.Typeable Data.Proxy> }}} This is odd since the `$tc'(,)` binding is present in the interface file for `GHC.Tuple`, {{{ $ inplace/bin/ghc-stage2 --show-iface libraries/ghc-prim/dist- install/build/GHC/Tuple.dyn_hi |less ... 14e44400752f4580e52ed2a760b9633f $tc'(,) :: TyCon {- HasNoCafRefs, Strictness: m, Unfolding: (TyCon 14407099369839560749## 10712746223293009168## $trModule $tc'(,)1) -} 543be63d698612591d2e75b0b60ad643 $tc'(,)1 :: TrName {- HasNoCafRefs, Strictness: m1, Unfolding: (TrNameS "'(,)"#) -} ... }}} -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12132#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12132: Type representations missing for promoted boxed tuples -------------------------------------+------------------------------------- Reporter: bgamari | Owner: bgamari Type: bug | Status: new Priority: normal | Milestone: 8.0.2 Component: Compiler | Version: 8.0.1 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: | -------------------------------------+------------------------------------- Comment (by bgamari): Sadly `-ddump-if-trace` doesn't appear to be so helpful here, {{{ $ inplace/bin/ghc-stage2 --interactive GHCi, version 8.1.20160528: http://www.haskell.org/ghc/ :? for help Prelude> :set -XDataKinds Prelude> :m + Data.Typeable Data.Proxy Prelude Data.Typeable Data.Proxy> typeOf (Proxy :: Proxy (Int,Int)) Proxy * (Int,Int) Prelude Data.Typeable Data.Proxy> typeOf (Proxy :: Proxy '(Int,Int)) GHC error in desugarer lookup in Ghci2: Can't find interface-file declaration for variable $tc'(,) 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 ghc-stage2: panic! (the 'impossible' happened) (GHC version 8.1.20160528 for x86_64-unknown-linux): initDs IOEnv failure Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug Prelude Data.Typeable Data.Proxy> }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12132#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12132: Type representations missing for promoted boxed tuples -------------------------------------+------------------------------------- Reporter: bgamari | Owner: bgamari Type: bug | Status: new Priority: normal | Milestone: 8.0.2 Component: Compiler | Version: 8.0.1 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: | -------------------------------------+------------------------------------- Comment (by bgamari): It seems like the issue here is that the uniques don't match. For instance, in the case of the error, {{{ GHC error in desugarer lookup in interactive:Ghci1: Can't find interface-file declaration for variable ghc- prim-0.5.0.0:GHC.Tuple.$tc'(,){v 78} 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 }}} I have only this in the PTE, {{{ Identifier ‘ghc-prim-0.5.0.0:GHC.Tuple.$tc(,){v 45}’ }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12132#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12132: Type representations missing for promoted boxed tuples -------------------------------------+------------------------------------- Reporter: bgamari | Owner: bgamari Type: bug | Status: patch Priority: normal | Milestone: 8.0.2 Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D2279 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: new => patch * differential: => Phab:D2279 Comment: The issue ended up being that promoted tycons arising from the boxed tuple types weren't being included in `knownKeyNames`. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12132#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12132: Type representations missing for promoted boxed tuples -------------------------------------+------------------------------------- Reporter: bgamari | Owner: bgamari Type: bug | Status: merge Priority: normal | Milestone: 8.0.2 Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D2279 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: patch => merge -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12132#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12132: Type representations missing for promoted boxed tuples
-------------------------------------+-------------------------------------
Reporter: bgamari | Owner: bgamari
Type: bug | Status: merge
Priority: normal | Milestone: 8.0.2
Component: Compiler | Version: 8.0.1
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D2279
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ben Gamari

#12132: Type representations missing for promoted boxed tuples -------------------------------------+------------------------------------- Reporter: bgamari | Owner: bgamari Type: bug | Status: closed Priority: normal | Milestone: 8.0.2 Component: Compiler | Version: 8.0.1 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D2279 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: merge => closed * resolution: => fixed Comment: Merged to `ghc-8.0` as f7b6adccec14cd4d8d4854e01b9f78b80f533b4d. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12132#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12132: Type representations missing for promoted boxed tuples -------------------------------------+------------------------------------- Reporter: bgamari | Owner: bgamari Type: bug | Status: closed Priority: normal | Milestone: 8.0.2 Component: Compiler | Version: 8.0.1 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D2279 Wiki Page: | -------------------------------------+------------------------------------- Comment (by simonpj): mmm. So it looks as though ''promoted'' tuple data cons are not handled by the special encoding in `Note [Symbol table representation of names]` in `BinIface`. Adding them to `knownKeyNames` may be one solution. But another, and a more consistent one, is to fix up the encoding described in that Note so that it does handle promoted tuple data cons. Let's not have several different fixes for the same problem! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12132#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

Adding them to knownKeyNames may be one solution. But another, and a more consistent one, is to fix up the encoding described in that Note so
#12132: Type representations missing for promoted boxed tuples -------------------------------------+------------------------------------- Reporter: bgamari | Owner: bgamari Type: bug | Status: closed Priority: normal | Milestone: 8.0.2 Component: Compiler | Version: 8.0.1 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D2279 Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): that it does handle promoted tuple data cons. Let's not have several different fixes for the same problem! Sure, sounds like a better plan. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12132#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC