GHC issueshttps://gitlab.haskell.org/ghc/ghc/-/issues2019-07-07T18:02:21Zhttps://gitlab.haskell.org/ghc/ghc/-/issues/15943"ASSERT failed" with quantified constraints2019-07-07T18:02:21ZIcelandjack"ASSERT failed" with quantified constraints```hs
{-# Language RankNTypes #-}
{-# Language DataKinds #-}
{-# Language KindSignatures #-}
{-# Language PolyKinds #-}
{-# Language TypeFamilyDependencies #-}
{-# Language GADTs ...```hs
{-# Language RankNTypes #-}
{-# Language DataKinds #-}
{-# Language KindSignatures #-}
{-# Language PolyKinds #-}
{-# Language TypeFamilyDependencies #-}
{-# Language GADTs #-}
{-# Language TypeSynonymInstances #-}
{-# Language FlexibleInstances #-}
{-# Language QuantifiedConstraints #-}
import Data.Type.Equality
import Data.Coerce
import Data.Type.Coercion
import Data.Kind
newtype WrapFalse a b = WrapFalse (Hom False a b)
newtype WrapTrue a b = WrapTrue (Hom True a b)
class
(forall (x :: ob) (y :: ob). Coercible (WrapFalse x y) (WrapTrue y x))
=>
Ríki ob where
type Hom (or::Bool) = (res :: ob -> ob -> Type) | res -> or
instance Ríki Type where
type Hom False = (->)
type Hom True = Op
newtype Op :: Type -> Type -> Type where
Op :: (b -> a) -> Op a b
```
```
$ ghc-stage2 --interactive -ignore-dot-ghci 740_bug.hs
GHCi, version 8.7.20181029: http://www.haskell.org/ghc/ :? for help
[1 of 1] Compiling Main ( 740_bug.hs, interpreted )
*** Exception: ASSERT failed! file compiler/typecheck/TcFlatten.hs, line 1288
>
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.6.2 |
| 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":"\"ASSERT failed\" with quantified constraints","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"8.6.3","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.6.2","keywords":["QuantifiedConstraints"],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"{{{#!hs\r\n{-# Language RankNTypes #-}\r\n{-# Language DataKinds #-}\r\n{-# Language KindSignatures #-}\r\n{-# Language PolyKinds #-}\r\n{-# Language TypeFamilyDependencies #-}\r\n{-# Language GADTs #-}\r\n{-# Language TypeSynonymInstances #-}\r\n{-# Language FlexibleInstances #-}\r\n{-# Language QuantifiedConstraints #-}\r\n\r\nimport Data.Type.Equality\r\nimport Data.Coerce\r\nimport Data.Type.Coercion\r\nimport Data.Kind\r\n\r\nnewtype WrapFalse a b = WrapFalse (Hom False a b)\r\nnewtype WrapTrue a b = WrapTrue (Hom True a b)\r\n\r\nclass\r\n (forall (x :: ob) (y :: ob). Coercible (WrapFalse x y) (WrapTrue y x))\r\n =>\r\n Ríki ob where\r\n\r\n type Hom (or::Bool) = (res :: ob -> ob -> Type) | res -> or\r\n\r\ninstance Ríki Type where\r\n type Hom False = (->)\r\n type Hom True = Op\r\n\r\nnewtype Op :: Type -> Type -> Type where\r\n Op :: (b -> a) -> Op a b\r\n}}}\r\n\r\n{{{\r\n$ ghc-stage2 --interactive -ignore-dot-ghci 740_bug.hs\r\nGHCi, version 8.7.20181029: http://www.haskell.org/ghc/ :? for help\r\n[1 of 1] Compiling Main ( 740_bug.hs, interpreted )\r\n*** Exception: ASSERT failed! file compiler/typecheck/TcFlatten.hs, line 1288\r\n>\r\n}}}","type_of_failure":"OtherFailure","blocking":[]} -->8.6.3https://gitlab.haskell.org/ghc/ghc/-/issues/15942Associated type family can't be used at the kind level within other parts of ...2020-09-19T20:55:39ZIcelandjackAssociated type family can't be used at the kind level within other parts of parent classI want to run the following past you (using [Visible Kind Applications](https://phabricator.haskell.org/D5229) but may be unrelated). The following compiles
```hs
{-# Language DataKinds #-}
{-# Language KindSignatures #-}...I want to run the following past you (using [Visible Kind Applications](https://phabricator.haskell.org/D5229) but may be unrelated). The following compiles
```hs
{-# Language DataKinds #-}
{-# Language KindSignatures #-}
{-# Language TypeFamilies #-}
{-# Language AllowAmbiguousTypes #-}
import Data.Kind
type G = Bool -> Type
data Fun :: G
class F (bool :: Bool) where
type Not bool :: Bool
foo :: Fun (Not bool)
```
but quantifying `Bool` invisibly all of a sudden I can't use `Not`
```hs
{-# Language DataKinds #-}
{-# Language RankNTypes #-}
{-# Language TypeApplications #-}
{-# Language PolyKinds #-}
{-# Language KindSignatures #-}
{-# Language TypeFamilies #-}
{-# Language AllowAmbiguousTypes #-}
import Data.Kind
type G = forall (b :: Bool). Type
data Fun :: G
class F (bool :: Bool) where
type Not bool :: Bool
foo :: Fun @(Not bool)
```
```
$ ghc-stage2 --interactive -ignore-dot-ghci 739_bug.hs
GHCi, version 8.7.20181017: http://www.haskell.org/ghc/ :? for help
[1 of 1] Compiling Main ( 739_bug.hs, interpreted )
739_bug.hs:17:16: error:
• Type constructor ‘Not’ cannot be used here
(it is defined and used in the same recursive group)
• In the first argument of ‘Fun’, namely ‘(Not bool)’
In the type signature: foo :: Fun @(Not bool)
In the class declaration for ‘F’
|
17 | foo :: Fun @(Not bool)
| ^^^
Failed, no modules loaded.
```
Is this restriction warranted8.6.3https://gitlab.haskell.org/ghc/ghc/-/issues/15936Rethink Choice of Baseline Commit for Performance Tests2019-07-07T18:02:23ZdavideRethink Choice of Baseline Commit for Performance Tests# Intro
Currently we always use the previous commit when running performance tests. This works well in CI where we fully test each commit in sequence (and hence always have test results for the previous commit). Remember, test results a...# Intro
Currently we always use the previous commit when running performance tests. This works well in CI where we fully test each commit in sequence (and hence always have test results for the previous commit). Remember, test results are stored in git notes and are not by default shared between repositories (i.e. your local repo will only have performance results when they were run locally on your machine). This is by design: we want to avoid comparing results form different machines.
Unfortunately This is not so effective when testing locally. The programmer may have only run a subset of performance tests on the previous commit, and often have not run the tests at all (this is notably true after performing a rebase: the previous commit has changed). We need to rethink how we pick a baseline commit.
# Proposed Solution
- Search for a baseline per test/test_env/metric/way
- Start at HEAD\^ and use local metrics. If none exist, use CI metrics. If none exist continue the search at the parent.
- Stop after a constant number of commits (failing to find a baseline).
- Stop the search if the child commit has expected changes for this test/metric/way (failing to find a baseline).
- It's possible that there are multiple runs of the test (e.g if the test was run many times locally). In that case take the average.
- If no baseline is found, show a warning and let the test pass.
### Handling Expected changes
If there are expected changes between HEAD and a potential baseline commit, then that baseline cannot be used. We make no attempt to approximate a baseline. A warning will be issued telling the user to run the tests of the previous commit or try and fetch CI results.
#### Issues
- The programmer is responsible for the final commit message having the correct expected changes. This is particularly important when merged via gitlab with a squash (this can change the commit message).
- We do not distinguish between full/partial performance results being available for the baseline commit: that would require checking out the baseline commit and extracting the full list of tests (This seems fragile and far too expensive).
### When to automatically fetch CI results?
Do not fetch CI results. Allow the user to do this, but give the exact git command so they can just copy and paste.
# Alternative Solution
Ultimately this was deemed too complicated. It assumes that commits will be squashed and merged into master (not always true).
- When running performance tests, results will be compared to a baseline commit that is the merge base with master (most recent commit from master). If HEAD is already in master, then the previous commit is used instead.
- If any locally generated performance results exist, they are used exclusively for the baseline.
- Else if any CI generated performance results exist (and have been fetched), they are used exclusively for the baseline.
- Else performance tests trivially pass, and a warning is given to the user.
To find the baseline commit:
```
mergeBase = merge-base master HEAD
baselineCommit = if mergeBase == HEAD
then HEAD^
else mergeBase
```
### Reasoning
- We want each commit in master not to introduce a significant change in performance: hence we compare commits in mater to the previous commit.
- If not on master (1 or more ahead and 0 or more commits behind master). We assume that the intention is to create a patch where all new commits will ultimately be squashed and placed on top of master as a single commit. On the other hand we don't want to consider changes in master from after we branched. Instead of using master HEAD as the baseline, we use the commit from which we branched from master (i.e. the merge base). In other words we are concerned only with the change in performance introduced by the newly crated commits.8.6.3davidedavidehttps://gitlab.haskell.org/ghc/ghc/-/issues/15933Wrong size for int for callbacks into Haskell from foreign code2020-06-14T21:08:58ZIlias TsitsimpisWrong size for int for callbacks into Haskell from foreign codeThe following code produces different results on amd64 (64-bit little endian) and s390x (64-bit big endian).
`foo.h:`
```c
typedef void(*hs_callback)(int x);
extern void function_in_c(hs_callback cb);
```
`foo.c:`
```c
#include "foo....The following code produces different results on amd64 (64-bit little endian) and s390x (64-bit big endian).
`foo.h:`
```c
typedef void(*hs_callback)(int x);
extern void function_in_c(hs_callback cb);
```
`foo.c:`
```c
#include "foo.h"
void function_in_c(hs_callback cb)
{
int x = 10;
cb(x);
}
```
`Foo.hs:`
```hs
module Main(main) where
import Foreign
import Foreign.C
type HsCallback = CInt -> IO ()
foreign import ccall "foo.h function_in_c"
functionInC :: FunPtr HsCallback -> IO ()
foreign import ccall "wrapper"
wrap :: HsCallback -> IO (FunPtr HsCallback)
main = do
f <- wrap $ \x -> print x
functionInC f
freeHaskellFunPtr f
```
On amd64 the output is 10, but on s390x is 0. On both machines, `sizeOf (undefined :: CInt) == sizeof(int) == 4`. When changing `HsCallback` to:
```hs
type HsCallback = Int -> IO ()
```
both produce the same, correct result, but the above seems wrong, as `sizeOf (undefined :: Int) == 8`.
This has been reproduced with both ghc-8.4 and ghc-8.2, and causes dbus to fail to build on s390x (https://github.com/rblaze/haskell-dbus/issues/26), as it relies on libxml-sax which contains the above (simplified) code.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | -------------- |
| Version | 8.4.3 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler (FFI) |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Wrong size for int for callbacks into Haskell from foreign code","status":"New","operating_system":"","component":"Compiler (FFI)","related":[],"milestone":"8.6.3","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.4.3","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"The following code produces different results on amd64 (64-bit little endian) and s390x (64-bit big endian).\r\n\r\n`foo.h:`\r\n{{{#!c\r\ntypedef void(*hs_callback)(int x);\r\nextern void function_in_c(hs_callback cb);\r\n}}}\r\n`foo.c:`\r\n{{{#!c\r\n#include \"foo.h\"\r\n\r\nvoid function_in_c(hs_callback cb)\r\n{\r\n int x = 10;\r\n cb(x);\r\n}\r\n}}}\r\n`Foo.hs:`\r\n{{{#!hs\r\nmodule Main(main) where\r\n\r\nimport Foreign\r\nimport Foreign.C\r\n\r\ntype HsCallback = CInt -> IO ()\r\n\r\nforeign import ccall \"foo.h function_in_c\"\r\n functionInC :: FunPtr HsCallback -> IO ()\r\n\r\nforeign import ccall \"wrapper\"\r\n wrap :: HsCallback -> IO (FunPtr HsCallback)\r\n\r\nmain = do\r\n f <- wrap $ \\x -> print x\r\n functionInC f\r\n freeHaskellFunPtr f\r\n}}}\r\n\r\nOn amd64 the output is 10, but on s390x is 0. On both machines, `sizeOf (undefined :: CInt) == sizeof(int) == 4`. When changing `HsCallback` to:\r\n{{{#!hs\r\ntype HsCallback = Int -> IO ()\r\n}}}\r\nboth produce the same, correct result, but the above seems wrong, as `sizeOf (undefined :: Int) == 8`.\r\n\r\nThis has been reproduced with both ghc-8.4 and ghc-8.2, and causes dbus to fail to build on s390x (https://github.com/rblaze/haskell-dbus/issues/26), as it relies on libxml-sax which contains the above (simplified) code.\r\n","type_of_failure":"OtherFailure","blocking":[]} -->8.6.3Peter Trommlerptrommler@acm.orgPeter Trommlerptrommler@acm.orghttps://gitlab.haskell.org/ghc/ghc/-/issues/15914haddock-library-1.7.0 fails to build on ppc64 BE2019-07-27T14:54:23ZJens Petersenhaddock-library-1.7.0 fails to build on ppc64 BEI was trying to build ghc-8.6.2 for Fedora 28 and it failed on ppc64 (Bigendian) with:
```
utils/haddock/haddock-library/src/Documentation/Haddock/Types.hs:99:25: error:
• GHC internal error: ‘TableRow’ is not in scope during type c...I was trying to build ghc-8.6.2 for Fedora 28 and it failed on ppc64 (Bigendian) with:
```
utils/haddock/haddock-library/src/Documentation/Haddock/Types.hs:99:25: error:
• GHC internal error: ‘TableRow’ is not in scope during type checking, but it passed the renamer
tcl_env of environment: [aIy :-> Type variable ‘id’ = id :: k,
rHO :-> ATcTyCon Table :: k -> *,
rHP :-> APromotionErr RecDataConPE]
• In the type ‘[TableRow id]’
In the definition of data constructor ‘Table’
In the data declaration for ‘Table’
|
99 | { tableHeaderRows :: [TableRow id]
| ^^^^^^^^
utils/haddock/dist/build/haddock/autogen/Paths_haddock.hs:41:22: error:
• Couldn't match type ‘a’ with ‘String’
Expected type: IO a
Actual type: IO String
• In the first argument of ‘catchIO’, namely
‘(getEnv "haddock_libdir")’
In the expression:
catchIO (getEnv "haddock_libdir") (\ _ -> return libdir)
In an equation for ‘getLibDir’:
getLibDir
= catchIO (getEnv "haddock_libdir") (\ _ -> return libdir)
|
41 | getLibDir = catchIO (getEnv "haddock_libdir") (\_ -> return libdir)
| ^^^^^^^^^^^^^^^^^^^^^^^
make[1]: *** [utils/haddock/ghc.mk:20: utils/haddock/dist/build/Documentation/Haddock/Types.dyn_o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [utils/haddock/ghc.mk:20: utils/haddock/dist/build/Paths_haddock.dyn_o] Error 1
utils/haddock/haddock-api/src/Haddock/Syb.hs:22:1: warning: [-Wunused-top-binds]
Defined but not used: ‘isType’
|
22 | isType _ = isJust $ eqT @a @b
| ^^^^^^
utils/haddock/haddock-api/src/Haddock/Syb.hs:38:1: warning: [-Wunused-top-binds]
Defined but not used: ‘everythingBut’
|
38 | everythingBut k f x = let (v, stop) = f x
| ^^^^^^^^^^^^^
utils/haddock/haddock-api/src/Haddock/Syb.hs:60:21: warning: [-Wunused-matches]
Defined but not used: ‘s’
|
60 | everythingWithState s k f x =
| ^
utils/haddock/haddock-api/src/Haddock/Syb.hs:75:1: warning: [-Wunused-top-binds]
Defined but not used: ‘everywhereBut’
|
75 | everywhereBut q f x
| ^^^^^^^^^^^^^
ghc-stage2: panic! (the 'impossible' happened)
(GHC version 8.6.2 for powerpc64-unknown-linux):
urk! lookup local fingerprint
$fShowTokenType
[]
Call stack:
CallStack (from HasCallStack):
callStackDoc, called at compiler/utils/Outputable.hs:1160:37 in ghc:Outputable
pprPanic, called at compiler/iface/MkIface.hs:524:37 in ghc:MkIface
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
make[1]: *** [utils/haddock/ghc.mk:20: utils/haddock/dist/build/Haddock/Backends/Hyperlinker/Types.dyn_o] Error 1
make: *** [Makefile:127: all] Error 2
```
https://koji.fedoraproject.org/koji/taskinfo?taskID=30919315 (the log files are only preserved for 2 weeks)
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.6.2 |
| 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":"haddock-library-1.7.0 fails to build on ppc64 BE","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"8.6.3","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.6.2","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"I was trying to build ghc-8.6.2 for Fedora 28 and it failed on ppc64 (Bigendian) with:\r\n\r\n{{{\r\nutils/haddock/haddock-library/src/Documentation/Haddock/Types.hs:99:25: error:\r\n • GHC internal error: ‘TableRow’ is not in scope during type checking, but it passed the renamer\r\n tcl_env of environment: [aIy :-> Type variable ‘id’ = id :: k,\r\n rHO :-> ATcTyCon Table :: k -> *,\r\n rHP :-> APromotionErr RecDataConPE]\r\n • In the type ‘[TableRow id]’\r\n In the definition of data constructor ‘Table’\r\n In the data declaration for ‘Table’\r\n |\r\n99 | { tableHeaderRows :: [TableRow id]\r\n | ^^^^^^^^\r\nutils/haddock/dist/build/haddock/autogen/Paths_haddock.hs:41:22: error:\r\n • Couldn't match type ‘a’ with ‘String’\r\n Expected type: IO a\r\n Actual type: IO String\r\n • In the first argument of ‘catchIO’, namely\r\n ‘(getEnv \"haddock_libdir\")’\r\n In the expression:\r\n catchIO (getEnv \"haddock_libdir\") (\\ _ -> return libdir)\r\n In an equation for ‘getLibDir’:\r\n getLibDir\r\n = catchIO (getEnv \"haddock_libdir\") (\\ _ -> return libdir)\r\n |\r\n41 | getLibDir = catchIO (getEnv \"haddock_libdir\") (\\_ -> return libdir)\r\n | ^^^^^^^^^^^^^^^^^^^^^^^\r\nmake[1]: *** [utils/haddock/ghc.mk:20: utils/haddock/dist/build/Documentation/Haddock/Types.dyn_o] Error 1\r\nmake[1]: *** Waiting for unfinished jobs....\r\nmake[1]: *** [utils/haddock/ghc.mk:20: utils/haddock/dist/build/Paths_haddock.dyn_o] Error 1\r\nutils/haddock/haddock-api/src/Haddock/Syb.hs:22:1: warning: [-Wunused-top-binds]\r\n Defined but not used: ‘isType’\r\n |\r\n22 | isType _ = isJust $ eqT @a @b\r\n | ^^^^^^\r\nutils/haddock/haddock-api/src/Haddock/Syb.hs:38:1: warning: [-Wunused-top-binds]\r\n Defined but not used: ‘everythingBut’\r\n |\r\n38 | everythingBut k f x = let (v, stop) = f x\r\n | ^^^^^^^^^^^^^\r\nutils/haddock/haddock-api/src/Haddock/Syb.hs:60:21: warning: [-Wunused-matches]\r\n Defined but not used: ‘s’\r\n |\r\n60 | everythingWithState s k f x =\r\n | ^\r\nutils/haddock/haddock-api/src/Haddock/Syb.hs:75:1: warning: [-Wunused-top-binds]\r\n Defined but not used: ‘everywhereBut’\r\n |\r\n75 | everywhereBut q f x\r\n | ^^^^^^^^^^^^^\r\nghc-stage2: panic! (the 'impossible' happened)\r\n (GHC version 8.6.2 for powerpc64-unknown-linux):\r\n\turk! lookup local fingerprint\r\n $fShowTokenType\r\n []\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/iface/MkIface.hs:524:37 in ghc:MkIface\r\nPlease report this as a GHC bug: http://www.haskell.org/ghc/reportabug\r\nmake[1]: *** [utils/haddock/ghc.mk:20: utils/haddock/dist/build/Haddock/Backends/Hyperlinker/Types.dyn_o] Error 1\r\nmake: *** [Makefile:127: all] Error 2\r\n}}}\r\n\r\nhttps://koji.fedoraproject.org/koji/taskinfo?taskID=30919315 (the log files are only preserved for 2 weeks)","type_of_failure":"OtherFailure","blocking":[]} -->8.6.3https://gitlab.haskell.org/ghc/ghc/-/issues/15912Output hadrian build data for cabal-helper tool support2020-01-05T18:00:44ZdavideOutput hadrian build data for cabal-helper tool supportAs a step in the direction of adding tool support for ghc development we can output some meta data from Hadrian to better support the cabal-helper tool. Proposed changes:
1. Add a \<ghc-root\>/cabal.helper file that points to the 3 stag...As a step in the direction of adding tool support for ghc development we can output some meta data from Hadrian to better support the cabal-helper tool. Proposed changes:
1. Add a \<ghc-root\>/cabal.helper file that points to the 3 stage build directories under the default Hadrian build dir: _build.
1. Add a "--cabal-helper" command line option to Hadrian that enables this output.
1. Output \<build-root\>/stage\<x\>/build.helper in JSON format containing per package:
- .cabal file path relative to \<ghc-root\> (achieved by prefixing paths with $PROJECTDIR) e.g $PROJECTDIR/libraries/binary/binary.cabal
- source path e.g. $PROJECTDIR/libraries/binary/binary.cabal
- Build "dist directory", which is the directory containing the setup-config file generated by cabal on build. this is a relative path e.g. libraries/binary/setup-config
\#\# TODO
- decide on the naming of files
\#\# Implementation
- See:
\* Packages.ghcPackages
\* Hadrian.Package.pkgCabalFile
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ---------------------- |
| Version | 8.6.2 |
| Type | FeatureRequest |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Build System (Hadrian) |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | DanielG |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Output hadrian build data for cabal-helper tool support","status":"New","operating_system":"","component":"Build System (Hadrian)","related":[],"milestone":"8.6.3","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.6.2","keywords":["cabal-helper","hadrian","support","tool"],"differentials":[],"test_case":"","architecture":"","cc":["DanielG"],"type":"FeatureRequest","description":"As a step in the direction of adding tool support for ghc development we can output some meta data from Hadrian to better support the cabal-helper tool. Proposed changes:\r\n\r\n1. Add a <ghc-root>/cabal.helper file that points to the 3 stage build directories under the default Hadrian build dir: _build.\r\n2. Add a \"--cabal-helper\" command line option to Hadrian that enables this output.\r\n3. Output <build-root>/stage<x>/build.helper in JSON format containing per package:\r\n * .cabal file path relative to <ghc-root> (achieved by prefixing paths with $PROJECTDIR) e.g $PROJECTDIR/libraries/binary/binary.cabal\r\n * source path e.g. $PROJECTDIR/libraries/binary/binary.cabal\r\n * Build \"dist directory\", which is the directory containing the setup-config file generated by cabal on build. this is a relative path e.g. libraries/binary/setup-config\r\n\r\n## TODO\r\n\r\n* decide on the naming of files\r\n\r\n## Implementation\r\n\r\n* See:\r\n * Packages.ghcPackages\r\n * Hadrian.Package.pkgCabalFile","type_of_failure":"OtherFailure","blocking":[]} -->8.6.3https://gitlab.haskell.org/ghc/ghc/-/issues/15910GHC missreports import as redundant.2019-07-07T18:02:29ZAndreas KlebingerGHC missreports import as redundant.In the following code GHC claims the first import is redundant.
```
import Data.Map (Map)
import qualified Data.Map as M
type MT = Map
```
```
test.hs:5:1: warning: [-Wunused-imports]
The qualified import of `Data.Map' is redunda...In the following code GHC claims the first import is redundant.
```
import Data.Map (Map)
import qualified Data.Map as M
type MT = Map
```
```
test.hs:5:1: warning: [-Wunused-imports]
The qualified import of `Data.Map' is redundant
except perhaps to import instances from `Data.Map'
To import instances alone, use: import Data.Map()
|
5 | import qualified Data.Map as M
```
Reproduceable on 8.4 and HEAD at least.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.6.2 |
| 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 missreports import as redundant.","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"8.6.3","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.6.2","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"In the following code GHC claims the first import is redundant.\r\n\r\n{{{\r\nimport Data.Map (Map)\r\n\r\nimport qualified Data.Map as M\r\n\r\ntype MT = Map\r\n}}}\r\n\r\n\r\n{{{\r\ntest.hs:5:1: warning: [-Wunused-imports]\r\n The qualified import of `Data.Map' is redundant\r\n except perhaps to import instances from `Data.Map'\r\n To import instances alone, use: import Data.Map()\r\n |\r\n5 | import qualified Data.Map as M\r\n}}}\r\n\r\n\r\nReproduceable on 8.4 and HEAD at least.","type_of_failure":"OtherFailure","blocking":[]} -->8.6.3https://gitlab.haskell.org/ghc/ghc/-/issues/15898Promoted type constructors don't print right in HsType2019-07-07T18:02:32ZSimon Peyton JonesPromoted type constructors don't print right in HsTypeConsider this
```
ghci> import Data.Proxy
ghci> undefined :: '() -> Int
<interactive>:11:14: error:
• Expected a type, but ‘ '()’ has kind ‘()’
• In an expression type signature: '() -> Int
```
What is that strange space doin...Consider this
```
ghci> import Data.Proxy
ghci> undefined :: '() -> Int
<interactive>:11:14: error:
• Expected a type, but ‘ '()’ has kind ‘()’
• In an expression type signature: '() -> Int
```
What is that strange space doing before the `'()`?
Similarly
```
undefined :: Proxy '() Int
<interactive>:12:14: error:
• Expected kind ‘* -> *’, but ‘Proxy '()’ has kind ‘*’
• In an expression type signature: Proxy '() Int
```
Again, the strange space.
It comes from the `HsType` pretty printer, which is worried
about printing the type
```
'['K]
```
That is, a promoted list with one element `K`. The trouble is that looks
like a character literal `'['`.
So we add an extra space, thus `'[ 'K]`. ''But we add it before every
promoded data constructor!" Hence the spurious spaces.
In `IfaceType` exactly the same thing happens, but we are more clever,
and only print the leading space if the promoted data con immediately
follows `'[` or `'(`. We should do the same thing for `HsType`.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.6.2 |
| 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":"Promoted type constructors don't print right in HsType","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"8.6.3","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.6.2","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"Consider this\r\n{{{\r\nghci> import Data.Proxy\r\nghci> undefined :: '() -> Int\r\n\r\n<interactive>:11:14: error:\r\n • Expected a type, but ‘ '()’ has kind ‘()’\r\n • In an expression type signature: '() -> Int\r\n}}}\r\nWhat is that strange space doing before the `'()`?\r\n\r\nSimilarly\r\n{{{\r\nundefined :: Proxy '() Int\r\n\r\n<interactive>:12:14: error:\r\n • Expected kind ‘* -> *’, but ‘Proxy '()’ has kind ‘*’\r\n • In an expression type signature: Proxy '() Int\r\n}}}\r\nAgain, the strange space.\r\n\r\nIt comes from the `HsType` pretty printer, which is worried\r\nabout printing the type\r\n{{{\r\n '['K]\r\n}}}\r\nThat is, a promoted list with one element `K`. The trouble is that looks\r\nlike a character literal `'['`.\r\n\r\nSo we add an extra space, thus `'[ 'K]`. ''But we add it before every\r\npromoded data constructor!\" Hence the spurious spaces.\r\n\r\nIn `IfaceType` exactly the same thing happens, but we are more clever,\r\nand only print the leading space if the promoted data con immediately\r\nfollows `'[` or `'(`. We should do the same thing for `HsType`.\r\n","type_of_failure":"OtherFailure","blocking":[]} -->8.6.3https://gitlab.haskell.org/ghc/ghc/-/issues/15895Unable to match instance signatures2020-05-19T14:27:34ZIcelandjackUnable to match instance signaturesRichard said GHC should be able to infer this
```hs
{-# Language PolyKinds #-}
{-# Language RankNTypes #-}
{-# Language TypeFamilies #-}
{-# Language FlexibleInstances #-}
{-# Language InstanceSigs #-}
import D...Richard said GHC should be able to infer this
```hs
{-# Language PolyKinds #-}
{-# Language RankNTypes #-}
{-# Language TypeFamilies #-}
{-# Language FlexibleInstances #-}
{-# Language InstanceSigs #-}
import Data.Kind
class Ríki ob where
type Arr :: ob -> ob -> Type
ið :: forall (a :: ob). Arr a a
instance Ríki Type where
type Arr = (->)
ið :: Arr a a
ið a = a
```
```
$ ~/code/unmodifiedghc/inplace/bin/ghc-stage2 --interactive -ignore-dot-ghci ~/hs/693_bug.hs
GHCi, version 8.7.20181029: http://www.haskell.org/ghc/ :? for help
[1 of 1] Compiling Main ( /home/baldur/hs/693_bug.hs, interpreted )
/home/baldur/hs/693_bug.hs:18:3: error:
• Couldn't match kind ‘ob’ with ‘*’
‘ob’ is a rigid type variable bound by
the type signature for:
ið :: forall ob (a :: ob). Arr a a
at /home/baldur/hs/693_bug.hs:17:9-15
When matching types
p0 :: *
a :: ob
Expected type: Arr a a
Actual type: p0 -> p0
• The equation(s) for ‘ið’ have one argument,
but its type ‘Arr a a’ has none
In the instance declaration for ‘Ríki *’
• Relevant bindings include
ið :: Arr a a (bound at /home/baldur/hs/693_bug.hs:18:3)
|
18 | ið a = a
| ^^^^^^^^
Failed, no modules loaded.
```
It works if we specify the kind of `a` or use `(->)`
```hs
ið :: forall (a :: Type). Arr a a
```
```hs
ið :: a -> a
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.6.2 |
| 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":"Unable to match instance signatures","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"8.6.3","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.6.2","keywords":["InstanceSigs"],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"Richard said GHC should be able to infer this\r\n\r\n{{{#!hs\r\n{-# Language PolyKinds #-}\r\n{-# Language RankNTypes #-}\r\n{-# Language TypeFamilies #-}\r\n{-# Language FlexibleInstances #-}\r\n{-# Language InstanceSigs #-}\r\n\r\nimport Data.Kind\r\n\r\nclass Ríki ob where\r\n type Arr :: ob -> ob -> Type\r\n\r\n ið :: forall (a :: ob). Arr a a\r\n\r\ninstance Ríki Type where\r\n type Arr = (->)\r\n\r\n ið :: Arr a a\r\n ið a = a\r\n}}}\r\n\r\n{{{\r\n$ ~/code/unmodifiedghc/inplace/bin/ghc-stage2 --interactive -ignore-dot-ghci ~/hs/693_bug.hs\r\nGHCi, version 8.7.20181029: http://www.haskell.org/ghc/ :? for help\r\n[1 of 1] Compiling Main ( /home/baldur/hs/693_bug.hs, interpreted )\r\n\r\n/home/baldur/hs/693_bug.hs:18:3: error:\r\n • Couldn't match kind ‘ob’ with ‘*’\r\n ‘ob’ is a rigid type variable bound by\r\n the type signature for:\r\n ið :: forall ob (a :: ob). Arr a a\r\n at /home/baldur/hs/693_bug.hs:17:9-15\r\n When matching types\r\n p0 :: *\r\n a :: ob\r\n Expected type: Arr a a\r\n Actual type: p0 -> p0\r\n • The equation(s) for ‘ið’ have one argument,\r\n but its type ‘Arr a a’ has none\r\n In the instance declaration for ‘Ríki *’\r\n • Relevant bindings include\r\n ið :: Arr a a (bound at /home/baldur/hs/693_bug.hs:18:3)\r\n |\r\n18 | ið a = a\r\n | ^^^^^^^^\r\nFailed, no modules loaded.\r\n}}}\r\n\r\nIt works if we specify the kind of `a` or use `(->)`\r\n\r\n{{{#!hs\r\n ið :: forall (a :: Type). Arr a a \r\n}}}\r\n{{{#!hs\r\n ið :: a -> a \r\n}}}","type_of_failure":"OtherFailure","blocking":[]} -->8.6.3https://gitlab.haskell.org/ghc/ghc/-/issues/15894Cannot find symbol during interactive linking using new-repl on Windows2019-07-07T18:02:33ZYellPikaCannot find symbol during interactive linking using new-repl on WindowsOriginally from https://github.com/haskell/cabal/issues/5683.
I get the following error on Windows 10:
```
> cabal new-repl --build-depends=ieee754
... GHCi loads ...
Prelude> import Numeric.IEEE
Prelude Numeric.IEEE> infinity
ghc.ex...Originally from https://github.com/haskell/cabal/issues/5683.
I get the following error on Windows 10:
```
> cabal new-repl --build-depends=ieee754
... GHCi loads ...
Prelude> import Numeric.IEEE
Prelude Numeric.IEEE> infinity
ghc.exe: | C:\Users\Anthony\AppData\Roaming\cabal\store\ghc-8.6.2\ieee754-0.8.0-7eecc33cf22b0ebf4d3c4dda98cc9f039432a266\lib\libHSieee754-0.8.0-7eecc33cf22b0ebf4d3c4dda98cc9f039432a266.a: unknown symbol `copysign'
ghc.exe: ^^ Could not load 'ieee754zm0zi8zi0zm7eecc33cf22b0ebf4d3c4dda98cc9f039432a266_NumericziIEEE_infinity_closure', dependency unresolved. See top entry above.
ByteCodeLink.lookupCE
During interactive linking, GHCi couldn't find the following symbol:
ieee754zm0zi8zi0zm7eecc33cf22b0ebf4d3c4dda98cc9f039432a266_NumericziIEEE_infinity_closure
This may be due to you not asking GHCi to load extra object files,
archives or DLLs needed by your current session. Restart GHCi, specifying
the missing library using the -L/path/to/object/dir and -lmissinglibname
flags, or simply by naming the relevant files on the GHCi command line.
Alternatively, this link failure might indicate a bug in GHCi.
If you suspect the latter, please send a bug report to:
glasgow-haskell-bugs@haskell.org
```
This occurs with both cabal-install 2.4.0.0 and HEAD. This does not occur if I install ieee754 into a sandbox and use `cabal repl`. It also works correctly on Ubuntu 18.04 (on both WSL and a full installation), so it looks like a Windows-specific problem.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | -------------- |
| Version | 8.6.2 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | Phyx- |
| Operating system | |
| Architecture | x86_64 (amd64) |
</details>
<!-- {"blocked_by":[],"summary":"Cannot find symbol during interactive linking using new-repl on Windows","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"8.6.3","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.6.2","keywords":[],"differentials":[],"test_case":"","architecture":"x86_64 (amd64)","cc":["Phyx-"],"type":"Bug","description":"Originally from https://github.com/haskell/cabal/issues/5683.\r\n\r\nI get the following error on Windows 10:\r\n{{{\r\n> cabal new-repl --build-depends=ieee754\r\n\r\n... GHCi loads ...\r\n\r\nPrelude> import Numeric.IEEE\r\nPrelude Numeric.IEEE> infinity\r\nghc.exe: | C:\\Users\\Anthony\\AppData\\Roaming\\cabal\\store\\ghc-8.6.2\\ieee754-0.8.0-7eecc33cf22b0ebf4d3c4dda98cc9f039432a266\\lib\\libHSieee754-0.8.0-7eecc33cf22b0ebf4d3c4dda98cc9f039432a266.a: unknown symbol `copysign'\r\nghc.exe: ^^ Could not load 'ieee754zm0zi8zi0zm7eecc33cf22b0ebf4d3c4dda98cc9f039432a266_NumericziIEEE_infinity_closure', dependency unresolved. See top entry above.\r\n\r\n\r\nByteCodeLink.lookupCE\r\nDuring interactive linking, GHCi couldn't find the following symbol:\r\n ieee754zm0zi8zi0zm7eecc33cf22b0ebf4d3c4dda98cc9f039432a266_NumericziIEEE_infinity_closure\r\nThis may be due to you not asking GHCi to load extra object files,\r\narchives or DLLs needed by your current session. Restart GHCi, specifying\r\nthe missing library using the -L/path/to/object/dir and -lmissinglibname\r\nflags, or simply by naming the relevant files on the GHCi command line.\r\nAlternatively, this link failure might indicate a bug in GHCi.\r\nIf you suspect the latter, please send a bug report to:\r\n glasgow-haskell-bugs@haskell.org\r\n}}}\r\n\r\nThis occurs with both cabal-install 2.4.0.0 and HEAD. This does not occur if I install ieee754 into a sandbox and use `cabal repl`. It also works correctly on Ubuntu 18.04 (on both WSL and a full installation), so it looks like a Windows-specific problem.","type_of_failure":"OtherFailure","blocking":[]} -->8.6.3https://gitlab.haskell.org/ghc/ghc/-/issues/15886Spurious warning about incomplete pattern with PatternSynonyms2019-07-07T18:02:34ZselingerSpurious warning about incomplete pattern with PatternSynonyms```hs
{-# LANGUAGE ViewPatterns #-}
{-# LANGUAGE PatternSynonyms #-}
module Test where
f :: Int -> Bool
f (id -> a) = True
pattern X a <- (id -> a)
g :: Int -> Bool
g (X a) = True
```
When compiling with -Wincomplete-patterns, this ...```hs
{-# LANGUAGE ViewPatterns #-}
{-# LANGUAGE PatternSynonyms #-}
module Test where
f :: Int -> Bool
f (id -> a) = True
pattern X a <- (id -> a)
g :: Int -> Bool
g (X a) = True
```
When compiling with -Wincomplete-patterns, this code produces an (incorrect) warning for `g`, but not for `f`. The only difference is that `g` uses a pattern synonym.
```
K.hs:12:1: warning: [-Wincomplete-patterns]
Pattern match(es) are non-exhaustive
In an equation for ‘g’: Patterns not matched: _
|
12 | g (X a) = True
| ^^^^^^^^^^^^^^
```
<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":"Spurious warning about incomplete pattern with PatternSynonyms","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"8.6.3","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.6.1","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"{{{#!hs\r\n{-# LANGUAGE ViewPatterns #-}\r\n{-# LANGUAGE PatternSynonyms #-}\r\n\r\nmodule Test where\r\n\r\nf :: Int -> Bool\r\nf (id -> a) = True\r\n\r\npattern X a <- (id -> a)\r\n\r\ng :: Int -> Bool\r\ng (X a) = True\r\n}}}\r\n\r\nWhen compiling with -Wincomplete-patterns, this code produces an (incorrect) warning for `g`, but not for `f`. The only difference is that `g` uses a pattern synonym.\r\n\r\n{{{\r\nK.hs:12:1: warning: [-Wincomplete-patterns]\r\n Pattern match(es) are non-exhaustive\r\n In an equation for ‘g’: Patterns not matched: _\r\n |\r\n12 | g (X a) = True\r\n | ^^^^^^^^^^^^^^\r\n}}}","type_of_failure":"OtherFailure","blocking":[]} -->8.6.3https://gitlab.haskell.org/ghc/ghc/-/issues/15884Completeness of View Patterns With a Complete Set of Output Patterns2023-07-31T10:31:25ZShayan-NajdCompleteness of View Patterns With a Complete Set of Output PatternsFor example, the code
```hs
{-# OPTIONS_GHC -Wall #-}
{-# LANGUAGE ViewPatterns #-}
f :: Maybe a -> Bool
f (id->Nothing) = False
f (id->(Just _)) = True
```
mistakenly returns the warning
```
warning: [-Wincomplete-patterns]
Patt...For example, the code
```hs
{-# OPTIONS_GHC -Wall #-}
{-# LANGUAGE ViewPatterns #-}
f :: Maybe a -> Bool
f (id->Nothing) = False
f (id->(Just _)) = True
```
mistakenly returns the warning
```
warning: [-Wincomplete-patterns]
Pattern match(es) are non-exhaustive
In an equation for ‘f’: Patterns not matched: _
|
4 | f (id->Nothing) = False
| ^^^^^^^^^^^^^^^^^^^^^^^^...
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | -------------- |
| Version | 8.6.2 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | alanz, bgamari |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Completeness of View Patterns With a Complete Set of Output Patterns","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"8.6.3","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.6.2","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":["alanz","bgamari"],"type":"Bug","description":"For example, the code\r\n\r\n{{{#!hs\r\n{-# OPTIONS_GHC -Wall #-}\r\n{-# LANGUAGE ViewPatterns #-}\r\nf :: Maybe a -> Bool\r\nf (id->Nothing) = False\r\nf (id->(Just _)) = True\r\n}}}\r\n\r\nmistakenly returns the warning\r\n\r\n{{{\r\nwarning: [-Wincomplete-patterns]\r\n Pattern match(es) are non-exhaustive\r\n In an equation for ‘f’: Patterns not matched: _\r\n |\r\n4 | f (id->Nothing) = False\r\n | ^^^^^^^^^^^^^^^^^^^^^^^^...\r\n}}}\r\n\r\n\r\n\r\n","type_of_failure":"OtherFailure","blocking":[]} -->8.6.3https://gitlab.haskell.org/ghc/ghc/-/issues/15881GHC Panic: data A n (a :: n) :: a -> Type2019-07-07T18:02:35ZIcelandjackGHC Panic: data A n (a :: n) :: a -> Type```hs
{-# Language KindSignatures #-}
{-# Language PolyKinds #-}
import Data.Kind
data A n (a :: n) :: a -> Type
```
causes a panic on 8.7.20181017
```
$ ~/code/headghc/inplace/bin/ghc-stage2 --interactive -ignore-dot-ghci 665_b...```hs
{-# Language KindSignatures #-}
{-# Language PolyKinds #-}
import Data.Kind
data A n (a :: n) :: a -> Type
```
causes a panic on 8.7.20181017
```
$ ~/code/headghc/inplace/bin/ghc-stage2 --interactive -ignore-dot-ghci 665_bug.hs
GHCi, version 8.7.20181017: http://www.haskell.org/ghc/ :? for help
[1 of 1] Compiling Main ( 665_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_a1xR}
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
>
```
and an assertion failure in 8.7.20181029
```
$ ~/code/unmodifiedghc/inplace/bin/ghc-stage2 --interactive -ignore-dot-ghci 665_bug.hs
GHCi, version 8.7.20181029: http://www.haskell.org/ghc/ :? for help
[1 of 1] Compiling Main ( 665_bug.hs, interpreted )
*** Exception: ASSERT failed! file compiler/types/TyCon.hs, line 420
>
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.6.2 |
| 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: data A n (a :: n) :: a -> Type","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"8.6.3","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.6.2","keywords":["TypeInType"],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"{{{#!hs\r\n{-# Language KindSignatures #-}\r\n{-# Language PolyKinds #-}\r\n\r\nimport Data.Kind\r\n\r\ndata A n (a :: n) :: a -> Type\r\n}}}\r\n\r\ncauses a panic on 8.7.20181017\r\n\r\n{{{\r\n$ ~/code/headghc/inplace/bin/ghc-stage2 --interactive -ignore-dot-ghci 665_bug.hs\r\nGHCi, version 8.7.20181017: http://www.haskell.org/ghc/ :? for help\r\n[1 of 1] Compiling Main ( 665_bug.hs, interpreted )\r\nghc-stage2: panic! (the 'impossible' happened)\r\n (GHC version 8.7.20181017 for x86_64-unknown-linux):\r\n\tASSERT failed!\r\n Type-correct unfilled coercion hole {co_a1xR}\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/TcHsSyn.hs:1805:99 in ghc:TcHsSyn\r\n\r\nPlease report this as a GHC bug: http://www.haskell.org/ghc/reportabug\r\n\r\n>\r\n}}}\r\n\r\nand an assertion failure in 8.7.20181029\r\n{{{\r\n$ ~/code/unmodifiedghc/inplace/bin/ghc-stage2 --interactive -ignore-dot-ghci 665_bug.hs\r\nGHCi, version 8.7.20181029: http://www.haskell.org/ghc/ :? for help\r\n[1 of 1] Compiling Main ( 665_bug.hs, interpreted )\r\n*** Exception: ASSERT failed! file compiler/types/TyCon.hs, line 420\r\n>\r\n}}}","type_of_failure":"OtherFailure","blocking":[]} -->8.6.3https://gitlab.haskell.org/ghc/ghc/-/issues/15879Make UniqDSet a newtype2019-07-07T18:02:36ZSebastian GrafMake UniqDSet a newtypeFor the same reasons as in #13114 and [D3146](https://phabricator.haskell.org/D3146) we should make `UniqDSet` a newtype of `UniqDFM`.
I wonder if we can also have a prettier `Outputable` instance this way.
<details><summary>Trac metad...For the same reasons as in #13114 and [D3146](https://phabricator.haskell.org/D3146) we should make `UniqDSet` a newtype of `UniqDFM`.
I wonder if we can also have a prettier `Outputable` instance this way.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.6.2 |
| Type | Task |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Make UniqDSet a newtype","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"8.6.3","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.6.2","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Task","description":"For the same reasons as in #13114 and Phab:D3146 we should make `UniqDSet` a newtype of `UniqDFM`.\r\n\r\nI wonder if we can also have a prettier `Outputable` instance this way.","type_of_failure":"OtherFailure","blocking":[]} -->8.6.3https://gitlab.haskell.org/ghc/ghc/-/issues/15875Detection of ranlib by binary distribution is broken2019-07-07T18:02:37ZBen GamariDetection of ranlib by binary distribution is brokenThe `configure` shipped with binary distributions fails to set `RanlibCmd` which therefore means that we end up installing `settings` with an empty `ranlib command` configuration field.
<details><summary>Trac metadata</summary>
| Trac ...The `configure` shipped with binary distributions fails to set `RanlibCmd` which therefore means that we end up installing `settings` with an empty `ranlib command` configuration field.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.6.2 |
| 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":"Detection of ranlib by binary distribution is broken","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"8.6.3","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.6.2","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"The `configure` shipped with binary distributions fails to set `RanlibCmd` which therefore means that we end up installing `settings` with an empty `ranlib command` configuration field.","type_of_failure":"OtherFailure","blocking":[]} -->8.6.3https://gitlab.haskell.org/ghc/ghc/-/issues/15866libiserv's version number is hard-coded2020-09-28T07:11:37ZRyan Scottlibiserv's version number is hard-codedI recently discovered that GHC 8.6.2 was shipped with `libiserv-8.6.1`. Yes, you read that correctly—8.6.1, not 8.6.2. I was baffled at how this could possibly happen until I realized that we hard-code the version number for `libiserv` d...I recently discovered that GHC 8.6.2 was shipped with `libiserv-8.6.1`. Yes, you read that correctly—8.6.1, not 8.6.2. I was baffled at how this could possibly happen until I realized that we hard-code the version number for `libiserv` directly in its `.cabal` file.
Needless to say, this is quite easy to forget to update. Let's let `autoconf` do the hard work for us and use `@ProjectVersionMunged@` instead.
<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":"libiserv's version number is hard-coded","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":"I recently discovered that GHC 8.6.2 was shipped with `libiserv-8.6.1`. Yes, you read that correctly—8.6.1, not 8.6.2. I was baffled at how this could possibly happen until I realized that we hard-code the version number for `libiserv` directly in its `.cabal` file.\r\n\r\nNeedless to say, this is quite easy to forget to update. Let's let `autoconf` do the hard work for us and use `@ProjectVersionMunged@` instead.","type_of_failure":"OtherFailure","blocking":[]} -->8.6.3https://gitlab.haskell.org/ghc/ghc/-/issues/15859Dependent quantification, GHC panic2019-07-07T18:02:41ZIcelandjackDependent quantification, GHC panicWhile exploring [Ryan's gist for term-level](https://gist.github.com/RyanGlScott/ded669b5ae3db1ce38c4b6021f144776) `f :: forall a -> a -> Type`.
```hs
{-# Language PolyKinds #-}
{-# Language TypeApplications #-}
{-# Language ...While exploring [Ryan's gist for term-level](https://gist.github.com/RyanGlScott/ded669b5ae3db1ce38c4b6021f144776) `f :: forall a -> a -> Type`.
```hs
{-# Language PolyKinds #-}
{-# Language TypeApplications #-}
{-# Language ImpredicativeTypes #-}
import Data.Kind
data A k :: k -> Type
f :: KindOf A
f a = undefined
type KindOf (a :: k) = k
a = f @Int
```
gives
```
$ ~/code/unmodifiedghc/inplace/bin/ghc-stage2 --interactive -ignore-dot-ghci 630_bug.hs
GHCi, version 8.7.20181029: http://www.haskell.org/ghc/ :? for help
[1 of 1] Compiling Main ( 630_bug.hs, interpreted )
ghc-stage2: panic! (the 'impossible' happened)
(GHC version 8.7.20181029 for x86_64-unknown-linux):
ASSERT failed!
KindOf A
forall k -> k -> *
k_a1xQ[sk:0]
k_a1xQ[sk:0] -> *
k_a1xQ[sk:0]
[req]
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/TcExpr.hs:1336:94 in ghc:TcExpr
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":"Dependent quantification, GHC panic","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.6.1","keywords":["TypeInType"],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"While exploring [https://gist.github.com/RyanGlScott/ded669b5ae3db1ce38c4b6021f144776 Ryan's gist for term-level] `f :: forall a -> a -> Type`.\r\n\r\n{{{#!hs\r\n{-# Language PolyKinds #-}\r\n{-# Language TypeApplications #-}\r\n{-# Language ImpredicativeTypes #-}\r\n\r\nimport Data.Kind\r\n\r\ndata A k :: k -> Type\r\n\r\nf :: KindOf A\r\nf a = undefined\r\n\r\ntype KindOf (a :: k) = k\r\n\r\na = f @Int\r\n}}}\r\n\r\ngives \r\n\r\n{{{\r\n$ ~/code/unmodifiedghc/inplace/bin/ghc-stage2 --interactive -ignore-dot-ghci 630_bug.hs\r\nGHCi, version 8.7.20181029: http://www.haskell.org/ghc/ :? for help\r\n[1 of 1] Compiling Main ( 630_bug.hs, interpreted )\r\nghc-stage2: panic! (the 'impossible' happened)\r\n (GHC version 8.7.20181029 for x86_64-unknown-linux):\r\n ASSERT failed!\r\n KindOf A\r\n forall k -> k -> *\r\n k_a1xQ[sk:0]\r\n k_a1xQ[sk:0] -> *\r\n k_a1xQ[sk:0]\r\n [req]\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/TcExpr.hs:1336:94 in ghc:TcExpr\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.6.3https://gitlab.haskell.org/ghc/ghc/-/issues/15715problematic openFile with named pipes2019-07-07T18:03:19Zadpproblematic openFile with named pipes- while `openFile`'ng named pipes for `ReadMode` works fine, on `WriteMode` or `AppendMode` it throws `openFile: does not exist (No such device or address)`; and on `WriteReadMode`, it opens it, but seem not able to write to it (the proc...- while `openFile`'ng named pipes for `ReadMode` works fine, on `WriteMode` or `AppendMode` it throws `openFile: does not exist (No such device or address)`; and on `WriteReadMode`, it opens it, but seem not able to write to it (the process hearing on the other side didn't hear anything).
- `writeFile` and `appendFile` works though.
- using stack `resolver: lts-12.4`, on ubuntu 16.04 LTS
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------------------ |
| Version | 8.4.3 |
| Type | Bug |
| TypeOfFailure | IncorrectResultAtRuntime |
| Priority | normal |
| Resolution | Unresolved |
| Component | libraries/base |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"problematic openFile with named pipes","status":"New","operating_system":"","component":"libraries/base","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.4.3","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"- while `openFile`'ng named pipes for `ReadMode` works fine, on `WriteMode` or `AppendMode` it throws `openFile: does not exist (No such device or address)`; and on `WriteReadMode`, it opens it, but seem not able to write to it (the process hearing on the other side didn't hear anything).\r\n\r\n- `writeFile` and `appendFile` works though.\r\n\r\n- using stack `resolver: lts-12.4`, on ubuntu 16.04 LTS\r\n","type_of_failure":"IncorrectResultAtRuntime","blocking":[]} -->8.6.3https://gitlab.haskell.org/ghc/ghc/-/issues/15633Type-checker plugins aren't loaded in GHCi 8.6.12019-07-07T18:03:39ZOleg GrenrusType-checker plugins aren't loaded in GHCi 8.6.1Type-Checker plugins seem to work in GHCi-8.4.3 https://gist.github.com/phadej/f2040eba327a88d3652cda021403f97f
However with GHC-8.6.1
The Glorious Glasgow Haskell Compilation System, version 8.6.0.20180907
76a233143f1ec940f342ce3ce3af...Type-Checker plugins seem to work in GHCi-8.4.3 https://gist.github.com/phadej/f2040eba327a88d3652cda021403f97f
However with GHC-8.6.1
The Glorious Glasgow Haskell Compilation System, version 8.6.0.20180907
76a233143f1ec940f342ce3ce3afaf306923b392 (which seems to be the last commit in 8.6 branch atm)
the plugins aren't loaded.
```
% ghci-8.6.1 -fplugin=ThereIsNoPlugin
GHCi, version 8.6.0.20180907: http://www.haskell.org/ghc/ :? for help
Loaded GHCi configuration from /home/ogre/.ghci
λ>
```
starts a session without a warning. 8.4.3 however fails:
```
% ghci-8.4.3 -fplugin=ThereIsNoPlugin
GHCi, version 8.4.3: http://www.haskell.org/ghc/ :? for help
<command line>: Could not find module ‘ThereIsNoPlugin’
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.6.1-beta1 |
| 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":"Type-checker plugins aren't loaded in 8.6.1","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"8.6.1","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.6.1-beta1","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"Type-Checker plugins seem to work in GHCi-8.4.3 https://gist.github.com/phadej/f2040eba327a88d3652cda021403f97f\r\n\r\nHowever with GHC-8.6.1\r\n\r\nThe Glorious Glasgow Haskell Compilation System, version 8.6.0.20180907\r\n76a233143f1ec940f342ce3ce3afaf306923b392 (which seems to be the last commit in 8.6 branch atm)\r\n\r\nthe plugins aren't loaded.\r\n\r\n{{{\r\n% ghci-8.6.1 -fplugin=ThereIsNoPlugin\r\nGHCi, version 8.6.0.20180907: http://www.haskell.org/ghc/ :? for help\r\nLoaded GHCi configuration from /home/ogre/.ghci\r\nλ> \r\n}}}\r\n\r\nstarts a session without a warning. 8.4.3 however fails:\r\n\r\n{{{\r\n% ghci-8.4.3 -fplugin=ThereIsNoPlugin\r\nGHCi, version 8.4.3: http://www.haskell.org/ghc/ :? for help\r\n<command line>: Could not find module ‘ThereIsNoPlugin’\r\n}}}","type_of_failure":"OtherFailure","blocking":[]} -->8.6.3https://gitlab.haskell.org/ghc/ghc/-/issues/15608Segfault in retainer profiling2019-07-07T18:03:45ZÖmer Sinan AğacanSegfault in retainer profilingTo reproduce, build ghc using "prof" flavor, then
```
$ ghc-stage2 --interactive +RTS -hr
GHCi, version 8.7.20180905: http://www.haskell.org/ghc/ :? for help
Loaded GHCi configuration from /home/omer/rcbackup/.ghci
λ:1> sequence_ (repl...To reproduce, build ghc using "prof" flavor, then
```
$ ghc-stage2 --interactive +RTS -hr
GHCi, version 8.7.20180905: http://www.haskell.org/ghc/ :? for help
Loaded GHCi configuration from /home/omer/rcbackup/.ghci
λ:1> sequence_ (replicate 100000000 (return ()))
zsh: segmentation fault (core dumped) ghc-stage2 --interactive +RTS -hr
```
If I use debug runtime in stage2 compiler I can't even run the repl:
```
haskell $ ghc-stage2 --interactive +RTS -hr
rr: Saving execution to trace directory `/home/omer/.local/share/rr/ghc-stage2-13'.
GHCi, version 8.7.20180906: http://www.haskell.org/ghc/ :? for help
zsh: segmentation fault ghc-stage2 --interactive +RTS -hr
```8.6.3