GHC issueshttps://gitlab.haskell.org/ghc/ghc/-/issues2021-10-12T06:43:31Zhttps://gitlab.haskell.org/ghc/ghc/-/issues/20198hadrian install creates symlinks pointing to `_build` directory2021-10-12T06:43:31ZTeo Camarasuhadrian install creates symlinks pointing to `_build` directory## Summary
When using `hadrian/build install --prefix=<prefix>`, we end up with absolute symlinks pointing from unversioned executables to versioned ones. These symlinks are created in relation to the `_build` directory. This makes buil...## Summary
When using `hadrian/build install --prefix=<prefix>`, we end up with absolute symlinks pointing from unversioned executables to versioned ones. These symlinks are created in relation to the `_build` directory. This makes build outputs dependent on the existence of `_build`. So, they break when `install` copies these files elsewhere and the `_build` directory is later removed.
I encountered this in the context of building ghc with nix using a slightly modified version of https://gitlab.haskell.org/bgamari/ghcs-nix/-/blob/hadrian/hadrian.nix
This seems to be introduced by f481c1890066b4dac78d981ca680fb01cfff9a11
My guess is that the fix is to change https://gitlab.haskell.org/ghc/ghc/-/blob/f481c1890066b4dac78d981ca680fb01cfff9a11/hadrian/src/Rules/BinaryDist.hs#L166
such that we create a relative symlink rather than an absolute one.
## Steps to reproduce
1. Build ghc HEAD using hadrian
2. Install ghc somewhere using `hadrian/build install --prefix=<prefix>`
3. delete `_build`
4. try `<prefix>/bin/ghc --version`. You will get an error that looks like this:
```
bin/ghc: line 10: /nix/store/bq04dr93g6a87g4wkrxhpwcphpnan4cg-ghc-9.3.0/lib/ghc-9.3.20210802/bin/ghc: No such file or directory
```
Looking at the ghc exe with `ls -l` gives:
```
lrwxrwxrwx 3 teo teo 84 Jan 1 1970 ghc -> /build/ghc/_build/bindist/ghc-9.3.20210802-x86_64-unknown-linux/bin/ghc-9.3.20210802
```
## Expected behavior
`ghc --version` should run successfully
## Environment
* GHC version used: ghc-9.3.20210802
Optional:
* Operating System: Linux
* System Architecture: x86_64Matthew PickeringMatthew Pickeringhttps://gitlab.haskell.org/ghc/ghc/-/issues/20212`runInjectRPaths` fails when space in the rpath2021-10-12T06:43:31ZMatthew Pickering`runInjectRPaths` fails when space in the rpathThe parsing function assumes there's no spaces in the rpath entry. If there are spaces you get errors like:
```
Stderr ( T14304 ):
Warning: -rtsopts and -with-rtsopts have no effect with -shared.
Call hs_init_ghc() from your main() ...The parsing function assumes there's no spaces in the rpath entry. If there are spaces you get errors like:
```
Stderr ( T14304 ):
Warning: -rtsopts and -with-rtsopts have no effect with -shared.
Call hs_init_ghc() from your main() function to set these options.
error: /nix/store/a6j5761iy238pbckxq2xrhqr2d5kra4m-cctools-binutils-darwin-949.0.1/bin/install_name_tool: for: dist/build/libHSp-0.1-ghc8.10.6.dylib (for architecture arm64) option "-add_rpath /Users/matt/ghc/bindisttest/install dir/lib/ghc-8.10.6/ghc-prim-0.6.1" would duplicate path, file already has LC_RPATH for: /Users/matt/ghc/bindisttest/install dir/lib/ghc-8.10.6/ghc-prim-0.6.1
`install_name_tool' failed in phase `Install Name Tool'. (Exit code: 1)
```
because the logic fails to detect the library is already in the rpath.Matthew PickeringMatthew Pickeringhttps://gitlab.haskell.org/ghc/ghc/-/issues/20254Darwin bindists do not install wrappers correctly2021-10-12T06:43:32ZMatthew PickeringDarwin bindists do not install wrappers correctlyWe are using `cp -P` to copy symlinks for the wrappers in to the correct place but on darwin this was following the symlink and copying the wrapper.
Apparently the `cp` utility on macs ignores `-P` unless `-R` is also passed so the fix...We are using `cp -P` to copy symlinks for the wrappers in to the correct place but on darwin this was following the symlink and copying the wrapper.
Apparently the `cp` utility on macs ignores `-P` unless `-R` is also passed so the fix is to pass both `-R and -P` on all platforms.
Worryingly CI is not affected by this, probably a result of #201319.2.1https://gitlab.haskell.org/ghc/ghc/-/issues/20166Make-based build fails entirely2021-10-12T18:00:40ZSimon Peyton JonesMake-based build fails entirelyAs of today, building GHC using the old make-based system fails entirely
```
bash$ sh validate --legacy --fast
using THREADS=21
make: Entering directory '/home/simonpj/code/HEAD/utils/checkUniques'
./check-uniques.py ../..
make: Leaving ...As of today, building GHC using the old make-based system fails entirely
```
bash$ sh validate --legacy --fast
using THREADS=21
make: Entering directory '/home/simonpj/code/HEAD/utils/checkUniques'
./check-uniques.py ../..
make: Leaving directory '/home/simonpj/code/HEAD/utils/checkUniques'
make --no-print-directory -f ghc.mk maintainer-clean CLEANING=YES
rts/ghc.mk:78: *** Target architecture has no native adjustor implementation. Stop.
make: *** [Makefile:166: maintainer-clean] Error 2
```
What should I do?
(I know I shouldn't be using --legacy but it still does things for me that hadrian doesn't.)https://gitlab.haskell.org/ghc/ghc/-/issues/197639.2 alpha2 and 8.10.5 fail to load ghci lib due to allocateWrite missing2021-10-14T13:51:44Zadam9.2 alpha2 and 8.10.5 fail to load ghci lib due to allocateWrite missingFails like:
```
ghc-stage2: <sanitised>/libraries/ghci/dist-install/build/HSghci-9.2.0.20210422.o: unknown symbol `allocateWrite'
ghc-stage2: Could not load Object Code <sanitised>/libraries/ghci/dist-install/build/HSghci-9.2.0.20210422...Fails like:
```
ghc-stage2: <sanitised>/libraries/ghci/dist-install/build/HSghci-9.2.0.20210422.o: unknown symbol `allocateWrite'
ghc-stage2: Could not load Object Code <sanitised>/libraries/ghci/dist-install/build/HSghci-9.2.0.20210422.o.
```
We build using make and crucially with `DYNAMIC_GHC_PROGRAMS=NO`. I suspect there's a missing export of `allocateWrite` in the RTS.8.10.6https://gitlab.haskell.org/ghc/ghc/-/issues/19571runhaskell is missing on Windows2021-10-22T20:32:30ZNeil Mitchellrunhaskell is missing on WindowsAfter installing GHC 9.0.1 via Chocolatey, it lacks `runhaskell`, but contains `runghc`. I also observe the same absence of `runhaskell` on GitHub CI actions (which might well be installing via Chocolatey, or a direct GHC install, I have...After installing GHC 9.0.1 via Chocolatey, it lacks `runhaskell`, but contains `runghc`. I also observe the same absence of `runhaskell` on GitHub CI actions (which might well be installing via Chocolatey, or a direct GHC install, I have no idea). I guess it's a problem with the upstream GHC distribution, but it could equally be a problem with the Chocolatey wrapping (I don't have time to investigate that).
It was present with GHC 8.10.3, which is otherwise the most recent GHC on my machine.9.0.2Ben GamariBen Gamarihttps://gitlab.haskell.org/ghc/ghc/-/issues/20576Hadrian's C dependency file rules are nonsense2021-10-29T18:34:58ZBen GamariHadrian's C dependency file rules are nonsenseHadrian's dependency file rules for C files appears to be utter nonsense, which breaks some newer C compilers. Specifically,
```
| Run Cc FindCDependencies Stage0: utils/unlit/fs.c => _build/stage0/utils/unlit/build/c/fs.o.d
gcc: warning...Hadrian's dependency file rules for C files appears to be utter nonsense, which breaks some newer C compilers. Specifically,
```
| Run Cc FindCDependencies Stage0: utils/unlit/fs.c => _build/stage0/utils/unlit/build/c/fs.o.d
gcc: warning: c: linker input file unused because linking not done
gcc: error: c: linker input file not found: No such file or directory
<command line>: does not exist: /tmp/2848417-92.c
Error when running Shake build system:
at action, called at src/Rules.hs:40:19 in main:Rules
at need, called at src/Rules.hs:62:5 in main:Rules
* Depends on: _build/stage0/lib/bin/unlit
at need, called at src/Rules/Program.hs:125:5 in main:Rules.Program
* Depends on: _build/stage0/utils/unlit/build/c/fs.o
at cmd', called at src/Builder.hs:322:23 in main:Builder
at cmd, called at src/Builder.hs:424:8 in main:Builder
* Raised the exception:
Development.Shake.cmd, system command failed
Command line: /usr/bin/gcc -E -MM -MG -MF _build/stage0/utils/unlit/build/c/fs.o.d -MT _build/stage0/utils/unlit/build/c/fs.o -I_build/stage0/lib -I_build/stage0/utils/unlit/build -I -x c utils/unlit/fs.c
Exit code: 1
```
Notice that in the command line we are passing the path of an object file despite the fact that we are invoking `gcc` in `-M` mode. GCC is quite right to complain about this.Make removalhttps://gitlab.haskell.org/ghc/ghc/-/issues/5748ghci segfault on OS X after dlsym failed lookup2021-11-02T09:27:29Zgwright@antiope.comghci segfault on OS X after dlsym failed lookupI've had repeatable segfaults with ghci 7.2.2 (OS X 10.6) and 7.0.4 (OS X 10.7 and 10.6). The immediate cause is a failed lookup of an external symbol in `rts/Linker.c`. The failure is not detected and the NULL value returned is eventual...I've had repeatable segfaults with ghci 7.2.2 (OS X 10.6) and 7.0.4 (OS X 10.7 and 10.6). The immediate cause is a failed lookup of an external symbol in `rts/Linker.c`. The failure is not detected and the NULL value returned is eventually dereferenced, leading to a segfault. The underlying bug is still present in HEAD.
This is what happens:
```
gwright-macbook> ghci -v Test.hs
GHCi, version 7.2.2: http://www.haskell.org/ghc/ :? for help
Glasgow Haskell Compiler, Version 7.2.2, stage 2 booted by GHC version 7.0.4
Using binary package database: /usr/local/lib/ghc-7.2.2/package.conf.d/package.cache
Using binary package database: /Users/gwright/.ghc/x86_64-darwin-7.2.2/package.conf.d/package.cache
hiding package Cabal-1.12.0 to avoid conflict with later version Cabal-1.13.3
wired-in package ghc-prim mapped to ghc-prim-0.2.0.0-14e0c022e5d4efa3a40ab5991f2b2a1b
wired-in package integer-gmp mapped to integer-gmp-0.3.0.0-2e2b0fd56be1a5f60c50913e615691d9
wired-in package base mapped to base-4.4.1.0-5ca60b2acbb66fd59e5f81685cb72740
wired-in package rts mapped to builtin_rts
wired-in package template-haskell mapped to template-haskell-2.6.0.0-e7db5d1205f362bb792ab7bd5c7bbfae
wired-in package dph-seq not found.
wired-in package dph-par not found.
Hsc static flags: -static
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Loading package ffi-1.0 ... linking ... done.
*** Chasing dependencies:
Chasing modules from:
Stable obj: []
Stable BCO: []
unload: retaining objs []
unload: retaining bcos []
Ready for upsweep []
Upsweep completely successful.
*** Deleting temp files:
Deleting:
*** Chasing dependencies:
Chasing modules from: *Test.hs
Stable obj: []
Stable BCO: []
unload: retaining objs []
unload: retaining bcos []
Ready for upsweep
[NONREC
ModSummary {
ms_hs_date = Sun Jan 1 18:20:14 EST 2012
ms_mod = main:Main,
ms_textual_imps = [import Prelude,
import Math.Symbolic.Wheeler.TensorUtilities,
import Math.Symbolic.Wheeler.TensorBasics,
import Math.Symbolic.Wheeler.Tensor,
import Math.Symbolic.Wheeler.IO,
import Math.Symbolic.Wheeler.Symbol,
import Math.Symbolic.Wheeler.Numeric,
import Math.Symbolic.Wheeler.Expr,
import Math.Symbolic.Wheeler.Commutativity,
import Math.Symbolic.Wheeler.Canonicalize,
import Math.Symbolic.Wheeler.Basic, import Data.Ratio,
import Data.Maybe]
ms_srcimps = []
}]
*** Deleting temp files:
Deleting:
compile: input file Test.hs
Created temporary directory: /var/folders/4j/4jmo0VgVHgu2WNrlXKFTB++++TI/-Tmp-/ghc61560_1
*** Checking old interface for main:Main:
[1 of 1] Compiling Main ( Test.hs, interpreted )
*** Parser:
*** Renamer/typechecker:
*** Desugar:
Result size of Desugar = 788
*** Simplifier:
Result size of Simplifier iteration=1 = 800
Result size of Simplifier = 788
*** Tidy Core:
Result size of Tidy Core = 788
*** CorePrep:
Result size of CorePrep = 1010
*** ByteCodeGen:
Upsweep completely successful.
*** Deleting temp files:
Deleting: /var/folders/4j/4jmo0VgVHgu2WNrlXKFTB++++TI/-Tmp-/ghc61560_1/ghc61560_0.c /var/folders/4j/4jmo0VgVHgu2WNrlXKFTB++++TI/-Tmp-/ghc61560_1/ghc61560_0.o
Warning: deleting non-existent /var/folders/4j/4jmo0VgVHgu2WNrlXKFTB++++TI/-Tmp-/ghc61560_1/ghc61560_0.c
Warning: deleting non-existent /var/folders/4j/4jmo0VgVHgu2WNrlXKFTB++++TI/-Tmp-/ghc61560_1/ghc61560_0.o
Ok, modules loaded: Main.
*Main> x
*** Parser:
*** Desugar:
*** Simplify:
*** CorePrep:
*** ByteCodeGen:
Loading package bytestring-0.9.2.0 ... linking ... done.
Loading package transformers-0.2.2.0 ... linking ... done.
Loading package mtl-2.0.1.0 ... linking ... done.
Loading package array-0.3.0.3 ... linking ... done.
Loading package deepseq-1.2.0.1 ... linking ... done.
Loading package text-0.11.1.12 ... linking ... done.
Loading package parsec-3.1.2 ... linking ... done.
Loading package uniqueid-0.1.1 ... linking ... done.
Loading package Wheeler-0.1 ... linking ... done.
Segmentation fault
gwright-macbook>
```
The program is trying to display a record type (the variable "x"). The record type has a Show instance associated with it, and that is apparently not being resolved correctly, leading to a NULL dereference and a segfault.
The problem is isolated to OS X as far as I can tell. The code responsible for the error is in the function `relocateSection`:
```
else if(reloc->r_extern)
{
struct nlist *symbol = &nlist[reloc->r_symbolnum];
char *nm = image + symLC->stroff + symbol->n_un.n_strx;
IF_DEBUG(linker, debugBelch("relocateSection: looking up external symbol %s\n", nm));
IF_DEBUG(linker, debugBelch(" : type = %d\n", symbol->n_type));
IF_DEBUG(linker, debugBelch(" : sect = %d\n", symbol->n_sect));
IF_DEBUG(linker, debugBelch(" : desc = %d\n", symbol->n_desc));
IF_DEBUG(linker, debugBelch(" : value = %p\n", (void *)symbol->n_value));
if ((symbol->n_type & N_TYPE) == N_SECT) {
value = relocateAddress(oc, nSections, sections,
symbol->n_value);
IF_DEBUG(linker, debugBelch("relocateSection, defined external symbol %s, relocated address %p\n", nm, (void *)value));
}
else {
value = (uint64_t) lookupSymbol(nm);
IF_DEBUG(linker, debugBelch("relocateSection: external symbol %s, address %p\n", nm, (void *)value));
}
}
```
The returned value from `lookupSymbol` is not checked for failure.
A simple check for NULL and a call to `errorBelch` is all that's needed to fix this. There's another place where the return value from `lookupSymbol` is not checked and it should be fixed similarly.
In a bit more detail, the program "Test.hs" I was loading does some simple tests on a library. I admit to having been sloppy while sorting out the module exports, but the library compiles without warnings when -Wall is set. The library has a top-level module that re-exports the most commonly used symbols, but the test program doesn't use it, importing all of the modules it needs explicitly. Am I doing something that is known to be dangerous?
The failed symbol lookup is
```
lookupSymbol: looking up _Wheelerzm0zi1_MathziSymbolicziWheelerziSimpleSymbol_zdfShowSzuzdcshowsPrec_closure
```
which is the Show instance for a `SimpleSymbol` data type. (The library implements a symbolic algebra DSL.) The symbol is undefined in the object module:
```
gwright-macbook> nm HSWheeler-0.1.o | grep "_Wheelerzm0zi1_MathziSymbolicziWheelerziSimpleSymbol_zdfShowSzuzdcshowsPrec_closure"
U _Wheelerzm0zi1_MathziSymbolicziWheelerziSimpleSymbol_zdfShowSzuzdcshowsPrec_closure
gwright-macbook>
```
so some sort of failure is expected when I try to show something of the `SimpleSymbol` type.
I'm puzzled that the first indication of failure is a segfault, or, after I patch `rts/Linker.c`, an error from deep inside the linker. It seems that there is something else going wrong which ought to generate a warning at least.
I will generate a patch against HEAD to check for the failed symbol lookups; it would be good if it were included in the final 7.4.1.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 7.2.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | GHCi |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"ghci segfault on OS X after dlsym failed lookup","status":"New","operating_system":"","component":"GHCi","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.2.1","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"I've had repeatable segfaults with ghci 7.2.2 (OS X 10.6) and 7.0.4 (OS X 10.7 and 10.6). The immediate cause is a failed lookup of an external symbol in {{{rts/Linker.c}}}. The failure is not detected and the NULL value returned is eventually dereferenced, leading to a segfault. The underlying bug is still present in HEAD.\r\n\r\nThis is what happens:\r\n{{{\r\ngwright-macbook> ghci -v Test.hs\r\nGHCi, version 7.2.2: http://www.haskell.org/ghc/ :? for help\r\nGlasgow Haskell Compiler, Version 7.2.2, stage 2 booted by GHC version 7.0.4\r\nUsing binary package database: /usr/local/lib/ghc-7.2.2/package.conf.d/package.cache\r\nUsing binary package database: /Users/gwright/.ghc/x86_64-darwin-7.2.2/package.conf.d/package.cache\r\nhiding package Cabal-1.12.0 to avoid conflict with later version Cabal-1.13.3\r\nwired-in package ghc-prim mapped to ghc-prim-0.2.0.0-14e0c022e5d4efa3a40ab5991f2b2a1b\r\nwired-in package integer-gmp mapped to integer-gmp-0.3.0.0-2e2b0fd56be1a5f60c50913e615691d9\r\nwired-in package base mapped to base-4.4.1.0-5ca60b2acbb66fd59e5f81685cb72740\r\nwired-in package rts mapped to builtin_rts\r\nwired-in package template-haskell mapped to template-haskell-2.6.0.0-e7db5d1205f362bb792ab7bd5c7bbfae\r\nwired-in package dph-seq not found.\r\nwired-in package dph-par not found.\r\nHsc static flags: -static\r\nLoading package ghc-prim ... linking ... done.\r\nLoading package integer-gmp ... linking ... done.\r\nLoading package base ... linking ... done.\r\nLoading package ffi-1.0 ... linking ... done.\r\n*** Chasing dependencies:\r\nChasing modules from: \r\nStable obj: []\r\nStable BCO: []\r\nunload: retaining objs []\r\nunload: retaining bcos []\r\nReady for upsweep []\r\nUpsweep completely successful.\r\n*** Deleting temp files:\r\nDeleting: \r\n*** Chasing dependencies:\r\nChasing modules from: *Test.hs\r\nStable obj: []\r\nStable BCO: []\r\nunload: retaining objs []\r\nunload: retaining bcos []\r\nReady for upsweep\r\n [NONREC\r\n ModSummary {\r\n ms_hs_date = Sun Jan 1 18:20:14 EST 2012\r\n ms_mod = main:Main,\r\n ms_textual_imps = [import Prelude,\r\n import Math.Symbolic.Wheeler.TensorUtilities,\r\n import Math.Symbolic.Wheeler.TensorBasics,\r\n import Math.Symbolic.Wheeler.Tensor,\r\n import Math.Symbolic.Wheeler.IO,\r\n import Math.Symbolic.Wheeler.Symbol,\r\n import Math.Symbolic.Wheeler.Numeric,\r\n import Math.Symbolic.Wheeler.Expr,\r\n import Math.Symbolic.Wheeler.Commutativity,\r\n import Math.Symbolic.Wheeler.Canonicalize,\r\n import Math.Symbolic.Wheeler.Basic, import Data.Ratio,\r\n import Data.Maybe]\r\n ms_srcimps = []\r\n }]\r\n*** Deleting temp files:\r\nDeleting: \r\ncompile: input file Test.hs\r\nCreated temporary directory: /var/folders/4j/4jmo0VgVHgu2WNrlXKFTB++++TI/-Tmp-/ghc61560_1\r\n*** Checking old interface for main:Main:\r\n[1 of 1] Compiling Main ( Test.hs, interpreted )\r\n*** Parser:\r\n*** Renamer/typechecker:\r\n*** Desugar:\r\nResult size of Desugar = 788\r\n*** Simplifier:\r\nResult size of Simplifier iteration=1 = 800\r\nResult size of Simplifier = 788\r\n*** Tidy Core:\r\nResult size of Tidy Core = 788\r\n*** CorePrep:\r\nResult size of CorePrep = 1010\r\n*** ByteCodeGen:\r\nUpsweep completely successful.\r\n*** Deleting temp files:\r\nDeleting: /var/folders/4j/4jmo0VgVHgu2WNrlXKFTB++++TI/-Tmp-/ghc61560_1/ghc61560_0.c /var/folders/4j/4jmo0VgVHgu2WNrlXKFTB++++TI/-Tmp-/ghc61560_1/ghc61560_0.o\r\nWarning: deleting non-existent /var/folders/4j/4jmo0VgVHgu2WNrlXKFTB++++TI/-Tmp-/ghc61560_1/ghc61560_0.c\r\nWarning: deleting non-existent /var/folders/4j/4jmo0VgVHgu2WNrlXKFTB++++TI/-Tmp-/ghc61560_1/ghc61560_0.o\r\nOk, modules loaded: Main.\r\n*Main> x\r\n*** Parser:\r\n*** Desugar:\r\n*** Simplify:\r\n*** CorePrep:\r\n*** ByteCodeGen:\r\nLoading package bytestring-0.9.2.0 ... linking ... done.\r\nLoading package transformers-0.2.2.0 ... linking ... done.\r\nLoading package mtl-2.0.1.0 ... linking ... done.\r\nLoading package array-0.3.0.3 ... linking ... done.\r\nLoading package deepseq-1.2.0.1 ... linking ... done.\r\nLoading package text-0.11.1.12 ... linking ... done.\r\nLoading package parsec-3.1.2 ... linking ... done.\r\nLoading package uniqueid-0.1.1 ... linking ... done.\r\nLoading package Wheeler-0.1 ... linking ... done.\r\nSegmentation fault\r\ngwright-macbook> \r\n}}}\r\n\r\nThe program is trying to display a record type (the variable \"x\"). The record type has a Show instance associated with it, and that is apparently not being resolved correctly, leading to a NULL dereference and a segfault.\r\n\r\nThe problem is isolated to OS X as far as I can tell. The code responsible for the error is in the function {{{relocateSection}}}:\r\n\r\n{{{\r\n else if(reloc->r_extern)\r\n {\r\n struct nlist *symbol = &nlist[reloc->r_symbolnum];\r\n char *nm = image + symLC->stroff + symbol->n_un.n_strx;\r\n\r\n IF_DEBUG(linker, debugBelch(\"relocateSection: looking up external symbol %s\\n\", nm));\r\n IF_DEBUG(linker, debugBelch(\" : type = %d\\n\", symbol->n_type));\r\n IF_DEBUG(linker, debugBelch(\" : sect = %d\\n\", symbol->n_sect));\r\n IF_DEBUG(linker, debugBelch(\" : desc = %d\\n\", symbol->n_desc));\r\n IF_DEBUG(linker, debugBelch(\" : value = %p\\n\", (void *)symbol->n_value));\r\n if ((symbol->n_type & N_TYPE) == N_SECT) {\r\n value = relocateAddress(oc, nSections, sections,\r\n symbol->n_value);\r\n IF_DEBUG(linker, debugBelch(\"relocateSection, defined external symbol %s, relocated address %p\\n\", nm, (void *)value));\r\n }\r\n else {\r\n value = (uint64_t) lookupSymbol(nm);\r\n IF_DEBUG(linker, debugBelch(\"relocateSection: external symbol %s, address %p\\n\", nm, (void *)value));\r\n }\r\n }\r\n}}}\r\n\r\nThe returned value from {{{lookupSymbol}}} is not checked for failure.\r\nA simple check for NULL and a call to {{{errorBelch}}} is all that's needed to fix this. There's another place where the return value from {{{lookupSymbol}}} is not checked and it should be fixed similarly.\r\n\r\nIn a bit more detail, the program \"Test.hs\" I was loading does some simple tests on a library. I admit to having been sloppy while sorting out the module exports, but the library compiles without warnings when -Wall is set. The library has a top-level module that re-exports the most commonly used symbols, but the test program doesn't use it, importing all of the modules it needs explicitly. Am I doing something that is known to be dangerous?\r\n\r\nThe failed symbol lookup is \r\n\r\n{{{\r\nlookupSymbol: looking up _Wheelerzm0zi1_MathziSymbolicziWheelerziSimpleSymbol_zdfShowSzuzdcshowsPrec_closure\r\n}}}\r\n\r\nwhich is the Show instance for a {{{SimpleSymbol}}} data type. (The library implements a symbolic algebra DSL.) The symbol is undefined in the object module:\r\n\r\n{{{\r\ngwright-macbook> nm HSWheeler-0.1.o | grep \"_Wheelerzm0zi1_MathziSymbolicziWheelerziSimpleSymbol_zdfShowSzuzdcshowsPrec_closure\"\r\n U _Wheelerzm0zi1_MathziSymbolicziWheelerziSimpleSymbol_zdfShowSzuzdcshowsPrec_closure\r\ngwright-macbook> \r\n}}}\r\n\r\nso some sort of failure is expected when I try to show something of the {{{SimpleSymbol}}} type.\r\n\r\nI'm puzzled that the first indication of failure is a segfault, or, after I patch {{{rts/Linker.c}}}, an error from deep inside the linker. It seems that there is something else going wrong which ought to generate a warning at least.\r\n\r\nI will generate a patch against HEAD to check for the failed symbol lookups; it would be good if it were included in the final 7.4.1.","type_of_failure":"OtherFailure","blocking":[]} -->7.4.1Ian Lynagh <igloo@earth.li>Ian Lynagh <igloo@earth.li>https://gitlab.haskell.org/ghc/ghc/-/issues/4394IPRun failure2021-11-02T09:27:32ZSimon MarlowIPRun failuretypecheck/should_run/IPRun is currently failing all ways:
```
=====> IPRun(normal) 1973 of 2622 [0, 24, 0]
cd ./typecheck/should_run && '/64playpen/simonmar/nightly/HEAD-cam-04-unx/x86_64-unknown-linux/inplace/bin/ghc-stage2' -fforce-re...typecheck/should_run/IPRun is currently failing all ways:
```
=====> IPRun(normal) 1973 of 2622 [0, 24, 0]
cd ./typecheck/should_run && '/64playpen/simonmar/nightly/HEAD-cam-04-unx/x86_64-unknown-linux/inplace/bin/ghc-stage2' -fforce-recomp -dcore-lint -dcmm-lint -dno-debug-output -no-user-package-conf -rtsopts -o IPRun IPRun.hs >IPRun.comp.stderr 2>&1
Compile failed (status 256) errors were:
[1 of 1] Compiling Main ( IPRun.hs, IPRun.o )
IPRun.hs:13:18:
Ambiguous type variable `a' in the constraint:
(Num a) arising from the literal `5'
Probable fix: add a type signature that fixes these type variable(s)
In the expression: 5
In the expression: let ?x = 5 in \ () -> ?x
In an equation for `f2': f2 () = let ?x = 5 in \ () -> ?x
IPRun.hs:24:13:
Ambiguous type variable `a1' in the constraint:
(Show a1) arising from a use of `print'
Probable fix: add a type signature that fixes these type variable(s)
In a stmt of a 'do' expression: print (f2 () ())
In the expression:
do { print (f0 ());
print (f1 ());
print (f2 () ());
print (f3 ()) }
In the expression:
let ?x = 0
in
do { print (f0 ());
print (f1 ());
print (f2 () ());
.... }
*** unexpected failure for IPRun(normal)
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ----------------------- |
| Version | 6.12.3 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | highest |
| Resolution | Unresolved |
| Component | Compiler (Type checker) |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"IPRun failure","status":"New","operating_system":"","component":"Compiler (Type checker)","related":[],"milestone":"7.0.1","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"6.12.3","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"typecheck/should_run/IPRun is currently failing all ways:\r\n\r\n{{{\r\n=====> IPRun(normal) 1973 of 2622 [0, 24, 0]\r\ncd ./typecheck/should_run && '/64playpen/simonmar/nightly/HEAD-cam-04-unx/x86_64-unknown-linux/inplace/bin/ghc-stage2' -fforce-recomp -dcore-lint -dcmm-lint -dno-debug-output -no-user-package-conf -rtsopts -o IPRun IPRun.hs >IPRun.comp.stderr 2>&1\r\nCompile failed (status 256) errors were:\r\n[1 of 1] Compiling Main ( IPRun.hs, IPRun.o )\r\n\r\nIPRun.hs:13:18:\r\n Ambiguous type variable `a' in the constraint:\r\n (Num a) arising from the literal `5'\r\n Probable fix: add a type signature that fixes these type variable(s)\r\n In the expression: 5\r\n In the expression: let ?x = 5 in \\ () -> ?x\r\n In an equation for `f2': f2 () = let ?x = 5 in \\ () -> ?x\r\n\r\nIPRun.hs:24:13:\r\n Ambiguous type variable `a1' in the constraint:\r\n (Show a1) arising from a use of `print'\r\n Probable fix: add a type signature that fixes these type variable(s)\r\n In a stmt of a 'do' expression: print (f2 () ())\r\n In the expression:\r\n do { print (f0 ());\r\n print (f1 ());\r\n print (f2 () ());\r\n print (f3 ()) }\r\n In the expression:\r\n let ?x = 0\r\n in\r\n do { print (f0 ());\r\n print (f1 ());\r\n print (f2 () ());\r\n .... }\r\n\r\n*** unexpected failure for IPRun(normal)\r\n}}}\r\n","type_of_failure":"OtherFailure","blocking":[]} -->7.0.1https://gitlab.haskell.org/ghc/ghc/-/issues/16051Cross compilation broken under Hadrian2021-11-05T19:45:02ZBen GamariCross compilation broken under HadrianHadrian falls over essentially immediately when cross-compiling:
```
$ ./boot
$ ./configure --target=aarch64-linux-gnu
$ hadrian/build.cabal.sh -j32
Up to date
Up to date
| Copy file: settings => _build/stage1/lib/settings
| Copy file: ...Hadrian falls over essentially immediately when cross-compiling:
```
$ ./boot
$ ./configure --target=aarch64-linux-gnu
$ hadrian/build.cabal.sh -j32
Up to date
Up to date
| Copy file: settings => _build/stage1/lib/settings
| Copy file: settings => _build/stage0/lib/settings
| Copy file: utils/hsc2hs/template-hsc.h => _build/stage0/lib/template-hsc.h
| Copy file: llvm-targets => _build/stage0/lib/llvm-targets
| Copy file: driver/ghc-usage.txt => _build/stage0/lib/ghc-usage.txt
| Copy file: llvm-passes => _build/stage0/lib/llvm-passes
| Copy file: driver/ghci-usage.txt => _build/stage0/lib/ghci-usage.txt
shakeArgsWith 0.000s 0%
Function shake 0.084s 20% ======
Database read 0.000s 0%
With database 0.000s 0%
Running rules 0.329s 79% =========================
Total 0.415s 100%
Error when running Shake build system:
at src/Rules.hs:(35,19)-(48,17):
at src/Rules.hs:48:5-17:
* Depends on: _build/stage2/bin/aarch64-linux-gnu-ghctags
at src/Hadrian/Utilities.hs:292:5-18:
* Depends on: _build/stage0/bin/aarch64-linux-gnu-ghctags
* Raised the exception:
Unknown program "_build/stage0/bin/aarch64-linux-gnu-ghctags"
CallStack (from HasCallStack):
error, called at src/Rules/Program.hs:26:29 in main:Rules.Program
```Make removalAlp MestanogullariAlp Mestanogullarihttps://gitlab.haskell.org/ghc/ghc/-/issues/20199g++ doesn't allow including Rts.h from HEAD2021-11-05T19:45:02ZTeo Camarasug++ doesn't allow including Rts.h from HEAD## Summary
If you try to compile `ghc-debug-stub` with HEAD, you get the following message from g++:
```
GNU C++17 (GCC) version 9.3.0 (x86_64-unknown-linux-gnu)
compiled by GNU C version 9.3.0, GMP version 6.2.0, MPFR version 4...## Summary
If you try to compile `ghc-debug-stub` with HEAD, you get the following message from g++:
```
GNU C++17 (GCC) version 9.3.0 (x86_64-unknown-linux-gnu)
compiled by GNU C version 9.3.0, GMP version 6.2.0, MPFR version 4.1.0, MPC version 1.2.0, isl version isl-0.17.1-GMP
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
GNU C++17 (GCC) version 9.3.0 (x86_64-unknown-linux-gnu)
compiled by GNU C version 9.3.0, GMP version 6.2.0, MPFR version 4.1.0, MPC version 1.2.0, isl version isl-0.17.1-GMP
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: a73d4a62d7cd30907d3cbd101fc2954b
In file included from /nix/store/av9j7zva8s012nsm3y9hgb7kdf41pw7c-ghc-9.3.0/lib/ghc-9.3.20210803/lib/../lib/x86_64-linux-ghc-9.3.20210803/rts-1.0.2/include/Rts.h:224,
from cbits/socket.cpp:3:0: error:
/nix/store/av9j7zva8s012nsm3y9hgb7kdf41pw7c-ghc-9.3.0/lib/ghc-9.3.20210803/lib/../lib/x86_64-linux-ghc-9.3.20210803/rts-1.0.2/include/rts/storage/Heap.h:27:73: error:
error: expected ‘,’ or ‘...’ before ‘ptrs’
27 | StgWord collect_pointers(StgClosure *closure, StgWord size, StgClosure *ptrs[size]);
| ^~~~
|
27 | StgWord collect_pointers(StgClosure *closure, StgWord size, StgClosure *ptrs[size]);
| ^
`cc' failed in phase `C Compiler'. (Exit code: 1)
```
Link to socket.cpp: https://gitlab.haskell.org/ghc/ghc-debug/-/blob/master/stub/cbits/socket.cpp
The error seems to be due to importing `Rts.h` rather than anything in socket.cpp
I think this is caused by https://gitlab.haskell.org/ghc/ghc/-/merge_requests/6235 @bgamari
It looks like this use of variable length arrays is valid in C but not in C++. `ghc-debug-common`, which uses `Rts.h` within a C file compiles fine.
## Steps to reproduce
1. Create a c++ file that includes `Rts.h`
2. Try to compile that file with `g++`
3. You will get an error similar to above
## Expected behaviour
`Rts.h` should be compatible with c++
## Environment
* GHC version used: The Glorious Glasgow Haskell Compilation System, version 9.3.20210803
Optional:
* Operating System: Linux
* System Architecture: x86_649.2.1Ben GamariBen Gamarihttps://gitlab.haskell.org/ghc/ghc/-/issues/11208GHCi doesn't qualify types anymore2021-11-06T18:22:58ZHerbert Valerio Riedelhvr@gnu.orgGHCi doesn't qualify types anymore`M.hs` contains:
```hs
module M where
import qualified Prelude as P
f n = n P.+ 1
g h (P.Just x) = P.Just (h x)
g _ P.Nothing = P.Nothing
```
GHC 7.10.3 behaves as expected:
```
$ ghci-7.10.3 -ignore-dot-ghci M.hs
GHCi, version 7...`M.hs` contains:
```hs
module M where
import qualified Prelude as P
f n = n P.+ 1
g h (P.Just x) = P.Just (h x)
g _ P.Nothing = P.Nothing
```
GHC 7.10.3 behaves as expected:
```
$ ghci-7.10.3 -ignore-dot-ghci M.hs
GHCi, version 7.10.3: http://www.haskell.org/ghc/ :? for help
[1 of 1] Compiling M ( M.hs, interpreted )
Ok, modules loaded: M.
*M> :browse
f :: P.Num a => a -> a
g :: (t -> a) -> P.Maybe t -> P.Maybe a
*M> :t f
f :: P.Num a => a -> a
*M> :t g
g :: (t -> a) -> P.Maybe t -> P.Maybe a
```
However, GHC HEAD drops the module qualifiers
```
$ ghci-7.11.20151209 -ignore-dot-ghci M.hs
GHCi, version 7.11.20151209: http://www.haskell.org/ghc/ :? for help
[1 of 1] Compiling M ( M.hs, interpreted )
Ok, modules loaded: M.
*M> :browse
f :: Num a => a -> a
g :: (t -> a) -> Maybe t -> Maybe a
*M> :t f
f :: Num a => a -> a
*M> :t g
g :: (t -> a) -> Maybe t -> Maybe a
*M> Nothing :: Maybe ()
<interactive>:4:12: error:
Not in scope: type constructor or class ‘Maybe’
Perhaps you meant ‘P.Maybe’ (imported from Prelude)
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 7.11 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | highest |
| Resolution | Unresolved |
| Component | GHCi |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | bgamari |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"GHCi doesn't qualify types anymore","status":"New","operating_system":"","component":"GHCi","related":[],"milestone":"8.0.1","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.11","keywords":["regression"],"differentials":[],"test_case":"","architecture":"","cc":["bgamari"],"type":"Bug","description":"`M.hs` contains:\r\n\r\n{{{#!hs\r\nmodule M where\r\n\r\nimport qualified Prelude as P\r\n\r\nf n = n P.+ 1\r\n\r\ng h (P.Just x) = P.Just (h x)\r\ng _ P.Nothing = P.Nothing\r\n}}}\r\n\r\nGHC 7.10.3 behaves as expected:\r\n\r\n{{{\r\n$ ghci-7.10.3 -ignore-dot-ghci M.hs \r\nGHCi, version 7.10.3: http://www.haskell.org/ghc/ :? for help\r\n[1 of 1] Compiling M ( M.hs, interpreted )\r\nOk, modules loaded: M.\r\n*M> :browse\r\nf :: P.Num a => a -> a\r\ng :: (t -> a) -> P.Maybe t -> P.Maybe a\r\n*M> :t f\r\nf :: P.Num a => a -> a\r\n*M> :t g\r\ng :: (t -> a) -> P.Maybe t -> P.Maybe a\r\n}}}\r\n\r\nHowever, GHC HEAD drops the module qualifiers\r\n\r\n{{{\r\n$ ghci-7.11.20151209 -ignore-dot-ghci M.hs\r\nGHCi, version 7.11.20151209: http://www.haskell.org/ghc/ :? for help\r\n[1 of 1] Compiling M ( M.hs, interpreted )\r\nOk, modules loaded: M.\r\n*M> :browse\r\nf :: Num a => a -> a\r\ng :: (t -> a) -> Maybe t -> Maybe a\r\n*M> :t f\r\nf :: Num a => a -> a\r\n*M> :t g\r\ng :: (t -> a) -> Maybe t -> Maybe a\r\n*M> Nothing :: Maybe ()\r\n\r\n<interactive>:4:12: error:\r\n Not in scope: type constructor or class ‘Maybe’\r\n Perhaps you meant ‘P.Maybe’ (imported from Prelude)\r\n}}}","type_of_failure":"OtherFailure","blocking":[]} -->8.0.1https://gitlab.haskell.org/ghc/ghc/-/issues/20142Cmm type mismatch in %MO_S_Shr_W8 application2021-11-08T13:30:59ZBen GamariCmm type mismatch in %MO_S_Shr_W8 application`text` currently fails to build with `-dcmm-lint`:
```
$ _build/stage1/bin/ghc -O2 -dcore-lint -dstg-lint -dcmm-lint -ilibraries/text/src Data.Text.Lazy.Builder.Int -Ilibraries/text/include
...
[36 of 36] Compiling Data.Text.Lazy.Builde...`text` currently fails to build with `-dcmm-lint`:
```
$ _build/stage1/bin/ghc -O2 -dcore-lint -dstg-lint -dcmm-lint -ilibraries/text/src Data.Text.Lazy.Builder.Int -Ilibraries/text/include
...
[36 of 36] Compiling Data.Text.Lazy.Builder.Int ( libraries/text/src/Data/Text/Lazy/Builder/Int.hs, libraries/text/src/Data/Text/Lazy/Builder/Int.o )
Cmm lint error:
in basic block cTTj
in MachOp application:
%MO_S_Shr_W8(_sRS5::I8, 7 :: W8)
op is expecting: [W8, W64]
arguments provide: [I8, I8]
Program was:
{offset
cTTh: // global
if ((Sp + -16) < SpLim) (likely: False) goto cTTi; else goto cTTj;
cTTi: // global
R1 = R1;
call (stg_gc_enter_1)(R1) args: 8, res: 0, upd: 8;
cTTj: // global
I64[Sp - 16] = stg_upd_frame_info;
P64[Sp - 8] = R1;
_sRS5::I8 = I8[R1 + 16];
R2 = %MO_XX_Conv_W8_W64(%MO_S_Shr_W8(_sRS5::I8 + %MO_S_Shr_W8(_sRS5::I8,
7 :: W8) & 15 :: W8,
4 :: W8));
Sp = Sp - 16;
call $wgo7_info(R2) args: 24, res: 0, upd: 24;
}
<no location info>: error:
Compilation had errors
```https://gitlab.haskell.org/ghc/ghc/-/issues/20539diagrams-core-1.5.0 fails to compile on HEAD (expectJust isRecDataCon:go_tc_app)2021-11-09T13:57:09ZRyan Scottdiagrams-core-1.5.0 fails to compile on HEAD (expectJust isRecDataCon:go_tc_app)_Originally observed on a `head.hackage` CI job [here](https://gitlab.haskell.org/ghc/head.hackage/-/jobs/828159#L5933)._
`diagrams-core-1.5.0` will panic if you compile it with GHC 9.3.20211020. Here is a heavily minimized example:
``..._Originally observed on a `head.hackage` CI job [here](https://gitlab.haskell.org/ghc/head.hackage/-/jobs/828159#L5933)._
`diagrams-core-1.5.0` will panic if you compile it with GHC 9.3.20211020. Here is a heavily minimized example:
```hs
module Diagrams.Core.Types where
newtype Measured a = Measured { unmeasure :: () -> a }
data Subdiagram = Subdiagram () (Measured ())
mkSubdiagram :: () -> Subdiagram
mkSubdiagram d = Subdiagram d (Measured (\_ -> ()))
```
```
$ ~/Software/ghc-9.3.20211020/bin/ghc -fforce-recomp Bug.hs -O1
[1 of 1] Compiling Diagrams.Core.Types ( Bug.hs, Bug.o )
<no location info>: error:
expectJust isRecDataCon:go_tc_app
CallStack (from HasCallStack):
error, called at compiler/GHC/Data/Maybe.hs:68:27 in ghc:GHC.Data.Maybe
expectJust, called at compiler/GHC/Core/Opt/WorkWrap/Utils.hs:1392:25 in ghc:GHC.Core.Opt.WorkWrap.Utils
```
Note that:
* This is a regression from GHC 9.0.1 and 9.2.1-rc1, which do not panic.
* `-O1` or higher is required to trigger the bug.9.4.1Sebastian GrafSebastian Grafhttps://gitlab.haskell.org/ghc/ghc/-/issues/20584Several Hackage libraries fail to compile due to kind variables not defaultin...2021-11-11T10:51:33ZRyan ScottSeveral Hackage libraries fail to compile due to kind variables not defaulting in HEAD_Originally discovered in a `head.hackage` CI job [here](https://gitlab.haskell.org/ghc/head.hackage/-/jobs/840454)._
After commit 9cc6c1932dbbd3d27405a8ebe5586a0ef09dd7fd (`Don't default type variables in type families`), the following..._Originally discovered in a `head.hackage` CI job [here](https://gitlab.haskell.org/ghc/head.hackage/-/jobs/840454)._
After commit 9cc6c1932dbbd3d27405a8ebe5586a0ef09dd7fd (`Don't default type variables in type families`), the following libraries fail to build on `head.hackage`'s CI:
* `inj-base-0.2.0.0`
* `lens-5.0.1`
* `microlens-0.4.12.0`
* `mono-traversable-1.0.15.3`
There are likely others, but these are the ones that `head.hackage` in particular caught. The `inj-base` failure can be minimized fairly easily:
```hs
{-# LANGUAGE Haskell2010 #-}
{-# LANGUAGE TypeFamilies #-}
module Bug where
data Decision_Wrap
data Decision_Map
type family DecideFn p where
DecideFn (r -> p) = Decision_Map
DecideFn p = Decision_Wrap
```
This compiles on GHC 9.2 and earlier, but fails on HEAD with:
```
$ ~/Software/ghc-9.3.20211029/bin/ghc Bug.hs
[1 of 1] Compiling Bug ( Bug.hs, Bug.o )
Bug.hs:9:3: error:
• Cannot default kind variable ‘t0’
of kind: GHC.Types.RuntimeRep
Perhaps enable PolyKinds or add a kind signature
• In the type family declaration for ‘DecideFn’
|
9 | DecideFn (r -> p) = Decision_Map
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Bug.hs:9:3: error:
• Cannot default kind variable ‘t0’
of kind: GHC.Types.RuntimeRep
Perhaps enable PolyKinds or add a kind signature
• In the type family declaration for ‘DecideFn’
|
9 | DecideFn (r -> p) = Decision_Map
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
```
I'm unclear if this is expected behavior or not. I certainly hope not, since 9cc6c1932dbbd3d27405a8ebe5586a0ef09dd7fd didn't advertise anything in the release notes about this, and this seems like it would break lots of code in the wild. If it is expected, it would be good to document this change and to remove the duplicate error message.
cc @sheaf9.4.1sheafsam.derbyshire@gmail.comsheafsam.derbyshire@gmail.comhttps://gitlab.haskell.org/ghc/ghc/-/issues/20294Regression `refineFromInScope` caused by "Get the in-scope set right during R...2021-12-14T08:52:49ZMatthew PickeringRegression `refineFromInScope` caused by "Get the in-scope set right during RULE matching"Agda fails to compile with a panic from refineInScopeSet
If I revert 4ff4d434e9a90623afce00b43e2a5a1ccbdb4c05 then it builds successfully.
cc @simonpj
```
<no location info>: error:
panic! (the 'impossible' happened)
GHC versi...Agda fails to compile with a panic from refineInScopeSet
If I revert 4ff4d434e9a90623afce00b43e2a5a1ccbdb4c05 then it builds successfully.
cc @simonpj
```
<no location info>: error:
panic! (the 'impossible' happened)
GHC version 9.3.20210825:
refineFromInScope
InScope {wild_00 $dReadTCState_aJ8Dp $dHasOptions_aJ8Dq
$dMonadTCEnv_aJ8Iu $dMonadReduce_aJ8IS $d(%,,%)_aJ8LE
$dMonadFail_aJ8PI $dMonadTCM_aJ8Qb $d(%,,,,%)_aJ8R6
$d(%,,,,,,,,%)_aJ8Uq $dMonadReduce_aJ9ff $dPureTCM_aJ9fs
$dMonadTCEnv_aJ9h1 $dMonadDebug_aJ9ha $cshowsPrec_aJ9o4
$cshow_aJ9om $cshowList_aJ9os $d(%,,%)_aJ9oJ $d(%,,,,,%)_aJ9oK
$dMonadFresh_aJ9oP $dHasBuiltins_aJ9oS $dMonadFresh_aJ9oV
$dMonadFresh_aJ9oW $dSubst_aJ9p3 $dSubst_aJ9p5 $d~_aJ9p7 $d~_aJ9pb
$dSubst_aJ9pi $d~_aJ9pk $d~_aJ9po $d(%,%)_aJ9pq $dSubst_aJ9pr
$d~_aJ9ps $d~_aJ9pv $krep_aJ9rN $krep_aJ9rO $krep_aJ9rP eta_in87h
eta_in87u eta1_in87v f252_in8cs ds_in8ct r_in8cu e_in8cv s183_in8cw
eta_ipLiD ww4_ipLiN ww5_ipLiO ww7_ipLiS ww8_ipLiT ww9_ipLiU
wild4_ipLiW ww10_ipLiX ww11_ipLiY ww12_ipLiZ ww13_ipLj0 ww_ipM0f
ww3_ipM0i ww5_ipM0o ww9_ipM0u ww2_iJ9xX ww6_iJ9y3 ww8_iJ9y5
ww1_iJajv findInstance isInstanceConstraint
postponeInstanceConstraints shouldPostponeInstanceSearch
$fShowYesNoMaybe $tc'HellNo $trModule $tc'Maybe $tc'No
$tc'NoBecause $tc'Yes $tcYesNoMaybe isInstanceProblemConstraint
insidePi $trModule_sJ9NW $trModule_sJ9NX $trModule_sJ9NY
$trModule_sJ9NZ $tcYesNoMaybe_sJ9O0 $tcYesNoMaybe_sJ9O1
$tc'Yes_sJ9O2 $tc'Yes_sJ9O3 $tc'No_sJ9O4 $tc'No_sJ9O5
$tc'Maybe_sJ9O6 $tc'Maybe_sJ9O7 $tc'NoBecause_sJ9O8
$tc'NoBecause_sJ9O9 $tc'HellNo_sJ9Oa $tc'HellNo_sJ9Ob loc_sJ9Oc
loc_sJ9Od loc_sJ9Oe loc_sJ9Of loc_sJ9Og loc_sJ9Oh loc_sJ9Oi
$dIP_sJ9Oj $dIP_sJ9Ok $dIP_sJ9Ol loc_sJ9Om loc_sJ9On loc_sJ9Oo
loc_sJ9Op loc_sJ9Oq loc_sJ9Or loc_sJ9Os $dIP_sJ9Ot $dIP_sJ9Ou
$dIP_sJ9Ov $dSubst_sJ9Ow $dIsMeta_sJ9Ox loc_sJ9Oz loc_sJ9OA
loc_sJ9OB loc_sJ9OC loc_sJ9OD loc_sJ9OE loc_sJ9OF $dIP_sJ9OG
$dIP_sJ9OH $dIP_sJ9OI loc_sJ9OM loc_sJ9ON loc_sJ9OO loc_sJ9OP
loc_sJ9OQ loc_sJ9OR loc_sJ9OS $dIP_sJ9OT $dIP_sJ9OU $dIP_sJ9OV
loc_sJ9OY loc_sJ9OZ loc_sJ9P0 loc_sJ9P1 loc_sJ9P2 loc_sJ9P3
loc_sJ9P4 $dIP_sJ9P5 $dIP_sJ9P6 $dIP_sJ9P7 loc_sJ9Qu loc_sJ9Qv
loc_sJ9Qw loc_sJ9Qx loc_sJ9Qy loc_sJ9Qz loc_sJ9QA $dIP_sJ9QB
$dIP_sJ9QC $dIP_sJ9QD loc_sJ9QE loc_sJ9QF loc_sJ9QG loc_sJ9QH
loc_sJ9QI loc_sJ9QJ loc_sJ9QK $dIP_sJ9QL $dIP_sJ9QM $dIP_sJ9QN
loc_sJ9QO loc_sJ9QP loc_sJ9QQ loc_sJ9QR loc_sJ9QS loc_sJ9QT
loc_sJ9QU $dIP_sJ9QV $dIP_sJ9QW $dIP_sJ9QX loc_sJ9QY loc_sJ9QZ
loc_sJ9R0 loc_sJ9R1 loc_sJ9R2 loc_sJ9R3 loc_sJ9R4 $dIP_sJ9R5
$dIP_sJ9R6 $dIP_sJ9R7 loc_sJ9R8 loc_sJ9R9 loc_sJ9Ra loc_sJ9Rb
loc_sJ9Rc loc_sJ9Rd loc_sJ9Re $dIP_sJ9Rf $dIP_sJ9Rg $dIP_sJ9Rh
loc_sJ9Ri loc_sJ9Rj loc_sJ9Rk loc_sJ9Rl loc_sJ9Rm loc_sJ9Rn
loc_sJ9Ro $dIP_sJ9Rp $dIP_sJ9Rq $dIP_sJ9Rr loc_sJ9Rs loc_sJ9Rt
loc_sJ9Ru loc_sJ9Rv loc_sJ9Rw loc_sJ9Rx loc_sJ9Ry $dIP_sJ9Rz
$dIP_sJ9RA $dIP_sJ9RB loc_sJ9RC loc_sJ9RD loc_sJ9RE loc_sJ9RF
loc_sJ9RG loc_sJ9RH loc_sJ9RI $dIP_sJ9RJ $dIP_sJ9RK $dIP_sJ9RL
eta1_sJ9RM wakeupInstanceConstraints_sJ9RN $dIsString_sJa18
$dMonadTCEnv_sJa4I $dMonadTCEnv_sJa4J $dPiApplyM_sJabp
$dFunctor_sJaeS $dApplicative_sJaeT $dMonad_sJaeU
$sshouldPostponeInstanceSearch_sJaeV wild_sJaeY ww_sJaeZ
$ssep_sJaf0 wild_sJaf3 ww_sJaf4 $svcat_sJaf5 $seInstanceDepth_sJaf7
wild_sJaf9 ww_sJafa wild1_sJafb ww3_sJafc wild2_sJafd ww7_sJafe
$sviewTC_sJaff wild_sJafh ww2_sJafi wild1_sJafj ww10_sJafk
$sreportSDoc_sJafl wild_sJafq ww1_sJafr $sdontAssignMetas_sJafs
wild_sJafv ww1_sJafw $sgetMetaType_sJafx $sdropWhileM_sJag2
wild_sJag4 ww_sJag5 $sallMetas'_$sallMetas'1_sJag6 wild_sJag8
ww1_sJag9 wild1_sJaga ww5_sJagb wild2_sJagc ww9_sJagd
$sgetMetaVariableSet_sJage wild_sJagk ww1_sJagl
$sgetMetaTypeInContext_sJagm wild_sJagp ww1_sJagq $sisFrozen_sJagr
wild_sJagu ww_sJagv ww1_sJagw wild2_sJagx ww3_sJagy wild3_sJagz
ww6_sJagA $sgetOpen_sJagB $s$w$c<*>_sJagD wild_sJagF ww_sJagG
$s$fMonadTCEnvBlockT_$caskTC_sJagH wild_sJagJ ww_sJagK $shang_sJagL
$s$fSubstDom'_$capplySubst_sJagP $s$fSubstDom'_$capplySubst_sJagT
wild_sJagV ww_sJagW wild1_sJagX ww3_sJagY wild2_sJagZ ww7_sJah0
$sgetContext_sJah1 $setaExpandRecord'_sJah5 $sisPrefixOf_sJahy
wild_sJahA ww_sJahB wild1_sJahC ww3_sJahD wild2_sJahE ww7_sJahF
$scurrentModule_sJahG $s$fAddContext(,)_$caddContext_sJahI
$sstConsideringInstance_sJahK $sstPostponeInstanceSearch_sJahM
m1_sJamn lvl_sJamo lvl_sJamp m'_sJamr lvl_sJams lvl_sJamt mb_sJamv
m'_sJamx lvl_sJamy lvl_sJamz lvl_sJamA lvl_sJamB lvl_sJamC
lvl_sJamD lvl_sJamE lvl_sJamF lvl_sJamG lvl_sJamH lvl_sJamI
lvl_sJamJ lvl_sJamK lvl_sJamL lvl_sJamM lvl_sJamN lvl_sJamO
lvl_sJamP lvl_sJamQ lvl_sJamR lvl_sJamS lvl_sJamT lvl_sJamU
lvl_sJamV lvl_sJamW lvl_sJamX lvl_sJamY lvl_sJamZ lvl_sJan0
lvl_sJan1 lvl_sJan2 lvl_sJan3 lvl_sJan4 lvl_sJan5 lvl_sJan6
lvl_sJan7 lvl_sJan8 lvl_sJan9 lvl_sJana lvl_sJanb lvl_sJanc
lvl_sJand lvl_sJane lvl_sJanf lvl_sJang lvl_sJanh lvl_sJani
lvl_sJanj lvl_sJank lvl_sJanl lvl_sJanm f_sJano lvl_sJanp lvl_sJanr
lvl_sJans lvl_sJant lvl_sJanu lvl_sJanv lvl_sJanw lvl_sJanx f_sJanz
lvl_sJanA lvl_sJanC lvl_sJanD lvl_sJanE lvl_sJanF lvl_sJanG
lvl_sJanH lvl_sJanI lvl_sJanJ lvl_sJanK lvl_sJanL lvl_sJanM
lvl_sJanN lvl_sJanO lvl_sJanP lvl_sJanQ lvl_sJanR lvl_sJanS
lvl_sJanT lvl_sJanU lvl_sJanV lvl_sJanW lvl_sJanX lvl_sJanY
lvl_sJanZ lvl_sJao0 lvl_sJao1 lvl_sJao2 lvl_sJao3 lvl_sJao4
lvl_sJao5 lvl_sJao6 lvl_sJao7 lvl_sJao8 lvl_sJao9 lvl_sJaoa
lvl_sJaob lvl_sJaoc lvl_sJaod lvl_sJaoe lvl_sJaof lvl_sJaog
lvl_sJaoh lvl_sJaoi lvl_sJaoj lvl_sJaok lvl_sJaol lvl_sJaom
lvl_sJaon lvl_sJaoo lvl_sJaop lvl_sJaoq lvl_sJaor lvl_sJaos
lvl_sJaot lvl_sJaou lvl_sJaov lvl_sJaow lvl_sJaox lvl_sJaoy
lvl_sJaoz lvl_sJaoA lvl_sJaoB lvl_sJaoC lvl_sJaoD lvl_sJaoE
lvl_sJaoF lvl_sJaoG lvl_sJaoH lvl_sJaoI lvl_sJaoJ lvl_sJaoK
lvl_sJaoL lvl_sJaoM lvl_sJaoN lvl_sJaoO lvl_sJaoP lvl_sJaoR
lvl_sJaoS lvl_sJaoT lvl_sJaoU lvl_sJaoV lvl_sJaoW lvl_sJaoX
lvl_sJaoY lvl_sJaoZ lvl_sJap0 lvl_sJap1 lvl_sJap2 lvl_sJap3
lvl_sJap4 lvl_sJap5 lvl_sJap6 lvl_sJap7 lvl_sJap8 eta_sJapa
lvl_sJapb lvl_sJapc lvl_sJapd lvl_sJape lvl_sJapf lvl_sJapg
lvl_sJaph lvl_sJapi instanceFields'_sJapk lvl_sJapl eta_sJapn
n_sJapp lvl_sJapq lvl_sJapr lvl_sJaps lvl_sJapt lvl_sJapu lvl_sJapv
lvl_sJapw lvl_sJapz lvl_sJapA eta_sJapC lvl_sJapD go1_sJapF
eta_sJapH lvl_sJapI lvl_sJapJ lvl_sJapK lvl_sJapL lvl_sJapM
lvl_sJapN s183_sJapP lvl_sJapQ lvl_sJapR lvl_sJapS lvl_sJapT
eta_sJapV lvl_sJapW lvl1068_sJapY lvl_sJapZ lvl_sJaq0 lvl_sJaq1
lvl_sJaq2 lvl_sJaq3 lvl_sJaq4 s183_sJaq6 f252_sJaq8 lvl_sJaq9
lvl_sJaqa s183_sJaqc lvl_sJaqd lvl_sJaqe lvl_sJaqf lvl_sJaqg
s183_sJaqi lvl_sJaqj f252_sJaql lvl_sJaqm wild1_sJaqo lvl_sJaqp
lvl_sJaqq lvl_sJaqr lvl_sJaqs s183_sJaqu lvl_sJaqv lvl_sJaqw
lvl_sJaqx eta_sJaqz lvl_sJaqA getContextVars_sJaqC lvl_sJaqD
lvl_sJaqE lvl_sJaqF lvl_sJaqG lvl_sJaqH lvl_sJaqI s183_sJaqK
lvl_sJaqL wild1_sJaqN lvl_sJaqO lvl_sJaqP lvl_sJaqS lvl_sJaqT
lvl_sJaqU m_sJaqW ds_sJaqY lvl_sJaqZ lvl_sJar0 lvl_sJar1 lvl_sJar2
lvl_sJar3 lvl_sJar4 lvl_sJar5 s183_sJar7 lvl_sJara lvl_sJarb
s183_sJard lvl_sJare lvl_sJarf lvl_sJarg lvl_sJarh lvl_sJari
wild1_sJark lvl_sJarl lvl_sJarm lvl_sJarn wild1_sJarp lvl_sJarq
lvl_sJarr lvl_sJars lvl_sJart s183_sJarv lvl_sJarw wild1_sJary
lvl_sJarz lvl_sJarA lvl_sJarC ds_sJarE m'_sJarG ds_sJarI lvl_sJarJ
go10_sJarL lvl_sJarM lvl_sJarN lvl_sJarO lvl_sJarP lvl_sJarQ
lvl_sJarR s183_sJarT lvl_sJarU lvl_sJarV lvl_sJarW lvl_sJarX
lvl_sJarY lvl_sJarZ lvl_sJas0 lvl_sJas1 lvl_sJas2 lvl_sJas3
lvl_sJas4 lvl_sJas5 lvl_sJas6 lvl_sJas7 s183_sJas9 lvl_sJasa
lvl_sJasb lvl_sJasc lvl_sJasd lvl_sJase lvl_sJasf lvl_sJasg
lvl_sJash lvl_sJasi lvl_sJasj lvl_sJask lvl_sJasl lvl_sJasm
lvl_sJasn lvl_sJasq lvl_sJasr lvl_sJass lvl_sJast lvl_sJasu
lvl_sJasv lvl_sJasw eta_sJasy lvl_sJasz lvl_sJasA lvl_sJasB
lvl_sJasC lvl_sJasD lvl_sJasE lvl_sJasF eta_sJasH lvl_sJasI
lvl_sJasJ lvl_sJasK lvl_sJasL lvl_sJasM lvl_sJasN lvl_sJasO
lvl_sJasP lvl_sJasQ lvl_sJasR lvl_sJasS lvl_sJasT lvl_sJasU
lvl_sJasV lvl_sJasW f252_sJasY lvl_sJasZ lvl_sJat0 s183_sJat2
lvl_sJat3 lvl_sJat4 lvl_sJat5 lvl_sJat6 s183_sJat8 lvl_sJat9
f252_sJatb lvl_sJatc lvl_sJatd lvl_sJate lvl_sJatf lvl_sJatg
lvl_sJath s183_sJatj f252_sJatl lvl_sJatm lvl_sJatn s183_sJatp
lvl_sJatq lvl_sJatr lvl_sJats lvl_sJatt s183_sJatv lvl_sJatw
f252_sJaty lvl_sJatA wild1_sJatC lvl_sJatD lvl_sJatE lvl_sJatF
lvl_sJatG lvl_sJatH lvl_sJatI lvl_sJatJ lvl_sJatK lvl_sJatL
lvl_sJatM lvl_sJatN lvl_sJatO lvl_sJatP lvl_sJatQ s183_sJatS
lvl_sJatT wild1_sJatV lvl_sJatW lvl_sJatX lvl_sJatY lvl_sJatZ
lvl_sJau0 lvl_sJau1 lvl_sJau2 lvl_sJau3 lvl_sJau4
anyMetaTypes_sJau6 lvl_sJau7 lvl_sJau9 lvl_sJaua lvl_sJaub
lvl_sJauc lvl_sJaud lvl_sJaue lvl_sJauf m1_sJaui lvl_sJauj
lvl_sJauk lvl_sJaul lvl_sJaum f252_sJauo lvl_sJaup lvl_sJauq
s183_sJaus lvl_sJaut wild1_sJauv lvl_sJauw lvl_sJaux lvl_sJauy
lvl_sJauz lvl_sJauA lvl_sJauB f252_sJauD lvl_sJauE lvl_sJauF
s183_sJauH lvl_sJauI lvl_sJauJ lvl_sJauK lvl_sJauL s183_sJauN
lvl_sJauO lvl_sJauP s183_sJauR lvl_sJauS lvl_sJauT lvl_sJauU
lvl_sJauV s183_sJauX lvl_sJauY wild1_sJav0 lvl_sJav1 lvl_sJav2
lvl_sJav3 wild1_sJav5 lvl_sJav6 lvl_sJav7 lvl_sJav8 lvl_sJavb
lvl_sJavc lvl_sJavd lvl_sJave lvl_sJavf lvl_sJavg lvl_sJavh
s183_sJavj lvl_sJavk wild1_sJavm lvl_sJavn lvl_sJavo handle_sJavq
$dMonadFresh_sJavs $d(%,,%)_sJavu $dIsString_sJavw
$dMonadTCEnv_sJavy $dReadTCState_sJavA $dHasOptions_sJavC
$dHasBuiltins_sJavE $d(%,,,,,%)_sJavG $d(%,,,,%)_sJavI lvl_sJavJ
lvl_sJavK lvl_sJavL lvl_sJavM lvl_sJavN lvl_sJavO s183_sJavQ
lvl_sJavR wild1_sJavT lvl_sJavU lvl_sJavV
$sdebugConstraintFail_sJavX $dMonadFresh_sJavZ $d(%,,%)_sJaw1
$dIsString_sJaw3 $dMonadTCEnv_sJaw5 $dReadTCState_sJaw7
$dHasOptions_sJaw9 $dHasBuiltins_sJawb $d(%,,,,,%)_sJawd
$d(%,,,,%)_sJawf lvl_sJawg lvl_sJawh lvl_sJawi lvl_sJawj lvl_sJawk
lvl_sJawl s183_sJawn lvl_sJawo wild1_sJawq lvl_sJawr lvl_sJaws
debugConstraintFail_sJawu lvl_sJawv lvl_sJaww lvl_sJawx lvl_sJawy
lvl_sJawz lvl_sJawA lvl_sJawB debugInconclusive_sJawD lvl_sJawE
lvl_sJawF lvl_sJawG lvl_sJawH lvl_sJawI lvl_sJawJ lvl_sJawK
debugSuccess_sJawM lvl_sJawN lvl_sJawO loc_sJawQ lvl_sJawR
lvl_sJawS loc_sJawU lvl_sJawV lvl_sJawW loc_sJawY loc_sJax0
loc_sJax2 loc_sJax4 loc_sJax6 lvl_sJax7 lvl_sJax8 $dIP_sJaxa
$dIP_sJaxc $dIP_sJaxe lvl_sJaxf lvl_sJaxg loc_sJaxi lvl_sJaxj
lvl_sJaxk loc_sJaxm lvl_sJaxn lvl_sJaxo loc_sJaxq loc_sJaxs
loc_sJaxu loc_sJaxw loc_sJaxy lvl_sJaxz lvl_sJaxA $dIP_sJaxC
$dIP_sJaxE $dIP_sJaxG eta_sJaxK lvl_sJaxL lvl_sJaxM lvl_sJaxN
lvl_sJaxO lvl_sJaxP lvl_sJaxQ lvl_sJaxR lvl_sJaxT lvl_sJaxU
lvl_sJaxV lvl_sJaxW lvl_sJaxX lvl_sJaxY lvl_sJaxZ lvl_sJay0
lvl_sJay1 lvl_sJay3 lvl_sJay4 lvl_sJay5 lvl_sJay6 lvl_sJay7
lvl_sJay8 s183_sJaya lvl_sJayb lvl_sJayc lvl_sJayd lvl_sJaye
s183_sJayg lvl_sJayh wild1_sJayj lvl_sJayk lvl_sJayl lvl_sJayn
lvl_sJayo s183_sJayq lvl_sJayr wild1_sJayt lvl_sJayu lvl_sJayv
lvl_sJayw lvl_sJayx s183_sJayz lvl_sJayA wild1_sJayC lvl_sJayD
lvl_sJayE lvl_sJayF lvl_sJayG lvl_sJayH lvl_sJayI lvl_sJayJ
lvl_sJayK lvl_sJayL lvl_sJayM s183_sJayO lvl_sJayP lvl_sJayQ
s183_sJayS lvl_sJayV lvl_sJayW wild1_sJayY lvl_sJayZ lvl_sJaz0
lvl_sJaz1 wild1_sJaz3 lvl_sJaz4 lvl_sJaz5 lvl_sJaz6 lvl_sJaz7
lvl_sJaz8 lvl_sJaz9 lvl_sJaza lvl_sJazb s183_sJazd lvl_sJaze
lvl_sJazf f252_sJazh f252_sJazk lvl_sJazl lvl_sJazm s183_sJazo
lvl_sJazp lvl_sJazq lvl_sJazr f252_sJazt lvl_sJazw lvl_sJazx
unsafeDrop_sJazz lvl_sJazA lvl_sJazB lvl_sJazC lvl_sJazD lvl_sJazE
lvl_sJazF lvl_sJazG s183_sJazI lvl_sJazJ lvl_sJazK f252_sJazM
lvl_sJazP lvl_sJazQ s183_sJazS lvl_sJazT lvl_sJazU lvl_sJazV
lvl_sJazW lvl_sJazX lvl_sJazY f252_sJaA0 lvl_sJaA1 lvl_sJaA2
s183_sJaA4 lvl_sJaA5 wild1_sJaA7 lvl_sJaA8 lvl_sJaA9 lvl_sJaAb
lvl_sJaAc lvl_sJaAd lvl_sJaAe lvl_sJaAf lvl_sJaAg lvl_sJaAh
lvl_sJaAi lvl_sJaAj lvl_sJaAk s183_sJaAm lvl_sJaAn lvl_sJaAo
s183_sJaAq lvl_sJaAr lvl_sJaAs wild1_sJaAu lvl_sJaAv lvl_sJaAw
lvl_sJaAx wild1_sJaAz lvl_sJaAA lvl_sJaAB f252_sJaAE lvl_sJaAF
lvl_sJaAG lvl_sJaAH lvl_sJaAI lvl_sJaAJ lvl_sJaAK s183_sJaAM
lvl_sJaAN lvl_sJaAO s183_sJaAQ lvl_sJaAR lvl_sJaAS wild1_sJaAU
lvl_sJaAV lvl_sJaAW lvl_sJaAX wild1_sJaAZ lvl_sJaB0 lvl_sJaB1
f252_sJaB4 lvl_sJaB5 lvl_sJaB6 lvl_sJaB7 lvl_sJaB8 lvl_sJaB9
lvl_sJaBa lvl_sJaBb lvl_sJaBw lvl_sJaBx lvl_sJaBy lvl_sJaBz
lvl_sJaBA lvl_sJaBB lvl_sJaBC lvl_sJaBD lvl_sJaBE eta_sJaBG
lvl_sJaBH lvl_sJaBI lvl_sJaBL lvl_sJaBM lvl_sJaBN lvl_sJaBO
lvl_sJaBP lvl_sJaBQ s183_sJaBS lvl_sJaBT lvl_sJaBU f252_sJaBW
lvl_sJaBX lvl_sJaBY s183_sJaC0 lvl_sJaC1 lvl_sJaC2 lvl_sJaC3
lvl_sJaC4 lvl_sJaC5 lvl_sJaC6 lvl_sJaC7 lvl_sJaC8 lvl_sJaC9
lvl_sJaCa lvl_sJaCb lvl_sJaCc lvl_sJaCd lvl_sJaCe lvl_sJaCf
lvl_sJaCg s183_sJaCi lvl_sJaCj f252_sJaCm f_sJaCq lvl_sJaCr
lvl_sJaCs lvl_sJaCt lvl_sJaCM lvl_sJaCN lvl_sJaCO lvl_sJaCP
lvl_sJaCQ lvl_sJaCR lvl_sJaCS lvl_sJaCT eta_sJaCV lvl_sJaCW
lvl_sJaCX lvl_sJaCY lvl_sJaCZ lvl_sJaD0 lvl_sJaD1 lvl_sJaD2
lvl_sJaD4 lvl_sJaD5 lvl_sJaD6 lvl_sJaD7 lvl_sJaD8 lvl_sJaD9
lvl_sJaDa lvl_sJaDb lvl_sJaDc lvl_sJaDd lvl_sJaDe f252_sJaDg
lvl_sJaDh lvl_sJaDi s183_sJaDk lvl_sJaDl lvl_sJaDm lvl_sJaDn
lvl_sJaDo s183_sJaDq lvl_sJaDr lvl_sJaDs s183_sJaDu lvl_sJaDv
lvl_sJaDw lvl_sJaDx lvl_sJaDy s183_sJaDA lvl_sJaDB wild1_sJaDD
lvl_sJaDE lvl_sJaDF lvl_sJaDG wild1_sJaDI lvl_sJaDJ lvl_sJaDK
lvl_sJaDL lvl_sJaDM lvl_sJaDN lvl_sJaDO lvl_sJaDP f252_sJaDR
lvl_sJaDS lvl_sJaDT s183_sJaDV lvl_sJaDW lvl_sJaDX lvl_sJaDY
lvl_sJaDZ s183_sJaE1 lvl_sJaE2 lvl_sJaE3 s183_sJaE5 lvl_sJaE6
lvl_sJaE7 lvl_sJaE8 lvl_sJaE9 s183_sJaEb lvl_sJaEc wild1_sJaEe
lvl_sJaEf lvl_sJaEg lvl_sJaEh wild1_sJaEj lvl_sJaEk lvl_sJaEl
lvl_sJaEm lvl_sJaEp lvl_sJaEq lvl_sJaEr lvl_sJaEs lvl_sJaEt
lvl_sJaEu s_sJaEw lvl_sJaEx eta_sJaEz g_sJaEB lvl_sJaEC lvl_sJaED
lvl_sJaEE lvl_sJaEF lvl_sJaEG lvl_sJaEH lvl_sJaEI lvl_sJaEJ
lvl_sJaEK s183_sJaEM lvl_sJaEN lvl_sJaEO lvl_sJaEP lvl_sJaEQ
lvl_sJaER lvl_sJaES lvl_sJaET lvl_sJaEU lvl_sJaEV s183_sJaEX
lvl_sJaEY lvl_sJaEZ lvl_sJaF0 infinity_sJaF2 f_sJaF4 lvl_sJaF5
n_sJaF7 lvl_sJaF8 lvl_sJaF9 lvl_sJaFa lvl_sJaFb lvl_sJaFc lvl_sJaFd
lvl_sJaFe lvl_sJaFf s183_sJaFh lvl_sJaFi lvl_sJaFj f252_sJaFl
lvl_sJaFm lvl_sJaFn s183_sJaFp lvl_sJaFq lvl_sJaFr lvl_sJaFs
lvl_sJaFt s183_sJaFv lvl_sJaFw wild1_sJaFy lvl_sJaFz lvl_sJaFA
lvl_sJaFB lvl_sJaFC s183_sJaFE lvl_sJaFF wild1_sJaFH lvl_sJaFI
lvl_sJaFJ lvl_sJaFL lvl_sJaFM lvl_sJaFN lvl_sJaFO lvl_sJaFP
lvl_sJaFQ s183_sJaFS lvl_sJaFT lvl_sJaFU eta_sJaFY lvl_sJaFZ
$s$w$c<*>_sJaG6 ww6_sJaGJ ww3_sJaHR ww5_sJaHS}
checkpointSubstitution
Call stack:
CallStack (from HasCallStack):
callStackDoc, called at compiler/GHC/Utils/Panic.hs:181:37 in ghc:GHC.Utils.Panic
pprPanic, called at compiler/GHC/Core/Opt/Simplify/Env.hs:708:30 in ghc:GHC.Core.Opt.Simplify.Env
Please report this as a GHC bug: https://www.haskell.org/ghc/reportabug
```9.0.2https://gitlab.haskell.org/ghc/ghc/-/issues/19994Darwin x86_64 fails during tests with out-of-memory2021-12-17T13:40:35ZMoritz AngermannDarwin x86_64 fails during tests with out-of-memoryWhile debugging the odd test failure issues on macOS (x86_64) with @mpickering we came up with the following test-program (against 8.10.5), that illustrates the issue:
```haskell
module Main where
import Outputable
import GHC.IO
import...While debugging the odd test failure issues on macOS (x86_64) with @mpickering we came up with the following test-program (against 8.10.5), that illustrates the issue:
```haskell
module Main where
import Outputable
import GHC.IO
import SysTools.Process
import Data.List ( isInfixOf, isPrefixOf )
import Data.IORef
import System.IO
import System.Process
import System.Environment
import Exception
-- See Note [Run-time linker info].
getCompilerInfo' :: String -> IO String
getCompilerInfo' pgm = do
let -- Try to grab the info from the process output.
parseCompilerInfo _stdo stde _exitc
-- Regular GCC
| any ("gcc version" `isInfixOf`) stde =
return "GCC"
-- Regular clang
| any ("clang version" `isInfixOf`) stde =
return "Clang"
-- FreeBSD clang
| any ("FreeBSD clang version" `isInfixOf`) stde =
return "Clang"
-- Xcode 5.1 clang
| any ("Apple LLVM version 5.1" `isPrefixOf`) stde =
return "AppleClang51"
-- Xcode 5 clang
| any ("Apple LLVM version" `isPrefixOf`) stde =
return "AppleClang"
-- Xcode 4.1 clang
| any ("Apple clang version" `isPrefixOf`) stde =
return "AppleClang"
-- Unknown compiler.
| otherwise = fail $ "invalid -v output, or compiler is unsupported (" ++ pgm ++ "): " ++ unlines stde
-- Process the executable call
catchIO (do
(exitc, stdo, stde) <- do
env <- getEnvironment
readCreateProcessWithExitCode ((proc pgm ["-v"]) { env = Just env }) ""
env <- show <$> getEnvironment
print $ length env
-- Split the output by lines to make certain kinds
-- of processing easier.
parseCompilerInfo (lines stdo) (lines stde) exitc
)
(\err -> do
print $ "Warning:\nCouldn't figure out C compiler information!\nMake sure you're using GNU gcc, or clang\n" ++ show err
return "UnknownCC"
)
main = do
print =<< getCompilerInfo' "clang"
main
```
fundamentally the issue appears to be due to the large ENV in a nix shell and `readCreateProcessWithExitCode` not handling large env strings. Notabley the lengh of the show on env is `29299`.8.10.6Ben GamariBen Gamarihttps://gitlab.haskell.org/ghc/ghc/-/issues/19684DerivedConstants.h not produced atomically2021-12-20T01:39:27ZSylvain HenryDerivedConstants.h not produced atomicallyWe have seen the following issue on CI (https://gitlab.haskell.org/ghc/ghc/-/jobs/645999):
```
| Run DeriveConstants: none => _build/stage1/lib/DerivedConstants.h (and 1 more)
| Run Cc FindCDependencies Stage1: rts/linker/elf_util.c => ...We have seen the following issue on CI (https://gitlab.haskell.org/ghc/ghc/-/jobs/645999):
```
| Run DeriveConstants: none => _build/stage1/lib/DerivedConstants.h (and 1 more)
| Run Cc FindCDependencies Stage1: rts/linker/elf_util.c => _build/stage1/rts/build/c/linker/elf_util.o.d
| Run Cc FindCDependencies Stage1: rts/sm/Storage.c => _build/stage1/rts/build/c/sm/Storage.o.d
| Run Cc FindCDependencies Stage1: rts/Hpc.c => _build/stage1/rts/build/c/Hpc.o.d
| Run Cc FindCDependencies Stage1: rts/StgPrimFloat.c => _build/stage1/rts/build/c/StgPrimFloat.o.d
| Run Cc FindCDependencies Stage1: rts/sm/NonMoving.c => _build/stage1/rts/build/c/sm/NonMoving.o.d
| Run Cc FindCDependencies Stage1: rts/RaiseAsync.c => _build/stage1/rts/build/c/RaiseAsync.o.d
| Run Cc FindCDependencies Stage1: rts/posix/Itimer.c => _build/stage1/rts/build/c/posix/Itimer.o.d
| Run Cc FindCDependencies Stage1: rts/hooks/MallocFail.c => _build/stage1/rts/build/c/hooks/MallocFail.o.d
| Run Cc FindCDependencies Stage1: rts/sm/MarkWeak.c => _build/stage1/rts/build/c/sm/MarkWeak.o.d
| Run Cc FindCDependencies Stage1: rts/StaticPtrTable.c => _build/stage1/rts/build/c/StaticPtrTable.o.d
| Run Cc FindCDependencies Stage1: rts/linker/elf_reloc.c => _build/stage1/rts/build/c/linker/elf_reloc.o.d
| Run Cc FindCDependencies Stage1: rts/OldARMAtomic.c => _build/stage1/rts/build/c/OldARMAtomic.o.d
| Run Ghc CompileCWithGhc Stage1: rts/hooks/MallocFail.c => _build/stage1/rts/build/c/hooks/MallocFail.o
| Run Ghc CompileCWithGhc Stage1: rts/hooks/StackOverflow.c => _build/stage1/rts/build/c/hooks/StackOverflow.o
| Run Cc FindCDependencies Stage1: rts/posix/Signals.c => _build/stage1/rts/build/c/posix/Signals.o.d
| Run Cc FindCDependencies Stage1: rts/PrimOps.cmm => _build/stage1/rts/build/cmm/PrimOps.o.d
| Run Cc FindCDependencies Stage1: rts/linker/MachO.c => _build/stage1/rts/build/c/linker/MachO.o.d
| Run Cc FindCDependencies Stage1: rts/ClosureFlags.c => _build/stage1/rts/build/c/ClosureFlags.o.d
| Run Ghc CompileCWithGhc Stage1: rts/OldARMAtomic.c => _build/stage1/rts/build/c/OldARMAtomic.o
| Run Cc FindCDependencies Stage1: rts/Inlines.c => _build/stage1/rts/build/c/Inlines.o.d
ghc: panic! (the 'impossible' happened)
(GHC version 9.1.20210410:
Couldn't find #define HS_CONSTANTS " in _build/stage1/lib/DerivedConstants.h
CallStack (from HasCallStack):
error, called at _build/stage0/compiler/build/GHC/Platform/Constants.hs:143:20 in ghc:GHC.Platform.Constants
```
It's because `DerivedConstants.h` file is not created atomically. Fix incoming.https://gitlab.haskell.org/ghc/ghc/-/issues/20079Strange IO and segmentation fault in ghci on Macos (aarch64)2021-12-25T13:21:44ZAlexey ProninStrange IO and segmentation fault in ghci on Macos (aarch64)## Summary
After moving the cursor left using arrow keys and pressing any keys, right part of previously inserted input duplicates.
Also, window resizing causes a segmentation fault.
## Steps to reproduce
1. Run ghci, press any keys, ...## Summary
After moving the cursor left using arrow keys and pressing any keys, right part of previously inserted input duplicates.
Also, window resizing causes a segmentation fault.
## Steps to reproduce
1. Run ghci, press any keys, move cursor left using arrow keys, press any keys
2. Resize terminal window
## Environment
* GHC version used: 8.10.5
Optional:
* Operating System: MacOS 11.4
* System Architecture: aarch64
![Screen_Recording_2021-07-04_at_23.37.40](/uploads/5586c7b867206097ab1024919332c656/Screen_Recording_2021-07-04_at_23.37.40.mov)8.10.6https://gitlab.haskell.org/ghc/ghc/-/issues/197349.2.1-alpha2 fails to install on OS X2021-12-25T13:22:23ZEdward Kmett9.2.1-alpha2 fails to install on OS X## Summary
Attempting to install on a normal OSX machine fails.
## Steps to reproduce
Install:
In my case using
```
$ ghcup install ghc -u file:///Users/ekmett/ghc/ghc-9.2.0.20210422-x86_64-apple-darwin.tar.xz head
```
leads to
```...## Summary
Attempting to install on a normal OSX machine fails.
## Steps to reproduce
Install:
In my case using
```
$ ghcup install ghc -u file:///Users/ekmett/ghc/ghc-9.2.0.20210422-x86_64-apple-darwin.tar.xz head
```
leads to
```
[ ghc-make ] "/Users/ekmett/.ghcup/ghc/head/lib/ghc-9.2.0.20210422/bin/ghc-pkg" --force --global-package-db "/Users/ekmet...
a... dyld: Library not loaded: /nix/store/wxx8sfsa5x1753r8d1x8dx2927qncwbw-ncurses-6.2/lib/libncursesw.6.dylib
a...c-make ] Referenced from: /Users/ekmett/.ghcup/ghc/head/lib/ghc-9.2.0.20210422/terminfo-0.4.1.4/libHSterminfo-0.4.1...
[ ghc-make ] Reason: image not found
[ ghc-make ] make[1]: *** [install_packages] Abort trap: 6
a... make: *** [install] Error 2
```
I get the same error if I extract the distribution, `xattr -rc` and then `./configure` and `make install` as normal.
It appears that the distribution includes fixed path links to `nix-darwin` specific build paths.
## Expected behavior
Installation of ghc 9.2.1-alpha2.
## Environment
* GHC version used: 9.2.1-alpha2
Optional:
* Operating System: OSX
* System Architecture: Darwin9.2.1