GHC issueshttps://gitlab.haskell.org/ghc/ghc/-/issues2019-07-07T18:02:53Zhttps://gitlab.haskell.org/ghc/ghc/-/issues/15811Comment out CONSTANT_FOLDED annotation for some GHC.Natural functions2019-07-07T18:02:53ZdarchonComment out CONSTANT_FOLDED annotation for some GHC.Natural functionsSome functions in GHC.Natural with a CONSTANT_FOLDED annotation don't have actual builtin rules (nor a builtin name in PrelNames and friends).
This is hurting the Clash compiler because the workers for these functions do not end up in t...Some functions in GHC.Natural with a CONSTANT_FOLDED annotation don't have actual builtin rules (nor a builtin name in PrelNames and friends).
This is hurting the Clash compiler because the workers for these functions do not end up in the .hi interface files, nor can we reliably define primops; meaning Clash cannot translate functions over Natural. This is doubly problematic because Natural is the underlying representation for KnownNat which Clash uses extensively.
This feature request is simply a backstop for GHC 8.6.2 until proper builtin rules are defined for the referred to functions in GHC.Natural8.6.2https://gitlab.haskell.org/ghc/ghc/-/issues/15810Kind inference error in classes2019-07-07T18:02:53ZRichard Eisenbergrae@richarde.devKind inference error in classesThis is rejected today, but it shouldn't be:
```hs
class C a where
meth :: Proxy (a :: k)
```
It's the kind signature that kills it.
Expected solution: change `tcImplicitTKBndrs` to `kcImplicitTKBndrs` in `kcHsKindSig`.
<details><s...This is rejected today, but it shouldn't be:
```hs
class C a where
meth :: Proxy (a :: k)
```
It's the kind signature that kills it.
Expected solution: change `tcImplicitTKBndrs` to `kcImplicitTKBndrs` in `kcHsKindSig`.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.6.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Kind inference error in classes","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.6.1","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"This is rejected today, but it shouldn't be:\r\n\r\n{{{#!hs\r\nclass C a where\r\n meth :: Proxy (a :: k)\r\n}}}\r\n\r\nIt's the kind signature that kills it.\r\n\r\nExpected solution: change `tcImplicitTKBndrs` to `kcImplicitTKBndrs` in `kcHsKindSig`.","type_of_failure":"OtherFailure","blocking":[]} -->https://gitlab.haskell.org/ghc/ghc/-/issues/15809Use level numbers for generalisation2019-09-19T13:37:13ZSimon Peyton JonesUse level numbers for generalisationGHC's type inference engine goes to quite a bit of effort to pin a *level number* on every type variable (both skolems and unification variables).
**Idea**: when generalising a type or kind, use those level numbers to decide which varia...GHC's type inference engine goes to quite a bit of effort to pin a *level number* on every type variable (both skolems and unification variables).
**Idea**: when generalising a type or kind, use those level numbers to decide which variables to generalise.
This could completely replace the "global tyvars" field of the `TcLclEnv` (the `tcl_tyvars` field), which is very tiresome to maintain.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.6.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Use level numbers for generalisation","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.6.1","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"GHC's type inference engine goes to quite a bit of effort to pin a ''level number'' on every type variable (both skolems and unification variables).\r\n\r\n'''Idea''': when generalising a type or kind, use those level numbers to decide which variables to generalise.\r\n\r\nThis could completely replace the \"global tyvars\" field of the `TcLclEnv` (the `tcl_tyvars` field), which is very tiresome to maintain.","type_of_failure":"OtherFailure","blocking":[]} -->Richard Eisenbergrae@richarde.devRichard Eisenbergrae@richarde.devhttps://gitlab.haskell.org/ghc/ghc/-/issues/15808Loading libraries with FFI exports may cause segfaults in the compiler if the...2020-11-14T11:50:27ZAndreas KlebingerLoading libraries with FFI exports may cause segfaults in the compiler if they are loaded far from the rts in memory.Original report below.
In this case we compile aeson which uses TH triggering dynamic loading of a number of libraries.
Some libraries (eg base) have FFI exports which require us to place a relative jump to the RTS in order to register...Original report below.
In this case we compile aeson which uses TH triggering dynamic loading of a number of libraries.
Some libraries (eg base) have FFI exports which require us to place a relative jump to the RTS in order to register a stable name.
Now an issue arises if base is placed more than 2G from the RTS as we can't have relative jumps are limited to a 2GB range.
In the particular case this caused the jump target to underflow, resulting in a jump to unallocated memory and a segfault.
In more detail the PE linker (PEi386.c:ocResolve_PEi386) fails to detect, or properly deal with the bounds violation.
There seems to be some code in place to deal with an overflow already but fails to detect it.
----
I haven't had any luck with reproducing it outside of building the aeson package with cabal yet. So for now just documenting the fact.
build.mk used
```
GhcLibHcOpts += -g3
GhcRtsHcOpts += -g3
STRIP_CMD = :
BUILD_PROF_LIBS = NO
SplitObjs = NO
SplitSections = NO
HADDOCK_DOCS = NO
BUILD_SPHINX_HTML = NO
BUILD_SPHINX_PDF = NO
BUILD_MAN = NO
```
Error log:
```
"E:/ghc_dwarf/inplace/bin/ghc-stage2.exe" "--make" "-fbuilding-cabal-package" "-O" "-outputdir" "C:\ghc\msys64\home\Andi\aeson_repro\dist-newstyle\build\x86_64-windows\ghc-8.7.20181025\aeson-1.4.1.0\build" "-odir" "C:\ghc\msys64\home\Andi\aeson_repro\dist-newstyle\build\x86_64-windows\ghc-8.7.20181025\aeson-1.4.1.0\build" "-hidir" "C:\ghc\msys64\home\Andi\aeson_repro\dist-newstyle\build\x86_64-windows\ghc-8.7.20181025\aeson-1.4.1.0\build" "-stubdir" "C:\ghc\msys64\home\Andi\aeson_repro\dist-newstyle\build\x86_64-windows\ghc-8.7.20181025\aeson-1.4.1.0\build""-i" "-iC:\ghc\msys64\home\Andi\aeson_repro\dist-newstyle\build\x86_64-windows\ghc-8.7.20181025\aeson-1.4.1.0\build" "-i." "-iattoparsec-iso8601/" "-ipure" "-iC:\ghc\msys64\home\Andi\aeson_repro\dist-newstyle\build\x86_64-windows\ghc-8.7.20181025\aeson-1.4.1.0\build\autogen" "-iC:\ghc\msys64\home\Andi\aeson_repro\dist-newstyle\build\x86_64-windows\ghc-8.7.20181025\aeson-1.4.1.0\build\global-autogen" "-IC:\ghc\msys64\home\Andi\aeson_repro\dist-newstyle\build\x86_64-windows\ghc-8.7.20181025\aeson-1.4.1.0\build\autogen" "-IC:\ghc\msys64\home\Andi\aeson_repro\dist-newstyle\build\x86_64-windows\ghc-8.7.20181025\aeson-1.4.1.0\build\global-autogen" "-IC:\ghc\msys64\home\Andi\aeson_repro\dist-newstyle\build\x86_64-windows\ghc-8.7.20181025\aeson-1.4.1.0\build" "-Iinclude" "-IC:\ghc\msys64\home\Andi\aeson_repro\dist-newstyle\build\x86_64-windows\ghc-8.7.20181025\aeson-1.4.1.0\build\include" "-optP-include" "-optPC:\ghc\msys64\home\Andi\aeson_repro\dist-newstyle\build\x86_64-windows\ghc-8.7.20181025\aeson-1.4.1.0\build\autogen\cabal_macros.h" "-this-unit-id" "aeson-1.4.1.0-inplace" "-hide-all-packages" "-Wmissing-home-modules" "-no-user-package-db" "-package-db" "C:\Users\Andi\AppData\Roaming\cabal\store\ghc-8.7.20181025\package.db" "-package-db" "C:\ghc\msys64\home\Andi\aeson_repro\dist-newstyle\packagedb\ghc-8.7.20181025" "-package-db" "C:\ghc\msys64\home\Andi\aeson_repro\dist-newstyle\build\x86_64-windows\ghc-8.7.20181025\aeson-1.4.1.0\package.conf.inplace" "-package-id" "attoparsec-0.13.2.2-8913a968506e9e83757f6fe696d6fe61e0d4b4a8" "-package-id" "base-4.12.0.0" "-package-id" "base-compat-0.10.5-34e11ceb2d98e0262d1d958bca2afc3184e70c60" "-package-id" "bytestring-0.10.8.2" "-package-id" "containers-0.6.0.1" "-package-id" "deepseq-1.4.4.0" "-package-id" "dlist-0.8.0.5-681a0f929505417757ba9f9981a50ab1d7c8a0e0" "-package-id" "ghc-prim-0.5.3" "-package-id" "hashable-1.2.7.0-50f89c5dee92df34fc2d6540cfde1983f26d8e31" "-package-id" "primitive-0.6.4.0-c08c185073660c1604acdddfe5c369afae583ba2" "-package-id" "scientific-0.3.6.2-4bea197b4523e02da61c34a1eed01432d9fefff6" "-package-id" "tagged-0.8.6-d3cce1acba663b646f565adb64d80579664d8caa" "-package-id" "template-haskell-2.14.0.0" "-package-id" "text-1.2.3.1" "-package-id" "th-abstraction-0.2.8.0-e197ba78a6de8bf8fc5d00ecb5a358a8b27bcc92" "-package-id" "time-1.8.0.2" "-package-id" "time-locale-c_-0.1.1.5-7549537073e62ce01921c89c30cc6cafeed99b5b" "-package-id" "unordered-con_-0.2.9.0-f5cd33176070f516c88b1aac3ef61959b09fcfa6" "-package-id" "uuid-types-1.0.3-f68643250767dce83d2c227104d15a0aa9c3c77f" "-package-id" "vector-0.12.0.1-3a9a26f81a463f0efefa41528af3e27d3a88cc7d" "-XHaskell2010" "Data.Aeson" "Data.Aeson.Encoding" "Data.Aeson.Parser" "Data.Aeson.Text" "Data.Aeson.Types" "Data.Aeson.TH" "Data.Aeson.QQ.Simple" "Data.Aeson.Encoding.Internal" "Data.Aeson.Internal" "Data.Aeson.Internal.Time" "Data.Aeson.Parser.Internal" "Data.Aeson.Encode" "Data.Aeson.Compat" "Data.Aeson.Encoding.Builder" "Data.Aeson.Internal.Functions" "Data.Aeson.Parser.Unescape" "Data.Aeson.Parser.Time" "Data.Aeson.Types.FromJSON" "Data.Aeson.Types.Generic" "Data.Aeson.Types.ToJSON" "Data.Aeson.Types.Class" "Data.Aeson.Types.Internal" "Data.Attoparsec.Time" "Data.Attoparsec.Time.Internal" "Data.Aeson.Parser.UnescapePure" "-Wall" "-O2" "-hide-all-packages" "-g13"
[ 2 of 25] Compiling Data.Aeson.Internal.Functions ( Data\Aeson\Internal\Functions.hs, C:\ghc\msys64\home\Andi\aeson_repro\dist-newstyle\build\x86_64-windows\ghc-8.7.20181025\aeson-1.4.1.0\build\Data\Aeson\Internal\Functions.o ) [Data.HashMap.Strict changed]
[ 5 of 25] Compiling Data.Aeson.Types.Generic ( Data\Aeson\Types\Generic.hs, C:\ghc\msys64\home\Andi\aeson_repro\dist-newstyle\build\x86_64-windows\ghc-8.7.20181025\aeson-1.4.1.0\build\Data\Aeson\Types\Generic.o ) [Prelude.Compat changed]
[ 6 of 25] Compiling Data.Aeson.Types.Internal ( Data\Aeson\Types\Internal.hs, C:\ghc\msys64\home\Andi\aeson_repro\dist-newstyle\build\x86_64-windows\ghc-8.7.20181025\aeson-1.4.1.0\build\Data\Aeson\Types\Internal.o ) [Data.Vector changed]
[ 7 of 25] Compiling Data.Aeson.Parser.Internal ( Data\Aeson\Parser\Internal.hs, C:\ghc\msys64\home\Andi\aeson_repro\dist-newstyle\build\x86_64-windows\ghc-8.7.20181025\aeson-1.4.1.0\build\Data\Aeson\Parser\Internal.o ) [Data.Scientific changed]
[ 8 of 25] Compiling Data.Aeson.Parser ( Data\Aeson\Parser.hs, C:\ghc\msys64\home\Andi\aeson_repro\dist-newstyle\build\x86_64-windows\ghc-8.7.20181025\aeson-1.4.1.0\build\Data\Aeson\Parser.o ) [Data.Aeson.Parser.Internal changed]
[ 9 of 25] Compiling Data.Attoparsec.Time.Internal ( attoparsec-iso8601\Data\Attoparsec\Time\Internal.hs, C:\ghc\msys64\home\Andi\aeson_repro\dist-newstyle\build\x86_64-windows\ghc-8.7.20181025\aeson-1.4.1.0\build\Data\Attoparsec\Time\Internal.o ) [Prelude.Compat changed]
attoparsec-iso8601\Data\Attoparsec\Time\Internal.hs:24:1: warning: [-Wunused-imports]
The import of `Unsafe.Coerce' is redundant
except perhaps to import instances from `Unsafe.Coerce'
To import instances alone, use: import Unsafe.Coerce()
|
24 | import Unsafe.Coerce (unsafeCoerce)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[10 of 25] Compiling Data.Attoparsec.Time ( attoparsec-iso8601\Data\Attoparsec\Time.hs, C:\ghc\msys64\home\Andi\aeson_repro\dist-newstyle\build\x86_64-windows\ghc-8.7.20181025\aeson-1.4.1.0\build\Data\Attoparsec\Time.o ) [Data.Attoparsec.Text changed]
[11 of 25] Compiling Data.Aeson.Parser.Time ( Data\Aeson\Parser\Time.hs, C:\ghc\msys64\home\Andi\aeson_repro\dist-newstyle\build\x86_64-windows\ghc-8.7.20181025\aeson-1.4.1.0\build\Data\Aeson\Parser\Time.o ) [Data.Attoparsec.Text changed]
[12 of 25] Compiling Data.Aeson.Types.FromJSON ( Data\Aeson\Types\FromJSON.hs, C:\ghc\msys64\home\Andi\aeson_repro\dist-newstyle\build\x86_64-windows\ghc-8.7.20181025\aeson-1.4.1.0\build\Data\Aeson\Types\FromJSON.o ) [Data.Primitive.PrimArray changed]
[13 of 25] Compiling Data.Aeson.Internal ( Data\Aeson\Internal.hs, C:\ghc\msys64\home\Andi\aeson_repro\dist-newstyle\build\x86_64-windows\ghc-8.7.20181025\aeson-1.4.1.0\build\Data\Aeson\Internal.o ) [Data.Aeson.Types.FromJSON changed]
[14 of 25] Compiling Data.Aeson.Internal.Time ( Data\Aeson\Internal\Time.hs, C:\ghc\msys64\home\Andi\aeson_repro\dist-newstyle\build\x86_64-windows\ghc-8.7.20181025\aeson-1.4.1.0\build\Data\Aeson\Internal\Time.o ) [Data.Attoparsec.Time.Internal changed]
[15 of 25] Compiling Data.Aeson.Encoding.Builder ( Data\Aeson\Encoding\Builder.hs, C:\ghc\msys64\home\Andi\aeson_repro\dist-newstyle\build\x86_64-windows\ghc-8.7.20181025\aeson-1.4.1.0\build\Data\Aeson\Encoding\Builder.o ) [Data.Vector changed]
[16 of 25] Compiling Data.Aeson.Encoding.Internal ( Data\Aeson\Encoding\Internal.hs, C:\ghc\msys64\home\Andi\aeson_repro\dist-newstyle\build\x86_64-windows\ghc-8.7.20181025\aeson-1.4.1.0\build\Data\Aeson\Encoding\Internal.o ) [Data.Scientific changed]
[17 of 25] Compiling Data.Aeson.Encoding ( Data\Aeson\Encoding.hs, C:\ghc\msys64\home\Andi\aeson_repro\dist-newstyle\build\x86_64-windows\ghc-8.7.20181025\aeson-1.4.1.0\build\Data\Aeson\Encoding.o ) [Data.Aeson.Encoding.Internal changed]
[18 of 25] Compiling Data.Aeson.Types.ToJSON ( Data\Aeson\Types\ToJSON.hs, C:\ghc\msys64\home\Andi\aeson_repro\dist-newstyle\build\x86_64-windows\ghc-8.7.20181025\aeson-1.4.1.0\build\Data\Aeson\Types\ToJSON.o ) [Data.Primitive.PrimArray changed]
Access violation in generated code when executing data at 0x103fec440
Attempting to reconstruct a stack trace...
Frame Code address
* 0x845d9c0 0x103fec440
* 0x845da20 0x400c0f8 E:\ghc_dwarf\inplace\bin\ghc-stage2.exe+0x3c0c0f8
* 0x845da80 0x3fec9a1 E:\ghc_dwarf\inplace\bin\ghc-stage2.exe+0x3bec9a1
* 0x845dab0 0x3feca31 E:\ghc_dwarf\inplace\bin\ghc-stage2.exe+0x3beca31
* 0x845dab8 0x34c8934 E:\ghc_dwarf\inplace\bin\ghc-stage2.exe+0x30c8934
* 0x845dac0 0xfa340
* 0x845dac8 0x2a940b78
* 0x845dad0 0x2a98cd69
* 0x845dad8 0x2a98d7d0
CallStack (from HasCallStack):
die', called at .\\Distribution\\Client\\ProjectOrchestration.hs:977:55 in main:Distribution.Client.ProjectOrchestration
cabal.exe: Failed to build aeson-1.4.1.0-inplace. The build process terminated
with exit code 11
```
I could only reproduce it with master on Windows so far. It always triggers but under very specific circumstances:
- GHC built with the flags above, adding dwarf info to the ghc executable or removing dwarf info eliminates the issue.
- Only on a complete rebuild of aeson. Restarting the crashed build finishes without an error.Ben GamariBen Gamarihttps://gitlab.haskell.org/ghc/ghc/-/issues/15807GHC panic with visible kind applications2019-07-07T18:02:54ZIcelandjackGHC panic with visible kind applicationsUsing the https://phabricator.haskell.org/D5229 diff
This is **fine**
```hs
{-# Language RankNTypes #-}
{-# Language TypeApplications #-}
{-# Language PolyKinds #-}
{-# Language GADTs #-}
import Data.Kind
data...Using the https://phabricator.haskell.org/D5229 diff
This is **fine**
```hs
{-# Language RankNTypes #-}
{-# Language TypeApplications #-}
{-# Language PolyKinds #-}
{-# Language GADTs #-}
import Data.Kind
data
App :: forall (f :: Type -> Type). Type -> Type
where
MkApp :: f a -> App @f a
```
Kind polymorphic is **fine**
```hs
{-# Language RankNTypes #-}
{-# Language TypeApplications #-}
{-# Language PolyKinds #-}
{-# Language GADTs #-}
import Data.Kind
data
App :: forall k (f :: k -> Type). k -> Type
where
MkApp :: f a -> App @k @(f :: k -> Type) (a :: k)
```
But offing the visibility of `k` **fails**
```hs
{-# Language RankNTypes #-}
{-# Language TypeApplications #-}
{-# Language PolyKinds #-}
{-# Language GADTs #-}
import Data.Kind
data
App :: forall (f :: k -> Type). k -> Type
where
MkApp :: f a -> App @(f :: k -> Type) (a :: k)
```
```hs
{-# Language RankNTypes #-}
{-# Language TypeApplications #-}
{-# Language PolyKinds #-}
{-# Language GADTs #-}
import Data.Kind
data
App :: forall (f :: k -> Type). k -> Type
where
MkApp :: f a -> App @f a
```
```
$ ghci -ignore-dot-ghci 581_bug.hs
GHCi, version 8.7.20181017: http://www.haskell.org/ghc/ :? for help
[1 of 1] Compiling Main ( 581_bug.hs, interpreted )
ghc-stage2: panic! (the 'impossible' happened)
(GHC version 8.7.20181017 for x86_64-unknown-linux):
ASSERT failed!
2
1
f_a1yB[tau:1]
f_a1yx[sk:1]
Call stack:
CallStack (from HasCallStack):
callStackDoc, called at compiler/utils/Outputable.hs:1160:37 in ghc:Outputable
pprPanic, called at compiler/utils/Outputable.hs:1219:5 in ghc:Outputable
assertPprPanic, called at compiler/typecheck/TcMType.hs:778:54 in ghc:TcMType
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
>
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.6.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | mnguyen |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"GHC panic with visible kind applications","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.6.1","keywords":["TypeApplications"],"differentials":[],"test_case":"","architecture":"","cc":["mnguyen"],"type":"Bug","description":"Using the https://phabricator.haskell.org/D5229 diff\r\n\r\nThis is '''fine'''\r\n\r\n{{{#!hs\r\n{-# Language RankNTypes #-}\r\n{-# Language TypeApplications #-}\r\n{-# Language PolyKinds #-}\r\n{-# Language GADTs #-}\r\n\r\nimport Data.Kind\r\n\r\ndata\r\n App :: forall (f :: Type -> Type). Type -> Type\r\n where\r\n MkApp :: f a -> App @f a\r\n}}}\r\n\r\nKind polymorphic is '''fine'''\r\n\r\n{{{#!hs\r\n{-# Language RankNTypes #-}\r\n{-# Language TypeApplications #-}\r\n{-# Language PolyKinds #-}\r\n{-# Language GADTs #-}\r\n\r\nimport Data.Kind\r\n\r\ndata\r\n App :: forall k (f :: k -> Type). k -> Type\r\n where\r\n MkApp :: f a -> App @k @(f :: k -> Type) (a :: k)\r\n}}}\r\n\r\nBut offing the visibility of `k` '''fails'''\r\n\r\n{{{#!hs\r\n{-# Language RankNTypes #-}\r\n{-# Language TypeApplications #-}\r\n{-# Language PolyKinds #-}\r\n{-# Language GADTs #-}\r\n\r\nimport Data.Kind\r\n\r\ndata\r\n App :: forall (f :: k -> Type). k -> Type\r\n where\r\n MkApp :: f a -> App @(f :: k -> Type) (a :: k)\r\n}}}\r\n\r\n{{{#!hs\r\n{-# Language RankNTypes #-}\r\n{-# Language TypeApplications #-}\r\n{-# Language PolyKinds #-}\r\n{-# Language GADTs #-}\r\n\r\nimport Data.Kind\r\n\r\ndata\r\n App :: forall (f :: k -> Type). k -> Type\r\n where\r\n MkApp :: f a -> App @f a\r\n}}}\r\n\r\n{{{\r\n$ ghci -ignore-dot-ghci 581_bug.hs\r\nGHCi, version 8.7.20181017: http://www.haskell.org/ghc/ :? for help\r\n[1 of 1] Compiling Main ( 581_bug.hs, interpreted )\r\nghc-stage2: panic! (the 'impossible' happened)\r\n (GHC version 8.7.20181017 for x86_64-unknown-linux):\r\n ASSERT failed!\r\n 2\r\n 1\r\n f_a1yB[tau:1]\r\n f_a1yx[sk:1]\r\n Call stack:\r\n CallStack (from HasCallStack):\r\n callStackDoc, called at compiler/utils/Outputable.hs:1160:37 in ghc:Outputable\r\n pprPanic, called at compiler/utils/Outputable.hs:1219:5 in ghc:Outputable\r\n assertPprPanic, called at compiler/typecheck/TcMType.hs:778:54 in ghc:TcMType\r\n\r\nPlease report this as a GHC bug: http://www.haskell.org/ghc/reportabug\r\n\r\n> \r\n}}}","type_of_failure":"OtherFailure","blocking":[]} -->8.8.1https://gitlab.haskell.org/ghc/ghc/-/issues/15806Impredicativity behavior in `:k` command in GHCi2019-07-07T18:02:54ZNingning XieImpredicativity behavior in `:k` command in GHCiIn GHCi, the following command works:
```hs
Prelude> :set -XRankNTypes
Prelude> :k (Maybe (forall a. a -> a))
(Maybe (forall a. a -> a)) :: *
```
Note here the type argument of `Maybe` is a polymorphic type.
However the following woul...In GHCi, the following command works:
```hs
Prelude> :set -XRankNTypes
Prelude> :k (Maybe (forall a. a -> a))
(Maybe (forall a. a -> a)) :: *
```
Note here the type argument of `Maybe` is a polymorphic type.
However the following would be (correctly) rejected:
```hs
Prelude> let f :: (Maybe (forall a. a -> a)) -> Int; f _ = 1
<interactive>:4:10: error:
• Illegal polymorphic type: forall a. a -> a
GHC doesn't yet support impredicative polymorphism
• In the type signature: f :: (Maybe (forall a. a -> a)) -> Int
```
Question: why does `:k` behave differently and is it what is expected?
I think if we have #14859 those are both acceptable though?
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.6.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Impredicativity behavior in `:k` command in GHCi","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.6.1","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"In GHCi, the following command works:\r\n\r\n{{{#!hs\r\nPrelude> :set -XRankNTypes\r\nPrelude> :k (Maybe (forall a. a -> a))\r\n(Maybe (forall a. a -> a)) :: *\r\n}}}\r\n\r\nNote here the type argument of `Maybe` is a polymorphic type.\r\n\r\nHowever the following would be (correctly) rejected:\r\n\r\n{{{#!hs\r\nPrelude> let f :: (Maybe (forall a. a -> a)) -> Int; f _ = 1\r\n\r\n<interactive>:4:10: error:\r\n • Illegal polymorphic type: forall a. a -> a\r\n GHC doesn't yet support impredicative polymorphism\r\n • In the type signature: f :: (Maybe (forall a. a -> a)) -> Int\r\n}}}\r\n\r\nQuestion: why does `:k` behave differently and is it what is expected?\r\n\r\nI think if we have #14859 those are both acceptable though?","type_of_failure":"OtherFailure","blocking":[]} -->8.6.2Ningning XieNingning Xiehttps://gitlab.haskell.org/ghc/ghc/-/issues/15805Bug in anyRewritableTyVar2019-07-07T18:02:54ZNingning XieBug in anyRewritableTyVarThe current implementation of `TcType.anyRewritableTyVar` has one wrong case:
```hs
go_tc ReprEq bvs tc tys = foldr ((&&) . go_arg bvs) False $
(tyConRolesRepresentational tc `zip` tys)
```
Here `foldr...The current implementation of `TcType.anyRewritableTyVar` has one wrong case:
```hs
go_tc ReprEq bvs tc tys = foldr ((&&) . go_arg bvs) False $
(tyConRolesRepresentational tc `zip` tys)
```
Here `foldr` uses `&&` in the function and a `False` as the initial value, which causes this case to always return `False` no matter what the inputs are.
This bug is introduced in \[changeset:"3acd6164fea6d4d5d87521a291455a18c9c9a8ee/ghc" 3acd616/ghc\], which is for fixing #14363.
The correct implementation (I think) should use `||` instead of `&&`:
```hs
go_tc ReprEq bvs tc tys = foldr ((||) . go_arg bvs) False $
(tyConRolesRepresentational tc `zip` tys)
-- or just
go_tc ReprEq bvs tc tys = any (go_arg bvs) (tyConRolesRepresentational tc `zip` tys)
```
We presume that there might be some program which loops because of this bug.
Patch incoming.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | goldfire |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Bug in anyRewritableTyVar","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":["goldfire"],"type":"Bug","description":"The current implementation of `TcType.anyRewritableTyVar` has one wrong case:\r\n\r\n{{{#!hs\r\n go_tc ReprEq bvs tc tys = foldr ((&&) . go_arg bvs) False $\r\n (tyConRolesRepresentational tc `zip` tys)\r\n}}}\r\n\r\nHere `foldr` uses `&&` in the function and a `False` as the initial value, which causes this case to always return `False` no matter what the inputs are. \r\n\r\nThis bug is introduced in [changeset:\"3acd6164fea6d4d5d87521a291455a18c9c9a8ee/ghc\" 3acd616/ghc], which is for fixing #14363.\r\n\r\nThe correct implementation (I think) should use `||` instead of `&&`:\r\n\r\n{{{#!hs\r\n go_tc ReprEq bvs tc tys = foldr ((||) . go_arg bvs) False $\r\n (tyConRolesRepresentational tc `zip` tys)\r\n-- or just\r\n go_tc ReprEq bvs tc tys = any (go_arg bvs) (tyConRolesRepresentational tc `zip` tys)\r\n}}}\r\n\r\nWe presume that there might be some program which loops because of this bug.\r\n\r\nPatch incoming.","type_of_failure":"OtherFailure","blocking":[]} -->Ningning XieNingning Xiehttps://gitlab.haskell.org/ghc/ghc/-/issues/15804GHC panic: data T :: (a :: k) -> *2019-07-07T18:02:55ZIcelandjackGHC panic: data T :: (a :: k) -> *This might be the root cause of some of my previous
```hs
{-# Language PolyKinds #-}
data T :: (a :: k) -> *
```
```
$ ghci -ignore-dot-ghci 580.hs
GHCi, version 8.7.20181017: http://www.haskell.org/ghc/ :? for help
[1 of 1] Compilin...This might be the root cause of some of my previous
```hs
{-# Language PolyKinds #-}
data T :: (a :: k) -> *
```
```
$ ghci -ignore-dot-ghci 580.hs
GHCi, version 8.7.20181017: http://www.haskell.org/ghc/ :? for help
[1 of 1] Compiling Main ( 580.hs, interpreted )
ghc-stage2: panic! (the 'impossible' happened)
(GHC version 8.7.20181017 for x86_64-unknown-linux):
ASSERT failed!
Type-correct unfilled coercion hole {co_a1xI}
Call stack:
CallStack (from HasCallStack):
callStackDoc, called at compiler/utils/Outputable.hs:1160:37 in ghc:Outputable
pprPanic, called at compiler/utils/Outputable.hs:1219:5 in ghc:Outputable
assertPprPanic, called at compiler/typecheck/TcHsSyn.hs:1805:99 in ghc:TcHsSyn
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
>
```
on 8.6.1 this gives
```
$ ~/.stack/programs/x86_64-linux/ghc-8.6.1/bin/ghci -ignore-dot-ghci 580.hs
GHCi, version 8.6.1: http://www.haskell.org/ghc/ :? for help
[1 of 1] Compiling Main ( /home/baldur/hs/580.hs, interpreted )
/home/baldur/hs/580.hs:3:11: error:
• Expected a type, but ‘(a :: k)’ has kind ‘k’
• In the kind ‘(a :: k) -> *’
|
3 | data T :: (a :: k) -> *
| ^^^^^^^^
Failed, no modules loaded.
Prelude>
```https://gitlab.haskell.org/ghc/ghc/-/issues/15801"ASSERT failed!" with visible kind applications2019-07-07T18:02:55ZIcelandjack"ASSERT failed!" with visible kind applicationsSorry for the workload mnguyen. This gives a very short error (using diff for visible kind application: https://phabricator.haskell.org/D5229)
```hs
{-# Language CPP #-}
{-# Language QuantifiedConstraints #-}
{-# Langu...Sorry for the workload mnguyen. This gives a very short error (using diff for visible kind application: https://phabricator.haskell.org/D5229)
```hs
{-# Language CPP #-}
{-# Language QuantifiedConstraints #-}
{-# Language TypeApplications #-}
{-# Language PolyKinds #-}
{-# Language TypeOperators #-}
{-# Language DataKinds #-}
{-# Language TypeFamilies #-}
{-# Language TypeSynonymInstances #-}
{-# Language FlexibleInstances #-}
{-# Language GADTs #-}
{-# Language UndecidableInstances #-}
{-# Language MultiParamTypeClasses #-}
{-# Language FlexibleContexts #-}
import Data.Coerce
import Data.Kind
type Cat ob = ob -> ob -> Type
type Obj = Type
class Coercible (op_a --> b) (b <-- op_a) => (op_a -#- b)
instance Coercible (op_a --> b) (b <-- op_a) => (op_a -#- b)
class (forall (op_a :: obj) (b :: obj). op_a -#- b) => OpOpNoOp obj
instance (forall (op_a :: obj) (b :: obj). op_a -#- b) => OpOpNoOp obj
class
Ríki (obj :: Obj) where
type (-->) :: obj -> obj -> Type
ið :: a --> (a::obj)
class
OpOpNoOp obj
=>
OpRíki (obj :: Obj) where
type (<--) :: obj -> obj -> Type
data Op a = Op a
type family UnOp op where UnOp ('Op obj) = obj
newtype Y :: Cat (Op a) where
Y :: (UnOp b --> UnOp a) -> Y a b
instance Ríki Type where
type (-->) = (->)
ið x = x
instance OpRíki (Op Type) where
type (<--) @(Op Type) = Y @Type
```
```
$ ghci -ignore-dot-ghci 577.hs
GHCi, version 8.7.20181017: http://www.haskell.org/ghc/ :? for help
[1 of 1] Compiling Main ( 577.hs, interpreted )
*** Exception: ASSERT failed! file compiler/typecheck/TcFlatten.hs, line 1285
>
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.6.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | mnguyen |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"\"ASSERT failed!\" with visible kind applications","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.6.1","keywords":["TypeApplications"],"differentials":[],"test_case":"","architecture":"","cc":["mnguyen"],"type":"Bug","description":"Sorry for the workload mnguyen. This gives a very short error (using diff for visible kind application: https://phabricator.haskell.org/D5229)\r\n\r\n{{{#!hs\r\n{-# Language CPP #-}\r\n{-# Language QuantifiedConstraints #-}\r\n{-# Language TypeApplications #-}\r\n{-# Language PolyKinds #-}\r\n{-# Language TypeOperators #-}\r\n{-# Language DataKinds #-}\r\n{-# Language TypeFamilies #-}\r\n{-# Language TypeSynonymInstances #-}\r\n{-# Language FlexibleInstances #-}\r\n{-# Language GADTs #-}\r\n{-# Language UndecidableInstances #-}\r\n{-# Language MultiParamTypeClasses #-}\r\n{-# Language FlexibleContexts #-}\r\n\r\nimport Data.Coerce\r\nimport Data.Kind\r\n\r\ntype Cat ob = ob -> ob -> Type\r\n\r\ntype Obj = Type\r\n\r\nclass Coercible (op_a --> b) (b <-- op_a) => (op_a -#- b)\r\ninstance Coercible (op_a --> b) (b <-- op_a) => (op_a -#- b)\r\n\r\nclass (forall (op_a :: obj) (b :: obj). op_a -#- b) => OpOpNoOp obj\r\ninstance (forall (op_a :: obj) (b :: obj). op_a -#- b) => OpOpNoOp obj\r\n\r\nclass\r\n Ríki (obj :: Obj) where\r\n type (-->) :: obj -> obj -> Type\r\n\r\n ið :: a --> (a::obj)\r\n\r\nclass\r\n OpOpNoOp obj\r\n =>\r\n OpRíki (obj :: Obj) where\r\n type (<--) :: obj -> obj -> Type\r\n\r\ndata Op a = Op a\r\n\r\ntype family UnOp op where UnOp ('Op obj) = obj\r\n\r\nnewtype Y :: Cat (Op a) where\r\n Y :: (UnOp b --> UnOp a) -> Y a b\r\n\r\ninstance Ríki Type where\r\n type (-->) = (->)\r\n ið x = x\r\n\r\ninstance OpRíki (Op Type) where\r\n type (<--) @(Op Type) = Y @Type\r\n}}}\r\n\r\n{{{\r\n$ ghci -ignore-dot-ghci 577.hs\r\nGHCi, version 8.7.20181017: http://www.haskell.org/ghc/ :? for help\r\n[1 of 1] Compiling Main ( 577.hs, interpreted )\r\n*** Exception: ASSERT failed! file compiler/typecheck/TcFlatten.hs, line 1285\r\n>\r\n}}}","type_of_failure":"OtherFailure","blocking":[]} -->8.8.1https://gitlab.haskell.org/ghc/ghc/-/issues/15800Overlapping instances error with single instance2019-07-07T18:02:56ZrolandOverlapping instances error with single instance```
{-# LANGUAGE MultiParamTypeClasses, FlexibleContexts, FlexibleInstances #-}
module Bug where
class C a b
instance C a Int
x :: ()
x = undefined :: C a Int => ()
```
```
ghc -c Bug.hs
Bug.hs:10:18: error:
• Overlapping insta...```
{-# LANGUAGE MultiParamTypeClasses, FlexibleContexts, FlexibleInstances #-}
module Bug where
class C a b
instance C a Int
x :: ()
x = undefined :: C a Int => ()
```
```
ghc -c Bug.hs
Bug.hs:10:18: error:
• Overlapping instances for C a0 Int
Matching givens (or their superclasses):
C a Int
bound by an expression type signature:
forall a. C a Int => ()
at Bug.hs:10:18-30
Matching instances: instance C a Int -- Defined at Bug.hs:7:10
(The choice depends on the instantiation of ‘a0’)
• In the ambiguity check for an expression type signature
To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
In an expression type signature: C a Int => ()
In the expression: undefined :: C a Int => ()
|
10 | x = undefined :: C a Int => ()
| ^^^^^^^^^^^^^
```
The "matching instances" bit of the error messages only lists a single instance. Doesn't it take at least two instances for something to overlap?
Also, following the algorithm laid out in the user guide (section "Overlapping Instances"), it appears this program should be accepted.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.6.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Overlapping instances error with single instance","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.6.1","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"{{{\r\n{-# LANGUAGE MultiParamTypeClasses, FlexibleContexts, FlexibleInstances #-}\r\n\r\nmodule Bug where\r\n\r\nclass C a b\r\n\r\ninstance C a Int\r\n\r\nx :: ()\r\nx = undefined :: C a Int => ()\r\n}}}\r\n\r\n{{{\r\nghc -c Bug.hs\r\n\r\nBug.hs:10:18: error:\r\n • Overlapping instances for C a0 Int\r\n Matching givens (or their superclasses):\r\n C a Int\r\n bound by an expression type signature:\r\n forall a. C a Int => ()\r\n at Bug.hs:10:18-30\r\n Matching instances: instance C a Int -- Defined at Bug.hs:7:10\r\n (The choice depends on the instantiation of ‘a0’)\r\n • In the ambiguity check for an expression type signature\r\n To defer the ambiguity check to use sites, enable AllowAmbiguousTypes\r\n In an expression type signature: C a Int => ()\r\n In the expression: undefined :: C a Int => ()\r\n |\r\n10 | x = undefined :: C a Int => ()\r\n | ^^^^^^^^^^^^^\r\n}}}\r\n\r\nThe \"matching instances\" bit of the error messages only lists a single instance. Doesn't it take at least two instances for something to overlap?\r\n\r\nAlso, following the algorithm laid out in the user guide (section \"Overlapping Instances\"), it appears this program should be accepted.","type_of_failure":"OtherFailure","blocking":[]} -->https://gitlab.haskell.org/ghc/ghc/-/issues/15799GHC panic (and warnings)2019-07-07T18:02:56ZIcelandjackGHC panic (and warnings)On the [visible kind application](https://phabricator.haskell.org/D5229) differential,
```hs
{-# Language CPP #-}
{-# Language DataKinds #-}
{-# Language RankNTypes #-}
{-# Language PatternSynonyms #-}
{-#...On the [visible kind application](https://phabricator.haskell.org/D5229) differential,
```hs
{-# Language CPP #-}
{-# Language DataKinds #-}
{-# Language RankNTypes #-}
{-# Language PatternSynonyms #-}
{-# Language TypeOperators #-}
{-# Language PolyKinds #-}
{-# Language GADTs #-}
{-# Language TypeFamilies #-}
{-# Language TypeApplications #-}
{-# Language FlexibleContexts #-}
{-# Language FlexibleInstances #-}
{-# Language InstanceSigs #-}
import qualified GHC.TypeLits as TypeLits
import GHC.TypeLits (Nat, KnownNat)
import Data.Kind
data Op obj = Op obj
type family
UnOp (op_a :: Op obj) :: obj where
UnOp ('Op obj) = obj
class
Ríki (obj :: Type) where
type (-->) :: Op obj -> obj -> Type
type (<--) :: obj -> Op obj -> Type
unop :: forall (a :: obj) (b :: obj). (a <-- 'Op b) -> ('Op b --> a)
data (<=) :: Op Nat -> Nat -> Type where
LessThan :: (KnownNat (UnOp op_a), KnownNat b, UnOp op_a TypeLits.<= b)
=> (op_a <= b)
newtype (>=) :: Nat -> Op Nat -> Type where
Y :: (a <= b) -> (b >= a)
instance Ríki Nat where
type (-->) = (<=)
type (<--) = (>=)
unop :: (a >= b) -> (b <= a)
unop GreaterThan = LessThan
pattern GreaterThan :: () => (KnownNat (UnOp b), KnownNat a, UnOp b <= a) => a >= b
pattern GreaterThan = Y LessThan
```
```
$ ghci -ignore-dot-ghci 573_bug.hs
GHCi, version 8.7.20181017: http://www.haskell.org/ghc/ :? for help
[1 of 1] Compiling Main ( 573_bug.hs, interpreted )
WARNING: file compiler/types/TyCoRep.hs, line 2567
in_scope InScope {b_a1Em a_a1En}
tenv [a1Em :-> b_a1Em[sk:0], a1En :-> a_a1En[sk:0]]
cenv []
tys [KnownNat (UnOp b_a1Em[sk:1]), KnownNat a_a1En[sk:1],
(UnOp b_a1Em[sk:1] |> {co_a1HN}) <= a_a1En[sk:1]]
cos []
needInScope [a1HN :-> co_a1HN]
WARNING: file compiler/types/TyCoRep.hs, line 2567
in_scope InScope {b_a1Jo a_a1Jp}
tenv [a1Em :-> b_a1Jo[tau:3], a1En :-> a_a1Jp[tau:3]]
cenv []
tys [KnownNat (UnOp b_a1Em), KnownNat a_a1En,
(UnOp b_a1Em |> {co_a1HN}) <= a_a1En]
cos []
needInScope [a1HN :-> co_a1HN]
ghc-stage2: panic! (the 'impossible' happened)
(GHC version 8.7.20181017 for x86_64-unknown-linux):
tcEvVarPred
irred_a1Js (UnOp b_a1Jo[tau:3] |> {co_a1HN}) <= a_a1Jp[tau:3]
Call stack:
CallStack (from HasCallStack):
callStackDoc, called at compiler/utils/Outputable.hs:1160:37 in ghc:Outputable
pprPanic, called at compiler/typecheck/TcType.hs:1998:20 in ghc:TcType
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
>
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.6.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"GHC panic (and warnings)","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.6.1","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"On the [https://phabricator.haskell.org/D5229 visible kind application] differential, \r\n\r\n{{{#!hs\r\n{-# Language CPP #-}\r\n{-# Language DataKinds #-}\r\n{-# Language RankNTypes #-}\r\n{-# Language PatternSynonyms #-}\r\n{-# Language TypeOperators #-}\r\n{-# Language PolyKinds #-}\r\n{-# Language GADTs #-}\r\n{-# Language TypeFamilies #-}\r\n{-# Language TypeApplications #-}\r\n{-# Language FlexibleContexts #-}\r\n{-# Language FlexibleInstances #-}\r\n{-# Language InstanceSigs #-}\r\n\r\nimport qualified GHC.TypeLits as TypeLits\r\nimport GHC.TypeLits (Nat, KnownNat)\r\nimport Data.Kind\r\n\r\ndata Op obj = Op obj\r\n\r\ntype family\r\n UnOp (op_a :: Op obj) :: obj where\r\n UnOp ('Op obj) = obj\r\n\r\nclass\r\n Ríki (obj :: Type) where\r\n type (-->) :: Op obj -> obj -> Type\r\n type (<--) :: obj -> Op obj -> Type\r\n\r\n unop :: forall (a :: obj) (b :: obj). (a <-- 'Op b) -> ('Op b --> a)\r\n\r\ndata (<=) :: Op Nat -> Nat -> Type where\r\n LessThan :: (KnownNat (UnOp op_a), KnownNat b, UnOp op_a TypeLits.<= b)\r\n => (op_a <= b)\r\n\r\nnewtype (>=) :: Nat -> Op Nat -> Type where\r\n Y :: (a <= b) -> (b >= a)\r\n\r\ninstance Ríki Nat where\r\n type (-->) = (<=)\r\n type (<--) = (>=)\r\n\r\n unop :: (a >= b) -> (b <= a)\r\n unop GreaterThan = LessThan\r\n\r\npattern GreaterThan :: () => (KnownNat (UnOp b), KnownNat a, UnOp b <= a) => a >= b\r\npattern GreaterThan = Y LessThan\r\n}}}\r\n\r\n{{{\r\n$ ghci -ignore-dot-ghci 573_bug.hs\r\nGHCi, version 8.7.20181017: http://www.haskell.org/ghc/ :? for help\r\n[1 of 1] Compiling Main ( 573_bug.hs, interpreted )\r\nWARNING: file compiler/types/TyCoRep.hs, line 2567\r\n in_scope InScope {b_a1Em a_a1En}\r\n tenv [a1Em :-> b_a1Em[sk:0], a1En :-> a_a1En[sk:0]]\r\n cenv []\r\n tys [KnownNat (UnOp b_a1Em[sk:1]), KnownNat a_a1En[sk:1],\r\n (UnOp b_a1Em[sk:1] |> {co_a1HN}) <= a_a1En[sk:1]]\r\n cos []\r\n needInScope [a1HN :-> co_a1HN]\r\nWARNING: file compiler/types/TyCoRep.hs, line 2567\r\n in_scope InScope {b_a1Jo a_a1Jp}\r\n tenv [a1Em :-> b_a1Jo[tau:3], a1En :-> a_a1Jp[tau:3]]\r\n cenv []\r\n tys [KnownNat (UnOp b_a1Em), KnownNat a_a1En,\r\n (UnOp b_a1Em |> {co_a1HN}) <= a_a1En]\r\n cos []\r\n needInScope [a1HN :-> co_a1HN]\r\nghc-stage2: panic! (the 'impossible' happened)\r\n (GHC version 8.7.20181017 for x86_64-unknown-linux):\r\n tcEvVarPred\r\n irred_a1Js (UnOp b_a1Jo[tau:3] |> {co_a1HN}) <= a_a1Jp[tau:3]\r\n Call stack:\r\n CallStack (from HasCallStack):\r\n callStackDoc, called at compiler/utils/Outputable.hs:1160:37 in ghc:Outputable\r\n pprPanic, called at compiler/typecheck/TcType.hs:1998:20 in ghc:TcType\r\n\r\nPlease report this as a GHC bug: http://www.haskell.org/ghc/reportabug\r\n\r\n>\r\n}}}","type_of_failure":"OtherFailure","blocking":[]} -->8.10.1https://gitlab.haskell.org/ghc/ghc/-/issues/15798Flag to warn when deriving strategy is not explicitly specified2019-10-06T15:28:31ZAndrew MartinFlag to warn when deriving strategy is not explicitly specifiedIn my code, I aim to always specify deriving strategies. I would like to add a flag `-fwarn-unspecified-deriving` that would cause a warning to be emitted when someone wrote this:
```
newtype Foo = Foo Int
deriving (Show)
```
The use...In my code, I aim to always specify deriving strategies. I would like to add a flag `-fwarn-unspecified-deriving` that would cause a warning to be emitted when someone wrote this:
```
newtype Foo = Foo Int
deriving (Show)
```
The user would be required to instead write:
```
newtype Foo = Foo Int
deriving newtype (Show)
```
Or they could use `stock` if that was the behavior they wanted. This flag would be off by default.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | -------------- |
| Version | 8.6.1 |
| Type | FeatureRequest |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Flag to warn when deriving strategy is not explicitly specified","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.6.1","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"FeatureRequest","description":"In my code, I aim to always specify deriving strategies. I would like to add a flag `-fwarn-unspecified-deriving` that would cause a warning to be emitted when someone wrote this:\r\n\r\n{{{\r\nnewtype Foo = Foo Int\r\n deriving (Show)\r\n}}}\r\n\r\nThe user would be required to instead write:\r\n\r\n{{{\r\nnewtype Foo = Foo Int\r\n deriving newtype (Show)\r\n}}}\r\n\r\nOr they could use `stock` if that was the behavior they wanted. This flag would be off by default.","type_of_failure":"OtherFailure","blocking":[]} -->8.8.1https://gitlab.haskell.org/ghc/ghc/-/issues/15797GHC panic using visible kind application2019-07-07T18:02:56ZIcelandjackGHC panic using visible kind application```hs
{-# Language RankNTypes #-}
{-# Language TypeFamilies #-}
{-# Language ScopedTypeVariables #-}
{-# Language TypeApplications #-}
{-# Language DataKinds #-}
{-# Language PolyKinds ...```hs
{-# Language RankNTypes #-}
{-# Language TypeFamilies #-}
{-# Language ScopedTypeVariables #-}
{-# Language TypeApplications #-}
{-# Language DataKinds #-}
{-# Language PolyKinds #-}
{-# Language TypeOperators #-}
{-# Language GADTs #-}
{-# Options_GHC -dcore-lint #-}
import Data.Kind
class Ríki (obj :: Type) where
type Obj :: obj -> Constraint
type Obj = Bæ @obj
class Bæ (a :: k)
instance Bæ @k (a :: k)
data
EQ :: forall ob. ob -> ob -> Type where
EQ :: EQ a a
instance
Ríki (EQ @ob)
```
```
$ ghci -dcore-lint 568_bug.hs
GHCi, version 8.7.20181017: http://www.haskell.org/ghc/ :? for help
[1 of 1] Compiling Main ( 568_bug.hs, interpreted )
WARNING: file compiler/types/TyCoRep.hs, line 2567
in_scope InScope {ob_a1zs co_a1zt}
tenv []
cenv [a1zt :-> co_a1zt]
tys [Bæ]
cos []
needInScope [a1zn :-> co_a1zn, a1zs :-> ob_a1zs]
ghc-stage2: panic! (the 'impossible' happened)
(GHC version 8.7.20181017 for x86_64-unknown-linux):
Core Lint error
<no location info>: warning:
In the type ‘Bæ’
Unfilled coercion hole: {co_a1zn}
<no location info>: warning:
In the type ‘Bæ’
co_a1zn :: (ob_a1zs -> ob_a1zs -> *) ~# *
[LclId[CoVarId]] is out of scope
Call stack:
CallStack (from HasCallStack):
callStackDoc, called at compiler/utils/Outputable.hs:1160:37 in ghc:Outputable
pprPanic, called at compiler/typecheck/FamInst.hs:171:31 in ghc:FamInst
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
>
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.6.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | mnguyen |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"GHC panic using visible kind application","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.6.1","keywords":["TypeApplications"],"differentials":[],"test_case":"","architecture":"","cc":["mnguyen"],"type":"Bug","description":"{{{#!hs\r\n{-# Language RankNTypes #-}\r\n{-# Language TypeFamilies #-}\r\n{-# Language ScopedTypeVariables #-}\r\n{-# Language TypeApplications #-}\r\n{-# Language DataKinds #-}\r\n{-# Language PolyKinds #-}\r\n{-# Language TypeOperators #-}\r\n{-# Language GADTs #-}\r\n\r\n{-# Options_GHC -dcore-lint #-}\r\n\r\nimport Data.Kind\r\n\r\nclass Ríki (obj :: Type) where\r\n type Obj :: obj -> Constraint\r\n type Obj = Bæ @obj\r\n\r\nclass Bæ (a :: k)\r\ninstance Bæ @k (a :: k)\r\n\r\ndata\r\n EQ :: forall ob. ob -> ob -> Type where\r\n EQ :: EQ a a\r\n\r\ninstance\r\n Ríki (EQ @ob)\r\n}}}\r\n\r\n{{{\r\n$ ghci -dcore-lint 568_bug.hs\r\nGHCi, version 8.7.20181017: http://www.haskell.org/ghc/ :? for help\r\n[1 of 1] Compiling Main ( 568_bug.hs, interpreted )\r\nWARNING: file compiler/types/TyCoRep.hs, line 2567\r\n in_scope InScope {ob_a1zs co_a1zt}\r\n tenv []\r\n cenv [a1zt :-> co_a1zt]\r\n tys [Bæ]\r\n cos []\r\n needInScope [a1zn :-> co_a1zn, a1zs :-> ob_a1zs]\r\nghc-stage2: panic! (the 'impossible' happened)\r\n (GHC version 8.7.20181017 for x86_64-unknown-linux):\r\n Core Lint error\r\n <no location info>: warning:\r\n In the type ‘Bæ’\r\n Unfilled coercion hole: {co_a1zn}\r\n <no location info>: warning:\r\n In the type ‘Bæ’\r\n co_a1zn :: (ob_a1zs -> ob_a1zs -> *) ~# *\r\n [LclId[CoVarId]] is out of scope\r\n Call stack:\r\n CallStack (from HasCallStack):\r\n callStackDoc, called at compiler/utils/Outputable.hs:1160:37 in ghc:Outputable\r\n pprPanic, called at compiler/typecheck/FamInst.hs:171:31 in ghc:FamInst\r\n\r\nPlease report this as a GHC bug: http://www.haskell.org/ghc/reportabug\r\n\r\n>\r\n}}}","type_of_failure":"OtherFailure","blocking":[]} -->8.8.1https://gitlab.haskell.org/ghc/ghc/-/issues/15796Core Lint error with invalid newtype declaration2019-07-07T18:02:56ZIcelandjackCore Lint error with invalid newtype declarationThis gives a Core Lint error
```hs
{-# Language QuantifiedConstraints #-}
{-# Language TypeApplications #-}
{-# Language TypeOperators #-}
{-# Language PolyKinds #-}
{-# Language FlexibleInstances #-}
{-# La...This gives a Core Lint error
```hs
{-# Language QuantifiedConstraints #-}
{-# Language TypeApplications #-}
{-# Language TypeOperators #-}
{-# Language PolyKinds #-}
{-# Language FlexibleInstances #-}
{-# Language DataKinds #-}
{-# Language TypeFamilies #-}
{-# Language MultiParamTypeClasses #-}
{-# Language ConstraintKinds #-}
{-# Language UndecidableInstances #-}
{-# Language GADTs #-}
{-# Options_GHC -dcore-lint #-}
import Data.Kind
type Cat ob = ob -> ob -> Type
class Ríki (obj :: Type) where
type (-->) :: Cat obj
class Varpi (f :: dom -> cod)
newtype
(··>) :: Cat (a -> b) where
Natu :: Varpi f
=> (forall xx. f xx --> f' xx)
-> (f ··> f')
instance
Ríki cod
=> -------------
Ríki (dom -> cod)
where
type (-->) = (··>) @dom @cod
```
```
$ ghci -ignore-dot-ghci 568_bug.hs
GHCi, version 8.7.20181017: http://www.haskell.org/ghc/ :? for help
[1 of 1] Compiling Main ( 568_bug.hs, interpreted )
ghc-stage2: panic! (the 'impossible' happened)
(GHC version 8.7.20181017 for x86_64-unknown-linux):
Core Lint error
<no location info>: warning:
In the type ‘(··>)’
Found TcTyCon: ··>[tc]
Call stack:
CallStack (from HasCallStack):
callStackDoc, called at compiler/utils/Outputable.hs:1160:37 in ghc:Outputable
pprPanic, called at compiler/typecheck/FamInst.hs:171:31 in ghc:FamInst
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
> :q
Leaving GHCi.
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.6.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Core Lint error","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.6.1","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"This gives a Core Lint error\r\n\r\n{{{#!hs\r\n{-# Language QuantifiedConstraints #-}\r\n{-# Language TypeApplications #-}\r\n{-# Language TypeOperators #-}\r\n{-# Language PolyKinds #-}\r\n{-# Language FlexibleInstances #-}\r\n{-# Language DataKinds #-}\r\n{-# Language TypeFamilies #-}\r\n{-# Language MultiParamTypeClasses #-}\r\n{-# Language ConstraintKinds #-}\r\n{-# Language UndecidableInstances #-}\r\n{-# Language GADTs #-}\r\n\r\n{-# Options_GHC -dcore-lint #-}\r\n\r\nimport Data.Kind\r\n\r\ntype Cat ob = ob -> ob -> Type\r\n\r\nclass Ríki (obj :: Type) where\r\n type (-->) :: Cat obj\r\n\r\nclass Varpi (f :: dom -> cod)\r\n\r\nnewtype\r\n (··>) :: Cat (a -> b) where\r\n Natu :: Varpi f\r\n => (forall xx. f xx --> f' xx)\r\n -> (f ··> f')\r\n\r\ninstance\r\n Ríki cod\r\n => -------------\r\n Ríki (dom -> cod)\r\n where\r\n\r\n type (-->) = (··>) @dom @cod\r\n}}}\r\n\r\n{{{\r\n$ ghci -ignore-dot-ghci 568_bug.hs\r\nGHCi, version 8.7.20181017: http://www.haskell.org/ghc/ :? for help\r\n[1 of 1] Compiling Main ( 568_bug.hs, interpreted )\r\nghc-stage2: panic! (the 'impossible' happened)\r\n (GHC version 8.7.20181017 for x86_64-unknown-linux):\r\n Core Lint error\r\n <no location info>: warning:\r\n In the type ‘(··>)’\r\n Found TcTyCon: ··>[tc]\r\n Call stack:\r\n CallStack (from HasCallStack):\r\n callStackDoc, called at compiler/utils/Outputable.hs:1160:37 in ghc:Outputable\r\n pprPanic, called at compiler/typecheck/FamInst.hs:171:31 in ghc:FamInst\r\n\r\nPlease report this as a GHC bug: http://www.haskell.org/ghc/reportabug\r\n\r\n> :q\r\nLeaving GHCi.\r\n}}}","type_of_failure":"OtherFailure","blocking":[]} -->8.6.2https://gitlab.haskell.org/ghc/ghc/-/issues/15795Core lint error with unused kind variable in data type return kind2019-07-07T18:02:57ZIcelandjackCore lint error with unused kind variable in data type return kindFinally managed to trigger a core lint error with #12045
```hs
{-# Language RankNTypes #-}
{-# Language TypeApplications #-}
{-# Language DataKinds #-}
{-# Language PolyKinds #-}
{-# Language TypeOpera...Finally managed to trigger a core lint error with #12045
```hs
{-# Language RankNTypes #-}
{-# Language TypeApplications #-}
{-# Language DataKinds #-}
{-# Language PolyKinds #-}
{-# Language TypeOperators #-}
{-# Language GADTs #-}
{-# Options_GHC -dcore-lint #-}
import Data.Kind
type Cat ob = ob -> ob -> Type
data (×) :: forall (cat1 :: Cat ob1) (cat2 :: Cat ob2). Cat (ob1, ob2) where
Prod
:: forall
ob1 ob2
cat1 cat2
a1 b1
a2 b2 u.
cat1 a1 b1
-> cat2 a2 b2
-> (×) @u '(a1, a2) '(b1, b2)
```
log attached from running `ghci -ignore-dot-ghci <file>.hs`
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.6.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | mnguyen |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Core lint error with visible kind patterns","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.6.1","keywords":["TypeApplications"],"differentials":[],"test_case":"","architecture":"","cc":["mnguyen"],"type":"Bug","description":"Finally managed to trigger a core lint error with #12045\r\n\r\n{{{#!hs\r\n{-# Language RankNTypes #-}\r\n{-# Language TypeApplications #-}\r\n{-# Language DataKinds #-}\r\n{-# Language PolyKinds #-}\r\n{-# Language TypeOperators #-}\r\n{-# Language GADTs #-}\r\n{-# Options_GHC -dcore-lint #-}\r\n\r\nimport Data.Kind\r\n\r\ntype Cat ob = ob -> ob -> Type\r\n\r\ndata (×) :: forall (cat1 :: Cat ob1) (cat2 :: Cat ob2). Cat (ob1, ob2) where\r\n Prod\r\n :: forall\r\n ob1 ob2\r\n cat1 cat2\r\n a1 b1\r\n a2 b2 u.\r\n cat1 a1 b1\r\n -> cat2 a2 b2\r\n -> (×) @u '(a1, a2) '(b1, b2)\r\n}}}\r\n\r\nlog attached from running `ghci -ignore-dot-ghci <file>.hs`","type_of_failure":"OtherFailure","blocking":[]} -->https://gitlab.haskell.org/ghc/ghc/-/issues/15794shell.nix depends on build artifacts2019-07-31T22:57:52ZVladislav Zavialovshell.nix depends on build artifactsFiled Mar 19, 2018, as https://github.com/snowleopard/hadrian/issues/532
- \*Steps to reproduce:\*\*
1. `git clone --recursive git://git.haskell.org/ghc.git`
1. `cd ghc/hadrian`
1. `nix-shell --pure`
- \*Expected result:\*\* Successfu...Filed Mar 19, 2018, as https://github.com/snowleopard/hadrian/issues/532
- \*Steps to reproduce:\*\*
1. `git clone --recursive git://git.haskell.org/ghc.git`
1. `cd ghc/hadrian`
1. `nix-shell --pure`
- \*Expected result:\*\* Successful build.
- \*Actual result:\*\*
```
hadrian(master)$ nix-shell --pure
these derivations will be built:
/nix/store/lmpgkvswlkcgpcjdilbyh202vm8a5i5r-directory-1.3.1.5.drv
/nix/store/rcg0mmq0bincjfjnzbabc8fq7307bylq-process-1.6.3.0.drv
/nix/store/15alkpni823gkfp63c79962v032wxvjs-extra-1.6.4.drv
/nix/store/1b54g6nv8rw0kq3i5xjpcbhy88jvdnbr-xml-1.3.14.drv
/nix/store/89salv051l8yr2y2k52pzkqraw9lfib9-test-framework-0.8.1.1.drv
/nix/store/iqq0xsvgf3hf551b3jj0x3lg661c5y4f-test-framework-hunit-0.3.0.2.drv
/nix/store/cy7ynm7r9jb41kxb1gxbwdprhvl03ivk-parsec-3.1.13.0.drv
/nix/store/rgnsvxfvmbhrkniy0c86v65jgvx8nsan-test-framework-quickcheck2-0.3.0.4.drv
/nix/store/fyrj002axd2skdz370hi13fq6prjh5cz-network-uri-2.6.1.0.drv
/nix/store/7qcfy5gy9sjcz7cijqghgj3cilm2pzps-HTTP-4000.3.8.drv
/nix/store/gk0w3grh2hz008sp6ksy669zvl6pyznb-js-flot-0.8.3.drv
/nix/store/h39chz7m8zvawlrzfjsz496vl2rbp921-hashable-1.2.6.1.drv
/nix/store/zpv0xi25jq6p5kkpvbc11sq73dxi2g0a-unordered-containers-0.2.8.0.drv
/nix/store/i7p5c3mv9p20z7kb2mrdlpx0fwmyz3f5-shake-0.16.2.drv
/nix/store/pzfcvib6sbsaascsc7djzcfqzlw847gc-Cabal-2.3.0.0.drv
/nix/store/j5w4i42pgfy03s7fjsj4dfkis26c3nnp-happy-1.19.8.drv
/nix/store/pl2dxjvbqs36rh80q5i09zdhbh6hjl2r-alex-3.2.3.drv
/nix/store/dck8p81zlij9qksglaw8hkp11msrm426-hadrian-0.1.0.0.drv
building '/nix/store/lmpgkvswlkcgpcjdilbyh202vm8a5i5r-directory-1.3.1.5.drv'...
building '/nix/store/1b54g6nv8rw0kq3i5xjpcbhy88jvdnbr-xml-1.3.14.drv'...
setupCompilerEnvironmentPhase
Build with /nix/store/d57p5gzyld7b3y4irzv70bfa3d8xxwgx-ghc-8.2.2.
setupCompilerEnvironmentPhase
Build with /nix/store/d57p5gzyld7b3y4irzv70bfa3d8xxwgx-ghc-8.2.2.
unpacking sources
unpacking source archive /nix/store/khjm3agcb1y91925r78h3chaq56w9fi7-6wsbrbb60dzbfqf62c6sskwcijc3arjj-directory
unpacking sources
unpacking source archive /nix/store/dnx7hpl7wz81r3av4l09pqqhdqi4qpg6-xml-1.3.14.tar.gz
source root is xml-1.3.14
source root is 6wsbrbb60dzbfqf62c6sskwcijc3arjj-directory
setting SOURCE_DATE_EPOCH to timestamp 1424727750 of file xml-1.3.14/xml.cabal
patching sources
patching sources
compileBuildDriverPhase
compileBuildDriverPhase
setupCompileFlags: -package-db=/tmp/nix-build-xml-1.3.14.drv-0/package.conf.d -j1 -threaded
setupCompileFlags: -package-db=/tmp/nix-build-directory-1.3.1.5.drv-0/package.conf.d -j1 -threaded
[1 of 1] Compiling Main ( Setup.hs, /tmp/nix-build-directory-1.3.1.5.drv-0/Main.o )
[1 of 1] Compiling Main ( Setup.hs, /tmp/nix-build-xml-1.3.14.drv-0/Main.o )
Linking Setup ...
Linking Setup ...
configuring
configureFlags: --verbose --prefix=/nix/store/v3yazy78gy6kkpvrcn3schm8lc8y5dgl-xml-1.3.14 --libdir=$prefix/lib/$compiler --libsubdir=$pkgid --docdir=/nix/store/zdzgar7mwysym9dbai87fann20pbw75n-xml-1.3.14-doc/share/doc --with-gcc=gcc --package-db=/tmp/nix-build-xml-1.3.14.drv-0/package.conf.d --ghc-option=-optl=-Wl,-rpath=/nix/store/v3yazy78gy6kkpvrcn3schm8lc8y5dgl-xml-1.3.14/lib/ghc-8.2.2/xml-1.3.14 --ghc-option=-j1 --disable-split-objs --disable-library-profiling --disable-profiling --enable-shared --disable-coverage --enable-library-vanilla --enable-executable-dynamic --enable-tests --ghc-option=-split-sections
configuring
configureFlags: --verbose --prefix=/nix/store/59r1c7sfgph9j2xxsc1k3j6dwkm32ybk-directory-1.3.1.5 --libdir=$prefix/lib/$compiler --libsubdir=$pkgid --docdir=/nix/store/w0gkzrf5q6ng40vzyvdl5m8pvw9v9dxy-directory-1.3.1.5-doc/share/doc --with-gcc=gcc --package-db=/tmp/nix-build-directory-1.3.1.5.drv-0/package.conf.d --ghc-option=-optl=-Wl,-rpath=/nix/store/59r1c7sfgph9j2xxsc1k3j6dwkm32ybk-directory-1.3.1.5/lib/ghc-8.2.2/directory-1.3.1.5 --ghc-option=-j1 --disable-split-objs --disable-library-profiling --disable-profiling --enable-shared --disable-coverage --enable-library-vanilla --enable-executable-dynamic --enable-tests --ghc-option=-split-sections
Configuring directory-1.3.1.5...
Warning: The 'build-type' is 'Configure' but there is no 'configure' script.
You probably need to run 'autoreconf -i' to generate it.
Configuring xml-1.3.14...
Dependency base >=3 && <5: using base-4.10.1.0
Dependency bytestring -any: using bytestring-0.10.8.2
Dependency text -any: using text-1.2.3.0
Dependency base >=4.5 && <4.12: using base-4.10.1.0
Dependency directory -any: using directory-1.3.1.5
Dependency filepath >=1.3 && <1.5: using filepath-1.4.2
Dependency time >=1.4 && <1.9: using time-1.8.0.2
Dependency unix >=2.5.1 && <2.8: using unix-2.7.2.2
Source component graph:
component lib
component test:test dependency lib
Configured component graph:
component directory-1.3.1.5-EFdDcGoPsV2JQnFPz1QOGK
include base-4.10.1.0
include time-1.8.0.2
include filepath-1.4.2-DyDAQ5oOwBVDvLxMoNLDxx
include unix-2.7.2.2
component directory-1.3.1.5-8aJ3UecsjNUIxs4bq1vU8T-test
include base-4.10.1.0
include directory-1.3.1.5-EFdDcGoPsV2JQnFPz1QOGK
include filepath-1.4.2-DyDAQ5oOwBVDvLxMoNLDxx
include time-1.8.0.2
include unix-2.7.2.2
Linked component graph:
unit directory-1.3.1.5-EFdDcGoPsV2JQnFPz1QOGK
include base-4.10.1.0
include time-1.8.0.2
include filepath-1.4.2-DyDAQ5oOwBVDvLxMoNLDxx
include unix-2.7.2.2
System.Directory=directory-1.3.1.5-EFdDcGoPsV2JQnFPz1QOGK:System.Directory,System.Directory.Internal=directory-1.3.1.5-EFdDcGoPsV2JQnFPz1QOGK:System.Directory.Internal,System.Directory.Internal.Prelude=directory-1.3.1.5-EFdDcGoPsV2JQnFPz1QOGK:System.Directory.Internal.Prelude
unit directory-1.3.1.5-8aJ3UecsjNUIxs4bq1vU8T-test
include base-4.10.1.0
include directory-1.3.1.5-EFdDcGoPsV2JQnFPz1QOGK
include filepath-1.4.2-DyDAQ5oOwBVDvLxMoNLDxx
include time-1.8.0.2
include unix-2.7.2.2
Ready component graph:
definite directory-1.3.1.5-EFdDcGoPsV2JQnFPz1QOGK
depends base-4.10.1.0
depends time-1.8.0.2
depends filepath-1.4.2-DyDAQ5oOwBVDvLxMoNLDxx
depends unix-2.7.2.2
definite directory-1.3.1.5-8aJ3UecsjNUIxs4bq1vU8T-test
depends base-4.10.1.0
depends directory-1.3.1.5-EFdDcGoPsV2JQnFPz1QOGK
depends filepath-1.4.2-DyDAQ5oOwBVDvLxMoNLDxx
depends time-1.8.0.2
depends unix-2.7.2.2
Using Cabal-2.0.1.0 compiled by ghc-8.2
Using compiler: ghc-8.2.2
Using install prefix:
/nix/store/59r1c7sfgph9j2xxsc1k3j6dwkm32ybk-directory-1.3.1.5
Executables installed in:
/nix/store/59r1c7sfgph9j2xxsc1k3j6dwkm32ybk-directory-1.3.1.5/bin
Libraries installed in:
/nix/store/59r1c7sfgph9j2xxsc1k3j6dwkm32ybk-directory-1.3.1.5/lib/ghc-8.2.2/directory-1.3.1.5
Dynamic Libraries installed in:
/nix/store/59r1c7sfgph9j2xxsc1k3j6dwkm32ybk-directory-1.3.1.5/lib/ghc-8.2.2/x86_64-linux-ghc-8.2.2
Private executables installed in:
/nix/store/59r1c7sfgph9j2xxsc1k3j6dwkm32ybk-directory-1.3.1.5/libexec/x86_64-linux-ghc-8.2.2/directory-1.3.1.5
Data files installed in:
/nix/store/59r1c7sfgph9j2xxsc1k3j6dwkm32ybk-directory-1.3.1.5/share/x86_64-linux-ghc-8.2.2/directory-1.3.1.5
Documentation installed in:
/nix/store/w0gkzrf5q6ng40vzyvdl5m8pvw9v9dxy-directory-1.3.1.5-doc/share/doc
Configuration files installed in:
/nix/store/59r1c7sfgph9j2xxsc1k3j6dwkm32ybk-directory-1.3.1.5/etc
No alex found
Using ar found on system at:
/nix/store/aplvnhqdm6s9wj9r0jh46r46wvh65j86-binutils-2.28.1/bin/ar
No c2hs found
No cpphs found
No doctest found
Using gcc version 6.4.0 given by user at:
/nix/store/wriy1xis74fybcg3m1jnq5bd5myxvhm6-gcc-wrapper-6.4.0/bin/gcc
Using ghc version 8.2.2 found on system at:
/nix/store/d57p5gzyld7b3y4irzv70bfa3d8xxwgx-ghc-8.2.2/bin/ghc
Using ghc-pkg version 8.2.2 found on system at:
/nix/store/d57p5gzyld7b3y4irzv70bfa3d8xxwgx-ghc-8.2.2/bin/ghc-pkg
No ghcjs found
No ghcjs-pkg found
No greencard found
Using haddock version 2.18.1 found on system at:
/nix/store/d57p5gzyld7b3y4irzv70bfa3d8xxwgx-ghc-8.2.2/bin/haddock
No happy found
Using haskell-suite found on system at: haskell-suite-dummy-location
Using haskell-suite-pkg found on system at: haskell-suite-pkg-dummy-location
No hmake found
Using hpc version 0.67 found on system at:
/nix/store/d57p5gzyld7b3y4irzv70bfa3d8xxwgx-ghc-8.2.2/bin/hpc
Using hsc2hs version 0.68.2 found on system at:
/nix/store/d57p5gzyld7b3y4irzv70bfa3d8xxwgx-ghc-8.2.2/bin/hsc2hs
Using hscolour version 1.24 found on system at:
/nix/store/yf0bs1q9ph388jms8xlgcd5vh99amjm4-hscolour-1.24.2/bin/HsColour
No jhc found
Using ld found on system at:
/nix/store/wriy1xis74fybcg3m1jnq5bd5myxvhm6-gcc-wrapper-6.4.0/bin/ld
No lhc found
No lhc-pkg found
No pkg-config found
Using runghc version 8.2.2 found on system at:
/nix/store/d57p5gzyld7b3y4irzv70bfa3d8xxwgx-ghc-8.2.2/bin/runghc
Using strip version 2.28 found on system at:
/nix/store/aplvnhqdm6s9wj9r0jh46r46wvh65j86-binutils-2.28.1/bin/strip
Using tar found on system at:
/nix/store/vvq16kzwgx9yhkf0fwwms5xzgg0rwdpl-gnutar-1.29/bin/tar
No uhc found
Setup: configure script not found.
builder for '/nix/store/lmpgkvswlkcgpcjdilbyh202vm8a5i5r-directory-1.3.1.5.drv' failed with exit code 1
cannot build derivation '/nix/store/dck8p81zlij9qksglaw8hkp11msrm426-hadrian-0.1.0.0.drv': 1 dependencies couldn't be built
error: build of '/nix/store/dck8p81zlij9qksglaw8hkp11msrm426-hadrian-0.1.0.0.drv' failed
```
Notice that the build fails for a library shipped with GHC. In `shell.nix` it's included as `localPackage`.
- \*Workaround\*\*
First, we need to run `configurePhase` of the default Nix derivation for GHC HEAD:
1. `cd ghc`
1. `nix-shell '<nixpkgs>' -A haskell.compiler.ghcHEAD`
1. `configurePhase`
1. `exit`
Now we can `cd` into `ghc/hadrian` and proceed normally, the build won't fail.
The issue is that this step shouldn't be required, we must have a self-contained `shell.nix`.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ---------------------- |
| Version | 8.6.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Build System (Hadrian) |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"shell.nix depends on build artifacts","status":"New","operating_system":"","component":"Build System (Hadrian)","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.6.1","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"Filed Mar 19, 2018, as https://github.com/snowleopard/hadrian/issues/532\r\n\r\n**Steps to reproduce:**\r\n\r\n1. `git clone --recursive git://git.haskell.org/ghc.git`\r\n2. `cd ghc/hadrian`\r\n3. `nix-shell --pure`\r\n\r\n**Expected result:** Successful build.\r\n\r\n**Actual result:**\r\n\r\n{{{\r\nhadrian(master)$ nix-shell --pure\r\nthese derivations will be built:\r\n /nix/store/lmpgkvswlkcgpcjdilbyh202vm8a5i5r-directory-1.3.1.5.drv\r\n /nix/store/rcg0mmq0bincjfjnzbabc8fq7307bylq-process-1.6.3.0.drv\r\n /nix/store/15alkpni823gkfp63c79962v032wxvjs-extra-1.6.4.drv\r\n /nix/store/1b54g6nv8rw0kq3i5xjpcbhy88jvdnbr-xml-1.3.14.drv\r\n /nix/store/89salv051l8yr2y2k52pzkqraw9lfib9-test-framework-0.8.1.1.drv\r\n /nix/store/iqq0xsvgf3hf551b3jj0x3lg661c5y4f-test-framework-hunit-0.3.0.2.drv\r\n /nix/store/cy7ynm7r9jb41kxb1gxbwdprhvl03ivk-parsec-3.1.13.0.drv\r\n /nix/store/rgnsvxfvmbhrkniy0c86v65jgvx8nsan-test-framework-quickcheck2-0.3.0.4.drv\r\n /nix/store/fyrj002axd2skdz370hi13fq6prjh5cz-network-uri-2.6.1.0.drv\r\n /nix/store/7qcfy5gy9sjcz7cijqghgj3cilm2pzps-HTTP-4000.3.8.drv\r\n /nix/store/gk0w3grh2hz008sp6ksy669zvl6pyznb-js-flot-0.8.3.drv\r\n /nix/store/h39chz7m8zvawlrzfjsz496vl2rbp921-hashable-1.2.6.1.drv\r\n /nix/store/zpv0xi25jq6p5kkpvbc11sq73dxi2g0a-unordered-containers-0.2.8.0.drv\r\n /nix/store/i7p5c3mv9p20z7kb2mrdlpx0fwmyz3f5-shake-0.16.2.drv\r\n /nix/store/pzfcvib6sbsaascsc7djzcfqzlw847gc-Cabal-2.3.0.0.drv\r\n /nix/store/j5w4i42pgfy03s7fjsj4dfkis26c3nnp-happy-1.19.8.drv\r\n /nix/store/pl2dxjvbqs36rh80q5i09zdhbh6hjl2r-alex-3.2.3.drv\r\n /nix/store/dck8p81zlij9qksglaw8hkp11msrm426-hadrian-0.1.0.0.drv\r\nbuilding '/nix/store/lmpgkvswlkcgpcjdilbyh202vm8a5i5r-directory-1.3.1.5.drv'...\r\nbuilding '/nix/store/1b54g6nv8rw0kq3i5xjpcbhy88jvdnbr-xml-1.3.14.drv'...\r\nsetupCompilerEnvironmentPhase\r\nBuild with /nix/store/d57p5gzyld7b3y4irzv70bfa3d8xxwgx-ghc-8.2.2.\r\nsetupCompilerEnvironmentPhase\r\nBuild with /nix/store/d57p5gzyld7b3y4irzv70bfa3d8xxwgx-ghc-8.2.2.\r\nunpacking sources\r\nunpacking source archive /nix/store/khjm3agcb1y91925r78h3chaq56w9fi7-6wsbrbb60dzbfqf62c6sskwcijc3arjj-directory\r\nunpacking sources\r\nunpacking source archive /nix/store/dnx7hpl7wz81r3av4l09pqqhdqi4qpg6-xml-1.3.14.tar.gz\r\nsource root is xml-1.3.14\r\nsource root is 6wsbrbb60dzbfqf62c6sskwcijc3arjj-directory\r\nsetting SOURCE_DATE_EPOCH to timestamp 1424727750 of file xml-1.3.14/xml.cabal\r\npatching sources\r\npatching sources\r\ncompileBuildDriverPhase\r\ncompileBuildDriverPhase\r\nsetupCompileFlags: -package-db=/tmp/nix-build-xml-1.3.14.drv-0/package.conf.d -j1 -threaded\r\nsetupCompileFlags: -package-db=/tmp/nix-build-directory-1.3.1.5.drv-0/package.conf.d -j1 -threaded\r\n[1 of 1] Compiling Main ( Setup.hs, /tmp/nix-build-directory-1.3.1.5.drv-0/Main.o )\r\n[1 of 1] Compiling Main ( Setup.hs, /tmp/nix-build-xml-1.3.14.drv-0/Main.o )\r\nLinking Setup ...\r\nLinking Setup ...\r\nconfiguring\r\nconfigureFlags: --verbose --prefix=/nix/store/v3yazy78gy6kkpvrcn3schm8lc8y5dgl-xml-1.3.14 --libdir=$prefix/lib/$compiler --libsubdir=$pkgid --docdir=/nix/store/zdzgar7mwysym9dbai87fann20pbw75n-xml-1.3.14-doc/share/doc --with-gcc=gcc --package-db=/tmp/nix-build-xml-1.3.14.drv-0/package.conf.d --ghc-option=-optl=-Wl,-rpath=/nix/store/v3yazy78gy6kkpvrcn3schm8lc8y5dgl-xml-1.3.14/lib/ghc-8.2.2/xml-1.3.14 --ghc-option=-j1 --disable-split-objs --disable-library-profiling --disable-profiling --enable-shared --disable-coverage --enable-library-vanilla --enable-executable-dynamic --enable-tests --ghc-option=-split-sections\r\nconfiguring\r\nconfigureFlags: --verbose --prefix=/nix/store/59r1c7sfgph9j2xxsc1k3j6dwkm32ybk-directory-1.3.1.5 --libdir=$prefix/lib/$compiler --libsubdir=$pkgid --docdir=/nix/store/w0gkzrf5q6ng40vzyvdl5m8pvw9v9dxy-directory-1.3.1.5-doc/share/doc --with-gcc=gcc --package-db=/tmp/nix-build-directory-1.3.1.5.drv-0/package.conf.d --ghc-option=-optl=-Wl,-rpath=/nix/store/59r1c7sfgph9j2xxsc1k3j6dwkm32ybk-directory-1.3.1.5/lib/ghc-8.2.2/directory-1.3.1.5 --ghc-option=-j1 --disable-split-objs --disable-library-profiling --disable-profiling --enable-shared --disable-coverage --enable-library-vanilla --enable-executable-dynamic --enable-tests --ghc-option=-split-sections\r\nConfiguring directory-1.3.1.5...\r\nWarning: The 'build-type' is 'Configure' but there is no 'configure' script.\r\nYou probably need to run 'autoreconf -i' to generate it.\r\nConfiguring xml-1.3.14...\r\nDependency base >=3 && <5: using base-4.10.1.0\r\nDependency bytestring -any: using bytestring-0.10.8.2\r\nDependency text -any: using text-1.2.3.0\r\nDependency base >=4.5 && <4.12: using base-4.10.1.0\r\nDependency directory -any: using directory-1.3.1.5\r\nDependency filepath >=1.3 && <1.5: using filepath-1.4.2\r\nDependency time >=1.4 && <1.9: using time-1.8.0.2\r\nDependency unix >=2.5.1 && <2.8: using unix-2.7.2.2\r\nSource component graph:\r\n component lib\r\n component test:test dependency lib\r\nConfigured component graph:\r\n component directory-1.3.1.5-EFdDcGoPsV2JQnFPz1QOGK\r\n include base-4.10.1.0\r\n include time-1.8.0.2\r\n include filepath-1.4.2-DyDAQ5oOwBVDvLxMoNLDxx\r\n include unix-2.7.2.2\r\n component directory-1.3.1.5-8aJ3UecsjNUIxs4bq1vU8T-test\r\n include base-4.10.1.0\r\n include directory-1.3.1.5-EFdDcGoPsV2JQnFPz1QOGK\r\n include filepath-1.4.2-DyDAQ5oOwBVDvLxMoNLDxx\r\n include time-1.8.0.2\r\n include unix-2.7.2.2\r\nLinked component graph:\r\n unit directory-1.3.1.5-EFdDcGoPsV2JQnFPz1QOGK\r\n include base-4.10.1.0\r\n include time-1.8.0.2\r\n include filepath-1.4.2-DyDAQ5oOwBVDvLxMoNLDxx\r\n include unix-2.7.2.2\r\n System.Directory=directory-1.3.1.5-EFdDcGoPsV2JQnFPz1QOGK:System.Directory,System.Directory.Internal=directory-1.3.1.5-EFdDcGoPsV2JQnFPz1QOGK:System.Directory.Internal,System.Directory.Internal.Prelude=directory-1.3.1.5-EFdDcGoPsV2JQnFPz1QOGK:System.Directory.Internal.Prelude\r\n unit directory-1.3.1.5-8aJ3UecsjNUIxs4bq1vU8T-test\r\n include base-4.10.1.0\r\n include directory-1.3.1.5-EFdDcGoPsV2JQnFPz1QOGK\r\n include filepath-1.4.2-DyDAQ5oOwBVDvLxMoNLDxx\r\n include time-1.8.0.2\r\n include unix-2.7.2.2\r\nReady component graph:\r\n definite directory-1.3.1.5-EFdDcGoPsV2JQnFPz1QOGK\r\n depends base-4.10.1.0\r\n depends time-1.8.0.2\r\n depends filepath-1.4.2-DyDAQ5oOwBVDvLxMoNLDxx\r\n depends unix-2.7.2.2\r\n definite directory-1.3.1.5-8aJ3UecsjNUIxs4bq1vU8T-test\r\n depends base-4.10.1.0\r\n depends directory-1.3.1.5-EFdDcGoPsV2JQnFPz1QOGK\r\n depends filepath-1.4.2-DyDAQ5oOwBVDvLxMoNLDxx\r\n depends time-1.8.0.2\r\n depends unix-2.7.2.2\r\nUsing Cabal-2.0.1.0 compiled by ghc-8.2\r\nUsing compiler: ghc-8.2.2\r\nUsing install prefix:\r\n/nix/store/59r1c7sfgph9j2xxsc1k3j6dwkm32ybk-directory-1.3.1.5\r\nExecutables installed in:\r\n/nix/store/59r1c7sfgph9j2xxsc1k3j6dwkm32ybk-directory-1.3.1.5/bin\r\nLibraries installed in:\r\n/nix/store/59r1c7sfgph9j2xxsc1k3j6dwkm32ybk-directory-1.3.1.5/lib/ghc-8.2.2/directory-1.3.1.5\r\nDynamic Libraries installed in:\r\n/nix/store/59r1c7sfgph9j2xxsc1k3j6dwkm32ybk-directory-1.3.1.5/lib/ghc-8.2.2/x86_64-linux-ghc-8.2.2\r\nPrivate executables installed in:\r\n/nix/store/59r1c7sfgph9j2xxsc1k3j6dwkm32ybk-directory-1.3.1.5/libexec/x86_64-linux-ghc-8.2.2/directory-1.3.1.5\r\nData files installed in:\r\n/nix/store/59r1c7sfgph9j2xxsc1k3j6dwkm32ybk-directory-1.3.1.5/share/x86_64-linux-ghc-8.2.2/directory-1.3.1.5\r\nDocumentation installed in:\r\n/nix/store/w0gkzrf5q6ng40vzyvdl5m8pvw9v9dxy-directory-1.3.1.5-doc/share/doc\r\nConfiguration files installed in:\r\n/nix/store/59r1c7sfgph9j2xxsc1k3j6dwkm32ybk-directory-1.3.1.5/etc\r\nNo alex found\r\nUsing ar found on system at:\r\n/nix/store/aplvnhqdm6s9wj9r0jh46r46wvh65j86-binutils-2.28.1/bin/ar\r\nNo c2hs found\r\nNo cpphs found\r\nNo doctest found\r\nUsing gcc version 6.4.0 given by user at:\r\n/nix/store/wriy1xis74fybcg3m1jnq5bd5myxvhm6-gcc-wrapper-6.4.0/bin/gcc\r\nUsing ghc version 8.2.2 found on system at:\r\n/nix/store/d57p5gzyld7b3y4irzv70bfa3d8xxwgx-ghc-8.2.2/bin/ghc\r\nUsing ghc-pkg version 8.2.2 found on system at:\r\n/nix/store/d57p5gzyld7b3y4irzv70bfa3d8xxwgx-ghc-8.2.2/bin/ghc-pkg\r\nNo ghcjs found\r\nNo ghcjs-pkg found\r\nNo greencard found\r\nUsing haddock version 2.18.1 found on system at:\r\n/nix/store/d57p5gzyld7b3y4irzv70bfa3d8xxwgx-ghc-8.2.2/bin/haddock\r\nNo happy found\r\nUsing haskell-suite found on system at: haskell-suite-dummy-location\r\nUsing haskell-suite-pkg found on system at: haskell-suite-pkg-dummy-location\r\nNo hmake found\r\nUsing hpc version 0.67 found on system at:\r\n/nix/store/d57p5gzyld7b3y4irzv70bfa3d8xxwgx-ghc-8.2.2/bin/hpc\r\nUsing hsc2hs version 0.68.2 found on system at:\r\n/nix/store/d57p5gzyld7b3y4irzv70bfa3d8xxwgx-ghc-8.2.2/bin/hsc2hs\r\nUsing hscolour version 1.24 found on system at:\r\n/nix/store/yf0bs1q9ph388jms8xlgcd5vh99amjm4-hscolour-1.24.2/bin/HsColour\r\nNo jhc found\r\nUsing ld found on system at:\r\n/nix/store/wriy1xis74fybcg3m1jnq5bd5myxvhm6-gcc-wrapper-6.4.0/bin/ld\r\nNo lhc found\r\nNo lhc-pkg found\r\nNo pkg-config found\r\nUsing runghc version 8.2.2 found on system at:\r\n/nix/store/d57p5gzyld7b3y4irzv70bfa3d8xxwgx-ghc-8.2.2/bin/runghc\r\nUsing strip version 2.28 found on system at:\r\n/nix/store/aplvnhqdm6s9wj9r0jh46r46wvh65j86-binutils-2.28.1/bin/strip\r\nUsing tar found on system at:\r\n/nix/store/vvq16kzwgx9yhkf0fwwms5xzgg0rwdpl-gnutar-1.29/bin/tar\r\nNo uhc found\r\nSetup: configure script not found.\r\nbuilder for '/nix/store/lmpgkvswlkcgpcjdilbyh202vm8a5i5r-directory-1.3.1.5.drv' failed with exit code 1\r\ncannot build derivation '/nix/store/dck8p81zlij9qksglaw8hkp11msrm426-hadrian-0.1.0.0.drv': 1 dependencies couldn't be built\r\nerror: build of '/nix/store/dck8p81zlij9qksglaw8hkp11msrm426-hadrian-0.1.0.0.drv' failed\r\n}}}\r\n\r\nNotice that the build fails for a library shipped with GHC. In `shell.nix` it's included as `localPackage`.\r\n\r\n**Workaround**\r\n\r\nFirst, we need to run `configurePhase` of the default Nix derivation for GHC HEAD:\r\n\r\n1. `cd ghc`\r\n2. `nix-shell '<nixpkgs>' -A haskell.compiler.ghcHEAD`\r\n3. `configurePhase`\r\n4. `exit`\r\n\r\nNow we can `cd` into `ghc/hadrian` and proceed normally, the build won't fail.\r\n\r\nThe issue is that this step shouldn't be required, we must have a self-contained `shell.nix`.\r\n","type_of_failure":"OtherFailure","blocking":[]} -->https://gitlab.haskell.org/ghc/ghc/-/issues/15793Type family doesn't reduce with visible kind application2019-07-07T18:02:57ZIcelandjackType family doesn't reduce with visible kind applicationIf we un-comment `f2`
```hs
{-# Language RankNTypes #-}
{-# Language TypeFamilies #-}
{-# Language TypeApplications #-}
{-# Language PolyKinds #-}
import Data.Kind
type family
F1 (a :: Type) :: Type where
F1 a = M...If we un-comment `f2`
```hs
{-# Language RankNTypes #-}
{-# Language TypeFamilies #-}
{-# Language TypeApplications #-}
{-# Language PolyKinds #-}
import Data.Kind
type family
F1 (a :: Type) :: Type where
F1 a = Maybe a
f1 :: F1 a
f1 = Nothing
type family
F2 :: forall (a :: Type). Type where
F2 @a = Maybe a
-- f2 :: F2 @a
-- f2 = Nothing
```
this program fails with
```
• Couldn't match kind ‘forall a1. *’ with ‘* -> *’
When matching types
F2 :: forall a. *
Maybe :: * -> *
Expected type: F2
Actual type: Maybe a
• In the expression: Nothing
In an equation for ‘f2’: f2 = Nothing
|
20 | f2 = Nothing
| ^^^^^^^
Failed, no modules loaded.
```
It also succeeds replacing `Nothing` with `undefined`
```hs
f2 :: F2 @a
f2 = undefined
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.6.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | mnguyen |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Type family doesn't reduce with visible kind application","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.6.1","keywords":["TypeApplications"],"differentials":[],"test_case":"","architecture":"","cc":["mnguyen"],"type":"Bug","description":"If we un-comment `f2`\r\n\r\n{{{#!hs\r\n{-# Language RankNTypes #-}\r\n{-# Language TypeFamilies #-}\r\n{-# Language TypeApplications #-}\r\n{-# Language PolyKinds #-}\r\n\r\nimport Data.Kind\r\n\r\ntype family\r\n F1 (a :: Type) :: Type where\r\n F1 a = Maybe a\r\n\r\nf1 :: F1 a\r\nf1 = Nothing\r\n\r\ntype family\r\n F2 :: forall (a :: Type). Type where\r\n F2 @a = Maybe a\r\n\r\n-- f2 :: F2 @a\r\n-- f2 = Nothing\r\n}}}\r\n\r\nthis program fails with\r\n\r\n{{{\r\n • Couldn't match kind ‘forall a1. *’ with ‘* -> *’\r\n When matching types\r\n F2 :: forall a. *\r\n Maybe :: * -> *\r\n Expected type: F2\r\n Actual type: Maybe a\r\n • In the expression: Nothing\r\n In an equation for ‘f2’: f2 = Nothing\r\n |\r\n 20 | f2 = Nothing\r\n | ^^^^^^^\r\n Failed, no modules loaded.\r\n}}}\r\n\r\nIt also succeeds replacing `Nothing` with `undefined`\r\n\r\n{{{#!hs\r\nf2 :: F2 @a\r\nf2 = undefined\r\n}}}","type_of_failure":"OtherFailure","blocking":[]} -->8.8.1https://gitlab.haskell.org/ghc/ghc/-/issues/15792TH reification prints invisible arguments to rank-2-kinded type as visible2019-07-07T18:02:57ZRyan ScottTH reification prints invisible arguments to rank-2-kinded type as visibleIf you run the following program:
```hs
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TemplateHaskell #-}
module Bug where
import Data.Kind
import Language.Haskell.TH hiding (Type)
newtype T (f :: forall a. a -> ...If you run the following program:
```hs
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TemplateHaskell #-}
module Bug where
import Data.Kind
import Language.Haskell.TH hiding (Type)
newtype T (f :: forall a. a -> Type) = MkT (f Bool)
$(pure [])
main :: IO ()
main = do
putStrLn $(reify ''T >>= stringE . pprint)
putStrLn $(reify ''T >>= stringE . show)
```
You'll get:
```
$ /opt/ghc/8.6.1/bin/runghc Bug.hs
newtype Bug.T (f_0 :: forall (a_1 :: *) . a_1 -> *)
= Bug.MkT (f_0 * GHC.Types.Bool)
TyConI (NewtypeD [] Bug.T [KindedTV f_6989586621679016168 (ForallT [KindedTV a_6989586621679016167 StarT] [] (AppT (AppT ArrowT (VarT a_6989586621679016167)) StarT))] Nothing (NormalC Bug.MkT [(Bang NoSourceUnpackedness NoSourceStrictness,AppT (AppT (VarT f_6989586621679016168) StarT) (ConT GHC.Types.Bool))]) [])
```
These are the parts that are suspect:
- `f_0 * GHC.Types.Bool`
- `AppT (AppT (VarT f_6989586621679016168) StarT) (ConT GHC.Types.Bool)`
Notice how `f`/`VarT f` accepts `*`/`StarT` as a visible argument, despite the fact that its kind `forall a. a -> Type` indicates that this should be invisible.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ---------------- |
| Version | 8.6.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Template Haskell |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"TH reification prints invisible arguments to rank-2-kinded type as visible","status":"New","operating_system":"","component":"Template Haskell","related":[],"milestone":"8.8.1","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.6.1","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"If you run the following program:\r\n\r\n{{{#!hs\r\n{-# LANGUAGE PolyKinds #-}\r\n{-# LANGUAGE RankNTypes #-}\r\n{-# LANGUAGE TemplateHaskell #-}\r\nmodule Bug where\r\n\r\nimport Data.Kind\r\nimport Language.Haskell.TH hiding (Type)\r\n\r\nnewtype T (f :: forall a. a -> Type) = MkT (f Bool)\r\n\r\n$(pure [])\r\n\r\nmain :: IO ()\r\nmain = do\r\n putStrLn $(reify ''T >>= stringE . pprint)\r\n putStrLn $(reify ''T >>= stringE . show)\r\n}}}\r\n\r\nYou'll get:\r\n\r\n{{{\r\n$ /opt/ghc/8.6.1/bin/runghc Bug.hs\r\nnewtype Bug.T (f_0 :: forall (a_1 :: *) . a_1 -> *)\r\n = Bug.MkT (f_0 * GHC.Types.Bool)\r\nTyConI (NewtypeD [] Bug.T [KindedTV f_6989586621679016168 (ForallT [KindedTV a_6989586621679016167 StarT] [] (AppT (AppT ArrowT (VarT a_6989586621679016167)) StarT))] Nothing (NormalC Bug.MkT [(Bang NoSourceUnpackedness NoSourceStrictness,AppT (AppT (VarT f_6989586621679016168) StarT) (ConT GHC.Types.Bool))]) [])\r\n}}}\r\n\r\nThese are the parts that are suspect:\r\n\r\n* `f_0 * GHC.Types.Bool`\r\n* `AppT (AppT (VarT f_6989586621679016168) StarT) (ConT GHC.Types.Bool)`\r\n\r\nNotice how `f`/`VarT f` accepts `*`/`StarT` as a visible argument, despite the fact that its kind `forall a. a -> Type` indicates that this should be invisible.","type_of_failure":"OtherFailure","blocking":[]} -->8.8.1https://gitlab.haskell.org/ghc/ghc/-/issues/15791typeKind confuses Type and Constraint2019-07-07T18:02:58ZRichard Eisenbergrae@richarde.devtypeKind confuses Type and ConstraintThe `typeKind` function takes a type and reports its kind. It gets this wrong, sometimes: if you ask for `typeKind` of the quantified constraint `Eq a => C a` (where `C` is a class), you get `Type`. This is wrong, though I don't have a c...The `typeKind` function takes a type and reports its kind. It gets this wrong, sometimes: if you ask for `typeKind` of the quantified constraint `Eq a => C a` (where `C` is a class), you get `Type`. This is wrong, though I don't have a concrete case where GHC misfires.
We *could* fix `typeKind` to get this right, but doing so would require making the `FunTy` case recursive (right now, it always returns `Type`). This is wasteful, because most clients of `typeKind` do not care about the distinction between `Type` and `Constraint`.
Instead, I propose making a new `tcTypeKind` which behaves correctly in this case.
We could also muse about making `tcTypeKind` monadic so that it can look through unification variables. This might also simplify the story around `Note [The tcType invariant]`.
Regardless of the "make monadic" idea, I claim that, when this is done, we should have `isPredTy` be functionally equivalent to `(== Constraint) . tcTypeKind`.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.6.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"typeKind confuses Type and Constraint","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.6.1","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"The `typeKind` function takes a type and reports its kind. It gets this wrong, sometimes: if you ask for `typeKind` of the quantified constraint `Eq a => C a` (where `C` is a class), you get `Type`. This is wrong, though I don't have a concrete case where GHC misfires.\r\n\r\nWe ''could'' fix `typeKind` to get this right, but doing so would require making the `FunTy` case recursive (right now, it always returns `Type`). This is wasteful, because most clients of `typeKind` do not care about the distinction between `Type` and `Constraint`.\r\n\r\nInstead, I propose making a new `tcTypeKind` which behaves correctly in this case.\r\n\r\nWe could also muse about making `tcTypeKind` monadic so that it can look through unification variables. This might also simplify the story around `Note [The tcType invariant]`.\r\n\r\nRegardless of the \"make monadic\" idea, I claim that, when this is done, we should have `isPredTy` be functionally equivalent to `(== Constraint) . tcTypeKind`.","type_of_failure":"OtherFailure","blocking":[]} -->https://gitlab.haskell.org/ghc/ghc/-/issues/15789GHC panic using visible kind applications and a higher-rank kind2019-07-07T18:02:59ZIcelandjackGHC panic using visible kind applications and a higher-rank kindUsing visible kind applications (#12045):
```hs
{-# Language LiberalTypeSynonyms #-}
{-# Language PolyKinds #-}
{-# Language RankNTypes #-}
{-# Language DataKinds #-}
import Data.Kind
type Cat ob = ob -> o...Using visible kind applications (#12045):
```hs
{-# Language LiberalTypeSynonyms #-}
{-# Language PolyKinds #-}
{-# Language RankNTypes #-}
{-# Language DataKinds #-}
import Data.Kind
type Cat ob = ob -> ob -> Type
data Zero :: forall (cat :: forall xx. xx -> Type) a. forall b. Cat (forall b. cat b u)
```
```
$ ghci -ignore-dot-ghci 546_bug.hs
GHCi, version 8.7.20181017: http://www.haskell.org/ghc/ :? for help
[1 of 1] Compiling Main ( 546_bug.hs, interpreted )
ghc-stage2: panic! (the 'impossible' happened)
(GHC version 8.7.20181017 for x86_64-unknown-linux):
ASSERT failed!
Type-correct unfilled coercion hole {co_a1yl}
Call stack:
CallStack (from HasCallStack):
callStackDoc, called at compiler/utils/Outputable.hs:1160:37 in ghc:Outputable
pprPanic, called at compiler/utils/Outputable.hs:1219:5 in ghc:Outputable
assertPprPanic, called at compiler/typecheck/TcHsSyn.hs:1805:99 in ghc:TcHsSyn
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
>
```