From git at git.haskell.org Mon Oct 1 00:10:23 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 1 Oct 2018 00:10:23 +0000 (UTC) Subject: [commit: ghc] wip/kavon-llvm-improve: Multiple fixes / improvements for LLVM backend #13904 (0424cc8) Message-ID: <20181001001023.49A283A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/kavon-llvm-improve Link : http://ghc.haskell.org/trac/ghc/changeset/0424cc8a589590925738ca0748d47321e526698d/ghc >--------------------------------------------------------------- commit 0424cc8a589590925738ca0748d47321e526698d Merge: aa362d4 df67f95 Author: Kavon Farvardin Date: Sun Sep 30 18:51:52 2018 -0500 Multiple fixes / improvements for LLVM backend #13904 Summary: - Fix for #13904 -- stop "trashing" callee-saved registers, since it is not actually doing anything useful. - Fix for #14251 -- fixes the calling convention for functions passing raw SSE-register values by adding padding as needed to get the values in the right registers. This problem cropped up when some args were unused an dropped from the live list. - Fixed a typo in 'readnone' attribute - Added 'lower-expect' pass to level 0 LLVM optimization passes to improve block layout in LLVM for stack checks, etc. Test Plan: `make test WAYS=optllvm` and `make test WAYS=llvm` Reviewers: bgamari, simonmar, angerman Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5190 >--------------------------------------------------------------- 0424cc8a589590925738ca0748d47321e526698d compiler/deSugar/Check.hs | 89 +++++++++++++++------- compiler/main/DynFlags.hs | 6 +- compiler/main/SysTools/ExtraObj.hs | 4 + compiler/typecheck/TcExpr.hs | 7 +- compiler/typecheck/TcMType.hs | 12 ++- compiler/typecheck/TcSimplify.hs | 53 ++++++++++++- compiler/utils/MonadUtils.hs | 7 ++ docs/users_guide/phases.rst | 14 ++++ testsuite/tests/pmcheck/should_compile/T14813.hs | 28 +++++++ testsuite/tests/pmcheck/should_compile/T15305.hs | 5 -- .../tests/pmcheck/should_compile/T15305.stderr | 2 +- testsuite/tests/pmcheck/should_compile/all.T | 2 + testsuite/tests/rts/KeepCafs1.hs | 9 +++ testsuite/tests/rts/KeepCafs2.hs | 9 +++ testsuite/tests/rts/KeepCafsBase.hs | 4 + testsuite/tests/rts/KeepCafsMain.hs | 25 ++++++ testsuite/tests/rts/Makefile | 10 +++ testsuite/tests/rts/all.T | 22 ++++++ testsuite/tests/rts/keep-cafs-fail.stdout | 5 ++ .../tests/rts/keep-cafs.stdout | 1 + 20 files changed, 269 insertions(+), 45 deletions(-) From git at git.haskell.org Mon Oct 1 00:10:26 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 1 Oct 2018 00:10:26 +0000 (UTC) Subject: [commit: ghc] wip/kavon-llvm-improve: remove redundant isSSE def (ff5fd9c) Message-ID: <20181001001026.1EA193A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/kavon-llvm-improve Link : http://ghc.haskell.org/trac/ghc/changeset/ff5fd9c637506d6e780d1ee4d54c745b97f1dc2b/ghc >--------------------------------------------------------------- commit ff5fd9c637506d6e780d1ee4d54c745b97f1dc2b Author: Kavon Farvardin Date: Sun Sep 30 19:09:38 2018 -0500 remove redundant isSSE def >--------------------------------------------------------------- ff5fd9c637506d6e780d1ee4d54c745b97f1dc2b compiler/llvmGen/LlvmCodeGen/Base.hs | 3 --- 1 file changed, 3 deletions(-) diff --git a/compiler/llvmGen/LlvmCodeGen/Base.hs b/compiler/llvmGen/LlvmCodeGen/Base.hs index ac75409..ec91bac 100644 --- a/compiler/llvmGen/LlvmCodeGen/Base.hs +++ b/compiler/llvmGen/LlvmCodeGen/Base.hs @@ -155,9 +155,6 @@ llvmFunArgs dflags live = paddedLive = map (\(_,r) -> r) $ padLiveArgs live isLive r = r `elem` alwaysLive || r `elem` paddedLive isPassed r = not (isSSE r) || isLive r - isSSE r - | Just _ <- sseRegNum r = True - | otherwise = False isSSE :: GlobalReg -> Bool From git at git.haskell.org Mon Oct 1 00:10:29 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 1 Oct 2018 00:10:29 +0000 (UTC) Subject: [commit: ghc] wip/kavon-llvm-improve's head updated: remove redundant isSSE def (ff5fd9c) Message-ID: <20181001001029.379763A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc Branch 'wip/kavon-llvm-improve' now includes: e72d788 Normalise EmptyCase types using the constraint solver c89297e Expose wopt_set/unset_fatal in DynFlags df67f95 Add -fkeep-cafs 0424cc8 Multiple fixes / improvements for LLVM backend #13904 ff5fd9c remove redundant isSSE def From git at git.haskell.org Mon Oct 1 14:23:42 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 1 Oct 2018 14:23:42 +0000 (UTC) Subject: [commit: ghc] master: Always check the relocation value for x86_64 (e44c992) Message-ID: <20181001142342.BCF073A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/e44c992ff62ae8d55b297db9f721ee7a40357a76/ghc >--------------------------------------------------------------- commit e44c992ff62ae8d55b297db9f721ee7a40357a76 Author: Zejun Wu Date: Mon Oct 1 15:12:29 2018 +0200 Always check the relocation value for x86_64 Summary: Always check that no overflow happens during relocation for x86_64. It's not safe to assume the result returned by `ocAllocateSymbolExtras` is always valid if we allocate it neither in lower 2G nor in a contiguous range with the image. There are also some minor fixes in this diff: * `off >= 0x7fffffffL` should be `>` * use of unaligned pointer is undefined behavior, use `memcpy` instead, gcc will be able to optimize it to `mov %edx, (%rax)`. Test Plan: build ghci with: ``` DYNAMIC_GHC_PROGRAMS = NO DYNAMIC_BY_DEFAULT = NO ``` and play with it. ./validate Reviewers: simonmar, austin, bgamari, erikd Reviewed By: simonmar Subscribers: alpmestan, rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5168 >--------------------------------------------------------------- e44c992ff62ae8d55b297db9f721ee7a40357a76 rts/linker/Elf.c | 126 ++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 79 insertions(+), 47 deletions(-) diff --git a/rts/linker/Elf.c b/rts/linker/Elf.c index f2fd88f..fd24a92 100644 --- a/rts/linker/Elf.c +++ b/rts/linker/Elf.c @@ -1576,8 +1576,11 @@ do_Elf_Rela_relocations ( ObjectCode* oc, char* ehdrC, break; case COMPAT_R_X86_64_64: - *(Elf64_Xword *)P = value; + { + Elf64_Xword payload = value; + memcpy((void*)P, &payload, sizeof(payload)); break; + } case COMPAT_R_X86_64_PC32: { @@ -1585,79 +1588,93 @@ do_Elf_Rela_relocations ( ObjectCode* oc, char* ehdrC, barf("R_X86_64_PC32 relocation, but ALWAYS_PIC."); #else StgInt64 off = value - P; - if (off >= 0x7fffffffL || off < -0x80000000L) { - if (X86_64_ELF_NONPIC_HACK) { - StgInt64 pltAddress = - (StgInt64) &makeSymbolExtra(oc, ELF_R_SYM(info), S) - -> jumpIsland; - off = pltAddress + A - P; - } else { - errorBelch("R_X86_64_PC32 relocation out of range: %s = %" - PRId64 "d\nRecompile %s with -fPIC.", - symbol, off, oc->fileName ); - return 0; - } + if (off != (Elf64_Sword)off && X86_64_ELF_NONPIC_HACK) { + StgInt64 pltAddress = + (StgInt64) &makeSymbolExtra(oc, ELF_R_SYM(info), S) + -> jumpIsland; + off = pltAddress + A - P; + } + if (off != (Elf64_Sword)off) { + errorBelch( + "R_X86_64_PC32 relocation out of range: %s = %" PRIx64 + "\nRecompile %s with -fPIC -fexternal-dynamic-refs.", + symbol, off, oc->fileName); + return 0; } - *(Elf64_Word *)P = (Elf64_Word)off; + Elf64_Sword payload = off; + memcpy((void*)P, &payload, sizeof(payload)); #endif break; } case COMPAT_R_X86_64_PC64: { - StgInt64 off = value - P; - *(Elf64_Word *)P = (Elf64_Word)off; + Elf64_Sxword payload = value - P; + memcpy((void*)P, &payload, sizeof(payload)); break; } case COMPAT_R_X86_64_32: + { #if defined(ALWAYS_PIC) barf("R_X86_64_32 relocation, but ALWAYS_PIC."); #else - if (value >= 0x7fffffffL) { - if (X86_64_ELF_NONPIC_HACK) { - StgInt64 pltAddress = - (StgInt64) &makeSymbolExtra(oc, ELF_R_SYM(info), S) - -> jumpIsland; - value = pltAddress + A; - } else { - errorBelch("R_X86_64_32 relocation out of range: %s = %" - PRId64 "d\nRecompile %s with -fPIC.", - symbol, value, oc->fileName ); - return 0; - } + if (value != (Elf64_Word)value && X86_64_ELF_NONPIC_HACK) { + StgInt64 pltAddress = + (StgInt64) &makeSymbolExtra(oc, ELF_R_SYM(info), S) + -> jumpIsland; + value = pltAddress + A; + } + if (value != (Elf64_Word)value) { + errorBelch( + "R_X86_64_32 relocation out of range: %s = %" PRIx64 + "\nRecompile %s with -fPIC -fexternal-dynamic-refs.", + symbol, value, oc->fileName); + return 0; } - *(Elf64_Word *)P = (Elf64_Word)value; + Elf64_Word payload = value; + memcpy((void*)P, &payload, sizeof(payload)); #endif break; + } case COMPAT_R_X86_64_32S: + { #if defined(ALWAYS_PIC) barf("R_X86_64_32S relocation, but ALWAYS_PIC."); #else - if ((StgInt64)value > 0x7fffffffL || (StgInt64)value < -0x80000000L) { - if (X86_64_ELF_NONPIC_HACK) { - StgInt64 pltAddress = - (StgInt64) &makeSymbolExtra(oc, ELF_R_SYM(info), S) - -> jumpIsland; - value = pltAddress + A; - } else { - errorBelch("R_X86_64_32S relocation out of range: %s = %" - PRId64 "d\nRecompile %s with -fPIC.", - symbol, value, oc->fileName ); - return 0; - } + if ((StgInt64)value != (Elf64_Sword)value && X86_64_ELF_NONPIC_HACK) { + StgInt64 pltAddress = + (StgInt64) &makeSymbolExtra(oc, ELF_R_SYM(info), S) + -> jumpIsland; + value = pltAddress + A; + } + if ((StgInt64)value != (Elf64_Sword)value) { + errorBelch( + "R_X86_64_32S relocation out of range: %s = %" PRIx64 + "\nRecompile %s with -fPIC -fexternal-dynamic-refs.", + symbol, value, oc->fileName); + return 0; } - *(Elf64_Sword *)P = (Elf64_Sword)value; + Elf64_Sword payload = value; + memcpy((void*)P, &payload, sizeof(payload)); #endif break; + } case COMPAT_R_X86_64_REX_GOTPCRELX: case COMPAT_R_X86_64_GOTPCRELX: case COMPAT_R_X86_64_GOTPCREL: { StgInt64 gotAddress = (StgInt64) &makeSymbolExtra(oc, ELF_R_SYM(info), S)->addr; StgInt64 off = gotAddress + A - P; - *(Elf64_Word *)P = (Elf64_Word)off; + if (off != (Elf64_Sword)off) { + barf( + "COMPAT_R_X86_64_GOTPCREL relocation out of range: " + "%s = %" PRIx64 " in %s.", + symbol, off, oc->fileName); + } + Elf64_Sword payload = off; + memcpy((void*)P, &payload, sizeof(payload)); break; } #if defined(dragonfly_HOST_OS) @@ -1674,7 +1691,15 @@ do_Elf_Rela_relocations ( ObjectCode* oc, char* ehdrC, /* make entry in GOT that contains said offset */ StgInt64 gotEntry = (StgInt64) &makeSymbolExtra(oc, ELF_R_SYM(info), (S - (Elf64_Addr)(ti.base)))->addr; - *(Elf64_Word *)P = gotEntry + A - P; + StgInt64 off = gotEntry + A - P; + if (off != (Elf64_Sword)off) { + barf( + "COMPAT_R_X86_64_GOTTPOFF relocation out of range: " + "%s = %" PRIx64 " in %s.", + symbol, off, oc->fileName); + } + Elf64_SWord payload = off; + memcpy((void*)P, &payload, sizeof(payload)); #endif break; } @@ -1686,19 +1711,26 @@ do_Elf_Rela_relocations ( ObjectCode* oc, char* ehdrC, barf("R_X86_64_PLT32 relocation, but ALWAYS_PIC."); #else StgInt64 off = value - P; - if (off >= 0x7fffffffL || off < -0x80000000L) { + if (off != (Elf64_Sword)off) { StgInt64 pltAddress = (StgInt64) &makeSymbolExtra(oc, ELF_R_SYM(info), S) -> jumpIsland; off = pltAddress + A - P; } - *(Elf64_Word *)P = (Elf64_Word)off; + if (off != (Elf64_Sword)off) { + barf( + "R_X86_64_PLT32 relocation out of range: " + "%s = %" PRIx64 " in %s.", + symbol, off, oc->fileName); + } + Elf64_Sword payload = off; + memcpy((void*)P, &payload, sizeof(payload)); #endif break; } #endif default: - errorBelch("%s: unhandled ELF relocation(RelA) type %" FMT_Word "\n", + barf("%s: unhandled ELF relocation(RelA) type %" FMT_Word "\n", oc->fileName, (W_)ELF_R_TYPE(info)); return 0; } From git at git.haskell.org Mon Oct 1 14:23:45 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 1 Oct 2018 14:23:45 +0000 (UTC) Subject: [commit: ghc] master: CodeGen: Teach CodeGen about aliasing of XMM/YMM/ZMM registers (139ef7e) Message-ID: <20181001142345.8B3C13A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/139ef7e19194c8396bb857df83fdd6bbe9ff3283/ghc >--------------------------------------------------------------- commit 139ef7e19194c8396bb857df83fdd6bbe9ff3283 Author: Ben Gamari Date: Mon Oct 1 15:13:32 2018 +0200 CodeGen: Teach CodeGen about aliasing of XMM/YMM/ZMM registers Reviewers: simonmar Reviewed By: simonmar Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5186 >--------------------------------------------------------------- 139ef7e19194c8396bb857df83fdd6bbe9ff3283 includes/CodeGen.Platform.hs | 66 +++++++++++++++++++++++--------------------- 1 file changed, 34 insertions(+), 32 deletions(-) diff --git a/includes/CodeGen.Platform.hs b/includes/CodeGen.Platform.hs index 868608a..8e93690 100644 --- a/includes/CodeGen.Platform.hs +++ b/includes/CodeGen.Platform.hs @@ -48,6 +48,8 @@ import Reg # define fake4 20 # define fake5 21 +-- N.B. XMM, YMM, and ZMM are all aliased to the same hardware registers hence +-- being assigned the same RegNos. # define xmm0 24 # define xmm1 25 # define xmm2 26 @@ -65,39 +67,39 @@ import Reg # define xmm14 38 # define xmm15 39 -# define ymm0 40 -# define ymm1 41 -# define ymm2 42 -# define ymm3 43 -# define ymm4 44 -# define ymm5 45 -# define ymm6 46 -# define ymm7 47 -# define ymm8 48 -# define ymm9 49 -# define ymm10 50 -# define ymm11 51 -# define ymm12 52 -# define ymm13 53 -# define ymm14 54 -# define ymm15 55 +# define ymm0 24 +# define ymm1 25 +# define ymm2 26 +# define ymm3 27 +# define ymm4 28 +# define ymm5 29 +# define ymm6 30 +# define ymm7 31 +# define ymm8 32 +# define ymm9 33 +# define ymm10 34 +# define ymm11 35 +# define ymm12 36 +# define ymm13 37 +# define ymm14 38 +# define ymm15 39 -# define zmm0 56 -# define zmm1 57 -# define zmm2 58 -# define zmm3 59 -# define zmm4 60 -# define zmm5 61 -# define zmm6 62 -# define zmm7 63 -# define zmm8 64 -# define zmm9 65 -# define zmm10 66 -# define zmm11 67 -# define zmm12 68 -# define zmm13 69 -# define zmm14 70 -# define zmm15 71 +# define zmm0 24 +# define zmm1 25 +# define zmm2 26 +# define zmm3 27 +# define zmm4 28 +# define zmm5 29 +# define zmm6 30 +# define zmm7 31 +# define zmm8 32 +# define zmm9 33 +# define zmm10 34 +# define zmm11 35 +# define zmm12 36 +# define zmm13 37 +# define zmm14 38 +# define zmm15 39 -- Note: these are only needed for ARM/ARM64 because globalRegMaybe is now used in CmmSink.hs. -- Since it's only used to check 'isJust', the actual values don't matter, thus From git at git.haskell.org Mon Oct 1 14:23:48 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 1 Oct 2018 14:23:48 +0000 (UTC) Subject: [commit: ghc] master: ghc-bin.cabal.in: add a 'threaded' flag for hadrian (99eb459) Message-ID: <20181001142348.5F2093A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/99eb4595910f20c41734aa07a2da4db1f25512ae/ghc >--------------------------------------------------------------- commit 99eb4595910f20c41734aa07a2da4db1f25512ae Author: Alp Mestanogullari Date: Mon Oct 1 15:14:23 2018 +0200 ghc-bin.cabal.in: add a 'threaded' flag for hadrian Summary: hadrian will explicitly enable this flag, but more importantly needs it as otherwise we just never end up passing -threaded to GHC when building a new GHC binary. We could quite likely unconditionally pass -threaded, as the corresponding logic for GhcThreaded in mk/config.mk.in seems to always lead to it being set to True, but we instead leave a way out for anyone in need of a GHC linked against a non-threaded runtime system in the future. Test Plan: T8242 (with a GHC built by hadrian) Reviewers: bgamari Reviewed By: bgamari Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5146 >--------------------------------------------------------------- 99eb4595910f20c41734aa07a2da4db1f25512ae ghc/ghc-bin.cabal.in | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ghc/ghc-bin.cabal.in b/ghc/ghc-bin.cabal.in index 5c51058..1f15c34 100644 --- a/ghc/ghc-bin.cabal.in +++ b/ghc/ghc-bin.cabal.in @@ -24,6 +24,11 @@ Flag ghci Default: False Manual: True +Flag threaded + Description: Link the ghc executable against the threaded RTS + Default: True + Manual: True + Executable ghc Default-Language: Haskell2010 @@ -80,6 +85,13 @@ Executable ghc UnboxedTuples ViewPatterns + -- The flag being True by default, this reflects the + -- mk/config.mk.in logic for GhcThreaded (which ends up + -- always being True as well). One can still opt out by + -- disabling this flag. + if flag(threaded) + ghc-options: -threaded + Other-Extensions: CPP NondecreasingIndentation From git at git.haskell.org Mon Oct 1 15:53:23 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 1 Oct 2018 15:53:23 +0000 (UTC) Subject: [commit: ghc] master: primops: Fix documentation of compactAllocateBlock# (d157762) Message-ID: <20181001155323.643F23A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/d1577621519f7740a6cc9ecdebc70e3ba9098409/ghc >--------------------------------------------------------------- commit d1577621519f7740a6cc9ecdebc70e3ba9098409 Author: Ben Gamari Date: Wed Sep 26 16:03:44 2018 -0400 primops: Fix documentation of compactAllocateBlock# Pointed out by @andrewthad. >--------------------------------------------------------------- d1577621519f7740a6cc9ecdebc70e3ba9098409 compiler/prelude/primops.txt.pp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/compiler/prelude/primops.txt.pp b/compiler/prelude/primops.txt.pp index 2f8ced7..9e14648 100644 --- a/compiler/prelude/primops.txt.pp +++ b/compiler/prelude/primops.txt.pp @@ -2818,11 +2818,11 @@ primop CompactGetNextBlockOp "compactGetNextBlock#" GenPrimOp primop CompactAllocateBlockOp "compactAllocateBlock#" GenPrimOp Word# -> Addr# -> State# RealWorld -> (# State# RealWorld, Addr# #) { Attempt to allocate a compact block with the given size (in - bytes) at the given address. The first argument is a hint to - the allocator, allocation might be satisfied at a different - address (which is returned). + bytes, given by the first argument). The {\texttt Addr\#} is a pointer to + previous block of the compact or {\texttt nullAddr\#} to create a new compact. + The resulting block is not known to the GC until - compactFixupPointers# is called on it, and care must be taken + {\texttt compactFixupPointers\#} is called on it, and care must be taken so that the address does not escape or memory will be leaked. } with From git at git.haskell.org Mon Oct 1 15:53:38 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 1 Oct 2018 15:53:38 +0000 (UTC) Subject: [commit: ghc] master: ghc-prim: Add missing changelog entry (4578548) Message-ID: <20181001155338.9D0573A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/4578548faf0679efb1d9f851835c99343cd04717/ghc >--------------------------------------------------------------- commit 4578548faf0679efb1d9f851835c99343cd04717 Author: Ben Gamari Date: Thu Sep 27 18:46:37 2018 -0400 ghc-prim: Add missing changelog entry >--------------------------------------------------------------- 4578548faf0679efb1d9f851835c99343cd04717 libraries/ghc-prim/changelog.md | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/libraries/ghc-prim/changelog.md b/libraries/ghc-prim/changelog.md index 76da3e0..ee1ed5c 100644 --- a/libraries/ghc-prim/changelog.md +++ b/libraries/ghc-prim/changelog.md @@ -10,12 +10,46 @@ - Shipped with GHC 8.6.1 - Added to `GHC.Prim`: + addWordC# :: Word# -> Word# -> (# Word#, Int# #) - `unpackClosure#` can now unpack any valid Haskell closure. Previously it returned empty pointer and non-pointer arrays for thunks. +- Add unaligned bytearray access primops (#4442) + + readWord8ArrayAsChar# :: MutableByteArray# s -> Int# -> State# s -> (# State# s, Char# #) + readWord8ArrayAsAddr# :: MutableByteArray# s -> Int# -> State# s -> (# State# s, Addr# #) + readWord8ArrayAsFloat# :: MutableByteArray# s -> Int# -> State# s -> (# State# s, Float# #) + readWord8ArrayAsDouble# :: MutableByteArray# s -> Int# -> State# s -> (# State# s, Double# #) + readWord8ArrayAsStablePtr# :: MutableByteArray# s -> Int# -> State# s -> (# State# s, StablePtr# #) + readWord8ArrayAsInt16# :: MutableByteArray# s -> Int# -> State# s -> (# State# s, Int16# #) + readWord8ArrayAsInt32# :: MutableByteArray# s -> Int# -> State# s -> (# State# s, Int32# #) + readWord8ArrayAsInt64# :: MutableByteArray# s -> Int# -> State# s -> (# State# s, Int64# #) + readWord8ArrayAsInt# :: MutableByteArray# s -> Int# -> State# s -> (# State# s, Int# #) + + readWord8ArrayAsWord16# :: MutableByteArray# s -> Int# -> State# s -> (# State# s, Word16# #) + readWord8ArrayAsWord32# :: MutableByteArray# s -> Int# -> State# s -> (# State# s, Word32# #) + readWord8ArrayAsWord64# :: MutableByteArray# s -> Int# -> State# s -> (# State# s, Word64# #) + readWord8ArrayAsWord# :: MutableByteArray# s -> Int# -> State# s -> (# State# s, Word# #) + + writeWord8ArrayAsChar# :: MutableByteArray# s -> Int# -> Char# -> State# s -> State# s + writeWord8ArrayAsAddr# :: MutableByteArray# s -> Int# -> Addr# -> State# s -> State# s + writeWord8ArrayAsFloat# :: MutableByteArray# s -> Int# -> Float# -> State# s -> State# s + writeWord8ArrayAsDouble# :: MutableByteArray# s -> Int# -> Double# -> State# s -> State# s + writeWord8ArrayAsStablePtr# :: MutableByteArray# s -> Int# -> StablePtr# -> State# s -> State# s + + writeWord8ArrayAsInt16# :: MutableByteArray# s -> Int# -> Int16# -> State# s -> State# s + writeWord8ArrayAsInt32# :: MutableByteArray# s -> Int# -> Int32# -> State# s -> State# s + writeWord8ArrayAsInt64# :: MutableByteArray# s -> Int# -> Int64# -> State# s -> State# s + writeWord8ArrayAsInt# :: MutableByteArray# s -> Int# -> Int# -> State# s -> State# s + + writeWord8ArrayAsWord16# :: MutableByteArray# s -> Int# -> Word16# -> State# s -> State# s + writeWord8ArrayAsWord32# :: MutableByteArray# s -> Int# -> Word32# -> State# s -> State# s + writeWord8ArrayAsWord64# :: MutableByteArray# s -> Int# -> Word64# -> State# s -> State# s + writeWord8ArrayAsWord# :: MutableByteArray# s -> Int# -> Word# -> State# s -> State# s + ## 0.5.2.0 - Shipped with GHC 8.4.1 From git at git.haskell.org Mon Oct 1 15:53:53 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 1 Oct 2018 15:53:53 +0000 (UTC) Subject: [commit: ghc] master: ghc-prim: Fix typo in traceBinaryEvent# changelog entry (0ac86cb) Message-ID: <20181001155353.A8D323A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/0ac86cb77b54ae1c9a7ff377cef47fe14affdf65/ghc >--------------------------------------------------------------- commit 0ac86cb77b54ae1c9a7ff377cef47fe14affdf65 Author: Ben Gamari Date: Thu Sep 27 18:46:53 2018 -0400 ghc-prim: Fix typo in traceBinaryEvent# changelog entry >--------------------------------------------------------------- 0ac86cb77b54ae1c9a7ff377cef47fe14affdf65 libraries/ghc-prim/changelog.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libraries/ghc-prim/changelog.md b/libraries/ghc-prim/changelog.md index ee1ed5c..ecbc93f 100644 --- a/libraries/ghc-prim/changelog.md +++ b/libraries/ghc-prim/changelog.md @@ -3,7 +3,8 @@ - Shipped with GHC 8.8.1 - Added to `GHC.Prim`: - traveBinaryEvent# :: Addr# -> Int# -> State# s -> State# s + + traceBinaryEvent# :: Addr# -> Int# -> State# s -> State# s ## 0.5.3 (edit as necessary) From git at git.haskell.org Mon Oct 1 15:54:12 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 1 Oct 2018 15:54:12 +0000 (UTC) Subject: [commit: ghc] master: circleci: Run slowtest with multiple threads (64475db) Message-ID: <20181001155412.03DAE3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/64475db050f25135e30d787ddeaf4e28ff00e1ef/ghc >--------------------------------------------------------------- commit 64475db050f25135e30d787ddeaf4e28ff00e1ef Author: Ben Gamari Date: Mon Oct 1 11:46:54 2018 -0400 circleci: Run slowtest with multiple threads >--------------------------------------------------------------- 64475db050f25135e30d787ddeaf4e28ff00e1ef .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 19780ab..a9c4cef 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -71,7 +71,7 @@ aliases: - &slowtest run: name: Full Test - command: make slowtest SKIP_PERF_TESTS=YES + command: make slowtest SKIP_PERF_TESTS=YES THREADS=`mk/detect-cpu-count.sh` JUNIT_FILE=../../test-results/junit.xml - &bindist run: name: Create bindist From git at git.haskell.org Mon Oct 1 16:48:54 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 1 Oct 2018 16:48:54 +0000 (UTC) Subject: [commit: ghc] master: Fix #15637 by using VTA more in GND (309438e) Message-ID: <20181001164854.90B9E3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/309438e948359a0ae71ffac4a41ebcd855cf5657/ghc >--------------------------------------------------------------- commit 309438e948359a0ae71ffac4a41ebcd855cf5657 Author: Ryan Scott Date: Mon Oct 1 12:00:52 2018 -0400 Fix #15637 by using VTA more in GND Summary: The code that GND was generating before could crumple over if it derived an instance for a class with an ambiguous type variable in the class head, such as the example in #15637. The solution is straightforward: simply instantiate all variables bound by the class head explicitly using visible type application, which will nip any ambiguity in the bud. Test Plan: make test TEST=T15637 Reviewers: bgamari, simonpj, goldfire Reviewed By: simonpj Subscribers: simonpj, rwbarton, carter GHC Trac Issues: #15637 Differential Revision: https://phabricator.haskell.org/D5148 >--------------------------------------------------------------- 309438e948359a0ae71ffac4a41ebcd855cf5657 compiler/typecheck/FamInst.hs | 12 ++-- compiler/typecheck/TcGenDeriv.hs | 46 +++++++++++++- compiler/typecheck/TcTyClsDecls.hs | 11 ++-- compiler/typecheck/TcValidity.hs | 4 +- compiler/types/Type.hs | 73 +++++++++++++--------- .../tests/deriving/should_compile/T14578.stderr | 26 +++++--- testsuite/tests/deriving/should_compile/T15637.hs | 9 +++ testsuite/tests/deriving/should_compile/all.T | 1 + testsuite/tests/deriving/should_fail/T15073.stderr | 4 +- testsuite/tests/deriving/should_fail/T4846.stderr | 6 +- 10 files changed, 137 insertions(+), 55 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 309438e948359a0ae71ffac4a41ebcd855cf5657 From git at git.haskell.org Mon Oct 1 16:48:58 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 1 Oct 2018 16:48:58 +0000 (UTC) Subject: [commit: ghc] master: Quantify class variables first in associated families' kinds (a57fa24) Message-ID: <20181001164858.76C843A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/a57fa24746421c0e13d0c09b72cbabea3622779f/ghc >--------------------------------------------------------------- commit a57fa24746421c0e13d0c09b72cbabea3622779f Author: Ryan Scott Date: Mon Oct 1 12:05:12 2018 -0400 Quantify class variables first in associated families' kinds Summary: Previously, `kcLHsQTyVars` would always quantify class-bound variables invisibly in the kinds of associated types, resulting in #15591. We counteract this by explicitly passing the class-bound variables to `kcLHsQTyVars` and quantifying over the ones that are mentioned in the associated type such that (1) they are specified, and (2) they come before other kind variables. See `Note [Kind variable ordering for associated types]`. Test Plan: make test TEST=T15591 Reviewers: goldfire, simonpj, bgamari Reviewed By: simonpj Subscribers: rwbarton, carter GHC Trac Issues: #15591 Differential Revision: https://phabricator.haskell.org/D5159 >--------------------------------------------------------------- a57fa24746421c0e13d0c09b72cbabea3622779f compiler/typecheck/TcHsType.hs | 82 ++++++++++++++++++++++++++---- compiler/typecheck/TcTyClsDecls.hs | 57 +++++++++++++-------- docs/users_guide/glasgow_exts.rst | 12 +++++ testsuite/tests/ghci/scripts/T15591.hs | 10 ++++ testsuite/tests/ghci/scripts/T15591.script | 4 ++ testsuite/tests/ghci/scripts/T15591.stdout | 2 + testsuite/tests/ghci/scripts/all.T | 1 + 7 files changed, 138 insertions(+), 30 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc a57fa24746421c0e13d0c09b72cbabea3622779f From git at git.haskell.org Tue Oct 2 13:17:28 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 2 Oct 2018 13:17:28 +0000 (UTC) Subject: [commit: ghc] master: circleci: Create missing test-results directory (caffff1) Message-ID: <20181002131728.723633A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/caffff1238097821cd2879f7285010a6565afd52/ghc >--------------------------------------------------------------- commit caffff1238097821cd2879f7285010a6565afd52 Author: Ben Gamari Date: Tue Oct 2 09:16:27 2018 -0400 circleci: Create missing test-results directory >--------------------------------------------------------------- caffff1238097821cd2879f7285010a6565afd52 .circleci/config.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a9c4cef..53962c9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -71,7 +71,9 @@ aliases: - &slowtest run: name: Full Test - command: make slowtest SKIP_PERF_TESTS=YES THREADS=`mk/detect-cpu-count.sh` JUNIT_FILE=../../test-results/junit.xml + command: | + mkdir -p test-results + make slowtest SKIP_PERF_TESTS=YES THREADS=`mk/detect-cpu-count.sh` JUNIT_FILE=../../test-results/junit.xml - &bindist run: name: Create bindist From git at git.haskell.org Tue Oct 2 14:00:44 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 2 Oct 2018 14:00:44 +0000 (UTC) Subject: [commit: ghc] master: GHCi should not filter instances involving cTuples (21efbc7) Message-ID: <20181002140044.91D313A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/21efbc7599e39ec93b8b13b7d7b84811226e6f6f/ghc >--------------------------------------------------------------- commit 21efbc7599e39ec93b8b13b7d7b84811226e6f6f Author: Alec Theriault Date: Tue Oct 2 14:48:00 2018 +0200 GHCi should not filter instances involving cTuples Summary: See the new T12005 test case for an example of this. Test Plan: make TEST=T12005 Reviewers: bgamari, osa1 Reviewed By: osa1 Subscribers: osa1, rwbarton, carter GHC Trac Issues: #12005 Differential Revision: https://phabricator.haskell.org/D5182 >--------------------------------------------------------------- 21efbc7599e39ec93b8b13b7d7b84811226e6f6f compiler/main/InteractiveEval.hs | 2 ++ testsuite/tests/ghci/scripts/T12005.script | 8 ++++++++ testsuite/tests/ghci/scripts/T12005.stdout | 6 ++++++ testsuite/tests/ghci/scripts/all.T | 1 + 4 files changed, 17 insertions(+) diff --git a/compiler/main/InteractiveEval.hs b/compiler/main/InteractiveEval.hs index 452ccb3..3d9dc18 100644 --- a/compiler/main/InteractiveEval.hs +++ b/compiler/main/InteractiveEval.hs @@ -76,6 +76,7 @@ import UniqSupply import MonadUtils import Module import PrelNames ( toDynName, pretendNameIsInScope ) +import TysWiredIn ( isCTupleTyConName ) import Panic import Maybes import ErrUtils @@ -758,6 +759,7 @@ getInfo allInfo name -- The one we looked for in the first place! | pretendNameIsInScope n = True | isBuiltInSyntax n = True + | isCTupleTyConName n = True | isExternalName n = isJust (lookupGRE_Name rdr_env n) | otherwise = True diff --git a/testsuite/tests/ghci/scripts/T12005.script b/testsuite/tests/ghci/scripts/T12005.script new file mode 100644 index 0000000..a86e7d5 --- /dev/null +++ b/testsuite/tests/ghci/scripts/T12005.script @@ -0,0 +1,8 @@ +:set -XKindSignatures -XRank2Types -XConstraintKinds -XAllowAmbiguousTypes -XInstanceSigs + +import Data.Kind + +class Defer (p :: Constraint) where defer :: (p => r) -> r +instance Defer () where defer :: r -> r; defer = id + +:i Defer diff --git a/testsuite/tests/ghci/scripts/T12005.stdout b/testsuite/tests/ghci/scripts/T12005.stdout new file mode 100644 index 0000000..34cde4a --- /dev/null +++ b/testsuite/tests/ghci/scripts/T12005.stdout @@ -0,0 +1,6 @@ +class Defer (p :: Constraint) where + defer :: (p => r) -> r + {-# MINIMAL defer #-} + -- Defined at :5:1 +instance [safe] Defer (() :: Constraint) + -- Defined at :6:10 diff --git a/testsuite/tests/ghci/scripts/all.T b/testsuite/tests/ghci/scripts/all.T index dcc4855..67c4b38 100755 --- a/testsuite/tests/ghci/scripts/all.T +++ b/testsuite/tests/ghci/scripts/all.T @@ -252,6 +252,7 @@ test('T12007', normal, ghci_script, ['T12007.script']) test('T11975', normal, ghci_script, ['T11975.script']) test('T10963', normal, ghci_script, ['T10963.script']) test('T11721', normal, ghci_script, ['T11721.script']) +test('T12005', normal, ghci_script, ['T12005.script']) test('T12023', normal, run_command, ['$MAKE -s --no-print-directory T12023']) test('T12520', normal, ghci_script, ['T12520.script']) From git at git.haskell.org Tue Oct 2 14:00:47 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 2 Oct 2018 14:00:47 +0000 (UTC) Subject: [commit: ghc] master: rts.cabal.in: add more flags to control the extra flavours (for hadrian) (e3355b7) Message-ID: <20181002140047.6219E3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/e3355b7c5955df8daab0f3fc75fe021f42d21dbb/ghc >--------------------------------------------------------------- commit e3355b7c5955df8daab0f3fc75fe021f42d21dbb Author: Alp Mestanogullari Date: Tue Oct 2 14:46:28 2018 +0200 rts.cabal.in: add more flags to control the extra flavours (for hadrian) Summary: In order to properly honor the different ways in which the RTS must be built by hadrian, and in particular to have fine grained control over that, I'm introducing new Cabal flags in rts.cabal[.in]. This should not affect the make build system and will only be used and picked up by hadrian, which uses Cabal directly to operate on cabal packages, including libHSrts. Reviewers: bgamari, erikd, simonmar Reviewed By: bgamari Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5166 >--------------------------------------------------------------- e3355b7c5955df8daab0f3fc75fe021f42d21dbb rts/rts.cabal.in | 40 ++++++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/rts/rts.cabal.in b/rts/rts.cabal.in index e09c054..76fd353 100644 --- a/rts/rts.cabal.in +++ b/rts/rts.cabal.in @@ -28,8 +28,17 @@ flag leading-underscore default: @CabalLeadingUnderscore@ flag smp default: True +-- Some cabal flags used to control the flavours we want to produce +-- for libHSrts in hadrian. By default, we just produce vanilla and +-- threaded. The flags "compose": if you enable debug and profiling, +-- you will produce vanilla, _thr, _debug, _p but also _thr_p, +-- _thr_debug_p and so on. flag profiling default: False +flag debug + default: False +flag logging + default: False library -- rts is a wired in package and @@ -40,25 +49,24 @@ library extra-bundled-libraries: Cffi-6 else extra-bundled-libraries: Cffi - -- the rts comes in a variety of flavours that ar built outside - -- of cabal. The combination of extra-bundled-libraries and - -- extra-library-flavours results in the following libraries to - -- be copied: - -- libHSrts-1.0_debug libHSrts-1.0_l libHSrts-1.0_p - -- libHSrts-1.0_thr libHSrts-1.0_thr_debug libHSrts-1.0_thr_l - -- libHSrts-1.0_thr_p - -- libCffi_debug libCffi_ libCffi_l libCffi_p - -- libCffi_thr libCffi_thr_debug libCffi_thr_l libCffi_thr_p - extra-library-flavours: _debug _l _thr _thr_debug _thr_l -- The make build system does something special in config.mk.in - -- for generating profiled builds of those libraries, but we need to - -- be transparent for hadrian which gets information about the rts - -- "package" through Cabal and this cabal file. We therefore declare - -- several profiling-enabled flavours to be available when passing the - -- 'profiling' flag when configuring the RTS from hadrian, using Cabal. + -- for generating profiled, debugged, etc builds of those + -- libraries, but we need to be transparent for hadrian which + -- gets information about the rts "package" through Cabal and + -- this cabal file. We therefore declare several + -- flavours to be available when passing the suitable (combination of) + -- flag(s) when configuring the RTS from hadrian, using Cabal. + extra-library-flavours: _thr + if flag(profiling) - extra-library-flavours: _p _thr_p _debug_p _thr_debug_p + extra-library-flavours: _p _thr_p + if flag(debug) + extra-library-flavours: _debug_p _thr_debug_p + if flag(debug) + extra-library-flavours: _debug _thr_debug + if flag(logging) + extra-library-flavours: _l _thr_l exposed: True exposed-modules: From git at git.haskell.org Tue Oct 2 14:00:50 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 2 Oct 2018 14:00:50 +0000 (UTC) Subject: [commit: ghc] master: resolve T13704 (abfb91f) Message-ID: <20181002140050.9B8343A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/abfb91fb0ea27eb618f297b1d3ba60cfa021afe0/ghc >--------------------------------------------------------------- commit abfb91fb0ea27eb618f297b1d3ba60cfa021afe0 Author: chessai Date: Tue Oct 2 14:46:08 2018 +0200 resolve T13704 Summary: allow -main-is to change export list for default module header, allowing one to change the entry point to one's program. Test Plan: ./validate Reviewers: bgamari, nomeata, mpickering Reviewed By: mpickering Subscribers: mpickering, rwbarton, carter GHC Trac Issues: #13704 Differential Revision: https://phabricator.haskell.org/D5189 >--------------------------------------------------------------- abfb91fb0ea27eb618f297b1d3ba60cfa021afe0 .gitignore | 6 ++++++ compiler/typecheck/TcRnExports.hs | 13 ++++++------- docs/users_guide/bugs.rst | 28 ++++++++++++++++++++++++++++ testsuite/tests/module/T13704.hs | 3 +++ testsuite/tests/module/all.T | 2 +- 5 files changed, 44 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index c72d044..83fa7ec 100644 --- a/.gitignore +++ b/.gitignore @@ -209,3 +209,9 @@ GIT_COMMIT_ID # Output of ghc-in-ghci /.ghci-objects/ + +# ----------------------------------------------------------------------------- +# ghc.nix +ghc.nix/ + + diff --git a/compiler/typecheck/TcRnExports.hs b/compiler/typecheck/TcRnExports.hs index dbe2b4b..1b57608 100644 --- a/compiler/typecheck/TcRnExports.hs +++ b/compiler/typecheck/TcRnExports.hs @@ -33,7 +33,7 @@ import DataCon import PatSyn import Maybes import Util (capitalise) - +import FastString (fsLit) import Control.Monad import DynFlags @@ -124,19 +124,18 @@ tcRnExports explicit_mod exports -- list, to avoid bleating about re-exporting a deprecated -- thing (especially via 'module Foo' export item) do { - -- If the module header is omitted altogether, then behave - -- as if the user had written "module Main(main) where..." - -- EXCEPT in interactive mode, when we behave as if he had + -- In interactive mode, we behave as if he had -- written "module Main where ..." - -- Reason: don't want to complain about 'main' not in scope - -- in interactive mode ; dflags <- getDynFlags + ; let default_main = case mainFunIs dflags of + Just main_fun -> mkUnqual varName (fsLit main_fun) + Nothing -> main_RDR_Unqual ; let real_exports | explicit_mod = exports | ghcLink dflags == LinkInMemory = Nothing | otherwise = Just (noLoc [noLoc (IEVar noExt - (noLoc (IEName $ noLoc main_RDR_Unqual)))]) + (noLoc (IEName $ noLoc default_main)))]) -- ToDo: the 'noLoc' here is unhelpful if 'main' -- turns out to be out of scope diff --git a/docs/users_guide/bugs.rst b/docs/users_guide/bugs.rst index aee8dc5..0290622 100644 --- a/docs/users_guide/bugs.rst +++ b/docs/users_guide/bugs.rst @@ -173,6 +173,34 @@ same context. For example, this is fine: :: .. _infelicities-Modules: +Default Module headers with -main-is +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The Haskell2010 report specifies in that + + "An abbreviated form of module, consisting only of the module body, + is permitted. If this is used, the header is assumed to be + `module Main(main) where`." + +Consider the following program: :: + + -- file: Main.hs + program :: IO () + program = return () + +Under the report, this would fail with ``ghc -main-is Main.program Main.hs`` +with the following errors: :: + + Main.hs:1:1: error: + Not in scope: 'main' + Perhaps you meant 'min' (imported from Prelude) + + Main.hs:1:1: error: + The main IO action 'program' is not exported by module 'Main' + +GHC's flag '-main-is' allows one to change the entry point name so that +the above example would succeed. + Module system and interface files ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/testsuite/tests/module/T13704.hs b/testsuite/tests/module/T13704.hs new file mode 100644 index 0000000..38b1cb7 --- /dev/null +++ b/testsuite/tests/module/T13704.hs @@ -0,0 +1,3 @@ +program = return () + +-- meant to be compiled with 'ghc -main-is Main.program T13704.hs' diff --git a/testsuite/tests/module/all.T b/testsuite/tests/module/all.T index e862413..dbba44f 100644 --- a/testsuite/tests/module/all.T +++ b/testsuite/tests/module/all.T @@ -284,4 +284,4 @@ test('T11970B', normal, compile_fail, ['']) test('MultiExport', normal, compile, ['']) test('T13528', normal, compile, ['']) test('T13622', normal, compile, ['']) - +test('T13704', normal, compile, ['-main-is Main.program']) From git at git.haskell.org Wed Oct 3 12:47:54 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 3 Oct 2018 12:47:54 +0000 (UTC) Subject: [commit: ghc] master: Drop GHC 8.2 compatibility (a838ae3) Message-ID: <20181003124754.D63EF3ABB2@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/a838ae3750d0744001f31f4cedad13acf47bd610/ghc >--------------------------------------------------------------- commit a838ae3750d0744001f31f4cedad13acf47bd610 Author: Ryan Scott Date: Wed Oct 3 08:41:56 2018 -0400 Drop GHC 8.2 compatibility Summary: GHC 8.6.1 is out, so now GHC's support window only extends back to GHC 8.4. This means we can delete gobs of code that were only used for GHC 8.2 support. Hooray! Test Plan: ./validate Reviewers: bgamari, Phyx, erikd Reviewed By: bgamari, Phyx Subscribers: rwbarton, erikd, carter Differential Revision: https://phabricator.haskell.org/D5192 >--------------------------------------------------------------- a838ae3750d0744001f31f4cedad13acf47bd610 compiler/iface/MkIface.hs | 3 -- compiler/main/Plugins.hs | 3 -- compiler/main/SysTools/BaseDir.hs | 97 ------------------------------------- compiler/utils/GhcPrelude.hs | 6 --- configure.ac | 9 +--- libraries/ghc-boot/GHC/PackageDb.hs | 2 - utils/genapply/Main.hs | 2 - utils/ghc-pkg/Main.hs | 67 +------------------------ 8 files changed, 4 insertions(+), 185 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc a838ae3750d0744001f31f4cedad13acf47bd610 From git at git.haskell.org Wed Oct 3 15:17:58 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 3 Oct 2018 15:17:58 +0000 (UTC) Subject: [commit: ghc] master: Make GHC (the library) flexible in the choice of integer library (fc2ff6d) Message-ID: <20181003151758.9B18D3ABB2@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/fc2ff6dd7496a33bf68165b28f37f40b7d647418/ghc >--------------------------------------------------------------- commit fc2ff6dd7496a33bf68165b28f37f40b7d647418 Author: Joachim Breitner Date: Wed Oct 3 15:36:55 2018 +0200 Make GHC (the library) flexible in the choice of integer library Summary: We have more and more users of GHC as a library, for example the Haskell-to-WebAssembly-compiler https://github.com/tweag/asterius. These need to make different decisions about various aspects of code generation than the host compiler, and ideally GHC-the-library allows them to set the `DynFlags` as needed. This patch adds a new `DynFlag` that configures which `integer` library to use. This flag is initialized by `cIntegerLibraryType` (as before), and is only used in `CorePrep` to decide whether to use `S#` or not. The other code paths that were varying based on `cIntegerLibraryType` are no now longer varying: The trick is to use `integer-wired-in` as the `-this-unit-id` when compiling either `integer-gmp` or `integer-simple`. Test Plan: Validate is happy. Reviewers: hvr, bgamari Reviewed By: bgamari Subscribers: TerrorJack, adamse, simonpj, rwbarton, carter GHC Trac Issues: #13477 Differential Revision: https://phabricator.haskell.org/D5079 >--------------------------------------------------------------- fc2ff6dd7496a33bf68165b28f37f40b7d647418 compiler/basicTypes/Module.hs | 60 +++++++++++++++------------ compiler/coreSyn/CorePrep.hs | 5 ++- compiler/ghc.mk | 2 - compiler/main/DynFlags.hs | 4 ++ compiler/main/Packages.hs | 48 +++++++++++---------- compiler/prelude/PrelNames.hs | 49 +++++++++++++++------- libraries/integer-gmp/integer-gmp.cabal | 5 ++- libraries/integer-simple/integer-simple.cabal | 5 ++- 8 files changed, 110 insertions(+), 68 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc fc2ff6dd7496a33bf68165b28f37f40b7d647418 From git at git.haskell.org Wed Oct 3 15:18:01 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 3 Oct 2018 15:18:01 +0000 (UTC) Subject: [commit: ghc] master: Drop accidental write-attributes request (deceb21) Message-ID: <20181003151801.6F6663ABB2@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/deceb21b7ec64ae60377addc2679692ca500b6ae/ghc >--------------------------------------------------------------- commit deceb21b7ec64ae60377addc2679692ca500b6ae Author: Tamar Christina Date: Wed Oct 3 15:34:56 2018 +0200 Drop accidental write-attributes request Summary: The new filesystem code accidentally asks for write attributes permissions when doing read-only access. I believe this is what's causing the GHC 8.6.1 tarballs to fail when installed to a privileged location. I haven't been able to reproduce the issue yet, but this permission bit is wrong anyway. Test Plan: I'm still trying to workout how to test that this works, changing the permissions on the folder doesn't seem to reproduce the error on a tarball I made from before the change. Reviewers: bgamari, tdammers Reviewed By: bgamari Subscribers: tdammers, monoidal, rwbarton, carter GHC Trac Issues: #15667 Differential Revision: https://phabricator.haskell.org/D5177 >--------------------------------------------------------------- deceb21b7ec64ae60377addc2679692ca500b6ae utils/fs/fs.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/utils/fs/fs.c b/utils/fs/fs.c index 0f8fbe7..6644705 100644 --- a/utils/fs/fs.c +++ b/utils/fs/fs.c @@ -107,15 +107,13 @@ int FS(swopen) (const wchar_t* filename, int oflag, int shflag, int pmode) /* Construct access mode. */ DWORD dwDesiredAccess = 0; if (HAS_FLAG (oflag, _O_RDONLY)) - dwDesiredAccess |= GENERIC_READ | FILE_READ_DATA | FILE_READ_ATTRIBUTES | - FILE_WRITE_ATTRIBUTES;; + dwDesiredAccess |= GENERIC_READ | FILE_READ_DATA | FILE_READ_ATTRIBUTES; if (HAS_FLAG (oflag, _O_RDWR)) dwDesiredAccess |= GENERIC_WRITE | GENERIC_READ | FILE_READ_DATA | FILE_WRITE_DATA | FILE_READ_ATTRIBUTES | FILE_WRITE_ATTRIBUTES; if (HAS_FLAG (oflag, _O_WRONLY)) - dwDesiredAccess|= GENERIC_WRITE | FILE_WRITE_DATA | - FILE_READ_ATTRIBUTES | FILE_WRITE_ATTRIBUTES; + dwDesiredAccess|= GENERIC_WRITE | FILE_WRITE_DATA | FILE_WRITE_ATTRIBUTES; /* Construct shared mode. */ DWORD dwShareMode = FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE; From git at git.haskell.org Wed Oct 3 15:18:04 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 3 Oct 2018 15:18:04 +0000 (UTC) Subject: [commit: ghc] master: distrib: Remove mention of no-longer-existent make target (3dedffa) Message-ID: <20181003151804.47C043ABB2@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/3dedffa2a51952b05c22b2d08668155ac07d7320/ghc >--------------------------------------------------------------- commit 3dedffa2a51952b05c22b2d08668155ac07d7320 Author: Ben Gamari Date: Wed Oct 3 15:35:32 2018 +0200 distrib: Remove mention of no-longer-existent make target Summary: `show-install-setup` used to be defined by `distrib/Makefile` which hasn't been used in a very long time and was removed from the tree in a1c008b30fc60a327afe098cf16bd14ca1e5e381. Reviewers: monoidal Reviewed By: monoidal Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5194 >--------------------------------------------------------------- 3dedffa2a51952b05c22b2d08668155ac07d7320 distrib/INSTALL | 3 --- 1 file changed, 3 deletions(-) diff --git a/distrib/INSTALL b/distrib/INSTALL index 2e374be..f0eb32f 100644 --- a/distrib/INSTALL +++ b/distrib/INSTALL @@ -22,9 +22,6 @@ Now run: make install -(`make show-install-setup' prints the details of where the different -pieces of the bundle are heading when -- possibly helpful). - For more information, full GHC documentation is available from the main GHC site: From git at git.haskell.org Thu Oct 4 13:28:40 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 4 Oct 2018 13:28:40 +0000 (UTC) Subject: [commit: ghc] master: Parse the (!) type operator and allow type operators in existential context (bd78985) Message-ID: <20181004132840.1D45D3ABBF@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/bd7898537768f936d05c0c83eef1cd9b00933347/ghc >--------------------------------------------------------------- commit bd7898537768f936d05c0c83eef1cd9b00933347 Author: Vladislav Zavialov Date: Thu Oct 4 09:17:55 2018 -0400 Parse the (!) type operator and allow type operators in existential context Summary: Improve the way `(!)`, `(~)`, and other type operators are handled in the parser, fixing two issues at once: 1. `(!)` can now be used as a type operator that respects fixity and precedence (#15457) 2. Existential context of a data constructor no longer needs parentheses (#15675) In addition to that, with this patch it is now trivial to adjust precedence of the `{-# UNPACK #-}` pragma, as suggested in https://ghc.haskell.org/trac/ghc/ticket/14761#comment:7 There was a small change to API Annotations. Before this patch, `(~)` was a strange special case that produced an annotation unlike any other type operator. After this patch, when `(~)` or `(!)` are used to specify strictness they produce AnnTilde and AnnBang annotations respectively, and when they are used as type operators, they produce no annotations. Test Plan: Validate Reviewers: simonpj, bgamari, alanz, RyanGlScott Reviewed By: RyanGlScott Subscribers: RyanGlScott, rwbarton, mpickering, carter GHC Trac Issues: #15457, #15675 Differential Revision: https://phabricator.haskell.org/D5180 >--------------------------------------------------------------- bd7898537768f936d05c0c83eef1cd9b00933347 compiler/parser/Lexer.x | 20 +- compiler/parser/Parser.y | 156 +++--- compiler/parser/RdrHsSyn.hs | 566 ++++++++++++++++----- docs/users_guide/8.8.1-notes.rst | 10 + testsuite/tests/ghc-api/annotations/T11321.stdout | 2 - testsuite/tests/ghci/prog006/prog006.stderr | 7 +- testsuite/tests/parser/should_compile/T15457.hs | 12 + testsuite/tests/parser/should_compile/T15675.hs | 13 + testsuite/tests/parser/should_compile/all.T | 2 + testsuite/tests/parser/should_fail/T3811b.stderr | 5 +- testsuite/tests/parser/should_fail/T3811c.stderr | 8 +- testsuite/tests/parser/should_fail/T3811f.stderr | 5 +- testsuite/tests/parser/should_fail/all.T | 4 + .../parser/should_fail/strictnessDataCon_A.hs | 1 + .../parser/should_fail/strictnessDataCon_A.stderr | 3 + .../parser/should_fail/strictnessDataCon_B.hs | 1 + .../parser/should_fail/strictnessDataCon_B.stderr | 3 + .../tests/parser/should_fail/typeopsDataCon_A.hs | 1 + .../parser/should_fail/typeopsDataCon_A.stderr | 4 + .../tests/parser/should_fail/typeopsDataCon_B.hs | 1 + .../parser/should_fail/typeopsDataCon_B.stderr | 2 + .../tests/rename/should_fail/rnfail053.stderr | 7 +- .../tests/typecheck/should_fail/T14761a.stderr | 10 +- .../tests/typecheck/should_fail/T14761b.stderr | 10 +- testsuite/tests/typecheck/should_fail/T7210.stderr | 10 +- testsuite/tests/typecheck/should_fail/T9634.stderr | 5 +- 26 files changed, 606 insertions(+), 262 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc bd7898537768f936d05c0c83eef1cd9b00933347 From git at git.haskell.org Thu Oct 4 15:03:46 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 4 Oct 2018 15:03:46 +0000 (UTC) Subject: [commit: ghc] master: Better pretty-printing of forall types (37ef703) Message-ID: <20181004150346.8438F3ABBF@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/37ef7031b95c97e7c8bc1d14bc95554a3bac2873/ghc >--------------------------------------------------------------- commit 37ef7031b95c97e7c8bc1d14bc95554a3bac2873 Author: Simon Peyton Jones Date: Wed Oct 3 15:58:13 2018 +0100 Better pretty-printing of forall types Currently forall-types with a lot of type variables, or type variables with big kinds, are pretty-printed too horizontally, and dribble off to the right in an illegible way. This patch treats the type variables as a group, and uses 'fsep' to lay them out decently. >--------------------------------------------------------------- 37ef7031b95c97e7c8bc1d14bc95554a3bac2873 compiler/iface/IfaceType.hs | 13 +++++++------ testsuite/tests/ghci/scripts/T12550.stdout | 4 ++-- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/compiler/iface/IfaceType.hs b/compiler/iface/IfaceType.hs index 23b09da..264dfa0 100644 --- a/compiler/iface/IfaceType.hs +++ b/compiler/iface/IfaceType.hs @@ -929,9 +929,10 @@ ppr_iface_forall_part show_forall tvs ctxt sdoc pprIfaceForAll :: [IfaceForAllBndr] -> SDoc pprIfaceForAll [] = empty pprIfaceForAll bndrs@(Bndr _ vis : _) - = add_separator (forAllLit <+> doc) <+> pprIfaceForAll bndrs' + = sep [ add_separator (forAllLit <+> fsep docs) + , pprIfaceForAll bndrs' ] where - (bndrs', doc) = ppr_itv_bndrs bndrs vis + (bndrs', docs) = ppr_itv_bndrs bndrs vis add_separator stuff = case vis of Required -> stuff <+> arrow @@ -943,12 +944,12 @@ pprIfaceForAll bndrs@(Bndr _ vis : _) -- No anonymous binders here! ppr_itv_bndrs :: [IfaceForAllBndr] -> ArgFlag -- ^ visibility of the first binder in the list - -> ([IfaceForAllBndr], SDoc) + -> ([IfaceForAllBndr], [SDoc]) ppr_itv_bndrs all_bndrs@(bndr@(Bndr _ vis) : bndrs) vis1 | vis `sameVis` vis1 = let (bndrs', doc) = ppr_itv_bndrs bndrs vis1 in - (bndrs', pprIfaceForAllBndr bndr <+> doc) - | otherwise = (all_bndrs, empty) -ppr_itv_bndrs [] _ = ([], empty) + (bndrs', pprIfaceForAllBndr bndr : doc) + | otherwise = (all_bndrs, []) +ppr_itv_bndrs [] _ = ([], []) pprIfaceForAllCo :: [(IfLclName, IfaceCoercion)] -> SDoc pprIfaceForAllCo [] = empty diff --git a/testsuite/tests/ghci/scripts/T12550.stdout b/testsuite/tests/ghci/scripts/T12550.stdout index 0955db3..c7173fc 100644 --- a/testsuite/tests/ghci/scripts/T12550.stdout +++ b/testsuite/tests/ghci/scripts/T12550.stdout @@ -57,8 +57,8 @@ datatypeName Datatype d ⇒ t d f a → [Char] class Datatype (d ∷ k) where - datatypeName ∷ ∀ k1 (t ∷ k → (k1 → ★) → k1 → ★) (f ∷ k1 - → ★) (a ∷ k1). + datatypeName ∷ ∀ k1 (t ∷ k → (k1 → ★) → k1 → ★) (f ∷ k1 → ★) + (a ∷ k1). t d f a → [Char] ... -- Defined in ‘GHC.Generics’ From git at git.haskell.org Thu Oct 4 15:03:49 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 4 Oct 2018 15:03:49 +0000 (UTC) Subject: [commit: ghc] master: tc-trace changes only (d25519e) Message-ID: <20181004150349.580D53ABBF@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/d25519e159d98cbd12f1893781e649ddb5a7fe90/ghc >--------------------------------------------------------------- commit d25519e159d98cbd12f1893781e649ddb5a7fe90 Author: Simon Peyton Jones Date: Thu Oct 4 15:30:04 2018 +0100 tc-trace changes only >--------------------------------------------------------------- d25519e159d98cbd12f1893781e649ddb5a7fe90 compiler/typecheck/TcExpr.hs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/compiler/typecheck/TcExpr.hs b/compiler/typecheck/TcExpr.hs index 17a07f6..bb9279e 100644 --- a/compiler/typecheck/TcExpr.hs +++ b/compiler/typecheck/TcExpr.hs @@ -1122,9 +1122,9 @@ wrapHsArgs f (HsTypeArg t : args) = wrapHsArgs (mkHsAppType f t) args wrapHsArgs f (HsArgPar sp : args) = wrapHsArgs (L sp $ HsPar noExt f) args instance (Outputable tm, Outputable ty) => Outputable (HsArg tm ty) where - ppr (HsValArg tm) = text "HsValArg" <> ppr tm - ppr (HsTypeArg ty) = text "HsTypeArg" <> ppr ty - ppr (HsArgPar sp) = text "HsArgPar" <> ppr sp + ppr (HsValArg tm) = text "HsValArg" <+> ppr tm + ppr (HsTypeArg ty) = text "HsTypeArg" <+> ppr ty + ppr (HsArgPar sp) = text "HsArgPar" <+> ppr sp isHsValArg :: HsArg tm ty -> Bool isHsValArg (HsValArg {}) = True @@ -1232,6 +1232,7 @@ tcFunApp :: Maybe SDoc -- like "The function `f' is applied to" tcFunApp m_herald rn_fun tc_fun fun_sigma rn_args res_ty = do { let orig = lexprCtOrigin rn_fun + ; traceTc "tcFunApp" (ppr rn_fun <+> dcolon <+> ppr fun_sigma $$ ppr rn_args $$ ppr res_ty) ; (wrap_fun, tc_args, actual_res_ty) <- tcArgs rn_fun fun_sigma orig rn_args (m_herald `orElse` mk_app_msg rn_fun rn_args) From git at git.haskell.org Thu Oct 4 15:03:52 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 4 Oct 2018 15:03:52 +0000 (UTC) Subject: [commit: ghc] master: Do not mark CoVars as dead in the occur-anal (02b303e) Message-ID: <20181004150352.95C833ABBF@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/02b303eed0170983921877801e57f55d012db301/ghc >--------------------------------------------------------------- commit 02b303eed0170983921877801e57f55d012db301 Author: Simon Peyton Jones Date: Wed Oct 3 15:41:43 2018 +0100 Do not mark CoVars as dead in the occur-anal For years we have been marking CoVars as dead, becuase we don't gather occurrence info from types. This is obviously wrong and caused Trac #15695. See Note [Do not mark CoVars as dead] in OccurAnal. >--------------------------------------------------------------- 02b303eed0170983921877801e57f55d012db301 compiler/simplCore/OccurAnal.hs | 23 ++++++++++++ testsuite/tests/patsyn/should_fail/T15695.hs | 48 ++++++++++++++++++++++++ testsuite/tests/patsyn/should_fail/T15695.stderr | 45 ++++++++++++++++++++++ testsuite/tests/patsyn/should_fail/all.T | 1 + 4 files changed, 117 insertions(+) diff --git a/compiler/simplCore/OccurAnal.hs b/compiler/simplCore/OccurAnal.hs index 236bb81..2cc38a2 100644 --- a/compiler/simplCore/OccurAnal.hs +++ b/compiler/simplCore/OccurAnal.hs @@ -2501,6 +2501,10 @@ zapDetails = markAllMany . markAllNonTailCalled -- effectively sets to noOccInfo lookupDetails :: UsageDetails -> Id -> OccInfo lookupDetails ud id + | isCoVar id -- We do not currenly gather occurrence info (from types) + = noOccInfo -- for CoVars, so we must conservatively mark them as used + -- See Note [DoO not mark CoVars as dead] + | otherwise = case lookupVarEnv (ud_env ud) id of Just occ -> doZapping ud id occ Nothing -> IAmDead @@ -2512,6 +2516,25 @@ udFreeVars :: VarSet -> UsageDetails -> VarSet -- Find the subset of bndrs that are mentioned in uds udFreeVars bndrs ud = restrictUniqSetToUFM bndrs (ud_env ud) +{- Note [Do not mark CoVars as dead] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +It's obviously wrong to mark CoVars as dead if they are used. +Currently we don't traverse types to gather usase info for CoVars, +so we had better treat them as having noOccInfo. + +This showed up in Trac #15696 we had something like + case eq_sel d of co -> ...(typeError @(...co...) "urk")... + +Then 'd' was substitued by a dictionary, so the expression +simpified to + case (Coercion ) of co -> ...(typeError @(...co...) "urk")... + +But then the "drop the case altogether" equation of rebuildCase +thought that 'co' was dead, and discarded the entire case. Urk! + +I have no idea how we managed to avoid this pitfall for so long! +-} + ------------------- -- Auxiliary functions for UsageDetails implementation diff --git a/testsuite/tests/patsyn/should_fail/T15695.hs b/testsuite/tests/patsyn/should_fail/T15695.hs new file mode 100644 index 0000000..de8035c --- /dev/null +++ b/testsuite/tests/patsyn/should_fail/T15695.hs @@ -0,0 +1,48 @@ +{-# Language RankNTypes, PatternSynonyms, DataKinds, PolyKinds, GADTs, + TypeOperators, MultiParamTypeClasses, TypeFamilies, + TypeSynonymInstances, FlexibleInstances, InstanceSigs, FlexibleContexts #-} + +{-# Options_GHC -fdefer-type-errors #-} + +module T15695 where + +import Data.Kind +import Data.Type.Equality + +data TyVar :: Type -> Type -> Type where + VO :: TyVar (a -> as) a + VS :: TyVar as a -> TyVar (b -> as) a + +data NP :: (k -> Type) -> ([k] -> Type) where + Nil :: NP f '[] + (:*) :: f a -> NP f as -> NP f (a:as) + +data NS :: (k -> Type) -> ([k] -> Type) where + Here :: f a -> NS f (a:as) + There :: NS f as -> NS f (a:as) + +infixr 6 :&: +data Ctx :: Type -> Type where + E :: Ctx(Type) + (:&:) :: a -> Ctx(as) -> Ctx(a -> as) + +data NA a + +type SOP(kind::Type) code = NS (NP NA) code + +data ApplyT(kind::Type) :: kind -> Ctx(kind) -> Type where + AO :: a -> ApplyT(Type) a E + AS :: ApplyT(ks) (f a) ctx + -> ApplyT(k -> ks) f (a:&:ctx) + +from' :: ApplyT(Type -> Type -> Type) Either ctx -> NS (NP NA) '[ '[VO] ] +from' (ASSO (Left a)) = Here (a :* Nil) +from' (ASSO (Right b)) = There (Here undefined) + +pattern ASSO + :: () => + forall (ks :: Type) k (f :: k -> ks) (a1 :: k) (ks1 :: Type) k1 (f1 :: k1 -> ks1) (a2 :: k1) a3. + (kind ~ (k -> k1 -> Type), a ~~ f, b ~~ (a1 :&: a2 :&: E), + f a1 ~~ f1, f1 a2 ~~ a3) => + a3 -> ApplyT kind a b +pattern ASSO a = AS (AS (AO a)) diff --git a/testsuite/tests/patsyn/should_fail/T15695.stderr b/testsuite/tests/patsyn/should_fail/T15695.stderr new file mode 100644 index 0000000..6ef415a --- /dev/null +++ b/testsuite/tests/patsyn/should_fail/T15695.stderr @@ -0,0 +1,45 @@ + +T15695.hs:39:14: warning: [-Wdeferred-type-errors (in -Wdefault)] + • Could not deduce: a2 ~ NA 'VO + from the context: ((* -> * -> *) ~ (k1 -> k2 -> *), Either ~~ f, + ctx ~~ (a2 ':&: (a3 ':&: 'E)), f a2 ~~ f1, f1 a3 ~~ a4) + bound by a pattern with pattern synonym: + ASSO :: forall kind (a :: kind) (b :: Ctx kind). + () => + forall ks k (f :: k -> ks) (a1 :: k) ks1 k1 (f1 :: k1 -> ks1) + (a2 :: k1) a3. + (kind ~ (k -> k1 -> *), a ~~ f, b ~~ (a1 ':&: (a2 ':&: 'E)), + f a1 ~~ f1, f1 a2 ~~ a3) => + a3 -> ApplyT kind a b, + in an equation for ‘from'’ + at T15695.hs:39:8-21 + ‘a2’ is a rigid type variable bound by + a pattern with pattern synonym: + ASSO :: forall kind (a :: kind) (b :: Ctx kind). + () => + forall ks k (f :: k -> ks) (a1 :: k) ks1 k1 (f1 :: k1 -> ks1) + (a2 :: k1) a3. + (kind ~ (k -> k1 -> *), a ~~ f, b ~~ (a1 ':&: (a2 ':&: 'E)), + f a1 ~~ f1, f1 a2 ~~ a3) => + a3 -> ApplyT kind a b, + in an equation for ‘from'’ + at T15695.hs:39:8-21 + Expected type: a4 + Actual type: Either (NA 'VO) a3 + • In the pattern: Left a + In the pattern: ASSO (Left a) + In an equation for ‘from'’: from' (ASSO (Left a)) = Here (a :* Nil) + • Relevant bindings include + from' :: ApplyT (* -> * -> *) Either ctx -> NS (NP NA) '[ '[ 'VO]] + (bound at T15695.hs:39:1) + +T15695.hs:40:26: warning: [-Wdeferred-type-errors (in -Wdefault)] + • Couldn't match type ‘a0 : as0’ with ‘'[]’ + Expected type: NS (NP NA) '[ '[ 'VO]] + Actual type: NS (NP NA) ('[ 'VO] : a0 : as0) + • In the expression: There (Here undefined) + In an equation for ‘from'’: + from' (ASSO (Right b)) = There (Here undefined) + • Relevant bindings include + from' :: ApplyT (* -> * -> *) Either ctx -> NS (NP NA) '[ '[ 'VO]] + (bound at T15695.hs:39:1) diff --git a/testsuite/tests/patsyn/should_fail/all.T b/testsuite/tests/patsyn/should_fail/all.T index c029f20..81e6644 100644 --- a/testsuite/tests/patsyn/should_fail/all.T +++ b/testsuite/tests/patsyn/should_fail/all.T @@ -34,6 +34,7 @@ test('T11667', normal, compile_fail, ['']) test('T12165', normal, compile_fail, ['']) test('T12819', normal, compile_fail, ['']) test('UnliftedPSBind', normal, compile_fail, ['']) +test('T15695', normal, compile, ['']) # It has -fdefer-type-errors inside test('T13349', normal, compile_fail, ['']) test('T13470', normal, compile_fail, ['']) test('T14112', normal, compile_fail, ['']) From git at git.haskell.org Thu Oct 4 15:03:56 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 4 Oct 2018 15:03:56 +0000 (UTC) Subject: [commit: ghc] master: Distinguish Inferred from Specified tyvars (2f09753) Message-ID: <20181004150356.4BA023ABBF@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/2f09753f96207c12efd43090f5de55b05aef35d3/ghc >--------------------------------------------------------------- commit 2f09753f96207c12efd43090f5de55b05aef35d3 Author: Simon Peyton Jones Date: Wed Oct 3 16:35:09 2018 +0100 Distinguish Inferred from Specified tyvars In a declared type we need to distinguish between Inferred and Specified type variables. This was exposed by Trac #15592. See Note [Work out final tyConBinders] in TcTyClsDecls. I had to change the definition of HasField in GHC.Records to class HasField x r a | x r -> a where so as to have an /inferred/ kind argument rather than a specfied one. So HasField :: forall {k}. k -> * -> * -> Constraint >--------------------------------------------------------------- 2f09753f96207c12efd43090f5de55b05aef35d3 compiler/typecheck/TcTyClsDecls.hs | 66 ++++++++++++++++++++++++++++----- libraries/base/GHC/Records.hs | 9 ++++- testsuite/tests/polykinds/T15592.hs | 5 +++ testsuite/tests/polykinds/T15592.stderr | 11 ++++++ testsuite/tests/polykinds/all.T | 1 + 5 files changed, 81 insertions(+), 11 deletions(-) diff --git a/compiler/typecheck/TcTyClsDecls.hs b/compiler/typecheck/TcTyClsDecls.hs index ae64f08..20c79bd 100644 --- a/compiler/typecheck/TcTyClsDecls.hs +++ b/compiler/typecheck/TcTyClsDecls.hs @@ -359,24 +359,36 @@ TcTyCons are used for two distinct purposes environment in TcTyClsDecls, until the real full TyCons can be created during desugaring. A desugared program should never have a TcTyCon. - A challenging piece in all of this is that we end up taking three separate - passes over every declaration: +3. In a TcTyCon, everything is zonked after the kind-checking pass (S2). + +4. tyConScopedTyVars. A challenging piece in all of this is that we + end up taking three separate passes over every declaration: - one in getInitialKind (this pass look only at the head, not the body) - one in kcTyClDecls (to kind-check the body) - a final one in tcTyClDecls (to desugar) + In the latter two passes, we need to connect the user-written type variables in an LHsQTyVars with the variables in the tycon's inferred kind. Because the tycon might not have a CUSK, this matching up is, in general, quite hard to do. (Look through the git history between Dec 2015 and Apr 2016 for - TcHsType.splitTelescopeTvs!) Instead of trying, we just store the - list of type variables to bring into scope, in the - tyConScopedTyVars field of the TcTyCon. These tyvars are brought - into scope in kcTyClTyVars and tcTyClTyVars, both in TcHsType. + TcHsType.splitTelescopeTvs!) + + Instead of trying, we just store the list of type variables to + bring into scope, in the tyConScopedTyVars field of the TcTyCon. + These tyvars are brought into scope in kcTyClTyVars and + tcTyClTyVars, both in TcHsType. - In a TcTyCon, everything is zonked after the kind-checking pass (S2). + In a TcTyCon, why is tyConScopedTyVars :: [(Name,TcTyVar)] rather + than just [TcTyVar]? Consider these mutually-recursive decls + data T (a :: k1) b = MkT (S a b) + data S (c :: k2) d = MkS (T c d) + We start with k1 bound to kappa1, and k2 to kappa2; so initially + in the (Name,TcTyVar) pairs the Name is that of the TcTyVar. But + then kappa1 and kappa2 get unified; so after the zonking in + 'generalise' in 'kcTyClGroup' the Name and TcTyVar may differ. - See also Note [Type checking recursive type and class declarations]. +See also Note [Type checking recursive type and class declarations]. Note [Check telescope again during generalisation] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -551,11 +563,17 @@ kcTyClGroup decls ; checkValidTelescope tc_binders user_tyvars empty ; kvs <- kindGeneralize (mkTyConKind tc_binders tc_res_kind) - ; let all_binders = mkNamedTyConBinders Inferred kvs ++ tc_binders + -- See Note [Work out final tyConBinders] + ; scoped_tvs' <- zonkTyVarTyVarPairs scoped_tvs + ; let (specified_kvs, inferred_kvs) = partition is_specified kvs + user_specified_tkvs = mkVarSet (map snd scoped_tvs') + is_specified kv = kv `elemVarSet` user_specified_tkvs + all_binders = mkNamedTyConBinders Inferred inferred_kvs ++ + mkNamedTyConBinders Specified specified_kvs ++ + tc_binders ; (env, all_binders') <- zonkTyVarBinders all_binders ; tc_res_kind' <- zonkTcTypeToTypeX env tc_res_kind - ; scoped_tvs' <- zonkTyVarTyVarPairs scoped_tvs -- See Note [Check telescope again during generalisation] ; let extra = text "NB: Implicitly declared variables come before others." @@ -573,6 +591,34 @@ kcTyClGroup decls (tyConFlavour tc)) } +{- Note [Work out final tyConBinders] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Consider + data T f (a::k1) b = MkT (f a b) (T f a b) + +We should get + T :: forall {k2} k1. (k1 -> k2 -> *) -> k1 -> k2 -> * + +Note that: + * k1 is Specified, because it appears in a user-written kind + * k2 is Inferred, because it doesn't appear at all in the + original declaration + +However, at this point in kcTyClGroup, the tc_binders are +simply [f, a, b], the user-written argumennts to the TyCon. +(Why? Because that's what we need for the recursive uses in +T's RHS.) + +So kindGeneralize will generalise over /both/ k1 /and/ k2. +Yet we must distinguish them, and we must put the Inferred +ones first. How can we tell the difference? Well, the +Specified variables will be among the tyConScopedTyVars of +the TcTyCon. + +Hence partitioning by is_specified. See Trac #15592 for +some discussion. +-} + -------------- tcExtendKindEnvWithTyCons :: [TcTyCon] -> TcM a -> TcM a tcExtendKindEnvWithTyCons tcs diff --git a/libraries/base/GHC/Records.hs b/libraries/base/GHC/Records.hs index 43c3931..3b1a4c2 100644 --- a/libraries/base/GHC/Records.hs +++ b/libraries/base/GHC/Records.hs @@ -29,6 +29,13 @@ module GHC.Records -- | Constraint representing the fact that the field @x@ belongs to -- the record type @r@ and has field type @a at . This will be solved -- automatically, but manual instances may be provided as well. -class HasField (x :: k) r a | x r -> a where +-- +-- HasField :: forall {k}. k -> * -> * -> Constraint +-- getField :: forall {k} (x::k) r a. HasField x r a => r -> a +-- NB: The {k} means that k is an 'inferred' type variable, and +-- hence not provided in visible type applications. Thus you +-- say getField @"foo" +-- not getField @Symbol @"foo" +class HasField x r a | x r -> a where -- | Selector function to extract the field from the record. getField :: r -> a diff --git a/testsuite/tests/polykinds/T15592.hs b/testsuite/tests/polykinds/T15592.hs new file mode 100644 index 0000000..7e81c42 --- /dev/null +++ b/testsuite/tests/polykinds/T15592.hs @@ -0,0 +1,5 @@ +{-# LANGUAGE TypeInType #-} +{-# OPTIONS_GHC -ddump-types -fprint-explicit-foralls #-} +module T15592 where + +data T f (a::k1) b = MkT (f a b) (T f a b) diff --git a/testsuite/tests/polykinds/T15592.stderr b/testsuite/tests/polykinds/T15592.stderr new file mode 100644 index 0000000..71dc3b2 --- /dev/null +++ b/testsuite/tests/polykinds/T15592.stderr @@ -0,0 +1,11 @@ +TYPE SIGNATURES + T15592.MkT :: + forall {k} k1 (f :: k1 -> k -> *) (a :: k1) (b :: k). + f a b -> T f a b -> T f a b +TYPE CONSTRUCTORS + type role T nominal nominal representational nominal nominal + T :: forall {k} k1. (k1 -> k -> *) -> k1 -> k -> * +COERCION AXIOMS +Dependent modules: [] +Dependent packages: [base-4.12.0.0, ghc-prim-0.5.3, + integer-gmp-1.0.2.0] diff --git a/testsuite/tests/polykinds/all.T b/testsuite/tests/polykinds/all.T index ae4ee51..010d0ac 100644 --- a/testsuite/tests/polykinds/all.T +++ b/testsuite/tests/polykinds/all.T @@ -193,3 +193,4 @@ test('T15116a', normal, compile_fail, ['']) test('T15170', normal, compile, ['']) test('T14939', normal, compile, ['-O']) test('T15577', normal, compile_fail, ['-O']) +test('T15592', normal, compile, ['']) From git at git.haskell.org Thu Oct 4 15:03:59 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 4 Oct 2018 15:03:59 +0000 (UTC) Subject: [commit: ghc] master: Make Lint check that for CoVars more carefully (e7ff934) Message-ID: <20181004150359.1CAFE3ABBF@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/e7ff9344a18c58c7b321566545fd37c10c609fb1/ghc >--------------------------------------------------------------- commit e7ff9344a18c58c7b321566545fd37c10c609fb1 Author: Simon Peyton Jones Date: Wed Oct 3 13:28:04 2018 +0100 Make Lint check that for CoVars more carefully Check than an Id of type (t1 ~# t2) is a CoVar; if not, it ends up in the wrong simplifier environment, with strange consequences. (Trac #15648) >--------------------------------------------------------------- e7ff9344a18c58c7b321566545fd37c10c609fb1 compiler/coreSyn/CoreLint.hs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/compiler/coreSyn/CoreLint.hs b/compiler/coreSyn/CoreLint.hs index f879a30..1cbfcd6 100644 --- a/compiler/coreSyn/CoreLint.hs +++ b/compiler/coreSyn/CoreLint.hs @@ -749,7 +749,7 @@ lintCoreExpr (Let (NonRec bndr rhs) body) | isId bndr = do { lintSingleBinding NotTopLevel NonRecursive (bndr,rhs) ; addLoc (BodyOfLetRec [bndr]) - (lintIdBndr NotTopLevel LetBind bndr $ \_ -> + (lintBinder LetBind bndr $ \_ -> addGoodJoins [bndr] $ lintCoreExpr body) } @@ -826,7 +826,7 @@ lintCoreExpr e@(Case scrut var alt_ty alts) = ; subst <- getTCvSubst ; ensureEqTys var_ty scrut_ty (mkScrutMsg var var_ty scrut_ty subst) - ; lintIdBndr NotTopLevel CaseBind var $ \_ -> + ; lintBinder CaseBind var $ \_ -> do { -- Check the alternatives mapM_ (lintCoreAlt scrut_ty alt_ty) alts ; checkCaseAlts e scrut_ty alts @@ -1247,6 +1247,7 @@ lintIdBndr top_lvl bind_site id linterF (mkNonTopExternalNameMsg id) ; (ty, k) <- lintInTy (idType id) + -- See Note [Levity polymorphism invariants] in CoreSyn ; lintL (isJoinId id || not (isKindLevPoly k)) (text "Levity-polymorphic binder:" <+> @@ -1257,6 +1258,11 @@ lintIdBndr top_lvl bind_site id linterF checkL (not is_top_lvl && is_let_bind) $ mkBadJoinBindMsg id + -- Check that the Id does not have type (t1 ~# t2) or (t1 ~R# t2); + -- if so, it should be a CoVar, and checked by lintCoVarBndr + ; lintL (not (isCoercionType ty)) + (text "Non-CoVar has coercion type" <+> ppr id <+> dcolon <+> ppr ty) + ; let id' = setIdType id ty ; addInScopeVar id' $ (linterF id') } where From git at git.haskell.org Thu Oct 4 15:04:03 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 4 Oct 2018 15:04:03 +0000 (UTC) Subject: [commit: ghc] master: Fail fast on pattern synonyms (9ebfa03) Message-ID: <20181004150403.48FCD3ABBF@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/9ebfa03d9e9cbf79f698b5d4bd39e799e4e9a02c/ghc >--------------------------------------------------------------- commit 9ebfa03d9e9cbf79f698b5d4bd39e799e4e9a02c Author: Simon Peyton Jones Date: Wed Oct 3 15:53:59 2018 +0100 Fail fast on pattern synonyms We were recovering too eagerly from errors in pattern-synonym type inference, leading to a cascade of confusing follow up errors (Trac #15685, #15692). The underlying issue is that a pattern synonym should have a closed, fixed type, with no unification variables in it. But it wasn't! Fixing this made me change the interface to simplifyInfer slightly. Instead of /emitting/ a residual implication constraint, it now /returns/ it, so that the caller can decide what to do. >--------------------------------------------------------------- 9ebfa03d9e9cbf79f698b5d4bd39e799e4e9a02c compiler/typecheck/TcBinds.hs | 3 +- compiler/typecheck/TcExpr.hs | 4 +- compiler/typecheck/TcPatSyn.hs | 75 +++++++++++++----------- compiler/typecheck/TcRnDriver.hs | 19 +++--- compiler/typecheck/TcRnMonad.hs | 12 +++- compiler/typecheck/TcRnTypes.hs | 37 +++++++----- compiler/typecheck/TcSimplify.hs | 66 ++++++++++----------- testsuite/tests/patsyn/should_fail/T15685.hs | 13 ++++ testsuite/tests/patsyn/should_fail/T15685.stderr | 10 ++++ testsuite/tests/patsyn/should_fail/T15692.hs | 9 +++ testsuite/tests/patsyn/should_fail/T15692.stderr | 13 ++++ testsuite/tests/patsyn/should_fail/all.T | 2 + 12 files changed, 165 insertions(+), 98 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 9ebfa03d9e9cbf79f698b5d4bd39e799e4e9a02c From git at git.haskell.org Thu Oct 4 15:04:06 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 4 Oct 2018 15:04:06 +0000 (UTC) Subject: [commit: ghc] master: Better -ddump-types (e9e6640) Message-ID: <20181004150406.257593ABBF@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/e9e664022af66778bcc08f66ce3ba3b012c77ea4/ghc >--------------------------------------------------------------- commit e9e664022af66778bcc08f66ce3ba3b012c77ea4 Author: Simon Peyton Jones Date: Wed Oct 3 13:24:11 2018 +0100 Better -ddump-types The debug flag -ddump-types is supposed to show the type of Ids, and the kinds of type constructors. It was doing the former but not the latter -- instead it was using showTyTying, which is actually less helpful when debugging. This patch changes it to print the kind and roles of the thing. I also made -ddump-types show pattern synonyms >--------------------------------------------------------------- e9e664022af66778bcc08f66ce3ba3b012c77ea4 compiler/typecheck/TcRnDriver.hs | 68 +++++++++++++++------- testsuite/tests/driver/json2.stderr | 2 +- .../indexed-types/should_compile/T3017.stderr | 8 +-- .../tests/partial-sigs/should_compile/ADT.stderr | 2 +- .../should_compile/DataFamilyInstanceLHS.stderr | 5 +- .../partial-sigs/should_compile/Meltdown.stderr | 2 +- .../NamedWildcardInDataFamilyInstanceLHS.stderr | 5 +- .../NamedWildcardInTypeFamilyInstanceLHS.stderr | 6 +- .../partial-sigs/should_compile/SkipMany.stderr | 2 +- .../should_compile/TypeFamilyInstanceLHS.stderr | 3 +- testsuite/tests/roles/should_compile/Roles1.stderr | 20 +++---- .../tests/roles/should_compile/Roles14.stderr | 4 +- testsuite/tests/roles/should_compile/Roles2.stderr | 4 +- testsuite/tests/roles/should_compile/Roles3.stderr | 25 +++----- testsuite/tests/roles/should_compile/Roles4.stderr | 10 +--- testsuite/tests/roles/should_compile/T8958.stderr | 6 +- testsuite/tests/th/TH_Roles2.stderr | 10 ++-- .../tests/typecheck/should_compile/T12763.stderr | 4 +- .../tests/typecheck/should_compile/tc231.stderr | 10 ++-- 19 files changed, 102 insertions(+), 94 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc e9e664022af66778bcc08f66ce3ba3b012c77ea4 From git at git.haskell.org Thu Oct 4 15:04:08 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 4 Oct 2018 15:04:08 +0000 (UTC) Subject: [commit: ghc] master: Better comments and debug-print only (43c2ffe) Message-ID: <20181004150408.EEA1F3ABBF@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/43c2ffe7c0ce85a8e1305cea3be453fd01de5b63/ghc >--------------------------------------------------------------- commit 43c2ffe7c0ce85a8e1305cea3be453fd01de5b63 Author: Simon Peyton Jones Date: Wed Oct 3 13:27:06 2018 +0100 Better comments and debug-print only >--------------------------------------------------------------- 43c2ffe7c0ce85a8e1305cea3be453fd01de5b63 compiler/typecheck/TcRnMonad.hs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/compiler/typecheck/TcRnMonad.hs b/compiler/typecheck/TcRnMonad.hs index aa95c1e..940e6a9 100644 --- a/compiler/typecheck/TcRnMonad.hs +++ b/compiler/typecheck/TcRnMonad.hs @@ -954,6 +954,8 @@ reportWarning reason err try_m :: TcRn r -> TcRn (Either IOEnvFailure r) -- Does tryM, with a debug-trace on failure +-- If we do recover from an exception, /insoluble/ constraints +-- (only) in 'thing' are are propagated try_m thing = do { (mb_r, lie) <- tryCaptureConstraints thing ; emitConstraints lie @@ -961,7 +963,7 @@ try_m thing -- Debug trace ; case mb_r of Left exn -> traceTc "tryTc/recoverM recovering from" $ - text (showException exn) + (text (showException exn) $$ ppr lie) Right {} -> return () ; return mb_r } @@ -972,6 +974,8 @@ recoverM :: TcRn r -- Recovery action; do this if the main one fails -- if it generates errors, propagate them all -> TcRn r -- Errors in 'thing' are retained +-- If we do recover from an exception, /insoluble/ constraints +-- (only) in 'thing' are are propagated recoverM recover thing = do { mb_res <- try_m thing ; case mb_res of @@ -1483,7 +1487,7 @@ tryCaptureConstraints :: TcM a -> TcM (Either IOEnvFailure a, WantedConstraints) -- (captureConstraints_maybe m) runs m, -- and returns the type constraints it generates -- It never throws an exception; instead if thing_inside fails, --- it returns Left exn and the insoluble constraints +-- it returns Left exn and the /insoluble/ constraints tryCaptureConstraints thing_inside = do { lie_var <- newTcRef emptyWC ; mb_res <- tryM $ From git at git.haskell.org Thu Oct 4 15:39:02 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 4 Oct 2018 15:39:02 +0000 (UTC) Subject: [commit: ghc] master: Document the list data type (60b547b) Message-ID: <20181004153902.B9B3D3ABBF@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/60b547b583f27f436912acd70e674cd9f34d72b2/ghc >--------------------------------------------------------------- commit 60b547b583f27f436912acd70e674cd9f34d72b2 Author: Alec Theriault Date: Thu Oct 4 11:18:32 2018 -0400 Document the list data type Summary: Also qualified some identifier hyperlinks along the way. Reviewers: bgamari Reviewed By: bgamari Subscribers: rwbarton, carter GHC Trac Issues: #4861 Differential Revision: https://phabricator.haskell.org/D5158 >--------------------------------------------------------------- 60b547b583f27f436912acd70e674cd9f34d72b2 libraries/ghc-prim/GHC/Magic.hs | 18 +++++++++--------- libraries/ghc-prim/GHC/Types.hs | 28 ++++++++++++++++++++++++---- 2 files changed, 33 insertions(+), 13 deletions(-) diff --git a/libraries/ghc-prim/GHC/Magic.hs b/libraries/ghc-prim/GHC/Magic.hs index ae95bfc..8bc8852 100644 --- a/libraries/ghc-prim/GHC/Magic.hs +++ b/libraries/ghc-prim/GHC/Magic.hs @@ -34,16 +34,16 @@ import GHC.Prim import GHC.CString () import GHC.Types (RuntimeRep, TYPE) --- | The call @inline f@ arranges that 'f' is inlined, regardless of +-- | The call @inline f@ arranges that @f@ is inlined, regardless of -- its size. More precisely, the call @inline f@ rewrites to the -- right-hand side of @f@'s definition. This allows the programmer to -- control inlining from a particular call site rather than the --- definition site of the function (c.f. 'INLINE' pragmas). +-- definition site of the function (c.f. @INLINE@ pragmas). -- -- This inlining occurs regardless of the argument to the call or the -- size of @f@'s definition; it is unconditional. The main caveat is -- that @f@'s definition must be visible to the compiler; it is --- therefore recommended to mark the function with an 'INLINABLE' +-- therefore recommended to mark the function with an @INLINABLE@ -- pragma at its definition so that GHC guarantees to record its -- unfolding regardless of size. -- @@ -53,7 +53,7 @@ import GHC.Types (RuntimeRep, TYPE) inline :: a -> a inline x = x --- | The call @noinline f@ arranges that 'f' will not be inlined. +-- | The call @noinline f@ arranges that @f@ will not be inlined. -- It is removed during CorePrep so that its use imposes no overhead -- (besides the fact that it blocks inlining.) {-# NOINLINE noinline #-} @@ -61,7 +61,7 @@ noinline :: a -> a noinline x = x -- | The 'lazy' function restrains strictness analysis a little. The --- call @lazy e@ means the same as 'e', but 'lazy' has a magical +-- call @lazy e@ means the same as @e@, but 'lazy' has a magical -- property so far as strictness analysis is concerned: it is lazy in -- its first argument, even though its semantics is strict. After -- strictness analysis has run, calls to 'lazy' are inlined to be the @@ -74,8 +74,8 @@ noinline x = x -- > par :: a -> b -> b -- > par x y = case (par# x) of _ -> lazy y -- --- If 'lazy' were not lazy, 'par' would look strict in 'y' which --- would defeat the whole purpose of 'par'. +-- If 'lazy' were not lazy, 'Control.Parallel.par' would look strict in +-- @y@ which would defeat the whole purpose of 'Control.Parallel.par'. -- -- Like 'seq', the argument of 'lazy' can have an unboxed type. lazy :: a -> a @@ -105,8 +105,8 @@ oneShot f = f -- Implementation note: This is wired in in MkId.hs, so the code here is -- mostly there to have a place for the documentation. --- | Apply a function to a 'State# RealWorld' token. When manually applying --- a function to `realWorld#`, it is necessary to use `NOINLINE` to prevent +-- | Apply a function to a @'State#' 'RealWorld'@ token. When manually applying +-- a function to `realWorld#`, it is necessary to use @NOINLINE@ to prevent -- semantically undesirable floating. `runRW#` is inlined, but only very late -- in compilation after all floating is complete. diff --git a/libraries/ghc-prim/GHC/Types.hs b/libraries/ghc-prim/GHC/Types.hs index 3275d57..d06c0be 100644 --- a/libraries/ghc-prim/GHC/Types.hs +++ b/libraries/ghc-prim/GHC/Types.hs @@ -97,6 +97,22 @@ type family Any :: k where { } * * ********************************************************************* -} +-- | The builtin list type, usually written in its non-prefix form @[a]@. +-- +-- ==== __Examples__ +-- +-- Unless the OverloadedLists extension is enabled, list literals are +-- syntatic sugar for repeated applications of @:@ and @[]@. +-- +-- >>> 1:2:3:4:[] == [1,2,3,4] +-- True +-- +-- Similarly, unless the OverloadedStrings extension is enabled, string +-- literals are syntactic sugar for a lists of characters. +-- +-- >>> ['h','e','l','l','o'] == "hello" +-- True +-- data [] a = [] | a : [a] @@ -124,7 +140,8 @@ Haskell has type 'Char'. To convert a 'Char' to or from the corresponding 'Int' value defined by Unicode, use 'Prelude.toEnum' and 'Prelude.fromEnum' from the -'Prelude.Enum' class respectively (or equivalently 'ord' and 'chr'). +'Prelude.Enum' class respectively (or equivalently 'Data.Char.ord' and +'Data.Char.chr'). -} data {-# CTYPE "HsChar" #-} Char = C# Char# @@ -164,7 +181,8 @@ function, unless that function is itself in the 'IO' monad and called at some point, directly or indirectly, from @Main.main at . 'IO' is a monad, so 'IO' actions can be combined using either the do-notation -or the '>>' and '>>=' operations from the 'Monad' class. +or the 'Prelude.>>' and 'Prelude.>>=' operations from the 'Prelude.Monad' +class. -} newtype IO a = IO (State# RealWorld -> (# State# RealWorld, a #)) type role IO representational @@ -213,7 +231,7 @@ class a ~~ b -- | Lifted, homogeneous equality. By lifted, we mean that it -- can be bogus (deferred type error). By homogeneous, the two --- types @a@ and @b@ must have the sme kinds. +-- types @a@ and @b@ must have the same kinds. class a ~ b -- See also Note [The equality types story] in TysPrim @@ -450,7 +468,9 @@ type KindBndr = Int #endif -- | The representation produced by GHC for conjuring up the kind of a --- 'TypeRep'. See Note [Representing TyCon kinds: KindRep] in TcTypeable. +-- 'Data.Typeable.TypeRep'. + +-- See Note [Representing TyCon kinds: KindRep] in TcTypeable. data KindRep = KindRepTyConApp TyCon [KindRep] | KindRepVar !KindBndr | KindRepApp KindRep KindRep From git at git.haskell.org Thu Oct 4 15:39:06 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 4 Oct 2018 15:39:06 +0000 (UTC) Subject: [commit: ghc] master: Improve generated `GHC.Prim` docs (feb8a67) Message-ID: <20181004153906.9883E3ABBF@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/feb8a671a4e92922ddac108686f0eace97dd331f/ghc >--------------------------------------------------------------- commit feb8a671a4e92922ddac108686f0eace97dd331f Author: Alec Theriault Date: Thu Oct 4 11:18:54 2018 -0400 Improve generated `GHC.Prim` docs Summary: * Extended `genprimcode` to generate Haddock-compatible deprecations, as well as displaying information about which functions are LLVM-only and which functions can fail with an unchecked exception. * Ported existing deprecations to the new format, and also added a deprecation on `par#` (see Trac #15227). * Emit an error on fixity/deprecation of builtins, unless we are processing the module in which that name is defined (see Trac #15233). That means the following is no longer accepted (outside of `GHC.Types`): ``` infixr 7 : {-# DEPRECATED (:) "cons is deprecated" #-} ``` * Generate `data (->) a b` with docs and fixity in `GHC.Prim`. This means: GHC can now parse `data (->) a b` and `infixr 0 ->` (only in `GHC.Prim`) and `genprimcode` can digest `primtype (->) a b` (See Trac #4861) as well as some misc fixes along the way. Reviewers: bgamari, RyanGlScott Reviewed By: RyanGlScott Subscribers: RyanGlScott, rwbarton, mpickering, carter GHC Trac Issues: #15227, #15233, #4861 Differential Revision: https://phabricator.haskell.org/D5167 >--------------------------------------------------------------- feb8a671a4e92922ddac108686f0eace97dd331f compiler/iface/LoadIface.hs | 3 +- compiler/parser/Parser.y | 1 + compiler/prelude/TysWiredIn.hs | 3 + compiler/prelude/primops.txt.pp | 89 +++++++++++----- compiler/rename/RnEnv.hs | 14 ++- compiler/types/TyCon.hs | 1 + testsuite/tests/parser/should_fail/T15233.hs | 9 ++ testsuite/tests/parser/should_fail/T15233.stderr | 8 ++ testsuite/tests/parser/should_fail/all.T | 1 + utils/genprimopcode/Lexer.x | 2 +- utils/genprimopcode/Main.hs | 127 +++++++++++++++-------- utils/genprimopcode/Parser.y | 9 +- 12 files changed, 190 insertions(+), 77 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc feb8a671a4e92922ddac108686f0eace97dd331f From git at git.haskell.org Thu Oct 4 15:39:09 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 4 Oct 2018 15:39:09 +0000 (UTC) Subject: [commit: ghc] master: Documentation fixes in 'template-haskell' (8537657) Message-ID: <20181004153909.7263B3ABBF@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/85376570c5d34950b1bd8f6c575526e7ff789b84/ghc >--------------------------------------------------------------- commit 85376570c5d34950b1bd8f6c575526e7ff789b84 Author: Alec Theriault Date: Thu Oct 4 11:19:46 2018 -0400 Documentation fixes in 'template-haskell' Summary: * Clarify the non-presence of derived classes in reified decls (#15167) * Clarify the shallowness of "reifyInstances" (#7066) * Mention that 'Typeable' instances are not found by reifyInstances (#11251) * Various Haddock markup issues fixed Reviewers: goldfire, bgamari Reviewed By: bgamari Subscribers: rwbarton, carter GHC Trac Issues: #15167, #7066, #11251 Differential Revision: https://phabricator.haskell.org/D5197 >--------------------------------------------------------------- 85376570c5d34950b1bd8f6c575526e7ff789b84 .../template-haskell/Language/Haskell/TH/Quote.hs | 2 +- .../template-haskell/Language/Haskell/TH/Syntax.hs | 65 ++++++++++++++-------- 2 files changed, 42 insertions(+), 25 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 85376570c5d34950b1bd8f6c575526e7ff789b84 From git at git.haskell.org Thu Oct 4 16:44:12 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 4 Oct 2018 16:44:12 +0000 (UTC) Subject: [commit: packages/array] master: Bump version to 0.5.3 and update changelog (8af2f62) Message-ID: <20181004164412.028CD3ABBF@ghc.haskell.org> Repository : ssh://git at git.haskell.org/array On branch : master Link : http://git.haskell.org/packages/array.git/commitdiff/8af2f620077c4bb67ec06ea0a0afede266e84b4d >--------------------------------------------------------------- commit 8af2f620077c4bb67ec06ea0a0afede266e84b4d Author: Ben Gamari Date: Thu Oct 4 11:04:47 2018 -0400 Bump version to 0.5.3 and update changelog >--------------------------------------------------------------- 8af2f620077c4bb67ec06ea0a0afede266e84b4d array.cabal | 2 +- changelog.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/array.cabal b/array.cabal index 928a7f6..b47538e 100644 --- a/array.cabal +++ b/array.cabal @@ -1,5 +1,5 @@ name: array -version: 0.5.2.0 +version: 0.5.3.0 -- NOTE: Don't forget to update ./changelog.md license: BSD3 license-file: LICENSE diff --git a/changelog.md b/changelog.md index 1a480a4..8a3d149 100644 --- a/changelog.md +++ b/changelog.md @@ -1,8 +1,8 @@ # Changelog for [`array` package](http://hackage.haskell.org/package/array) -## Next +## 0.5.3.0 *Oct 2018* - * Bundled with GHC 8.6.1 + * Bundled with GHC 8.6.2 * Drop support for GHC versions prior to GHC 8.0 ## 0.5.2.0 *Jul 2017* From git at git.haskell.org Thu Oct 4 23:38:37 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 4 Oct 2018 23:38:37 +0000 (UTC) Subject: [commit: ghc] master: Allow (unparenthesized) kind signatures (bace26a) Message-ID: <20181004233837.C783E3ABBF@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/bace26aadaafa4064e78f9ed088c1e2217221acc/ghc >--------------------------------------------------------------- commit bace26aadaafa4064e78f9ed088c1e2217221acc Author: Alec Theriault Date: Thu Oct 4 18:10:21 2018 -0400 Allow (unparenthesized) kind signatures Summary: This allows for things like `[t :: MyKind]`, `(a :: k, b)`, and so on. Test Plan: make TEST=T11622 && make TEST=T8708 Reviewers: RyanGlScott, bgamari, simonpj, goldfire, alanz Reviewed By: RyanGlScott, simonpj Subscribers: alanz, simonpj, rwbarton, mpickering, carter GHC Trac Issues: #11622, #8708 Differential Revision: https://phabricator.haskell.org/D5173 >--------------------------------------------------------------- bace26aadaafa4064e78f9ed088c1e2217221acc compiler/hsSyn/Convert.hs | 2 +- compiler/hsSyn/HsExpr.hs | 2 +- compiler/hsSyn/HsPat.hs | 2 +- compiler/hsSyn/HsTypes.hs | 4 +- compiler/hsSyn/HsUtils.hs | 2 +- compiler/parser/Parser.y | 32 +- compiler/parser/RdrHsSyn.hs | 52 +- docs/users_guide/8.8.1-notes.rst | 4 + testsuite/tests/ghc-api/annotations/T11018.stdout | 8 +- testsuite/tests/ghc-api/annotations/T11321.stdout | 2 +- .../tests/indexed-types/should_fail/T7938.stderr | 4 +- .../parser/should_compile/DumpParsedAst.stderr | 2 +- .../parser/should_compile/DumpRenamedAst.stderr | 33 +- testsuite/tests/parser/should_compile/KindSigs.hs | 32 ++ .../tests/parser/should_compile/KindSigs.stderr | 577 +++++++++++++++++++++ testsuite/tests/parser/should_compile/T11622.hs | 7 + testsuite/tests/parser/should_compile/T8708.hs | 7 + testsuite/tests/parser/should_compile/all.T | 4 + testsuite/tests/polykinds/T14450.stderr | 4 +- testsuite/tests/polykinds/T14580.stderr | 4 +- .../tests/typecheck/should_fail/T15629.stderr | 4 +- 21 files changed, 723 insertions(+), 65 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc bace26aadaafa4064e78f9ed088c1e2217221acc From git at git.haskell.org Thu Oct 4 23:38:41 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 4 Oct 2018 23:38:41 +0000 (UTC) Subject: [commit: ghc] master: Don't drop arguments in TH type arguments (ba163c3) Message-ID: <20181004233841.79A9D3ABBF@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/ba163c3b3502df039e589c5bb0bc9ea767267b2a/ghc >--------------------------------------------------------------- commit ba163c3b3502df039e589c5bb0bc9ea767267b2a Author: Alec Theriault Date: Thu Oct 4 18:13:15 2018 -0400 Don't drop arguments in TH type arguments Summary: When converting from TH AST back to HsType, we were occasionally dropping type arguments. This resulted in incorrectly accepted programs as well as incorrectly rejected programs. Test Plan: make TEST=T15360a && make TEST=T15360b Reviewers: goldfire, bgamari, tdammers Reviewed By: bgamari, tdammers Subscribers: RyanGlScott, rwbarton, carter GHC Trac Issues: #15360 Differential Revision: https://phabricator.haskell.org/D5188 >--------------------------------------------------------------- ba163c3b3502df039e589c5bb0bc9ea767267b2a compiler/hsSyn/Convert.hs | 22 +++++++++++++--------- testsuite/tests/th/T15360a.hs | 12 ++++++++++++ testsuite/tests/th/T15360b.hs | 20 ++++++++++++++++++++ testsuite/tests/th/T15360b.stderr | 20 ++++++++++++++++++++ testsuite/tests/th/all.T | 2 ++ 5 files changed, 67 insertions(+), 9 deletions(-) diff --git a/compiler/hsSyn/Convert.hs b/compiler/hsSyn/Convert.hs index f7713ff..d094e17 100644 --- a/compiler/hsSyn/Convert.hs +++ b/compiler/hsSyn/Convert.hs @@ -1355,7 +1355,7 @@ cvtTypeKind ty_str ty } LitT lit - -> returnL (HsTyLit noExt (cvtTyLit lit)) + -> mk_apps (HsTyLit noExt (cvtTyLit lit)) tys' WildCardT -> mk_apps mkAnonWildCardTy tys' @@ -1364,17 +1364,19 @@ cvtTypeKind ty_str ty -> do { s' <- tconName s ; t1' <- cvtType t1 ; t2' <- cvtType t2 - ; mk_apps (HsTyVar noExt NotPromoted (noLoc s')) [t1', t2'] + ; mk_apps (HsTyVar noExt NotPromoted (noLoc s')) + (t1' : t2' : tys') } UInfixT t1 s t2 -> do { t2' <- cvtType t2 - ; cvtOpAppT t1 s t2' - } -- Note [Converting UInfix] + ; t <- cvtOpAppT t1 s t2' -- Note [Converting UInfix] + ; mk_apps (unLoc t) tys' + } ParensT t -> do { t' <- cvtType t - ; returnL $ HsParTy noExt t' + ; mk_apps (HsParTy noExt t') tys' } PromotedT nm -> do { nm' <- cName nm @@ -1394,7 +1396,7 @@ cvtTypeKind ty_str ty m = length tys' PromotedNilT - -> returnL (HsExplicitListTy noExt Promoted []) + -> mk_apps (HsExplicitListTy noExt Promoted []) tys' PromotedConsT -- See Note [Representing concrete syntax in types] -- in Language.Haskell.TH.Syntax @@ -1406,12 +1408,14 @@ cvtTypeKind ty_str ty tys' StarT - -> returnL (HsTyVar noExt NotPromoted (noLoc - (getRdrName liftedTypeKindTyCon))) + -> mk_apps (HsTyVar noExt NotPromoted + (noLoc (getRdrName liftedTypeKindTyCon))) + tys' ConstraintT - -> returnL (HsTyVar noExt NotPromoted + -> mk_apps (HsTyVar noExt NotPromoted (noLoc (getRdrName constraintKindTyCon))) + tys' EqualityT | [x',y'] <- tys' -> diff --git a/testsuite/tests/th/T15360a.hs b/testsuite/tests/th/T15360a.hs new file mode 100644 index 0000000..4839ccf --- /dev/null +++ b/testsuite/tests/th/T15360a.hs @@ -0,0 +1,12 @@ +{-# LANGUAGE TemplateHaskell #-} +module T15360a where + +import Language.Haskell.TH + +data T a b c = Mk a b c + +bar :: $( return $ AppT (InfixT (ConT ''Int) ''T (ConT ''Bool)) (ConT ''Double) ) +bar = Mk 5 True 3.14 + +baz :: $( return $ AppT (ParensT (ConT ''Maybe)) (ConT ''Int) ) +baz = Just 5 diff --git a/testsuite/tests/th/T15360b.hs b/testsuite/tests/th/T15360b.hs new file mode 100644 index 0000000..276d2cd --- /dev/null +++ b/testsuite/tests/th/T15360b.hs @@ -0,0 +1,20 @@ +{-# LANGUAGE TemplateHaskell #-} +{-# LANGUAGE QuasiQuotes #-} +{-# LANGUAGE DataKinds #-} +{-# LANGUAGE StarIsType #-} +module T15360b where + +import Data.Kind +import Data.Proxy + +x :: Proxy $([t| * Double |]) +x = Proxy + +y :: Proxy $([t| 1 Int |]) +y = Proxy + +z :: Proxy $([t| Constraint Bool |]) +z = Proxy + +w :: Proxy $([t| '[] Int |]) +w = Proxy diff --git a/testsuite/tests/th/T15360b.stderr b/testsuite/tests/th/T15360b.stderr new file mode 100644 index 0000000..8175c12 --- /dev/null +++ b/testsuite/tests/th/T15360b.stderr @@ -0,0 +1,20 @@ + +T15360b.hs:10:14: error: + • Expected kind ‘* -> k4’, but ‘Type’ has kind ‘*’ + • In the first argument of ‘Proxy’, namely ‘(Type Double)’ + In the type signature: x :: Proxy (Type Double) + +T15360b.hs:13:14: error: + • Expected kind ‘* -> k3’, but ‘1’ has kind ‘GHC.Types.Nat’ + • In the first argument of ‘Proxy’, namely ‘(1 Int)’ + In the type signature: y :: Proxy (1 Int) + +T15360b.hs:16:14: error: + • Expected kind ‘* -> k2’, but ‘Constraint’ has kind ‘*’ + • In the first argument of ‘Proxy’, namely ‘(Constraint Bool)’ + In the type signature: z :: Proxy (Constraint Bool) + +T15360b.hs:19:14: error: + • Expected kind ‘* -> k1’, but ‘'[]’ has kind ‘[k0]’ + • In the first argument of ‘Proxy’, namely ‘('[] Int)’ + In the type signature: w :: Proxy ('[] Int) diff --git a/testsuite/tests/th/all.T b/testsuite/tests/th/all.T index 948c7db..249493e 100644 --- a/testsuite/tests/th/all.T +++ b/testsuite/tests/th/all.T @@ -419,6 +419,8 @@ test('T15321', normal, compile_fail, ['']) test('T15324', normal, compile, ['-v0 -ddump-splices -dsuppress-uniques']) test('T15331', normal, compile, ['-v0 -ddump-splices -dsuppress-uniques']) test('T15365', normal, compile, ['-v0 -ddump-splices -dsuppress-uniques']) +test('T15360a', normal, compile, ['']) +test('T15360b', normal, compile_fail, ['']) # Note: T9693 should be only_ways(['ghci']) once it's fixed. test('T9693', expect_broken(9693), ghci_script, ['T9693.script']) test('T14471', normal, compile, ['']) From git at git.haskell.org Thu Oct 4 23:38:44 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 4 Oct 2018 23:38:44 +0000 (UTC) Subject: [commit: ghc] master: Set `infixr -1 ->` (251e342) Message-ID: <20181004233844.5D70B3ABBF@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/251e3424a96986fca5164a2397783a1c066558fc/ghc >--------------------------------------------------------------- commit 251e3424a96986fca5164a2397783a1c066558fc Author: Alec Theriault Date: Thu Oct 4 18:13:28 2018 -0400 Set `infixr -1 ->` Summary: This simply makes explicit what is already the case. Due to special treatment in the parser, `->` has the lowest fixity. This patch propagates that information to: * GHCi, where `:info ->` now return the right fixity * TH, where `reifyFixity` returns the right fixity * the generated sources for `GHC.Prim` See #15235. Test Plan: make test Reviewers: bgamari, alanz, RyanGlScott Reviewed By: RyanGlScott Subscribers: int-index, RyanGlScott, rwbarton, mpickering, carter GHC Trac Issues: #15235 Differential Revision: https://phabricator.haskell.org/D5199 >--------------------------------------------------------------- 251e3424a96986fca5164a2397783a1c066558fc compiler/basicTypes/BasicTypes.hs | 2 +- compiler/parser/Parser.y | 6 ++++-- compiler/parser/RdrHsSyn.hs | 20 ++++++++++++++------ compiler/prelude/primops.txt.pp | 2 +- docs/users_guide/glasgow_exts.rst | 3 +-- testsuite/tests/ghci/scripts/T8535.stdout | 2 +- testsuite/tests/ghci/scripts/ghci020.stdout | 2 +- testsuite/tests/ghci/should_run/T10145.stdout | 2 +- testsuite/tests/th/T10704.stdout | 2 +- utils/genprimopcode/Main.hs | 1 + 10 files changed, 26 insertions(+), 16 deletions(-) diff --git a/compiler/basicTypes/BasicTypes.hs b/compiler/basicTypes/BasicTypes.hs index 151a040..cf56957 100644 --- a/compiler/basicTypes/BasicTypes.hs +++ b/compiler/basicTypes/BasicTypes.hs @@ -410,7 +410,7 @@ defaultFixity = Fixity NoSourceText maxPrecedence InfixL negateFixity, funTyFixity :: Fixity -- Wired-in fixities negateFixity = Fixity NoSourceText 6 InfixL -- Fixity of unary negate -funTyFixity = Fixity NoSourceText 0 InfixR -- Fixity of '->' +funTyFixity = Fixity NoSourceText (-1) InfixR -- Fixity of '->', see #15235 {- Consider diff --git a/compiler/parser/Parser.y b/compiler/parser/Parser.y index 25eb008..74db997 100644 --- a/compiler/parser/Parser.y +++ b/compiler/parser/Parser.y @@ -998,7 +998,7 @@ impspec :: { Located (Bool, Located [LIE GhcPs]) } prec :: { Located (SourceText,Int) } : {- empty -} { noLoc (NoSourceText,9) } | INTEGER - {% checkPrecP (sL1 $1 (getINTEGERs $1,fromInteger (il_value (getINTEGER $1)))) } + { sL1 $1 (getINTEGERs $1,fromInteger (il_value (getINTEGER $1))) } infix :: { Located FixityDirection } : 'infix' { sL1 $1 InfixN } @@ -2378,7 +2378,8 @@ sigdecl :: { LHsDecl GhcPs } [mu AnnDcolon $4] } } | infix prec ops - {% ams (sLL $1 $> $ SigD noExt + {% checkPrecP $2 $3 >> + ams (sLL $1 $> $ SigD noExt (FixSig noExt (FixitySig noExt (fromOL $ unLoc $3) (Fixity (fst $ unLoc $2) (snd $ unLoc $2) (unLoc $1))))) [mj AnnInfix $1,mj AnnVal $2] } @@ -3243,6 +3244,7 @@ op :: { Located RdrName } -- used in infix decls : varop { $1 } | conop { $1 } | '->' { sL1 $1 $ getRdrName funTyCon } + | '~' { sL1 $1 $ eqTyCon_RDR } varop :: { Located RdrName } : varsym { $1 } diff --git a/compiler/parser/RdrHsSyn.hs b/compiler/parser/RdrHsSyn.hs index 91fcb0d..1015319 100644 --- a/compiler/parser/RdrHsSyn.hs +++ b/compiler/parser/RdrHsSyn.hs @@ -87,7 +87,7 @@ import BasicTypes import TcEvidence ( idHsWrapper ) import Lexer import Lexeme ( isLexCon ) -import Type ( TyThing(..) ) +import Type ( TyThing(..), funTyCon ) import TysWiredIn ( cTupleTyConName, tupleTyCon, tupleDataCon, nilDataConName, nilDataConKey, listTyConName, listTyConKey, eqTyCon_RDR, @@ -1756,11 +1756,19 @@ cmdStmtFail loc e = parseErrorSDoc loc --------------------------------------------------------------------------- -- Miscellaneous utilities -checkPrecP :: Located (SourceText,Int) -> P (Located (SourceText,Int)) -checkPrecP (L l (src,i)) - | 0 <= i && i <= maxPrecedence = return (L l (src,i)) - | otherwise - = parseErrorSDoc l (text ("Precedence out of range: " ++ show i)) +-- | Check if a fixity is valid. We support bypassing the usual bound checks +-- for some special operators. +checkPrecP + :: Located (SourceText,Int) -- ^ precedence + -> Located (OrdList (Located RdrName)) -- ^ operators + -> P () +checkPrecP (L l (_,i)) (L _ ol) + | 0 <= i, i <= maxPrecedence = pure () + | all specialOp ol = pure () + | otherwise = parseErrorSDoc l (text ("Precedence out of range: " ++ show i)) + where + specialOp op = unLoc op `elem` [ eqTyCon_RDR + , getRdrName funTyCon ] mkRecConstrOrUpdate :: LHsExpr GhcPs diff --git a/compiler/prelude/primops.txt.pp b/compiler/prelude/primops.txt.pp index 2d2fff4..7360ccb 100644 --- a/compiler/prelude/primops.txt.pp +++ b/compiler/prelude/primops.txt.pp @@ -169,7 +169,7 @@ primtype (->) a b Note that {\tt a -> b} permits levity-polymorphism in both {\tt a} and {\tt b}, so that types like {\tt Int\# -> Int\#} can still be well-kinded. } - with fixity = infixr 0 + with fixity = infixr -1 -- This fixity is only the one picked up by Haddock. If you -- change this, do update 'ghcPrimIface' in 'LoadIface.hs'. diff --git a/docs/users_guide/glasgow_exts.rst b/docs/users_guide/glasgow_exts.rst index 1664dbc..4a77f3b 100644 --- a/docs/users_guide/glasgow_exts.rst +++ b/docs/users_guide/glasgow_exts.rst @@ -2409,8 +2409,7 @@ specifically: sets the fixity for both type constructor ``T`` and data constructor ``T``, and similarly for ``:*:``. ``Int `a` Bool``. -- Function arrow is ``infixr`` with fixity 0 (this might change; it's - not clear what it should be). +- The function arrow ``->`` is ``infixr`` with fixity -1. .. _type-operators: diff --git a/testsuite/tests/ghci/scripts/T8535.stdout b/testsuite/tests/ghci/scripts/T8535.stdout index 6ae0c4c..a0a5730 100644 --- a/testsuite/tests/ghci/scripts/T8535.stdout +++ b/testsuite/tests/ghci/scripts/T8535.stdout @@ -1,5 +1,5 @@ data (->) (a :: TYPE q) (b :: TYPE r) -- Defined in ‘GHC.Prim’ -infixr 0 -> +infixr -1 -> instance Applicative ((->) a) -- Defined in ‘GHC.Base’ instance Functor ((->) r) -- Defined in ‘GHC.Base’ instance Monad ((->) r) -- Defined in ‘GHC.Base’ diff --git a/testsuite/tests/ghci/scripts/ghci020.stdout b/testsuite/tests/ghci/scripts/ghci020.stdout index 6ae0c4c..a0a5730 100644 --- a/testsuite/tests/ghci/scripts/ghci020.stdout +++ b/testsuite/tests/ghci/scripts/ghci020.stdout @@ -1,5 +1,5 @@ data (->) (a :: TYPE q) (b :: TYPE r) -- Defined in ‘GHC.Prim’ -infixr 0 -> +infixr -1 -> instance Applicative ((->) a) -- Defined in ‘GHC.Base’ instance Functor ((->) r) -- Defined in ‘GHC.Base’ instance Monad ((->) r) -- Defined in ‘GHC.Base’ diff --git a/testsuite/tests/ghci/should_run/T10145.stdout b/testsuite/tests/ghci/should_run/T10145.stdout index 6ae0c4c..a0a5730 100644 --- a/testsuite/tests/ghci/should_run/T10145.stdout +++ b/testsuite/tests/ghci/should_run/T10145.stdout @@ -1,5 +1,5 @@ data (->) (a :: TYPE q) (b :: TYPE r) -- Defined in ‘GHC.Prim’ -infixr 0 -> +infixr -1 -> instance Applicative ((->) a) -- Defined in ‘GHC.Base’ instance Functor ((->) r) -- Defined in ‘GHC.Base’ instance Monad ((->) r) -- Defined in ‘GHC.Base’ diff --git a/testsuite/tests/th/T10704.stdout b/testsuite/tests/th/T10704.stdout index 99b87e2..5d6d015 100644 --- a/testsuite/tests/th/T10704.stdout +++ b/testsuite/tests/th/T10704.stdout @@ -1,4 +1,4 @@ -Just (Fixity 0 InfixR) +Just (Fixity (-1) InfixR) Nothing Nothing Just (Fixity 6 InfixL) diff --git a/utils/genprimopcode/Main.hs b/utils/genprimopcode/Main.hs index a0e9d54..e4779bf 100644 --- a/utils/genprimopcode/Main.hs +++ b/utils/genprimopcode/Main.hs @@ -244,6 +244,7 @@ gen_hs_source (Info defaults entries) = ++ "{-# LANGUAGE MultiParamTypeClasses #-}\n" ++ "{-# LANGUAGE NoImplicitPrelude #-}\n" ++ "{-# LANGUAGE UnboxedTuples #-}\n" + ++ "{-# LANGUAGE NegativeLiterals #-}\n" ++ "{-# OPTIONS_GHC -fno-warn-redundant-constraints #-}\n" -- We generate a binding for coerce, like From git at git.haskell.org Thu Oct 4 23:38:47 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 4 Oct 2018 23:38:47 +0000 (UTC) Subject: [commit: ghc] master: Don't leak internal commentary into HasField's Haddocks (89656c2) Message-ID: <20181004233847.338B63ABBF@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/89656c21ca18d949ac28a2c5931a44bc67a36513/ghc >--------------------------------------------------------------- commit 89656c21ca18d949ac28a2c5931a44bc67a36513 Author: Ryan Scott Date: Thu Oct 4 18:56:50 2018 -0400 Don't leak internal commentary into HasField's Haddocks In commit 2f09753f9620, some internal comments about the kind signature of the HasField class accidentially leaked into its publicly exported Haddocks. >--------------------------------------------------------------- 89656c21ca18d949ac28a2c5931a44bc67a36513 libraries/base/GHC/Records.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/base/GHC/Records.hs b/libraries/base/GHC/Records.hs index 3b1a4c2..0292f3a 100644 --- a/libraries/base/GHC/Records.hs +++ b/libraries/base/GHC/Records.hs @@ -29,7 +29,7 @@ module GHC.Records -- | Constraint representing the fact that the field @x@ belongs to -- the record type @r@ and has field type @a at . This will be solved -- automatically, but manual instances may be provided as well. --- + -- HasField :: forall {k}. k -> * -> * -> Constraint -- getField :: forall {k} (x::k) r a. HasField x r a => r -> a -- NB: The {k} means that k is an 'inferred' type variable, and From git at git.haskell.org Fri Oct 5 03:35:18 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 5 Oct 2018 03:35:18 +0000 (UTC) Subject: [commit: ghc] master: Make TcRnMonad independent of TcSplice (#14391) (e5013a5) Message-ID: <20181005033518.BF6363ABBF@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/e5013a567b230018b5d39b562ce21faf54740d04/ghc >--------------------------------------------------------------- commit e5013a567b230018b5d39b562ce21faf54740d04 Author: Krzysztof Gogolewski Date: Thu Oct 4 13:50:54 2018 -0400 Make TcRnMonad independent of TcSplice (#14391) Test Plan: validate Reviewers: simonpj, bgamari Reviewed By: simonpj Subscribers: rwbarton, carter GHC Trac Issues: #14391 Differential Revision: https://phabricator.haskell.org/D5135 >--------------------------------------------------------------- e5013a567b230018b5d39b562ce21faf54740d04 compiler/rename/RnSplice.hs | 15 +++++++++++---- compiler/typecheck/TcRnDriver.hs | 11 ++++++----- compiler/typecheck/TcRnMonad.hs | 4 +--- compiler/typecheck/TcRnTypes.hs | 5 ++--- 4 files changed, 20 insertions(+), 15 deletions(-) diff --git a/compiler/rename/RnSplice.hs b/compiler/rename/RnSplice.hs index 19bf763..c26d03a 100644 --- a/compiler/rename/RnSplice.hs +++ b/compiler/rename/RnSplice.hs @@ -51,7 +51,6 @@ import {-# SOURCE #-} TcSplice , runMetaE , runMetaP , runMetaT - , runRemoteModFinalizers , tcTopSpliceExpr ) @@ -638,9 +637,16 @@ rnTopSpliceDecls splice rnSplice splice -- As always, be sure to checkNoErrs above lest we end up with -- holes making it to typechecking, hence #12584. + -- + -- Note that we cannot call checkNoErrs for the whole duration + -- of rnTopSpliceDecls. The reason is that checkNoErrs changes + -- the local environment to temporarily contain a new + -- reference to store errors, and add_mod_finalizers would + -- cause this reference to be stored after checkNoErrs finishes. + -- This is checked by test TH_finalizer. ; traceRn "rnTopSpliceDecls: untyped declaration splice" empty - ; (decls, mod_finalizers) <- - runRnSplice UntypedDeclSplice runMetaD ppr_decls rn_splice + ; (decls, mod_finalizers) <- checkNoErrs $ + runRnSplice UntypedDeclSplice runMetaD ppr_decls rn_splice ; add_mod_finalizers_now mod_finalizers ; return (decls,fvs) } where @@ -658,8 +664,9 @@ rnTopSpliceDecls splice add_mod_finalizers_now [] = return () add_mod_finalizers_now mod_finalizers = do th_modfinalizers_var <- fmap tcg_th_modfinalizers getGblEnv + env <- getLclEnv updTcRef th_modfinalizers_var $ \fins -> - runRemoteModFinalizers (ThModFinalizers mod_finalizers) : fins + (env, ThModFinalizers mod_finalizers) : fins {- diff --git a/compiler/typecheck/TcRnDriver.hs b/compiler/typecheck/TcRnDriver.hs index 74319c0..e53314d 100644 --- a/compiler/typecheck/TcRnDriver.hs +++ b/compiler/typecheck/TcRnDriver.hs @@ -47,7 +47,7 @@ module TcRnDriver ( import GhcPrelude -import {-# SOURCE #-} TcSplice ( finishTH ) +import {-# SOURCE #-} TcSplice ( finishTH, runRemoteModFinalizers ) import RnSplice ( rnTopSpliceDecls, traceSplice, SpliceInfo(..) ) import IfaceEnv( externaliseName ) import TcHsType @@ -470,8 +470,10 @@ run_th_modfinalizers = do then getEnvs else do writeTcRef th_modfinalizers_var [] - (_, lie_th) <- captureTopConstraints $ - sequence_ th_modfinalizers + let run_finalizer (lcl_env, f) = + setLclEnv lcl_env (runRemoteModFinalizers f) + + (_, lie_th) <- captureTopConstraints $ mapM_ run_finalizer th_modfinalizers -- Finalizers can add top-level declarations with addTopDecls, so -- we have to run tc_rn_src_decls to get them (tcg_env, tcl_env, lie_top_decls) <- tc_rn_src_decls [] @@ -550,8 +552,7 @@ tc_rn_src_decls ds do { recordTopLevelSpliceLoc loc -- Rename the splice expression, and get its supporting decls - ; (spliced_decls, splice_fvs) <- checkNoErrs (rnTopSpliceDecls - splice) + ; (spliced_decls, splice_fvs) <- rnTopSpliceDecls splice -- Glue them on the front of the remaining decls and loop ; (tcg_env, tcl_env, lie2) <- diff --git a/compiler/typecheck/TcRnMonad.hs b/compiler/typecheck/TcRnMonad.hs index 12b88dd..b93652f 100644 --- a/compiler/typecheck/TcRnMonad.hs +++ b/compiler/typecheck/TcRnMonad.hs @@ -183,7 +183,6 @@ import Control.Monad import Data.Set ( Set ) import qualified Data.Set as Set -import {-# SOURCE #-} TcSplice ( runRemoteModFinalizers ) import {-# SOURCE #-} TcEnv ( tcInitTidyEnv ) import qualified Data.Map as Map @@ -1715,8 +1714,7 @@ addModFinalizersWithLclEnv mod_finalizers = do lcl_env <- getLclEnv th_modfinalizers_var <- fmap tcg_th_modfinalizers getGblEnv updTcRef th_modfinalizers_var $ \fins -> - setLclEnv lcl_env (runRemoteModFinalizers mod_finalizers) - : fins + (lcl_env, mod_finalizers) : fins {- ************************************************************************ diff --git a/compiler/typecheck/TcRnTypes.hs b/compiler/typecheck/TcRnTypes.hs index 322e4e0..695d2ae 100644 --- a/compiler/typecheck/TcRnTypes.hs +++ b/compiler/typecheck/TcRnTypes.hs @@ -633,11 +633,10 @@ data TcGblEnv tcg_th_topnames :: TcRef NameSet, -- ^ Exact names bound in top-level declarations in tcg_th_topdecls - tcg_th_modfinalizers :: TcRef [TcM ()], + tcg_th_modfinalizers :: TcRef [(TcLclEnv, ThModFinalizers)], -- ^ Template Haskell module finalizers. -- - -- They are computations in the @TcM@ monad rather than @Q@ because we - -- set them to use particular local environments. + -- They can use particular local environments. tcg_th_coreplugins :: TcRef [String], -- ^ Core plugins added by Template Haskell code. From git at git.haskell.org Fri Oct 5 03:35:21 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 5 Oct 2018 03:35:21 +0000 (UTC) Subject: [commit: ghc] master: Fix PE linker wibbles (98daa34) Message-ID: <20181005033521.9C8703ABBF@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/98daa34c73ed2a4bccc4cfb6608c6a614da61f8c/ghc >--------------------------------------------------------------- commit 98daa34c73ed2a4bccc4cfb6608c6a614da61f8c Author: Tamar Christina Date: Thu Oct 4 13:50:04 2018 -0400 Fix PE linker wibbles Fix some various issues that popped up because the linker now doesn't load import libraries for longer than it needs to. These are all use after free issues. Test Plan: ./validate Reviewers: bgamari, erikd, simonmar Reviewed By: bgamari Subscribers: simonpj, rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5175 >--------------------------------------------------------------- 98daa34c73ed2a4bccc4cfb6608c6a614da61f8c rts/Linker.c | 6 ++++++ rts/linker/PEi386.c | 35 ++++++++++++++++++++++------------- 2 files changed, 28 insertions(+), 13 deletions(-) diff --git a/rts/Linker.c b/rts/Linker.c index a1de6a7..8262697 100644 --- a/rts/Linker.c +++ b/rts/Linker.c @@ -1235,6 +1235,12 @@ void freeObjectCode (ObjectCode *oc) * Sets the initial status of a fresh ObjectCode */ static void setOcInitialStatus(ObjectCode* oc) { + /* If a target has requested the ObjectCode not to be resolved then + honor this requests. Usually this means the ObjectCode has not been + initialized and can't be. */ + if (oc->status == OBJECT_DONT_RESOLVE) + return; + if (oc->archiveMemberName == NULL) { oc->status = OBJECT_NEEDED; } else { diff --git a/rts/linker/PEi386.c b/rts/linker/PEi386.c index 4dbb629..ab4583d 100644 --- a/rts/linker/PEi386.c +++ b/rts/linker/PEi386.c @@ -414,12 +414,11 @@ void freePreloadObjectFile_PEi386(ObjectCode *oc) oc->image = NULL; } - if (oc->info->image) { - HeapFree(code_heap, 0, oc->info->image); - oc->info->image = NULL; - } - if (oc->info) { + if (oc->info->image) { + HeapFree(code_heap, 0, oc->info->image); + oc->info->image = NULL; + } if (oc->info->ch_info) stgFree (oc->info->ch_info); stgFree (oc->info); @@ -447,15 +446,15 @@ static void releaseOcInfo(ObjectCode* oc) { oc->info = NULL; } for (int i = 0; i < oc->n_sections; i++){ - Section section = oc->sections[i]; - if (section.info) { - stgFree (section.info->name); - if (section.info->relocs) { - stgFree (section.info->relocs); - section.info->relocs = NULL; + Section *section = &oc->sections[i]; + if (section->info) { + stgFree (section->info->name); + if (section->info->relocs) { + stgFree (section->info->relocs); + section->info->relocs = NULL; } - stgFree (section.info); - section.info = NULL; + stgFree (section->info); + section->info = NULL; } } } @@ -1161,6 +1160,11 @@ ocVerifyImage_PEi386 ( ObjectCode* oc ) { COFF_HEADER_INFO *info = getHeaderInfo (oc); + /* If the header could not be read, then don't process the ObjectCode. + This the case when the ObjectCode has been partially freed. */ + if (!info) + return false; + uint32_t i, noRelocs; COFF_section* sectab; COFF_symbol* symtab; @@ -1530,6 +1534,7 @@ ocGetNames_PEi386 ( ObjectCode* oc ) stgFree (oc->image); oc->image = NULL; releaseOcInfo (oc); + oc->status = OBJECT_DONT_RESOLVE; return true; } @@ -1831,6 +1836,10 @@ ocResolve_PEi386 ( ObjectCode* oc ) uint8_t symbol[1000]; /* debugBelch("resolving for %s\n", oc->fileName); */ + /* Such libraries have been partially freed and can't be resolved. */ + if (oc->status == OBJECT_DONT_RESOLVE) + return 1; + COFF_HEADER_INFO *info = oc->info->ch_info; uint32_t numberOfSections = info->numberOfSections; From git at git.haskell.org Fri Oct 5 03:35:24 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 5 Oct 2018 03:35:24 +0000 (UTC) Subject: [commit: ghc] master: testsuite: Skip T3171 for now (817ba0c) Message-ID: <20181005033524.736543ABBF@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/817ba0cf0d70663d934eee421288978ff939cbd2/ghc >--------------------------------------------------------------- commit 817ba0cf0d70663d934eee421288978ff939cbd2 Author: Ben Gamari Date: Thu Oct 4 13:42:30 2018 -0400 testsuite: Skip T3171 for now This test is remarkably flaky, failing regularly on i386/Linux, amd64/Fedora, and amd64/Darwin. I've opened #15383 to track this and am disabling the test for now until we have a chance to investigate. Test Plan: Validate Reviewers: alpmestan Subscribers: rwbarton, carter GHC Trac Issues: #15383 Differential Revision: https://phabricator.haskell.org/D5202 >--------------------------------------------------------------- 817ba0cf0d70663d934eee421288978ff939cbd2 testsuite/tests/ghci/should_run/all.T | 1 + 1 file changed, 1 insertion(+) diff --git a/testsuite/tests/ghci/should_run/all.T b/testsuite/tests/ghci/should_run/all.T index d92b0e7..70e200c 100644 --- a/testsuite/tests/ghci/should_run/all.T +++ b/testsuite/tests/ghci/should_run/all.T @@ -11,6 +11,7 @@ test('T2881', just_ghci, compile_and_run, ['']) test('T3171', [when(opsys('mingw32'),skip), + skip, # This test is quite flaky (#15383) req_interp, combined_output], run_command, From git at git.haskell.org Fri Oct 5 03:35:27 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 5 Oct 2018 03:35:27 +0000 (UTC) Subject: [commit: ghc] master: Add -Wstar-is-type to the User's Guide (07083fc) Message-ID: <20181005033527.41D983ABBF@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/07083fc44ebf3f0510ae1d71ae5c9c88c87ae1d8/ghc >--------------------------------------------------------------- commit 07083fc44ebf3f0510ae1d71ae5c9c88c87ae1d8 Author: Vladislav Zavialov Date: Thu Oct 4 13:43:47 2018 -0400 Add -Wstar-is-type to the User's Guide The -Wstar-is-type flag was added without documentation. Now it has documentation. Test Plan: Validate Reviewers: bgamari Reviewed By: bgamari Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5203 >--------------------------------------------------------------- 07083fc44ebf3f0510ae1d71ae5c9c88c87ae1d8 docs/users_guide/using-warnings.rst | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/docs/users_guide/using-warnings.rst b/docs/users_guide/using-warnings.rst index d93064b..dba30db 100644 --- a/docs/users_guide/using-warnings.rst +++ b/docs/users_guide/using-warnings.rst @@ -37,6 +37,7 @@ generally likely to indicate bugs in your program. These are: * :ghc-flag:`-Wtabs` * :ghc-flag:`-Wunrecognised-warning-flags` * :ghc-flag:`-Winaccessible-code` + * :ghc-flag:`-Wstar-is-type` * :ghc-flag:`-Wstar-binder` The following flags are simple ways to select standard "packages" of warnings: @@ -1175,6 +1176,24 @@ of ``-W(no-)*``. since we're passing ``Foo1`` and ``Foo2`` here, it follows that ``t ~ Char``, and ``u ~ Int``, and thus ``t ~ u`` cannot hold. +.. ghc-flag:: -Wstar-is-type + :shortdesc: warn when ``*`` is used to mean ``Data.Kind.Type`` + :type: dynamic + :reverse: -Wno-star-is-type + :category: + + :since: 8.6 + + The use of ``*`` to denote the kind of inhabited types relies on the + :extension:`StarIsType` extension, which in a future release will be + turned off by default and then possibly removed. The reasons for this and + the deprecation schedule are described in `GHC proposal #30 + `__. + + This warning allows to detect such uses of ``*`` before the actual + breaking change takes place. The recommended fix is to replace ``*`` with + ``Type`` imported from ``Data.Kind``. + .. ghc-flag:: -Wstar-binder :shortdesc: warn about binding the ``(*)`` type operator despite :ghc-flag:`-XStarIsType` From git at git.haskell.org Fri Oct 5 03:35:30 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 5 Oct 2018 03:35:30 +0000 (UTC) Subject: [commit: ghc] master: Bump Cabal submodule (fa1c827) Message-ID: <20181005033530.100CB3ABBF@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/fa1c8279ada1e9f9ee34056de5be3b043b469f05/ghc >--------------------------------------------------------------- commit fa1c8279ada1e9f9ee34056de5be3b043b469f05 Author: Ben Gamari Date: Thu Oct 4 12:44:49 2018 -0400 Bump Cabal submodule >--------------------------------------------------------------- fa1c8279ada1e9f9ee34056de5be3b043b469f05 libraries/Cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/Cabal b/libraries/Cabal index fe10982..5a42391 160000 --- a/libraries/Cabal +++ b/libraries/Cabal @@ -1 +1 @@ -Subproject commit fe10982db1f2fa7d828fc5f8ddaa5beedceaddec +Subproject commit 5a42391b88aca4467e45c23aff3d74720c353667 From git at git.haskell.org Fri Oct 5 03:35:32 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 5 Oct 2018 03:35:32 +0000 (UTC) Subject: [commit: ghc] master: Multiple fixes / improvements for LLVM backend (adcb5fb) Message-ID: <20181005033532.E231B3ABBF@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/adcb5fb47c0942671d409b940d8884daa9359ca4/ghc >--------------------------------------------------------------- commit adcb5fb47c0942671d409b940d8884daa9359ca4 Author: Kavon Farvardin Date: Thu Oct 4 13:44:55 2018 -0400 Multiple fixes / improvements for LLVM backend - Fix for #13904 -- stop "trashing" callee-saved registers, since it is not actually doing anything useful. - Fix for #14251 -- fixes the calling convention for functions passing raw SSE-register values by adding padding as needed to get the values in the right registers. This problem cropped up when some args were unused an dropped from the live list. - Fixed a typo in 'readnone' attribute - Added 'lower-expect' pass to level 0 LLVM optimization passes to improve block layout in LLVM for stack checks, etc. Test Plan: `make test WAYS=optllvm` and `make test WAYS=llvm` Reviewers: bgamari, simonmar, angerman Reviewed By: angerman Subscribers: rwbarton, carter GHC Trac Issues: #13904, #14251 Differential Revision: https://phabricator.haskell.org/D5190 >--------------------------------------------------------------- adcb5fb47c0942671d409b940d8884daa9359ca4 compiler/llvmGen/Llvm/Types.hs | 2 +- compiler/llvmGen/LlvmCodeGen/Base.hs | 62 +++++++++++++++++++++++++++----- compiler/llvmGen/LlvmCodeGen/CodeGen.hs | 60 ++++++------------------------- llvm-passes | 2 +- testsuite/tests/codeGen/should_run/all.T | 3 +- 5 files changed, 67 insertions(+), 62 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc adcb5fb47c0942671d409b940d8884daa9359ca4 From git at git.haskell.org Fri Oct 5 03:35:35 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 5 Oct 2018 03:35:35 +0000 (UTC) Subject: [commit: ghc] master: Update performance numbers on Windows (baec358) Message-ID: <20181005033535.B35FD3ABBF@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/baec3586576c1eed0d6fab32ef34293484cf5a2e/ghc >--------------------------------------------------------------- commit baec3586576c1eed0d6fab32ef34293484cf5a2e Author: Tamar Christina Date: Thu Oct 4 13:48:52 2018 -0400 Update performance numbers on Windows Test Plan: ./validate Reviewers: bgamari Reviewed By: bgamari Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5176 >--------------------------------------------------------------- baec3586576c1eed0d6fab32ef34293484cf5a2e testsuite/tests/perf/compiler/all.T | 7 ++++--- testsuite/tests/perf/should_run/all.T | 8 ++++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/testsuite/tests/perf/compiler/all.T b/testsuite/tests/perf/compiler/all.T index 7420690..d1d5a1c 100644 --- a/testsuite/tests/perf/compiler/all.T +++ b/testsuite/tests/perf/compiler/all.T @@ -670,10 +670,11 @@ test('T5837', # 2016-04-06: 24199320 (x86/Linux, 64-bit machine) TypeInType # 2017-03-24: 27028956 (x86/Linux, 64-bit machine) - (platform('x86_64-unknown-mingw32'), 54793816, 7), + (platform('x86_64-unknown-mingw32'), 61806136, 7), # 2017-02-19 59161648 (x64/Windows) - Unknown # 2017-04-21 54985248 (x64/Windows) - Unknown # 2017-12-24 54793816 (x64/Windows) - Unknown + # 2018-09-23 61806136 (x64/Windows) - Unknown (wordsize(64), 55813608, 7)]) # sample: 3926235424 (amd64/Linux, 15/2/2012) @@ -897,7 +898,7 @@ test('T9872c', test('T9872d', [ only_ways(['normal']), compiler_stats_num_field('bytes allocated', - [(wordsize(64), 578498120, 5), + [(wordsize(64), 578498120, 7), # 2014-12-18 796071864 Initally created # 2014-12-18 739189056 Reduce type families even more eagerly # 2015-01-07 687562440 TrieMap leaf compression @@ -1156,7 +1157,7 @@ test('T12707', test('T12150', [ only_ways(['optasm']), compiler_stats_num_field('bytes allocated', - [(wordsize(64), 77557800, 5) + [(wordsize(64), 77557800, 10) # initial: 70773000 # 2017-08-25: 74358208 Refactor the Mighty Simplifier # 2017-08-25: 78300680 Drift diff --git a/testsuite/tests/perf/should_run/all.T b/testsuite/tests/perf/should_run/all.T index 37ce0a4..e3fb136 100644 --- a/testsuite/tests/perf/should_run/all.T +++ b/testsuite/tests/perf/should_run/all.T @@ -586,7 +586,9 @@ test('T14936', test('T15226', [stats_num_field('bytes allocated', - [ (wordsize(64), 41040, 5) ]), + [(platform('x86_64-unknown-mingw32'), 37488, 4), + # 2018-09-23 37488 Linker changes + (wordsize(64), 41040, 5) ]), # 2018-06-06 41040 Let the simplifier know the result # of seq# is in WHNF # initial 400041040 @@ -596,7 +598,9 @@ test('T15226', test('T15226a', [stats_num_field('bytes allocated', - [ (wordsize(64), 41040, 5) ]), + [(platform('x86_64-unknown-mingw32'), 37488, 4), + # 2018-09-23 37488 Linker changes + (wordsize(64), 41040, 5) ]), # 2018-06-06 41040 Look through casts for seq# # initial 400041040 only_ways(['normal'])], From git at git.haskell.org Fri Oct 5 03:35:38 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 5 Oct 2018 03:35:38 +0000 (UTC) Subject: [commit: ghc] master: Stable name type role (2287257) Message-ID: <20181005033538.853733ABBF@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/228725747c3e493c36d6b6ad1034ca56581cb758/ghc >--------------------------------------------------------------- commit 228725747c3e493c36d6b6ad1034ca56581cb758 Author: David Feuer Date: Thu Oct 4 13:52:23 2018 -0400 Stable name type role Make the `StableName#` parameter phantom: There is actually never any reason to care about the type of the underlying object of a `StableName#`. The underlying object type shouldn't really even *be* a parameter. But at least we can mark it as phantom. Reviewers: hvr, bgamari, erikd, simonmar Reviewed By: simonmar Subscribers: ekmett, rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5117 >--------------------------------------------------------------- 228725747c3e493c36d6b6ad1034ca56581cb758 compiler/prelude/TysPrim.hs | 2 +- docs/users_guide/8.8.1-notes.rst | 8 ++++++++ libraries/base/changelog.md | 4 ++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/compiler/prelude/TysPrim.hs b/compiler/prelude/TysPrim.hs index c5af4a5..4a69df8 100644 --- a/compiler/prelude/TysPrim.hs +++ b/compiler/prelude/TysPrim.hs @@ -943,7 +943,7 @@ mkStablePtrPrimTy ty = TyConApp stablePtrPrimTyCon [ty] -} stableNamePrimTyCon :: TyCon -stableNamePrimTyCon = pcPrimTyCon stableNamePrimTyConName [Representational] UnliftedRep +stableNamePrimTyCon = pcPrimTyCon stableNamePrimTyConName [Phantom] UnliftedRep mkStableNamePrimTy :: Type -> Type mkStableNamePrimTy ty = TyConApp stableNamePrimTyCon [ty] diff --git a/docs/users_guide/8.8.1-notes.rst b/docs/users_guide/8.8.1-notes.rst index 6bdde40..a27aee7 100644 --- a/docs/users_guide/8.8.1-notes.rst +++ b/docs/users_guide/8.8.1-notes.rst @@ -104,6 +104,10 @@ Template Haskell eventlog events similar to ``traceBinaryEvent#`` but allows the user to pass the event payload as a binary blob instead of a ``String``. +- The ``StableName#`` type parameter now has a phantom role instead of + a representational one. There is really no reason to care about the + type of the underlying object. + ``ghc`` library ~~~~~~~~~~~~~~~ @@ -114,6 +118,10 @@ Template Haskell - Support the characters from recent versions of Unicode (up to v. 12) in literals (see :ghc-ticket:`5518`). +- The ``StableName`` type parameter now has a phantom role instead of + a representational one. There is really no reason to care about the + type of the underlying object. + Build system ~~~~~~~~~~~~ diff --git a/libraries/base/changelog.md b/libraries/base/changelog.md index 8964edd..3709a0a 100644 --- a/libraries/base/changelog.md +++ b/libraries/base/changelog.md @@ -6,6 +6,10 @@ * Support the characters from recent versions of Unicode (up to v. 12) in literals (#5518). + * The `StableName` type parameter now has a phantom role instead of + a representational one. There is really no reason to care about the + type of the underlying object. + ## 4.12.0.0 *TBA* * Bundled with GHC *TBA* From git at git.haskell.org Fri Oct 5 22:49:15 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 5 Oct 2018 22:49:15 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: Add testcase for #14251 (94cadce) Message-ID: <20181005224915.B47563ABBF@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/94cadce6c807857b8cc6186702d97b5266062b6f/ghc >--------------------------------------------------------------- commit 94cadce6c807857b8cc6186702d97b5266062b6f Author: Ben Gamari Date: Wed Sep 19 15:04:11 2018 -0400 Add testcase for #14251 (cherry picked from commit ba086ca72ee6c77abba685f3100ad513e38a1a87) >--------------------------------------------------------------- 94cadce6c807857b8cc6186702d97b5266062b6f testsuite/tests/codeGen/should_run/T14251.hs | 27 ++++++++++++++++++++++ .../should_run/{T6084.stdout => T14251.stdout} | 3 ++- testsuite/tests/codeGen/should_run/all.T | 3 +++ 3 files changed, 32 insertions(+), 1 deletion(-) diff --git a/testsuite/tests/codeGen/should_run/T14251.hs b/testsuite/tests/codeGen/should_run/T14251.hs new file mode 100644 index 0000000..d31498e --- /dev/null +++ b/testsuite/tests/codeGen/should_run/T14251.hs @@ -0,0 +1,27 @@ +{-# LANGUAGE MagicHash, BangPatterns #-} +module Main where + +import GHC.Exts + +{-# NOINLINE f #-} +f :: (Int# -> Float# -> Double# -> Float# -> Double# -> String) -> String +f g = g 3# 4.0# 5.0## 6.0# 6.9## ++ " World!" + +{-# NOINLINE p #-} +p :: Int# -> Float# -> Double# -> Float# -> Double# -> String +p i j k l m = "Hello" + +{-# NOINLINE q #-} +q :: Int# -> Int# -> Float# -> Double# -> Float# -> Double# -> String +q _ i j k l m = "Hello " ++ show (F# l) ++ " " ++ show (D# m) + +{-# NOINLINE r #-} +r :: Int# -> Float# -> Double# -> Float# -> Double# -> String +r i = let !(I# z) = length [I# 1# .. I# i] in \j k l m -> p z j k l m + -- ghc won't eta-expand around the length, because it has unknown cost + +main = do + putStrLn (f p) -- fast call + putStrLn (f r) -- slow call: function but wrong arity + let g = last [q 1#] + putStrLn (f g) -- slow call: thunk diff --git a/testsuite/tests/codeGen/should_run/T6084.stdout b/testsuite/tests/codeGen/should_run/T14251.stdout similarity index 54% copy from testsuite/tests/codeGen/should_run/T6084.stdout copy to testsuite/tests/codeGen/should_run/T14251.stdout index 8baa6e3..de80321 100644 --- a/testsuite/tests/codeGen/should_run/T6084.stdout +++ b/testsuite/tests/codeGen/should_run/T14251.stdout @@ -1,3 +1,4 @@ Hello World! Hello World! -Hello World! +Hello 6.0 6.9 World! + diff --git a/testsuite/tests/codeGen/should_run/all.T b/testsuite/tests/codeGen/should_run/all.T index 60f86d7..025acb4 100644 --- a/testsuite/tests/codeGen/should_run/all.T +++ b/testsuite/tests/codeGen/should_run/all.T @@ -172,3 +172,6 @@ test('T13825-unit', test('T14619', normal, compile_and_run, ['']) test('T14754', normal, compile_and_run, ['']) test('T14346', only_ways(['threaded1','threaded2']), compile_and_run, ['-O -threaded']) +test('T14251', [extra_ways(['llvm', 'optllvm']), + expect_broken_for(14251, ['optllvm'])], + compile_and_run, ['']) From git at git.haskell.org Fri Oct 5 22:49:18 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 5 Oct 2018 22:49:18 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: testsuite: Don't force run of llvm ways in T14251 (4338398) Message-ID: <20181005224918.804F93ABBF@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/4338398f09d3b8ca472ed46ce92602566913f2aa/ghc >--------------------------------------------------------------- commit 4338398f09d3b8ca472ed46ce92602566913f2aa Author: Ben Gamari Date: Fri Sep 21 11:44:35 2018 -0400 testsuite: Don't force run of llvm ways in T14251 This breaks if LLVM is not available. (cherry picked from commit d0d74842868ceb6716b7334eb6310f61f90023bf) >--------------------------------------------------------------- 4338398f09d3b8ca472ed46ce92602566913f2aa testsuite/tests/codeGen/should_run/all.T | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/testsuite/tests/codeGen/should_run/all.T b/testsuite/tests/codeGen/should_run/all.T index 025acb4..4959295 100644 --- a/testsuite/tests/codeGen/should_run/all.T +++ b/testsuite/tests/codeGen/should_run/all.T @@ -172,6 +172,5 @@ test('T13825-unit', test('T14619', normal, compile_and_run, ['']) test('T14754', normal, compile_and_run, ['']) test('T14346', only_ways(['threaded1','threaded2']), compile_and_run, ['-O -threaded']) -test('T14251', [extra_ways(['llvm', 'optllvm']), - expect_broken_for(14251, ['optllvm'])], +test('T14251', [expect_broken_for(14251, ['optllvm'])], compile_and_run, ['']) From git at git.haskell.org Fri Oct 5 22:49:21 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 5 Oct 2018 22:49:21 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: Multiple fixes / improvements for LLVM backend (73273be) Message-ID: <20181005224921.575B23ABBF@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/73273be476a8cc6c13368660b042b3b0614fd928/ghc >--------------------------------------------------------------- commit 73273be476a8cc6c13368660b042b3b0614fd928 Author: Kavon Farvardin Date: Thu Oct 4 13:44:55 2018 -0400 Multiple fixes / improvements for LLVM backend - Fix for #13904 -- stop "trashing" callee-saved registers, since it is not actually doing anything useful. - Fix for #14251 -- fixes the calling convention for functions passing raw SSE-register values by adding padding as needed to get the values in the right registers. This problem cropped up when some args were unused an dropped from the live list. - Fixed a typo in 'readnone' attribute - Added 'lower-expect' pass to level 0 LLVM optimization passes to improve block layout in LLVM for stack checks, etc. Test Plan: `make test WAYS=optllvm` and `make test WAYS=llvm` Reviewers: bgamari, simonmar, angerman Reviewed By: angerman Subscribers: rwbarton, carter GHC Trac Issues: #13904, #14251 Differential Revision: https://phabricator.haskell.org/D5190 (cherry picked from commit adcb5fb47c0942671d409b940d8884daa9359ca4) >--------------------------------------------------------------- 73273be476a8cc6c13368660b042b3b0614fd928 compiler/llvmGen/Llvm/Types.hs | 2 +- compiler/llvmGen/LlvmCodeGen/Base.hs | 62 +++++++++++++++++++++++++++----- compiler/llvmGen/LlvmCodeGen/CodeGen.hs | 60 ++++++------------------------- llvm-passes | 2 +- testsuite/tests/codeGen/should_run/all.T | 3 +- 5 files changed, 67 insertions(+), 62 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 73273be476a8cc6c13368660b042b3b0614fd928 From git at git.haskell.org Fri Oct 5 22:49:24 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 5 Oct 2018 22:49:24 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: Bump array submodule (bf256ef) Message-ID: <20181005224924.2E0833ABBF@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/bf256ef23e86b6bac16595d10e3bd9cf4b548b19/ghc >--------------------------------------------------------------- commit bf256ef23e86b6bac16595d10e3bd9cf4b548b19 Author: Ben Gamari Date: Fri Oct 5 17:43:59 2018 -0400 Bump array submodule >--------------------------------------------------------------- bf256ef23e86b6bac16595d10e3bd9cf4b548b19 libraries/array | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/array b/libraries/array index 82a29b1..8af2f62 160000 --- a/libraries/array +++ b/libraries/array @@ -1 +1 @@ -Subproject commit 82a29b198a67f54de2f72d96ca077800afbfbe4f +Subproject commit 8af2f620077c4bb67ec06ea0a0afede266e84b4d From git at git.haskell.org Fri Oct 5 22:49:26 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 5 Oct 2018 22:49:26 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: Drop accidental write-attributes request (a2e3334) Message-ID: <20181005224926.F1A0B3ABBF@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/a2e3334c0eaf249c5bc105c2ac15ef2ac84d78a0/ghc >--------------------------------------------------------------- commit a2e3334c0eaf249c5bc105c2ac15ef2ac84d78a0 Author: Tamar Christina Date: Wed Oct 3 15:34:56 2018 +0200 Drop accidental write-attributes request Summary: The new filesystem code accidentally asks for write attributes permissions when doing read-only access. I believe this is what's causing the GHC 8.6.1 tarballs to fail when installed to a privileged location. I haven't been able to reproduce the issue yet, but this permission bit is wrong anyway. Test Plan: I'm still trying to workout how to test that this works, changing the permissions on the folder doesn't seem to reproduce the error on a tarball I made from before the change. Reviewers: bgamari, tdammers Reviewed By: bgamari Subscribers: tdammers, monoidal, rwbarton, carter GHC Trac Issues: #15667 Differential Revision: https://phabricator.haskell.org/D5177 (cherry picked from commit deceb21b7ec64ae60377addc2679692ca500b6ae) >--------------------------------------------------------------- a2e3334c0eaf249c5bc105c2ac15ef2ac84d78a0 utils/fs/fs.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/utils/fs/fs.c b/utils/fs/fs.c index 0f8fbe7..6644705 100644 --- a/utils/fs/fs.c +++ b/utils/fs/fs.c @@ -107,15 +107,13 @@ int FS(swopen) (const wchar_t* filename, int oflag, int shflag, int pmode) /* Construct access mode. */ DWORD dwDesiredAccess = 0; if (HAS_FLAG (oflag, _O_RDONLY)) - dwDesiredAccess |= GENERIC_READ | FILE_READ_DATA | FILE_READ_ATTRIBUTES | - FILE_WRITE_ATTRIBUTES;; + dwDesiredAccess |= GENERIC_READ | FILE_READ_DATA | FILE_READ_ATTRIBUTES; if (HAS_FLAG (oflag, _O_RDWR)) dwDesiredAccess |= GENERIC_WRITE | GENERIC_READ | FILE_READ_DATA | FILE_WRITE_DATA | FILE_READ_ATTRIBUTES | FILE_WRITE_ATTRIBUTES; if (HAS_FLAG (oflag, _O_WRONLY)) - dwDesiredAccess|= GENERIC_WRITE | FILE_WRITE_DATA | - FILE_READ_ATTRIBUTES | FILE_WRITE_ATTRIBUTES; + dwDesiredAccess|= GENERIC_WRITE | FILE_WRITE_DATA | FILE_WRITE_ATTRIBUTES; /* Construct shared mode. */ DWORD dwShareMode = FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE; From git at git.haskell.org Fri Oct 5 22:49:29 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 5 Oct 2018 22:49:29 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: Be mindful of GADT tyvar order when desugaring record updates (0af55c1) Message-ID: <20181005224929.C55AB3ABBF@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/0af55c128d06e8c23a6fd68bafe47a5315bea812/ghc >--------------------------------------------------------------- commit 0af55c128d06e8c23a6fd68bafe47a5315bea812 Author: Ryan Scott Date: Fri Aug 17 16:31:27 2018 +0200 Be mindful of GADT tyvar order when desugaring record updates After commit ef26182e2014b0a2a029ae466a4b121bf235e4e4, the type variable binders in GADT constructor type signatures are now quantified in toposorted order, instead of always having all the universals before all the existentials. Unfortunately, that commit forgot to update some code (which was assuming the latter scenario) in `DsExpr` which desugars record updates. This wound up being the cause of #15499. This patch makes up for lost time by desugaring record updates in a way such that the desugared expression applies type arguments to the right-hand side constructor in the correct order—that is, the order in which they were quantified by the user. Test Plan: make test TEST=T15499 Reviewers: simonpj, bgamari Reviewed By: simonpj Subscribers: rwbarton, carter GHC Trac Issues: #15499 Differential Revision: https://phabricator.haskell.org/D5060 (cherry picked from commit 63b6a1d44849c479d2a7cb59211f5c64d133bc62) >--------------------------------------------------------------- 0af55c128d06e8c23a6fd68bafe47a5315bea812 testsuite/tests/typecheck/should_compile/all.T | 1 + 1 file changed, 1 insertion(+) diff --git a/testsuite/tests/typecheck/should_compile/all.T b/testsuite/tests/typecheck/should_compile/all.T index 173a7e5..878f6a9 100644 --- a/testsuite/tests/typecheck/should_compile/all.T +++ b/testsuite/tests/typecheck/should_compile/all.T @@ -647,3 +647,4 @@ test('T15431', normal, compile, ['']) test('T15431a', normal, compile, ['']) test('T15412', normal, compile, ['']) test('T15473', normal, compile_fail, ['']) +test('T15499', normal, compile, ['']) From git at git.haskell.org Sat Oct 6 14:54:39 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 6 Oct 2018 14:54:39 +0000 (UTC) Subject: [commit: ghc] master: Add a missing write barrier to small array writes (8be27c0) Message-ID: <20181006145439.CCF203ABBF@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/8be27c0371d53e051d59ba20dd65103bbb8d32d3/ghc >--------------------------------------------------------------- commit 8be27c0371d53e051d59ba20dd65103bbb8d32d3 Author: Ömer Sinan Ağacan Date: Sat Oct 6 17:53:06 2018 +0300 Add a missing write barrier to small array writes Write barriers for large array writes were added in D2525, as a part of #12469. However it seems we forgot about small arrays. This patch adds the same write barrier to small array writes. Reviewers: simonmar, bgamari Reviewed By: simonmar Subscribers: rwbarton, carter GHC Trac Issues: #12469 Differential Revision: https://phabricator.haskell.org/D5209 >--------------------------------------------------------------- 8be27c0371d53e051d59ba20dd65103bbb8d32d3 compiler/codeGen/StgCmmPrim.hs | 1 + 1 file changed, 1 insertion(+) diff --git a/compiler/codeGen/StgCmmPrim.hs b/compiler/codeGen/StgCmmPrim.hs index 266ab3a..f5437c0 100644 --- a/compiler/codeGen/StgCmmPrim.hs +++ b/compiler/codeGen/StgCmmPrim.hs @@ -2295,6 +2295,7 @@ doWriteSmallPtrArrayOp :: CmmExpr doWriteSmallPtrArrayOp addr idx val = do dflags <- getDynFlags let ty = cmmExprType dflags val + emitPrimCall [] MO_WriteBarrier [] -- #12469 mkBasicIndexedWrite (smallArrPtrsHdrSize dflags) Nothing addr ty idx val emit (setInfo addr (CmmLit (CmmLabel mkSMAP_DIRTY_infoLabel))) From git at git.haskell.org Sat Oct 6 18:46:42 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 6 Oct 2018 18:46:42 +0000 (UTC) Subject: [commit: ghc] master: UNREG: don't prefix asm prefixes in via-C mode (4e3562c) Message-ID: <20181006184642.7AA433ABBF@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/4e3562c041695198519a075340ceaf40ceec402a/ghc >--------------------------------------------------------------- commit 4e3562c041695198519a075340ceaf40ceec402a Author: Sergei Trofimovich Date: Sat Oct 6 19:45:18 2018 +0100 UNREG: don't prefix asm prefixes in via-C mode commit 64c54fff2d6534e1229359a8d357ec1dc6c21b73 ("Mark system and internal symbols as private symbols in asm") Added `internalNamePrefix` helper. Unfortunately it generates invalid label in unregisterised mode: ``` $ ./configure --enable-unregisterised /tmp/ghc19372_0/ghc_4.hc:2831:22: error: error: expected identifier or '(' before '.' token static const StgWord .Lcl3_info[]__attribute__((aligned(8)))= { ^ ``` Here asm-style prefix is applied to C symbol. The fix is simple: apply asm-style labels only to assembly code. Signed-off-by: Sergei Trofimovich Reviewers: simonmar, last_g, bgamari Reviewed By: simonmar Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5207 >--------------------------------------------------------------- 4e3562c041695198519a075340ceaf40ceec402a compiler/cmm/CLabel.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/cmm/CLabel.hs b/compiler/cmm/CLabel.hs index 12c3357..f07abeb 100644 --- a/compiler/cmm/CLabel.hs +++ b/compiler/cmm/CLabel.hs @@ -1339,7 +1339,7 @@ instance Outputable ForeignLabelSource where internalNamePrefix :: Name -> SDoc internalNamePrefix name = getPprStyle $ \ sty -> - if codeStyle sty && isRandomGenerated then + if asmStyle sty && isRandomGenerated then sdocWithPlatform $ \platform -> ptext (asmTempLabelPrefix platform) else From git at git.haskell.org Sun Oct 7 10:28:29 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 7 Oct 2018 10:28:29 +0000 (UTC) Subject: [commit: ghc] master: testsuite: disable nursery-chunks1 on non-smp targets (32ceaaa) Message-ID: <20181007102829.812C03ABB2@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/32ceaaab9daf6fa56d86d3e2d6c242b5dae0fc68/ghc >--------------------------------------------------------------- commit 32ceaaab9daf6fa56d86d3e2d6c242b5dae0fc68 Author: Sergei Trofimovich Date: Sun Oct 7 09:31:55 2018 +0100 testsuite: disable nursery-chunks1 on non-smp targets "ghc: setNumCapabilities: not supported on this platform" is caused by use of 'setNumCapabilities' in test itself. Signed-off-by: Sergei Trofimovich >--------------------------------------------------------------- 32ceaaab9daf6fa56d86d3e2d6c242b5dae0fc68 testsuite/tests/rts/all.T | 1 + 1 file changed, 1 insertion(+) diff --git a/testsuite/tests/rts/all.T b/testsuite/tests/rts/all.T index a1be5c7..138e6f0 100644 --- a/testsuite/tests/rts/all.T +++ b/testsuite/tests/rts/all.T @@ -428,6 +428,7 @@ test('alloccounter1', normal, compile_and_run, test('nursery-chunks1', [ extra_run_opts('4 100 +RTS -n32k -A1m -RTS') + , req_smp , only_ways(['threaded1','threaded2']) ], compile_and_run, From git at git.haskell.org Sun Oct 7 10:28:32 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 7 Oct 2018 10:28:32 +0000 (UTC) Subject: [commit: ghc] master: testsuite: disable T11760 on non-smp targets (e4bec29) Message-ID: <20181007102832.51E983ABB2@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/e4bec29cb475b7e1431dad41fb8d4438814641c9/ghc >--------------------------------------------------------------- commit e4bec29cb475b7e1431dad41fb8d4438814641c9 Author: Sergei Trofimovich Date: Sun Oct 7 09:35:48 2018 +0100 testsuite: disable T11760 on non-smp targets T11760 needs multicore support from RTS: T11760: unknown RTS option: -N2 Signed-off-by: Sergei Trofimovich >--------------------------------------------------------------- e4bec29cb475b7e1431dad41fb8d4438814641c9 libraries/base/tests/all.T | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/base/tests/all.T b/libraries/base/tests/all.T index 715d4c3..7cb5c4f 100644 --- a/libraries/base/tests/all.T +++ b/libraries/base/tests/all.T @@ -220,7 +220,7 @@ test('T11555', normal, compile_and_run, ['']) test('T12494', normal, compile_and_run, ['']) test('T12852', when(opsys('mingw32'), skip), compile_and_run, ['']) test('lazySTexamples', normal, compile_and_run, ['']) -test('T11760', normal, compile_and_run, ['-threaded -with-rtsopts=-N2']) +test('T11760', req_smp, compile_and_run, ['-threaded -with-rtsopts=-N2']) test('T12874', normal, compile_and_run, ['']) test('T13191', [ stats_num_field('bytes allocated', From git at git.haskell.org Sun Oct 7 10:28:35 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 7 Oct 2018 10:28:35 +0000 (UTC) Subject: [commit: ghc] master: testsuite: disable T10017 on non-smp targets (6483ff9) Message-ID: <20181007102835.23CF53ABB2@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/6483ff98f55029713007efd6dca4f73d6709652c/ghc >--------------------------------------------------------------- commit 6483ff98f55029713007efd6dca4f73d6709652c Author: Sergei Trofimovich Date: Sun Oct 7 09:27:34 2018 +0100 testsuite: disable T10017 on non-smp targets T10017 needs multicore support from RTS: T10017: unknown RTS option: -N2 Signed-off-by: Sergei Trofimovich >--------------------------------------------------------------- 6483ff98f55029713007efd6dca4f73d6709652c testsuite/tests/rts/all.T | 1 + 1 file changed, 1 insertion(+) diff --git a/testsuite/tests/rts/all.T b/testsuite/tests/rts/all.T index a537ee4..a1be5c7 100644 --- a/testsuite/tests/rts/all.T +++ b/testsuite/tests/rts/all.T @@ -291,6 +291,7 @@ test('T9045', [ omit_ways(['ghci']), extra_run_opts('10000 +RTS -A8k -RTS') ], c test('T9078', only_ways(['threaded1']), compile_and_run, ['']) test('T10017', [ when(opsys('mingw32'), skip) + , req_smp , only_ways(threaded_ways), extra_run_opts('+RTS -N2 -RTS') ], compile_and_run, ['']) test('T11108', normal, compile_and_run, ['']) From git at git.haskell.org Sun Oct 7 10:28:37 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 7 Oct 2018 10:28:37 +0000 (UTC) Subject: [commit: ghc] master: testsuite: disable T14075 on non-smp targets (ed1615d) Message-ID: <20181007102837.E7B2A3ABB2@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/ed1615dc2537a5321a8cf5b0372fcb44e196dd3d/ghc >--------------------------------------------------------------- commit ed1615dc2537a5321a8cf5b0372fcb44e196dd3d Author: Sergei Trofimovich Date: Sun Oct 7 09:23:07 2018 +0100 testsuite: disable T14075 on non-smp targets "ghc: setNumCapabilities: not supported on this platform" is caused by use of 'ghc --make -j2' in build rule. Signed-off-by: Sergei Trofimovich >--------------------------------------------------------------- ed1615dc2537a5321a8cf5b0372fcb44e196dd3d testsuite/tests/driver/T14075/all.T | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/testsuite/tests/driver/T14075/all.T b/testsuite/tests/driver/T14075/all.T index 646976a..4f6371a 100644 --- a/testsuite/tests/driver/T14075/all.T +++ b/testsuite/tests/driver/T14075/all.T @@ -1,4 +1,6 @@ test('T14075', - [extra_files(['F.hs', 'F.hs-boot', 'O.hs', 'V.hs', 'V.hs-boot'])], + [ extra_files(['F.hs', 'F.hs-boot', 'O.hs', 'V.hs', 'V.hs-boot']) + , req_smp, # uses ghc --make -j2 + ], run_command, ['$MAKE -s --no-print-directory T14075']) From git at git.haskell.org Sun Oct 7 22:34:56 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 7 Oct 2018 22:34:56 +0000 (UTC) Subject: [commit: packages/binary] master: Add docker-compose.yml to run tests on multiple ghc versions. (cb84b16) Message-ID: <20181007223456.BCA653ABB2@ghc.haskell.org> Repository : ssh://git at git.haskell.org/binary On branch : master Link : http://git.haskell.org/packages/binary.git/commitdiff/cb84b16a309f7f9bb0feb849776e57da8ed8548a >--------------------------------------------------------------- commit cb84b16a309f7f9bb0feb849776e57da8ed8548a Author: Lennart Kolmodin Date: Wed Aug 8 12:42:58 2018 +0000 Add docker-compose.yml to run tests on multiple ghc versions. >--------------------------------------------------------------- cb84b16a309f7f9bb0feb849776e57da8ed8548a docker-compose.yml | 68 +++++++++++++++++++++++++ docker/{Dockerfile.ghc843 => Dockerfile.anyghc} | 12 +++-- docker/Dockerfile.ghc843 | 2 +- 3 files changed, 78 insertions(+), 4 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..1931631 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,68 @@ +version: '3' +services: + binary_ghc843: + build: + context: . + dockerfile: docker/Dockerfile.ghc843 + args: + - ghcver=8.4.3 + volumes: + - cabal-store-cache:/root/.cabal/store + + binary_ghc822: + build: + context: . + dockerfile: docker/Dockerfile.anyghc + args: + - ghcver=8.2.2 + volumes: + - cabal-store-cache:/root/.cabal/store + + binary_ghc802: + build: + context: . + dockerfile: docker/Dockerfile.anyghc + args: + - ghcver=8.0.2 + volumes: + - cabal-store-cache:/root/.cabal/store + + binary_ghc7103: + build: + context: . + dockerfile: docker/Dockerfile.anyghc + args: + - ghcver=7.10.3 + volumes: + - cabal-store-cache:/root/.cabal/store + + binary_ghc784: + build: + context: . + dockerfile: docker/Dockerfile.anyghc + args: + - ghcver=7.8.4 + volumes: + - cabal-store-cache:/root/.cabal/store + + binary_ghc763: + build: + context: . + dockerfile: docker/Dockerfile.anyghc + args: + - ghcver=7.6.3 + volumes: + - cabal-store-cache:/root/.cabal/store + + binary_ghc742: + build: + context: . + dockerfile: docker/Dockerfile.anyghc + args: + - ghcver=7.4.2 + volumes: + - cabal-store-cache:/root/.cabal/store + +volumes: + cabal-store-cache: + driver: local diff --git a/docker/Dockerfile.ghc843 b/docker/Dockerfile.anyghc similarity index 94% copy from docker/Dockerfile.ghc843 copy to docker/Dockerfile.anyghc index 6b84c00..d241ca7 100644 --- a/docker/Dockerfile.ghc843 +++ b/docker/Dockerfile.anyghc @@ -12,7 +12,11 @@ # # How to build: # -# docker build -f docker/Dockerfile.ghc843 -t haskell/binary . +# docker build \ +# -f docker/Dockerfile.ghc843 \ +# -t haskell/binary \ +# --build-arg ghcver=8.4.2 \ +# . # # How to run (caching the cabal store directory), default is 'cabal new-test': # @@ -52,7 +56,7 @@ FROM debian:stable -# setup locale, US English with UTF-8. +# setup locale. # not setting a locale will make some apps fail when outputting utf8. RUN apt-get update && \ apt-get install -y locales && \ @@ -69,8 +73,10 @@ RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys BA3CBA3FFE22B574 # add haskell repo for debian RUN echo "deb http://downloads.haskell.org/debian stretch main" > /etc/apt/sources.list.d/haskell.list +ARG ghcver=8.4.3 + RUN apt update && apt install -y cabal-install-2.2 -RUN apt update && apt install -y ghc-8.4.3 +RUN apt update && apt install -y ghc-$ghcver RUN apt update && apt-get install -y zlib1g-dev ENV PATH=/opt/ghc/bin:$PATH diff --git a/docker/Dockerfile.ghc843 b/docker/Dockerfile.ghc843 index 6b84c00..e704d99 100644 --- a/docker/Dockerfile.ghc843 +++ b/docker/Dockerfile.ghc843 @@ -52,7 +52,7 @@ FROM debian:stable -# setup locale, US English with UTF-8. +# setup locale. # not setting a locale will make some apps fail when outputting utf8. RUN apt-get update && \ apt-get install -y locales && \ From git at git.haskell.org Sun Oct 7 22:34:58 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 7 Oct 2018 22:34:58 +0000 (UTC) Subject: [commit: packages/binary] master: Add instructions how to launch tests with docker-compose. (1cd855a) Message-ID: <20181007223458.C17BB3ABB2@ghc.haskell.org> Repository : ssh://git at git.haskell.org/binary On branch : master Link : http://git.haskell.org/packages/binary.git/commitdiff/1cd855a60cb885fb2d28ed3ae3581987ffe33e50 >--------------------------------------------------------------- commit 1cd855a60cb885fb2d28ed3ae3581987ffe33e50 Author: Lennart Kolmodin Date: Wed Aug 8 12:47:22 2018 +0000 Add instructions how to launch tests with docker-compose. >--------------------------------------------------------------- 1cd855a60cb885fb2d28ed3ae3581987ffe33e50 docker-compose.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index 1931631..1d95b1a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,3 +1,25 @@ +# Run tests on multiple ghc versions. +# +# Dependencies are cached between runs in the cabal-store-cache volume. +# +# To launch tests: +# +# $ docker-compose up -d +# +# To check on their status: +# +# $ docker-compose ps +# +# To read logs from a build: +# +# $ docker-compose logs binary_binary_ghc842 +# +# To cancel or clean up when finished: +# +# $ docker-compose down +# $ docker volume rm cabal-store-cache +# + version: '3' services: binary_ghc843: From git at git.haskell.org Sun Oct 7 22:35:00 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 7 Oct 2018 22:35:00 +0000 (UTC) Subject: [commit: packages/binary] master: Add support for Int8Rep/Word8Rep added in GHC 8.7 (64b5414) Message-ID: <20181007223500.C85BC3ABB2@ghc.haskell.org> Repository : ssh://git at git.haskell.org/binary On branch : master Link : http://git.haskell.org/packages/binary.git/commitdiff/64b5414bfb7cab667124a71f251668e114ba1500 >--------------------------------------------------------------- commit 64b5414bfb7cab667124a71f251668e114ba1500 Author: Ben Gamari Date: Thu Oct 4 16:28:41 2018 -0400 Add support for Int8Rep/Word8Rep added in GHC 8.7 >--------------------------------------------------------------- 64b5414bfb7cab667124a71f251668e114ba1500 src/Data/Binary/Class.hs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Data/Binary/Class.hs b/src/Data/Binary/Class.hs index 2eed93e..b44001d 100644 --- a/src/Data/Binary/Class.hs +++ b/src/Data/Binary/Class.hs @@ -882,6 +882,10 @@ instance Binary RuntimeRep where put AddrRep = putWord8 9 put FloatRep = putWord8 10 put DoubleRep = putWord8 11 +#if __GLASGOW_HASKELL__ >= 807 + put Int8Rep = putWord8 12 + put Word8Rep = putWord8 13 +#endif get = do tag <- getWord8 @@ -898,6 +902,10 @@ instance Binary RuntimeRep where 9 -> pure AddrRep 10 -> pure FloatRep 11 -> pure DoubleRep +#if __GLASGOW_HASKELL__ >= 807 + 12 -> pure Int8Rep + 13 -> pure Word8Rep +#endif _ -> fail "GHCi.TH.Binary.putRuntimeRep: invalid tag" -- | @since 0.8.5.0. See #typeable-instances# From git at git.haskell.org Sun Oct 7 22:35:02 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 7 Oct 2018 22:35:02 +0000 (UTC) Subject: [commit: packages/binary] master: Merge pull request #155 from bgamari/master (00224cc) Message-ID: <20181007223502.D12403ABB2@ghc.haskell.org> Repository : ssh://git at git.haskell.org/binary On branch : master Link : http://git.haskell.org/packages/binary.git/commitdiff/00224cc109f0e39bebcd51259d69a436db1c8ca9 >--------------------------------------------------------------- commit 00224cc109f0e39bebcd51259d69a436db1c8ca9 Merge: 1cd855a 64b5414 Author: Lennart Kolmodin Date: Sat Oct 6 12:02:57 2018 +0200 Merge pull request #155 from bgamari/master Add support for Int8Rep/Word8Rep added in GHC 8.7 >--------------------------------------------------------------- 00224cc109f0e39bebcd51259d69a436db1c8ca9 src/Data/Binary/Class.hs | 8 ++++++++ 1 file changed, 8 insertions(+) From git at git.haskell.org Sun Oct 7 22:35:04 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 7 Oct 2018 22:35:04 +0000 (UTC) Subject: [commit: packages/binary] master: Add GHC 8.6.1 to travis and docker. (1992874) Message-ID: <20181007223504.D662A3ABB2@ghc.haskell.org> Repository : ssh://git at git.haskell.org/binary On branch : master Link : http://git.haskell.org/packages/binary.git/commitdiff/19928747235581d97e9e8d1f18d26c594938b9cf >--------------------------------------------------------------- commit 19928747235581d97e9e8d1f18d26c594938b9cf Author: Lennart Kolmodin Date: Sat Oct 6 12:25:27 2018 +0200 Add GHC 8.6.1 to travis and docker. >--------------------------------------------------------------- 19928747235581d97e9e8d1f18d26c594938b9cf .travis.yml | 2 ++ docker-compose.yml | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/.travis.yml b/.travis.yml index 690195e..b294c12 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,6 +20,8 @@ matrix: addons: {apt: {packages: [cabal-install-1.24,ghc-8.2.2], sources: [hvr-ghc]}} - env: CABALVER=1.24 GHCVER=8.4.3 addons: {apt: {packages: [cabal-install-1.24,ghc-8.4.3], sources: [hvr-ghc]}} + - env: CABALVER=2.4 GHCVER=8.6.1 + addons: {apt: {packages: [cabal-install-2.4,ghc-8.6.1], sources: [hvr-ghc]}} - env: CABALVER=head GHCVER=head addons: {apt: {packages: [cabal-install-head,ghc-head], sources: [hvr-ghc]}} diff --git a/docker-compose.yml b/docker-compose.yml index 1d95b1a..3c011b3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -22,6 +22,15 @@ version: '3' services: + binary_ghc861: + build: + context: . + dockerfile: docker/Dockerfile.anyghc + args: + - ghcver=8.6.1 + volumes: + - cabal-store-cache:/root/.cabal/store + binary_ghc843: build: context: . From git at git.haskell.org Sun Oct 7 22:35:06 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 7 Oct 2018 22:35:06 +0000 (UTC) Subject: [commit: packages/binary] master: Fixes for docker and cabal-install 2.4. (6bdae6c) Message-ID: <20181007223506.DC01D3ABB2@ghc.haskell.org> Repository : ssh://git at git.haskell.org/binary On branch : master Link : http://git.haskell.org/packages/binary.git/commitdiff/6bdae6c097875097eb5dbf1faf805b9ab601bf74 >--------------------------------------------------------------- commit 6bdae6c097875097eb5dbf1faf805b9ab601bf74 Author: Lennart Kolmodin Date: Sat Oct 6 15:26:52 2018 +0200 Fixes for docker and cabal-install 2.4. >--------------------------------------------------------------- 6bdae6c097875097eb5dbf1faf805b9ab601bf74 docker-compose.yml | 2 +- docker/Dockerfile.anyghc | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 3c011b3..1c56761 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -34,7 +34,7 @@ services: binary_ghc843: build: context: . - dockerfile: docker/Dockerfile.ghc843 + dockerfile: docker/Dockerfile.anyghc args: - ghcver=8.4.3 volumes: diff --git a/docker/Dockerfile.anyghc b/docker/Dockerfile.anyghc index d241ca7..54caeb5 100644 --- a/docker/Dockerfile.anyghc +++ b/docker/Dockerfile.anyghc @@ -74,24 +74,25 @@ RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys BA3CBA3FFE22B574 RUN echo "deb http://downloads.haskell.org/debian stretch main" > /etc/apt/sources.list.d/haskell.list ARG ghcver=8.4.3 +ARG cabalinstallver=2.4 -RUN apt update && apt install -y cabal-install-2.2 +RUN apt update && apt install -y cabal-install-$cabalinstallver RUN apt update && apt install -y ghc-$ghcver RUN apt update && apt-get install -y zlib1g-dev ENV PATH=/opt/ghc/bin:$PATH -RUN cabal update +RUN cabal new-update COPY . /workdir/copy WORKDIR /workdir/copy RUN sed -i.bak -e 's/name:\s*binary/name: binary-next/' binary.cabal RUN mv binary.cabal binary-next.cabal -RUN cabal sdist +RUN cabal new-sdist WORKDIR /workdir/builddir -RUN tar xf /workdir/copy/dist/*.tar.gz -C /workdir/builddir +RUN tar xf /workdir/copy/dist-newstyle/sdist/*.tar.gz -C /workdir/builddir RUN mv /workdir/builddir/binary-* /workdir/builddir/binary-next # generics-bench.cache.gz is not part of the binary distribution, # it's too large. It only lives in the git repo. Copy it manually. From git at git.haskell.org Sun Oct 7 22:35:08 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 7 Oct 2018 22:35:08 +0000 (UTC) Subject: [commit: packages/binary] master: Merge pull request #156 from kolmodin/pr/ghc861 (0318374) Message-ID: <20181007223508.E29323ABB2@ghc.haskell.org> Repository : ssh://git at git.haskell.org/binary On branch : master Link : http://git.haskell.org/packages/binary.git/commitdiff/0318374b832ebe52a8d01bff2dd7bab8e747fbd4 >--------------------------------------------------------------- commit 0318374b832ebe52a8d01bff2dd7bab8e747fbd4 Merge: 00224cc 6bdae6c Author: Lennart Kolmodin Date: Sat Oct 6 15:27:28 2018 +0200 Merge pull request #156 from kolmodin/pr/ghc861 Add GHC 8.6.1 to travis and docker. >--------------------------------------------------------------- 0318374b832ebe52a8d01bff2dd7bab8e747fbd4 .travis.yml | 2 ++ docker-compose.yml | 11 ++++++++++- docker/Dockerfile.anyghc | 9 +++++---- 3 files changed, 17 insertions(+), 5 deletions(-) From git at git.haskell.org Mon Oct 8 19:44:21 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 8 Oct 2018 19:44:21 +0000 (UTC) Subject: [commit: ghc] branch 'wip/kavon-llvm-improve' deleted Message-ID: <20181008194421.2D73C3ABB2@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc Deleted branch: wip/kavon-llvm-improve From git at git.haskell.org Mon Oct 8 19:44:43 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 8 Oct 2018 19:44:43 +0000 (UTC) Subject: [commit: ghc] branch 'wip/T13904' deleted Message-ID: <20181008194443.450B03ABB2@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc Deleted branch: wip/T13904 From git at git.haskell.org Mon Oct 8 21:32:28 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 8 Oct 2018 21:32:28 +0000 (UTC) Subject: [commit: ghc] ghc-8.4: Be mindful of GADT tyvar order when desugaring record updates (1a6d7c1) Message-ID: <20181008213228.A11053ABB3@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.4 Link : http://ghc.haskell.org/trac/ghc/changeset/1a6d7c1888cf241e0b8f77f62911603863b7f124/ghc >--------------------------------------------------------------- commit 1a6d7c1888cf241e0b8f77f62911603863b7f124 Author: Ryan Scott Date: Fri Aug 17 16:31:27 2018 +0200 Be mindful of GADT tyvar order when desugaring record updates After commit ef26182e2014b0a2a029ae466a4b121bf235e4e4, the type variable binders in GADT constructor type signatures are now quantified in toposorted order, instead of always having all the universals before all the existentials. Unfortunately, that commit forgot to update some code (which was assuming the latter scenario) in `DsExpr` which desugars record updates. This wound up being the cause of #15499. This patch makes up for lost time by desugaring record updates in a way such that the desugared expression applies type arguments to the right-hand side constructor in the correct order—that is, the order in which they were quantified by the user. Test Plan: make test TEST=T15499 Reviewers: simonpj, bgamari Reviewed By: simonpj Subscribers: rwbarton, carter GHC Trac Issues: #15499 Differential Revision: https://phabricator.haskell.org/D5060 (cherry picked from commit 63b6a1d44849c479d2a7cb59211f5c64d133bc62) >--------------------------------------------------------------- 1a6d7c1888cf241e0b8f77f62911603863b7f124 compiler/deSugar/DsExpr.hs | 25 +++++++++++++++------- testsuite/tests/typecheck/should_compile/T15499.hs | 11 ++++++++++ testsuite/tests/typecheck/should_compile/all.T | 1 + 3 files changed, 29 insertions(+), 8 deletions(-) diff --git a/compiler/deSugar/DsExpr.hs b/compiler/deSugar/DsExpr.hs index 635a9c6..4d74c1f 100644 --- a/compiler/deSugar/DsExpr.hs +++ b/compiler/deSugar/DsExpr.hs @@ -649,12 +649,18 @@ ds_expr _ expr@(RecordUpd { rupd_expr = record_expr, rupd_flds = fields mk_alt upd_fld_env con = do { let (univ_tvs, ex_tvs, eq_spec, prov_theta, _req_theta, arg_tys, _) = conLikeFullSig con - subst = zipTvSubst univ_tvs in_inst_tys + user_tvs = + case con of + RealDataCon data_con -> dataConUserTyVars data_con + PatSynCon _ -> univ_tvs ++ ex_tvs + -- The order here is because of the order in `TcPatSyn`. + in_subst = zipTvSubst univ_tvs in_inst_tys + out_subst = zipTvSubst univ_tvs out_inst_tys -- I'm not bothering to clone the ex_tvs - ; eqs_vars <- mapM newPredVarDs (substTheta subst (eqSpecPreds eq_spec)) - ; theta_vars <- mapM newPredVarDs (substTheta subst prov_theta) - ; arg_ids <- newSysLocalsDs (substTysUnchecked subst arg_tys) + ; eqs_vars <- mapM newPredVarDs (substTheta in_subst (eqSpecPreds eq_spec)) + ; theta_vars <- mapM newPredVarDs (substTheta in_subst prov_theta) + ; arg_ids <- newSysLocalsDs (substTysUnchecked in_subst arg_tys) ; let field_labels = conLikeFieldLabels con val_args = zipWithEqual "dsExpr:RecordUpd" mk_val_arg field_labels arg_ids @@ -663,13 +669,16 @@ ds_expr _ expr@(RecordUpd { rupd_expr = record_expr, rupd_flds = fields inst_con = noLoc $ mkHsWrap wrap (HsConLikeOut con) -- Reconstruct with the WrapId so that unpacking happens - -- The order here is because of the order in `TcPatSyn`. wrap = mkWpEvVarApps theta_vars <.> dict_req_wrap <.> - mkWpTyApps (mkTyVarTys ex_tvs) <.> - mkWpTyApps [ ty - | (tv, ty) <- univ_tvs `zip` out_inst_tys + mkWpTyApps [ lookupTyVar out_subst tv + `orElse` mkTyVarTy tv + | tv <- user_tvs , not (tv `elemVarEnv` wrap_subst) ] + -- Be sure to use user_tvs (which may be ordered + -- differently than `univ_tvs ++ ex_tvs) above. + -- See Note [DataCon user type variable binders] + -- in DataCon. rhs = foldl (\a b -> nlHsApp a b) inst_con val_args -- Tediously wrap the application in a cast diff --git a/testsuite/tests/typecheck/should_compile/T15499.hs b/testsuite/tests/typecheck/should_compile/T15499.hs new file mode 100644 index 0000000..653440a --- /dev/null +++ b/testsuite/tests/typecheck/should_compile/T15499.hs @@ -0,0 +1,11 @@ +{-# LANGUAGE DataKinds, GADTs, KindSignatures #-} +module T15499 () +where + +data ADT (p :: Integer) where + ADT :: + { a :: a + , b :: Integer + } -> ADT p + +foo = undefined {b=undefined} diff --git a/testsuite/tests/typecheck/should_compile/all.T b/testsuite/tests/typecheck/should_compile/all.T index 1ea388c..a03fd02 100644 --- a/testsuite/tests/typecheck/should_compile/all.T +++ b/testsuite/tests/typecheck/should_compile/all.T @@ -595,3 +595,4 @@ test('T14763', normal, compile, ['']) test('T14811', normal, compile, ['']) test('T14934', [extra_files(['T14934.hs', 'T14934a.hs'])], run_command, ['$MAKE -s --no-print-directory T14934']) +test('T15499', normal, compile, ['']) From git at git.haskell.org Mon Oct 8 21:32:31 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 8 Oct 2018 21:32:31 +0000 (UTC) Subject: [commit: ghc] ghc-8.4: Bump text submodule (bdf00d3) Message-ID: <20181008213231.70FA53ABB3@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.4 Link : http://ghc.haskell.org/trac/ghc/changeset/bdf00d38f14e8cdee7757ad6620cbafeb06a0745/ghc >--------------------------------------------------------------- commit bdf00d38f14e8cdee7757ad6620cbafeb06a0745 Author: Ben Gamari Date: Fri Oct 5 17:31:56 2018 -0400 Bump text submodule This introduces the fix for https://github.com/haskell/text/pull/229. >--------------------------------------------------------------- bdf00d38f14e8cdee7757ad6620cbafeb06a0745 libraries/text | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/text b/libraries/text index a02c2da..44ec2ce 160000 --- a/libraries/text +++ b/libraries/text @@ -1 +1 @@ -Subproject commit a02c2dafafa425bd5f36c8629e98b98daf1cfa1e +Subproject commit 44ec2cee65e5326ed943370e424f60d4ae6206d1 From git at git.haskell.org Mon Oct 8 21:32:34 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 8 Oct 2018 21:32:34 +0000 (UTC) Subject: [commit: ghc] ghc-8.4: Add support for opting out of package environments (84c250b) Message-ID: <20181008213234.3F2F23ABB3@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.4 Link : http://ghc.haskell.org/trac/ghc/changeset/84c250b41b22604a830a1a8152bad8167a8b0db1/ghc >--------------------------------------------------------------- commit 84c250b41b22604a830a1a8152bad8167a8b0db1 Author: Herbert Valerio Riedel Date: Sun May 13 18:37:18 2018 -0400 Add support for opting out of package environments This implements the first part proposed in #13753: Define a special magic "null" environment, which instructs GHC to ignore any package environment files. To this end, I propose to use the name `-` (i.e. a single dash), as that is more portable than using the empty string for environment variables. In other words, a - `-package-env -` CLI flag, or a - `GHC_ENVIRONMENT=-` env var (unless a `-package-env` flag is present) would inhibit GHC from looking up and interpreting any package environment files from the filesystem; this is the equivalent of `-ignore-dot-ghci` for package environment files. Reviewers: bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie, carter GHC Trac Issues: #13753 Differential Revision: https://phabricator.haskell.org/D4690 (cherry picked from commit 8f3c149d94814e4f278b08c562f06fc257eb3c43) >--------------------------------------------------------------- 84c250b41b22604a830a1a8152bad8167a8b0db1 compiler/main/DynFlags.hs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index 5b512a1..63bf467 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -4825,12 +4825,14 @@ interpretPackageEnv :: DynFlags -> IO DynFlags interpretPackageEnv dflags = do mPkgEnv <- runMaybeT $ msum $ [ getCmdLineArg >>= \env -> msum [ - probeEnvFile env + probeNullEnv env + , probeEnvFile env , probeEnvName env , cmdLineError env ] , getEnvVar >>= \env -> msum [ - probeEnvFile env + probeNullEnv env + , probeEnvFile env , probeEnvName env , envError env ] @@ -4843,6 +4845,9 @@ interpretPackageEnv dflags = do Nothing -> -- No environment found. Leave DynFlags unchanged. return dflags + Just "-" -> do + -- Explicitly disabled environment file. Leave DynFlags unchanged. + return dflags Just envfile -> do content <- readFile envfile putLogMsg dflags NoReason SevInfo noSrcSpan @@ -4872,6 +4877,10 @@ interpretPackageEnv dflags = do guard =<< liftMaybeT (doesFileExist path) return path + probeNullEnv :: FilePath -> MaybeT IO FilePath + probeNullEnv "-" = return "-" + probeNullEnv _ = mzero + parseEnvFile :: FilePath -> String -> DynP () parseEnvFile envfile = mapM_ parseEntry . lines where From git at git.haskell.org Mon Oct 8 21:32:37 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 8 Oct 2018 21:32:37 +0000 (UTC) Subject: [commit: ghc] ghc-8.4: base: Make Foreign.Marshal.Alloc.allocBytes[Aligned] NOINLINE (d86ab8d) Message-ID: <20181008213237.123853ABB3@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.4 Link : http://ghc.haskell.org/trac/ghc/changeset/d86ab8df2f720d1c311ba0aaf438b550e109c76a/ghc >--------------------------------------------------------------- commit d86ab8df2f720d1c311ba0aaf438b550e109c76a Author: Ben Gamari Date: Tue Oct 24 12:19:08 2017 -0400 base: Make Foreign.Marshal.Alloc.allocBytes[Aligned] NOINLINE As noted in #14346, touch# may be optimized away when the simplifier can see that the continuation passed to allocaBytes will not return. Marking CPS-style functions with NOINLINE ensures that the simplier can't draw any unsound conclusions. Ultimately the right solution here will be to do away with touch# and instead introduce a scoped primitive as is suggested in #14375. Note: This was present in 8.2 but was never merged to 8.4 in hopes that we would have #14375 implemented in time. This meant that the issue regressed again in 8.4. Thankfully we caught it in time to fix it for 8.6. (cherry picked from commit 404bf05ed3193e918875cd2f6c95ae0da5989be2) (cherry picked from commit 56590db07a776ce81eb89d4a4d86bd0f953fb44e) >--------------------------------------------------------------- d86ab8df2f720d1c311ba0aaf438b550e109c76a libraries/base/Foreign/Marshal/Alloc.hs | 13 +++++++++++++ testsuite/tests/perf/should_run/all.T | 3 ++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/libraries/base/Foreign/Marshal/Alloc.hs b/libraries/base/Foreign/Marshal/Alloc.hs index 10b6d36..f8e2856 100644 --- a/libraries/base/Foreign/Marshal/Alloc.hs +++ b/libraries/base/Foreign/Marshal/Alloc.hs @@ -136,6 +136,19 @@ alloca = doAlloca undefined -- away with touch# in favor of a primitive that will capture the scoping left -- implicit in the case of touch#. +-- Note [NOINLINE for touch#] +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~ +-- Both allocaBytes and allocaBytesAligned use the touch#, which is notoriously +-- fragile in the presence of simplification (see #14346). In particular, the +-- simplifier may drop the continuation containing the touch# if it can prove +-- that the action passed to allocaBytes will not return. The hack introduced to +-- fix this for 8.2.2 is to mark allocaBytes as NOINLINE, ensuring that the +-- simplifier can't see the divergence. +-- +-- These can be removed once #14375 is fixed, which suggests that we instead do +-- away with touch# in favor of a primitive that will capture the scoping left +-- implicit in the case of touch#. + -- |@'allocaBytes' n f@ executes the computation @f@, passing as argument -- a pointer to a temporarily allocated block of memory of @n@ bytes. -- The block of memory is sufficiently aligned for any of the basic diff --git a/testsuite/tests/perf/should_run/all.T b/testsuite/tests/perf/should_run/all.T index f1284c0..840496b 100644 --- a/testsuite/tests/perf/should_run/all.T +++ b/testsuite/tests/perf/should_run/all.T @@ -454,11 +454,12 @@ test('T9203', # 2016-04-06 84345136 (i386/Debian) not sure # 2017-03-24 77969268 (x86/Linux, 64-bit machine) probably join points - , (wordsize(64), 84620888, 5) ]), + , (wordsize(64), 98360576, 5) ]), # was 95747304 # 2019-09-10 94547280 post-AMP cleanup # 2015-10-28 95451192 emit Typeable at definition site # 2016-12-19 84620888 Join points + # 2018-07-30 98360576 it's unclear only_ways(['normal'])], compile_and_run, ['-O2']) From git at git.haskell.org Mon Oct 8 21:32:39 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 8 Oct 2018 21:32:39 +0000 (UTC) Subject: [commit: ghc] ghc-8.4: Bump stm submodule to v2.4.5.1 (8c857df) Message-ID: <20181008213239.CF5453ABB3@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.4 Link : http://ghc.haskell.org/trac/ghc/changeset/8c857df21ebd56ea2464f8808c2381a9889ccb9e/ghc >--------------------------------------------------------------- commit 8c857df21ebd56ea2464f8808c2381a9889ccb9e Author: Ben Gamari Date: Fri Oct 5 17:36:32 2018 -0400 Bump stm submodule to v2.4.5.1 >--------------------------------------------------------------- 8c857df21ebd56ea2464f8808c2381a9889ccb9e libraries/stm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/stm b/libraries/stm index 5ea70d4..3722e83 160000 --- a/libraries/stm +++ b/libraries/stm @@ -1 +1 @@ -Subproject commit 5ea70d4e15d461888866796a164bf9c177a1e8b8 +Subproject commit 3722e83b92e947d6715153811f16c505c05a54f1 From git at git.haskell.org Mon Oct 8 21:32:43 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 8 Oct 2018 21:32:43 +0000 (UTC) Subject: [commit: ghc] ghc-8.4: Add testcase for #14251 (c55f45d) Message-ID: <20181008213243.42B933ABB3@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.4 Link : http://ghc.haskell.org/trac/ghc/changeset/c55f45d500a3ceaf06802de364da281ecbb582e4/ghc >--------------------------------------------------------------- commit c55f45d500a3ceaf06802de364da281ecbb582e4 Author: Ben Gamari Date: Wed Sep 19 15:04:11 2018 -0400 Add testcase for #14251 (cherry picked from commit ba086ca72ee6c77abba685f3100ad513e38a1a87) >--------------------------------------------------------------- c55f45d500a3ceaf06802de364da281ecbb582e4 testsuite/tests/codeGen/should_run/T14251.hs | 27 ++++++++++++++++++++++ .../should_run/{T6084.stdout => T14251.stdout} | 3 ++- testsuite/tests/codeGen/should_run/all.T | 3 +++ 3 files changed, 32 insertions(+), 1 deletion(-) diff --git a/testsuite/tests/codeGen/should_run/T14251.hs b/testsuite/tests/codeGen/should_run/T14251.hs new file mode 100644 index 0000000..d31498e --- /dev/null +++ b/testsuite/tests/codeGen/should_run/T14251.hs @@ -0,0 +1,27 @@ +{-# LANGUAGE MagicHash, BangPatterns #-} +module Main where + +import GHC.Exts + +{-# NOINLINE f #-} +f :: (Int# -> Float# -> Double# -> Float# -> Double# -> String) -> String +f g = g 3# 4.0# 5.0## 6.0# 6.9## ++ " World!" + +{-# NOINLINE p #-} +p :: Int# -> Float# -> Double# -> Float# -> Double# -> String +p i j k l m = "Hello" + +{-# NOINLINE q #-} +q :: Int# -> Int# -> Float# -> Double# -> Float# -> Double# -> String +q _ i j k l m = "Hello " ++ show (F# l) ++ " " ++ show (D# m) + +{-# NOINLINE r #-} +r :: Int# -> Float# -> Double# -> Float# -> Double# -> String +r i = let !(I# z) = length [I# 1# .. I# i] in \j k l m -> p z j k l m + -- ghc won't eta-expand around the length, because it has unknown cost + +main = do + putStrLn (f p) -- fast call + putStrLn (f r) -- slow call: function but wrong arity + let g = last [q 1#] + putStrLn (f g) -- slow call: thunk diff --git a/testsuite/tests/codeGen/should_run/T6084.stdout b/testsuite/tests/codeGen/should_run/T14251.stdout similarity index 54% copy from testsuite/tests/codeGen/should_run/T6084.stdout copy to testsuite/tests/codeGen/should_run/T14251.stdout index 8baa6e3..de80321 100644 --- a/testsuite/tests/codeGen/should_run/T6084.stdout +++ b/testsuite/tests/codeGen/should_run/T14251.stdout @@ -1,3 +1,4 @@ Hello World! Hello World! -Hello World! +Hello 6.0 6.9 World! + diff --git a/testsuite/tests/codeGen/should_run/all.T b/testsuite/tests/codeGen/should_run/all.T index 55386e4..6bc19a1 100644 --- a/testsuite/tests/codeGen/should_run/all.T +++ b/testsuite/tests/codeGen/should_run/all.T @@ -173,3 +173,6 @@ test('T13825-unit', ['-package ghc']) test('T14619', normal, compile_and_run, ['']) test('T14754', normal, compile_and_run, ['']) +test('T14251', [extra_ways(['llvm', 'optllvm']), + expect_broken_for(14251, ['optllvm'])], + compile_and_run, ['']) From git at git.haskell.org Mon Oct 8 21:32:46 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 8 Oct 2018 21:32:46 +0000 (UTC) Subject: [commit: ghc] ghc-8.4: ghc-pkg: Silence "ignoring abi-depends" warning unless verbose (648a004) Message-ID: <20181008213246.1352C3ABB3@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.4 Link : http://ghc.haskell.org/trac/ghc/changeset/648a004e7ec3de8b05af9567cd168c47d9b49d9c/ghc >--------------------------------------------------------------- commit 648a004e7ec3de8b05af9567cd168c47d9b49d9c Author: Ben Gamari Date: Mon Oct 8 16:52:00 2018 -0400 ghc-pkg: Silence "ignoring abi-depends" warning unless verbose >--------------------------------------------------------------- 648a004e7ec3de8b05af9567cd168c47d9b49d9c .../backpack/cabal/bkpcabal02/bkpcabal02.stdout | 5 ----- testsuite/tests/cabal/T12485a.stdout | 1 - testsuite/tests/cabal/T5442d.stdout | 1 - testsuite/tests/cabal/cabal01/cabal01.stdout | 1 - testsuite/tests/cabal/cabal06/cabal06.stdout | 4 ---- testsuite/tests/cabal/cabal08/cabal08.stdout | 2 -- testsuite/tests/cabal/shadow.stdout | 1 - testsuite/tests/driver/recomp007/recomp007.stdout | 2 -- .../tests/safeHaskell/check/pkg01/safePkg01.stdout | 20 ++++++++------------ testsuite/tests/typecheck/T13168/T13168.stdout | 2 -- utils/ghc-pkg/Main.hs | 2 +- 11 files changed, 9 insertions(+), 32 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 648a004e7ec3de8b05af9567cd168c47d9b49d9c From git at git.haskell.org Mon Oct 8 21:32:48 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 8 Oct 2018 21:32:48 +0000 (UTC) Subject: [commit: ghc] ghc-8.4: Multiple fixes / improvements for LLVM backend (6e361d8) Message-ID: <20181008213248.DA0113ABB3@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.4 Link : http://ghc.haskell.org/trac/ghc/changeset/6e361d895dda4600a85e01c72ff219474b5c7190/ghc >--------------------------------------------------------------- commit 6e361d895dda4600a85e01c72ff219474b5c7190 Author: Kavon Farvardin Date: Thu Oct 4 13:44:55 2018 -0400 Multiple fixes / improvements for LLVM backend - Fix for #13904 -- stop "trashing" callee-saved registers, since it is not actually doing anything useful. - Fix for #14251 -- fixes the calling convention for functions passing raw SSE-register values by adding padding as needed to get the values in the right registers. This problem cropped up when some args were unused an dropped from the live list. - Fixed a typo in 'readnone' attribute - Added 'lower-expect' pass to level 0 LLVM optimization passes to improve block layout in LLVM for stack checks, etc. Test Plan: `make test WAYS=optllvm` and `make test WAYS=llvm` Reviewers: bgamari, simonmar, angerman Reviewed By: angerman Subscribers: rwbarton, carter GHC Trac Issues: #13904, #14251 Differential Revision: https://phabricator.haskell.org/D5190 (cherry picked from commit adcb5fb47c0942671d409b940d8884daa9359ca4) >--------------------------------------------------------------- 6e361d895dda4600a85e01c72ff219474b5c7190 compiler/llvmGen/Llvm/Types.hs | 2 +- compiler/llvmGen/LlvmCodeGen/Base.hs | 62 +++++++++++++++++++++++++++----- compiler/llvmGen/LlvmCodeGen/CodeGen.hs | 59 ++++++------------------------ compiler/main/DriverPipeline.hs | 2 +- testsuite/tests/codeGen/should_run/all.T | 4 +-- 5 files changed, 67 insertions(+), 62 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 6e361d895dda4600a85e01c72ff219474b5c7190 From git at git.haskell.org Mon Oct 8 21:50:16 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 8 Oct 2018 21:50:16 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: users guide: Drop old release notes (facf7cc) Message-ID: <20181008215016.7727A3ABB3@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/facf7cce37a294cee109002b59755a036ad13891/ghc >--------------------------------------------------------------- commit facf7cce37a294cee109002b59755a036ad13891 Author: Ben Gamari Date: Sun Oct 7 11:53:52 2018 -0400 users guide: Drop old release notes >--------------------------------------------------------------- facf7cce37a294cee109002b59755a036ad13891 docs/users_guide/8.2.1-notes.rst | 527 --------------------------------------- docs/users_guide/8.4.1-notes.rst | 441 -------------------------------- docs/users_guide/8.4.2-notes.rst | 94 ------- docs/users_guide/index.rst | 1 - 4 files changed, 1063 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc facf7cce37a294cee109002b59755a036ad13891 From git at git.haskell.org Mon Oct 8 21:50:57 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 8 Oct 2018 21:50:57 +0000 (UTC) Subject: [commit: ghc] master: Add Int8# and Word8# (5d5307f) Message-ID: <20181008215057.9478E3ABB3@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/5d5307f943d7581d7013ffe20af22233273fba06/ghc >--------------------------------------------------------------- commit 5d5307f943d7581d7013ffe20af22233273fba06 Author: Michal Terepeta Date: Thu Oct 4 13:56:59 2018 -0400 Add Int8# and Word8# This is the first step of implementing: https://github.com/ghc-proposals/ghc-proposals/pull/74 The main highlights/changes: - `primops.txt.pp` gets two new sections for two new primitive types for signed and unsigned 8-bit integers (`Int8#` and `Word8` respectively) along with basic arithmetic and comparison operations. `PrimRep`/`RuntimeRep` get two new constructors for them. All of the primops translate into the existing `MachOP`s. - For `CmmCall`s the codegen will now zero-extend the values at call site (so that they can be moved to the right register) and then truncate them back their original width. - x86 native codegen needed some updates, since it wasn't able to deal with the new widths, but all the changes are quite localized. LLVM backend seems to just work. Bumps binary submodule. Signed-off-by: Michal Terepeta Test Plan: ./validate with new tests Reviewers: hvr, goldfire, bgamari, simonmar Subscribers: Abhiroop, dfeuer, rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4475 >--------------------------------------------------------------- 5d5307f943d7581d7013ffe20af22233273fba06 compiler/cmm/CmmExpr.hs | 5 +- compiler/cmm/CmmMachOp.hs | 10 + compiler/cmm/CmmUtils.hs | 6 +- compiler/cmm/MkGraph.hs | 73 ++++++-- compiler/cmm/PprC.hs | 3 + compiler/codeGen/StgCmmArgRep.hs | 2 + compiler/codeGen/StgCmmPrim.hs | 74 ++++++-- compiler/ghci/ByteCodeGen.hs | 17 +- compiler/llvmGen/LlvmCodeGen/CodeGen.hs | 4 + compiler/nativeGen/X86/CodeGen.hs | 90 ++++++++- compiler/nativeGen/X86/Instr.hs | 8 +- compiler/nativeGen/X86/Ppr.hs | 10 +- compiler/prelude/PrelNames.hs | 121 +++++++------ compiler/prelude/TysPrim.hs | 26 ++- compiler/prelude/TysWiredIn.hs | 33 ++-- compiler/prelude/TysWiredIn.hs-boot | 6 +- compiler/prelude/primops.txt.pp | 82 +++++++++ compiler/simplStg/RepType.hs | 7 +- compiler/typecheck/TcGenDeriv.hs | 156 ++++++++++------ compiler/types/TyCon.hs | 4 + compiler/utils/Binary.hs | 8 + libraries/base/Data/Typeable/Internal.hs | 4 +- libraries/binary | 2 +- libraries/ghc-prim/GHC/Types.hs | 4 +- testsuite/tests/ffi/should_run/PrimFFIInt8.hs | 28 +++ testsuite/tests/ffi/should_run/PrimFFIInt8.stdout | 1 + testsuite/tests/ffi/should_run/PrimFFIInt8_c.c | 7 + testsuite/tests/ffi/should_run/PrimFFIWord8.hs | 28 +++ testsuite/tests/ffi/should_run/PrimFFIWord8.stdout | 1 + testsuite/tests/ffi/should_run/PrimFFIWord8_c.c | 7 + testsuite/tests/ffi/should_run/all.T | 4 + testsuite/tests/primops/should_run/ArithInt8.hs | 201 +++++++++++++++++++++ .../tests/primops/should_run/ArithInt8.stdout | 8 + testsuite/tests/primops/should_run/ArithWord8.hs | 198 ++++++++++++++++++++ .../tests/primops/should_run/ArithWord8.stdout | 8 + testsuite/tests/primops/should_run/CmpInt8.hs | 84 +++++++++ testsuite/tests/primops/should_run/CmpInt8.stdout | 6 + testsuite/tests/primops/should_run/CmpWord8.hs | 84 +++++++++ testsuite/tests/primops/should_run/CmpWord8.stdout | 6 + testsuite/tests/primops/should_run/ShowPrim.hs | 14 ++ testsuite/tests/primops/should_run/ShowPrim.stdout | 1 + testsuite/tests/primops/should_run/all.T | 5 + utils/genprimopcode/Main.hs | 2 + 43 files changed, 1268 insertions(+), 180 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 5d5307f943d7581d7013ffe20af22233273fba06 From git at git.haskell.org Tue Oct 9 10:43:45 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 9 Oct 2018 10:43:45 +0000 (UTC) Subject: [commit: ghc] master: update amd64 linux/osx stats for haddock.base perf test (4eeeb51) Message-ID: <20181009104345.2677A3ABC0@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/4eeeb51d5f51083d0ae393009a7fd246223e9791/ghc >--------------------------------------------------------------- commit 4eeeb51d5f51083d0ae393009a7fd246223e9791 Author: Alp Mestanogullari Date: Tue Oct 9 12:37:10 2018 +0200 update amd64 linux/osx stats for haddock.base perf test This perf test is regularly failing (e.g with a deviation of 5.1% on a recent harbormaster build), this patch addresses the failure. Test Plan: TEST=haddock.base ./validate Reviewers: bgamari Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5215 >--------------------------------------------------------------- 4eeeb51d5f51083d0ae393009a7fd246223e9791 testsuite/tests/perf/haddock/all.T | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/testsuite/tests/perf/haddock/all.T b/testsuite/tests/perf/haddock/all.T index 393a697..4161c2e 100644 --- a/testsuite/tests/perf/haddock/all.T +++ b/testsuite/tests/perf/haddock/all.T @@ -10,7 +10,7 @@ test('haddock.base', # 2017-02-19 24286343184 (x64/Windows) - Generalize kind of (->) # 2017-12-24 18733710728 (x64/Windows) - Unknown - ,(wordsize(64), 24662232152, 5) + ,(wordsize(64), 25913205656, 5) # 2012-08-14: 5920822352 (amd64/Linux) # 2012-09-20: 5829972376 (amd64/Linux) # 2012-10-08: 5902601224 (amd64/Linux) @@ -52,6 +52,7 @@ test('haddock.base', # 2018-04-20: 18971030224 (x86_64/Linux) - Cache coercion roles # 2018-05-14: 21123660336 (amd64/Linux) - D4659: strictness to fix space leaks # 2018-06-14: 24662232152 (amd64/Linux) - Bump haddock + # 2018-10-08: 25913205656 (amd64/Linux&OSX) - D5167: Improve GHC.Prim docs ,(platform('i386-unknown-mingw32'), 2885173512, 5) # 2013-02-10: 3358693084 (x86/Windows) From git at git.haskell.org Tue Oct 9 16:40:43 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 9 Oct 2018 16:40:43 +0000 (UTC) Subject: [commit: ghc] master: Revert "Add Int8# and Word8#" (d728c3c) Message-ID: <20181009164043.E77DC3ABC0@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/d728c3c578cc9e9205def2c1e96934487b364b7b/ghc >--------------------------------------------------------------- commit d728c3c578cc9e9205def2c1e96934487b364b7b Author: Ben Gamari Date: Tue Oct 9 12:39:14 2018 -0400 Revert "Add Int8# and Word8#" This unfortunately broke i386 support since it introduced references to byte-sized registers that don't exist on that architecture. Reverts binary submodule This reverts commit 5d5307f943d7581d7013ffe20af22233273fba06. >--------------------------------------------------------------- d728c3c578cc9e9205def2c1e96934487b364b7b compiler/cmm/CmmExpr.hs | 5 +- compiler/cmm/CmmMachOp.hs | 10 - compiler/cmm/CmmUtils.hs | 6 +- compiler/cmm/MkGraph.hs | 73 ++------ compiler/cmm/PprC.hs | 3 - compiler/codeGen/StgCmmArgRep.hs | 2 - compiler/codeGen/StgCmmPrim.hs | 74 ++------ compiler/ghci/ByteCodeGen.hs | 17 +- compiler/llvmGen/LlvmCodeGen/CodeGen.hs | 4 - compiler/nativeGen/X86/CodeGen.hs | 90 +-------- compiler/nativeGen/X86/Instr.hs | 8 +- compiler/nativeGen/X86/Ppr.hs | 10 +- compiler/prelude/PrelNames.hs | 121 ++++++------- compiler/prelude/TysPrim.hs | 26 +-- compiler/prelude/TysWiredIn.hs | 33 ++-- compiler/prelude/TysWiredIn.hs-boot | 6 +- compiler/prelude/primops.txt.pp | 82 --------- compiler/simplStg/RepType.hs | 7 +- compiler/typecheck/TcGenDeriv.hs | 156 ++++++---------- compiler/types/TyCon.hs | 4 - compiler/utils/Binary.hs | 8 - libraries/base/Data/Typeable/Internal.hs | 4 +- libraries/binary | 2 +- libraries/ghc-prim/GHC/Types.hs | 4 +- testsuite/tests/ffi/should_run/PrimFFIInt8.hs | 28 --- testsuite/tests/ffi/should_run/PrimFFIInt8.stdout | 1 - testsuite/tests/ffi/should_run/PrimFFIInt8_c.c | 7 - testsuite/tests/ffi/should_run/PrimFFIWord8.hs | 28 --- testsuite/tests/ffi/should_run/PrimFFIWord8.stdout | 1 - testsuite/tests/ffi/should_run/PrimFFIWord8_c.c | 7 - testsuite/tests/ffi/should_run/all.T | 4 - testsuite/tests/primops/should_run/ArithInt8.hs | 201 --------------------- .../tests/primops/should_run/ArithInt8.stdout | 8 - testsuite/tests/primops/should_run/ArithWord8.hs | 198 -------------------- .../tests/primops/should_run/ArithWord8.stdout | 8 - testsuite/tests/primops/should_run/CmpInt8.hs | 84 --------- testsuite/tests/primops/should_run/CmpInt8.stdout | 6 - testsuite/tests/primops/should_run/CmpWord8.hs | 84 --------- testsuite/tests/primops/should_run/CmpWord8.stdout | 6 - testsuite/tests/primops/should_run/ShowPrim.hs | 14 -- testsuite/tests/primops/should_run/ShowPrim.stdout | 1 - testsuite/tests/primops/should_run/all.T | 5 - utils/genprimopcode/Main.hs | 2 - 43 files changed, 180 insertions(+), 1268 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc d728c3c578cc9e9205def2c1e96934487b364b7b From git at git.haskell.org Wed Oct 10 07:33:05 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 10 Oct 2018 07:33:05 +0000 (UTC) Subject: [commit: ghc] master: Fix dataToTag# argument evaluation (ac97768) Message-ID: <20181010073305.101643ABC0@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/ac977688523e5d77eb6f041f043552410b0c21da/ghc >--------------------------------------------------------------- commit ac977688523e5d77eb6f041f043552410b0c21da Author: Ömer Sinan Ağacan Date: Wed Oct 10 10:07:05 2018 +0300 Fix dataToTag# argument evaluation See #15696 for more details. We now always enter dataToTag# argument (done in generated Cmm, in StgCmmExpr). Any high-level optimisations on dataToTag# applications are done by the simplifier. Looking at tag bits (instead of reading the info table) for small types is left to another diff. Incorrect test T14626 is removed. We no longer do this optimisation (see comment:44, comment:45, comment:60). Comments and notes about special cases around dataToTag# are removed. We no longer have any special cases around it in Core. Other changes related to evaluating primops (seq# and dataToTag#) will be pursued in follow-up diffs. Test Plan: Validates with three regression tests Reviewers: simonpj, simonmar, hvr, bgamari, dfeuer Reviewed By: simonmar Subscribers: rwbarton, carter GHC Trac Issues: #15696 Differential Revision: https://phabricator.haskell.org/D5201 >--------------------------------------------------------------- ac977688523e5d77eb6f041f043552410b0c21da compiler/codeGen/StgCmmExpr.hs | 12 ++++ compiler/codeGen/StgCmmPrim.hs | 6 -- compiler/coreSyn/CorePrep.hs | 71 ++-------------------- compiler/coreSyn/CoreUtils.hs | 17 ------ compiler/prelude/PrelRules.hs | 13 ---- compiler/prelude/PrimOp.hs | 1 - compiler/prelude/primops.txt.pp | 26 ++++---- libraries/base/GHC/Base.hs | 11 +--- testsuite/tests/codeGen/should_compile/Makefile | 3 - testsuite/tests/codeGen/should_compile/T14626.hs | 15 ----- testsuite/tests/codeGen/should_compile/all.T | 3 - testsuite/tests/codeGen/should_run/T15696_1.hs | 26 ++++++++ testsuite/tests/codeGen/should_run/T15696_1.stdout | 1 + testsuite/tests/codeGen/should_run/T15696_2.hs | 17 ++++++ .../should_run/T15696_2.stdout} | 0 testsuite/tests/codeGen/should_run/T15696_3.hs | 9 +++ testsuite/tests/codeGen/should_run/T15696_3.stdout | 1 + testsuite/tests/codeGen/should_run/all.T | 10 ++- 18 files changed, 91 insertions(+), 151 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc ac977688523e5d77eb6f041f043552410b0c21da From git at git.haskell.org Wed Oct 10 18:57:46 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 10 Oct 2018 18:57:46 +0000 (UTC) Subject: [commit: ghc] master: Re-enable test T14251 (2f693b3) Message-ID: <20181010185746.B2A583ABC0@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/2f693b3e496bd90df037e7928b13d24449cee6e5/ghc >--------------------------------------------------------------- commit 2f693b3e496bd90df037e7928b13d24449cee6e5 Author: Ömer Sinan Ağacan Date: Wed Oct 10 21:57:03 2018 +0300 Re-enable test T14251 (This change was accidentally reverted with the previous commit) >--------------------------------------------------------------- 2f693b3e496bd90df037e7928b13d24449cee6e5 testsuite/tests/codeGen/should_run/all.T | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/testsuite/tests/codeGen/should_run/all.T b/testsuite/tests/codeGen/should_run/all.T index eaf0e77..f7ec405 100644 --- a/testsuite/tests/codeGen/should_run/all.T +++ b/testsuite/tests/codeGen/should_run/all.T @@ -172,8 +172,7 @@ test('T13825-unit', test('T14619', normal, compile_and_run, ['']) test('T14754', normal, compile_and_run, ['']) test('T14346', only_ways(['threaded1','threaded2']), compile_and_run, ['-O -threaded']) -test('T14251', [expect_broken_for(14251, [''])], - compile_and_run, ['']) +test('T14251', normal, compile_and_run, ['']) # These actually used to fail with all optimisation settings, but adding -O just # to make sure From git at git.haskell.org Thu Oct 11 11:15:14 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 11 Oct 2018 11:15:14 +0000 (UTC) Subject: [commit: ghc] branch 'wip/T15696' created Message-ID: <20181011111514.8C7663ABC0@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/T15696 Referencing: 8305c955346fd5318b5b3f1c7720f741ca8a75a5 From git at git.haskell.org Thu Oct 11 11:15:17 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 11 Oct 2018 11:15:17 +0000 (UTC) Subject: [commit: ghc] wip/T15696: Remove can_fail for dataToTag#, add a special case to app_ok (8305c95) Message-ID: <20181011111517.69F5D3ABC0@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T15696 Link : http://ghc.haskell.org/trac/ghc/changeset/8305c955346fd5318b5b3f1c7720f741ca8a75a5/ghc >--------------------------------------------------------------- commit 8305c955346fd5318b5b3f1c7720f741ca8a75a5 Author: Ömer Sinan Ağacan Date: Thu Oct 11 14:14:47 2018 +0300 Remove can_fail for dataToTag#, add a special case to app_ok >--------------------------------------------------------------- 8305c955346fd5318b5b3f1c7720f741ca8a75a5 compiler/coreSyn/CoreUtils.hs | 5 +++-- compiler/prelude/primops.txt.pp | 1 - 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/compiler/coreSyn/CoreUtils.hs b/compiler/coreSyn/CoreUtils.hs index 6dfb1df..ebdc31b 100644 --- a/compiler/coreSyn/CoreUtils.hs +++ b/compiler/coreSyn/CoreUtils.hs @@ -1557,14 +1557,15 @@ app_ok primop_ok fun args | SeqOp <- op -- See Note [seq# and expr_ok] -> all (expr_ok primop_ok) args + | DataToTagOp <- op + -> False -- all (expr_ok primop_ok) args + | otherwise -> primop_ok op -- Check the primop itself && and (zipWith arg_ok arg_tys args) -- Check the arguments _other -> isUnliftedType (idType fun) -- c.f. the Var case of exprIsHNF || idArity fun > n_val_args -- Partial apps - || (n_val_args == 0 && - isEvaldUnfolding (idUnfolding fun)) -- Let-bound values where n_val_args = valArgCount args where diff --git a/compiler/prelude/primops.txt.pp b/compiler/prelude/primops.txt.pp index 303c902..e72424b 100644 --- a/compiler/prelude/primops.txt.pp +++ b/compiler/prelude/primops.txt.pp @@ -2986,7 +2986,6 @@ section "Tag to enum stuff" primop DataToTagOp "dataToTag#" GenPrimOp a -> Int# -- Zero-indexed; the first constructor has tag zero with - can_fail = True -- See Note [dataToTag#] strictness = { \ _arity -> mkClosedStrictSig [evalDmd] topRes } primop TagToEnumOp "tagToEnum#" GenPrimOp From git at git.haskell.org Thu Oct 11 23:23:04 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 11 Oct 2018 23:23:04 +0000 (UTC) Subject: [commit: ghc] master: Support builtin classes like KnownNat in backpack (ce7a1c4) Message-ID: <20181011232304.7A7F23ABC0@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/ce7a1c4ae4c93f2d0d3d7a0b573ddd876fc855c2/ghc >--------------------------------------------------------------- commit ce7a1c4ae4c93f2d0d3d7a0b573ddd876fc855c2 Author: Piyush P Kurur Date: Tue Oct 9 10:14:15 2018 -0400 Support builtin classes like KnownNat in backpack This commit allows backpack signatures to enforce constraints like KnownNat on data types. Thus it fixes #15379. There were two important differences in the way GHC used to handle classes like KnowNat 1. Hand crafted instances of `KnownNat` were forbidden, and 2. The dictionary for an instance `KnownNat T` was generated on the fly. For supporting backpack both these points have to be revisited. Disallowing instances of KnownNat -------------------------------------------- Users were disallowed to declare instances of certain builtin classes like KnownNat for obvious safety reasons --- when we use the constraint like `KnownNat T`, we want T to be associated to a natural number. However, due to the reuse of this code while processing backpack signatures, `instance KnownNat T` were being disallowed even in module signature files. There is an important difference when it comes to instance declarations in a signature file. Consider the signature `Abstract` given below ``` signature Abstract where data T :: Nat instance KnownNat T ``` Inside a signature like `Abstract`, the `instance Known T` is not really creating an instance but rather demanding any module that implements this signature to enforce the constraint `KnownNat` on its type T. While hand crafted KnownNat instances continued to be prohibited in modules, this commit ensures that it is not forbidden while handling signatures. Resolving Dictionaries ---------------------------- Normally GHC expects any instance `T` of class `KnownNat` to eventually resolve to an integer and hence used to generate the evidence/dictionary for such instances on the fly as in when it is required. However, when backpack module and signatures are involved It is not always possible to resolve the type to a concrete integer utill the mixin stage. To illustrate consider again the signature `Abstract` > signature Abstract where > data T :: Nat > instance KnownNat T and a module `Util` that depends on it: > module Util where > import Abstract > printT :: IO () > printT = do print $ natVal (Proxy :: Proxy T) Clearly, we need to "use" the dictionary associated with `KnownNat T` in the module `Util`, but it is too early for the compiler to produce a real dictionary as we still have not fixed what `T` is. Only when we mixin a concrete module > module Concrete where > type T = 42 do we really get hold of the underlying integer. In this commit, we make the following changes in the resolution of instance dictionary for constraints like `KnownNat T` 1. If T is indeed available as a type alias for an integer constant, generate the dictionary on the fly as before, failing which 2. Do not give up as before but look up the type class environment for the evidence. This was enough to make the resolution of `KnownNat` dictionaries work in the setting of Backpack as when actual code is generated, the signature Abstract (due to the `import Abstract` ) in `Util` gets replaced by an actual module like Concrete, and resolution happens as before. Everything that we said for `KnownNat` is applicable for `KnownSymbol` as well. Reviewers: bgamari, ezyang, goldfire, simonpj Reviewed By: simonpj Subscribers: simonpj, ezyang, rwbarton, thomie, carter GHC Trac Issues: #15379 Differential Revision: https://phabricator.haskell.org/D4988 >--------------------------------------------------------------- ce7a1c4ae4c93f2d0d3d7a0b573ddd876fc855c2 compiler/main/DriverPhases.hs | 6 +- compiler/main/HscTypes.hs | 5 +- compiler/typecheck/ClsInst.hs | 76 +++++++++++++++++++--- compiler/typecheck/TcRnMonad.hs | 5 +- compiler/typecheck/TcValidity.hs | 39 +++++++++-- .../backpack/should_run/{T15138.bkp => T15379.bkp} | 28 ++++++-- testsuite/tests/backpack/should_run/T15379.stdout | 2 + testsuite/tests/backpack/should_run/all.T | 1 + 8 files changed, 140 insertions(+), 22 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc ce7a1c4ae4c93f2d0d3d7a0b573ddd876fc855c2 From git at git.haskell.org Fri Oct 12 05:56:48 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 12 Oct 2018 05:56:48 +0000 (UTC) Subject: [commit: ghc] wip/T15696: Fix FloatIn literal case (431b706) Message-ID: <20181012055648.5C8023ABC0@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T15696 Link : http://ghc.haskell.org/trac/ghc/changeset/431b70638dc98d3ffce93e182c25866ee870c22b/ghc >--------------------------------------------------------------- commit 431b70638dc98d3ffce93e182c25866ee870c22b Author: Ömer Sinan Ağacan Date: Fri Oct 12 08:23:50 2018 +0300 Fix FloatIn literal case >--------------------------------------------------------------- 431b70638dc98d3ffce93e182c25866ee870c22b compiler/simplCore/FloatIn.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/simplCore/FloatIn.hs b/compiler/simplCore/FloatIn.hs index 2593b1d..3a152ce 100644 --- a/compiler/simplCore/FloatIn.hs +++ b/compiler/simplCore/FloatIn.hs @@ -142,7 +142,7 @@ fiExpr :: DynFlags -> CoreExprWithFVs -- Input expr -> CoreExpr -- Result -fiExpr _ to_drop (_, AnnLit lit) = ASSERT( null to_drop ) Lit lit +fiExpr _ to_drop (_, AnnLit lit) = wrapFloats to_drop (Lit lit) fiExpr _ to_drop (_, AnnType ty) = ASSERT( null to_drop ) Type ty fiExpr _ to_drop (_, AnnVar v) = wrapFloats to_drop (Var v) fiExpr _ to_drop (_, AnnCoercion co) = wrapFloats to_drop (Coercion co) From git at git.haskell.org Fri Oct 12 09:30:27 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 12 Oct 2018 09:30:27 +0000 (UTC) Subject: [commit: ghc] wip/T14880-2-step2-c123: Use an accumulator version of tyCoVarsOfType (44d2302) Message-ID: <20181012093027.2E3553ABC0@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T14880-2-step2-c123 Link : http://ghc.haskell.org/trac/ghc/changeset/44d2302dc1a90c7d45ca1b2dec4a3e85860c6f4f/ghc >--------------------------------------------------------------- commit 44d2302dc1a90c7d45ca1b2dec4a3e85860c6f4f Author: Simon Peyton Jones Date: Fri Aug 31 14:18:55 2018 +0100 Use an accumulator version of tyCoVarsOfType Summary: This is part 1 from #14880: factor out a worker for the tyCoVarsOf... family of function, implementing them in terms of VarSet, but with accumulator-style (like in `FV`) built in, and with the same kind of pre-insert lookup; this has shown to perform better than either FV or plain VarSet in this particular scenario. Original notes from simonpj: In TyCoRep we now have tyCoVarsOfType implemented 1) Using FV -- this is the baseline version in GHC today 2) Using VarSets via unionVarSet 3) Using VarSets in accumulator-style In this patch (3) is enabled. When compiling perf/compiler/T5631 we get Compiler allocs (1) 1,144M (2) 1,175M (3) 1,142M The key new insight in (3) is this: ty_co_vars_of_type (TyVarTy v) is acc | v `elemVarSet` is = acc | v `elemVarSet` acc = acc <---- NB! | otherwise = ty_co_vars_of_type (tyVarKind v) is (extendVarSet acc v) Notice the second line! If the variable is already in the accumulator, don't re-add it. This makes big difference. Without it, allocation is 1,169M or so. One cause is that we only take the free vars of its kind once; that problem will go away when we do the main part of #14088 and close over kinds /afterwards/. But still, another cause is perhaps that every insert into a set overwrites the previous item, and so allocates a new path to the item; it's not a no-op even if the item is there already. Why use (3) rather than (1)? Becuase it just /has/ to be better; * FV carries around an InterestingVarFun, which does nothing useful here, but is tested at every variable * FV carries around a [Var] for the deterministic version. For this very hot operation (finding free vars) I think it makes sense to have speical purpose code. On the way I also simplified the (less used) coVarsOfType/Co family to use FV, by making serious use of the InterestingVarFun! Test Plan: validate, nofib Reviewers: simonpj, bgamari Subscribers: rwbarton, carter GHC Trac Issues: #14880 Differential Revision: https://phabricator.haskell.org/D5141 >--------------------------------------------------------------- 44d2302dc1a90c7d45ca1b2dec4a3e85860c6f4f compiler/types/TyCoRep.hs | 381 ++++++++++++++++++++++++++++++++++------------ 1 file changed, 284 insertions(+), 97 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 44d2302dc1a90c7d45ca1b2dec4a3e85860c6f4f From git at git.haskell.org Fri Oct 12 09:30:30 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 12 Oct 2018 09:30:30 +0000 (UTC) Subject: [commit: ghc] wip/T14880-2-step2-c123: Remove commented-out code, turn it into Note text instead. (0effa62) Message-ID: <20181012093030.0721F3ABC0@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T14880-2-step2-c123 Link : http://ghc.haskell.org/trac/ghc/changeset/0effa6215fb68cd802161f49a168294428309388/ghc >--------------------------------------------------------------- commit 0effa6215fb68cd802161f49a168294428309388 Author: Tobias Dammers Date: Mon Oct 8 09:53:01 2018 +0200 Remove commented-out code, turn it into Note text instead. >--------------------------------------------------------------- 0effa6215fb68cd802161f49a168294428309388 compiler/types/TyCoRep.hs | 165 ++++++---------------------------------------- 1 file changed, 21 insertions(+), 144 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 0effa6215fb68cd802161f49a168294428309388 From git at git.haskell.org Fri Oct 12 09:30:32 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 12 Oct 2018 09:30:32 +0000 (UTC) Subject: [commit: ghc] wip/T14880-2-step2-c123: Document TyCoRep changes better (1681eac) Message-ID: <20181012093032.CB2303ABC0@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T14880-2-step2-c123 Link : http://ghc.haskell.org/trac/ghc/changeset/1681eac12f2931e1bbd5e4ad86f0aa3239d09505/ghc >--------------------------------------------------------------- commit 1681eac12f2931e1bbd5e4ad86f0aa3239d09505 Author: Tobias Dammers Date: Wed Oct 10 14:01:52 2018 +0200 Document TyCoRep changes better >--------------------------------------------------------------- 1681eac12f2931e1bbd5e4ad86f0aa3239d09505 compiler/types/TyCoRep.hs | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/compiler/types/TyCoRep.hs b/compiler/types/TyCoRep.hs index 3495387..4fb6b1c 100644 --- a/compiler/types/TyCoRep.hs +++ b/compiler/types/TyCoRep.hs @@ -1627,6 +1627,8 @@ so we profiled several versions, exploring different implementation strategies. "in-scope set" filter found in the internals of FV, but without the determinism overhead. +See Trac #14880. + -} tyCoVarsOfType :: Type -> TyCoVarSet @@ -1721,9 +1723,6 @@ mkTyCoInScopeSet tys cos = mkInScopeSet (ty_co_vars_of_types tys emptyVarSet $ ty_co_vars_of_cos cos emptyVarSet emptyVarSet) ---------------------- End of accumulator version ---------------- ------------------------------------------------------------------ - -- | `tyCoFVsOfType` that returns free variables of a type in a deterministic -- set. For explanation of why using `VarSet` is not deterministic see -- Note [Deterministic FV] in FV. @@ -1857,6 +1856,24 @@ tyCoFVsOfCos (co:cos) fv_cand in_scope acc = (tyCoFVsOfCo co `unionFV` tyCoFVsOf ------------- Extracting the CoVars of a type or coercion ----------- +{- + +Note [CoVarsOfX and the InterestingVarFun] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The coVarsOfType, coVarsOfTypes, coVarsOfCo, and coVarsOfCos functions are +implemented in terms of the respective FV equivalents (tyCoFVsOf...), rather +than the VarSet-based flavors (tyCoVarsOf...), despite the performance +considerations outlined in Note [Free variables of types]. + +This is because FV includes the InterestingVarFun, which is useful here, +because we can cleverly use it to restrict our calculations to CoVars - this +is what getCoVarSet achieves. + +See Trac #14880. + +-} + getCoVarSet :: FV -> CoVarSet getCoVarSet fv = snd (fv isCoVar emptyVarSet ([], emptyVarSet)) From git at git.haskell.org Fri Oct 12 09:30:35 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 12 Oct 2018 09:30:35 +0000 (UTC) Subject: [commit: ghc] wip/T14880-2-step2-c123: Bugfix (b7f2ad3) Message-ID: <20181012093035.9D1243ABC0@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T14880-2-step2-c123 Link : http://ghc.haskell.org/trac/ghc/changeset/b7f2ad3225ee79b4abac844edf7c5541dd001771/ghc >--------------------------------------------------------------- commit b7f2ad3225ee79b4abac844edf7c5541dd001771 Author: Tobias Dammers Date: Mon Sep 10 22:46:31 2018 +0200 Bugfix >--------------------------------------------------------------- b7f2ad3225ee79b4abac844edf7c5541dd001771 compiler/types/TyCoRep.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/types/TyCoRep.hs b/compiler/types/TyCoRep.hs index f97db0d..d512eff 100644 --- a/compiler/types/TyCoRep.hs +++ b/compiler/types/TyCoRep.hs @@ -1906,8 +1906,8 @@ ty_co_vars_of_mco (MCo co) is acc = ty_co_vars_of_co co is acc ty_co_vars_of_co_var :: CoVar -> TyCoVarSet -> TyCoVarSet -> TyCoVarSet ty_co_vars_of_co_var v is acc - | v `elemVarSet` is = acc | v `elemVarSet` is = acc + | v `elemVarSet` acc = acc | otherwise = ty_co_vars_of_type (varType v) is (extendVarSet acc v) ty_co_vars_of_cos :: [Coercion] -> TyCoVarSet -> TyCoVarSet -> TyCoVarSet From git at git.haskell.org Fri Oct 12 09:30:38 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 12 Oct 2018 09:30:38 +0000 (UTC) Subject: [commit: ghc] wip/T14880-2-step2-c123: Use an accumulator version of tyCoVarsOfType (1ea447a) Message-ID: <20181012093038.759773ABC0@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T14880-2-step2-c123 Link : http://ghc.haskell.org/trac/ghc/changeset/1ea447a29e5965732e19bf7e255c2b9e5aeeb6a3/ghc >--------------------------------------------------------------- commit 1ea447a29e5965732e19bf7e255c2b9e5aeeb6a3 Author: Simon Peyton Jones Date: Fri Aug 31 14:18:55 2018 +0100 Use an accumulator version of tyCoVarsOfType Summary: This is part 1 from #14880: factor out a worker for the tyCoVarsOf... family of function, implementing them in terms of VarSet, but with accumulator-style (like in `FV`) built in, and with the same kind of pre-insert lookup; this has shown to perform better than either FV or plain VarSet in this particular scenario. Original notes from simonpj: In TyCoRep we now have tyCoVarsOfType implemented 1) Using FV -- this is the baseline version in GHC today 2) Using VarSets via unionVarSet 3) Using VarSets in accumulator-style In this patch (3) is enabled. When compiling perf/compiler/T5631 we get Compiler allocs (1) 1,144M (2) 1,175M (3) 1,142M The key new insight in (3) is this: ty_co_vars_of_type (TyVarTy v) is acc | v `elemVarSet` is = acc | v `elemVarSet` acc = acc <---- NB! | otherwise = ty_co_vars_of_type (tyVarKind v) is (extendVarSet acc v) Notice the second line! If the variable is already in the accumulator, don't re-add it. This makes big difference. Without it, allocation is 1,169M or so. One cause is that we only take the free vars of its kind once; that problem will go away when we do the main part of #14088 and close over kinds /afterwards/. But still, another cause is perhaps that every insert into a set overwrites the previous item, and so allocates a new path to the item; it's not a no-op even if the item is there already. Why use (3) rather than (1)? Becuase it just /has/ to be better; * FV carries around an InterestingVarFun, which does nothing useful here, but is tested at every variable * FV carries around a [Var] for the deterministic version. For this very hot operation (finding free vars) I think it makes sense to have speical purpose code. On the way I also simplified the (less used) coVarsOfType/Co family to use FV, by making serious use of the InterestingVarFun! Test Plan: validate, nofib Reviewers: simonpj, bgamari Subscribers: rwbarton, carter GHC Trac Issues: #14880 Differential Revision: https://phabricator.haskell.org/D5141 >--------------------------------------------------------------- 1ea447a29e5965732e19bf7e255c2b9e5aeeb6a3 compiler/types/TyCoRep.hs | 208 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 207 insertions(+), 1 deletion(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 1ea447a29e5965732e19bf7e255c2b9e5aeeb6a3 From git at git.haskell.org Fri Oct 12 09:30:41 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 12 Oct 2018 09:30:41 +0000 (UTC) Subject: [commit: ghc] wip/T14880-2-step2-c123: Close over kinds exactly once per var (#14880) (b7583b6) Message-ID: <20181012093041.46D923ABC0@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T14880-2-step2-c123 Link : http://ghc.haskell.org/trac/ghc/changeset/b7583b6650e2b6f9bb4742d182c503aad2827fc9/ghc >--------------------------------------------------------------- commit b7583b6650e2b6f9bb4742d182c503aad2827fc9 Author: Tobias Dammers Date: Thu Sep 13 09:56:02 2018 +0200 Close over kinds exactly once per var (#14880) Summary: As discussed in Trac:14880, comment:123, we have the issue that we want to avoid processing the same var more than once. The original plan was to move closing over kinds to the very end of the `tyCoVarsOfType` function, however, this turns out to be inefficient and unnecessary. Instead, we simply change the code in `ty_co_vars_of_type` such that closing over kinds doesn't happen if we've already seen the var in question. Test Plan: ./validate, nofib Reviewers: simonpj, goldfire, bgamari Subscribers: rwbarton, carter GHC Trac Issues: #14880 Differential Revision: https://phabricator.haskell.org/D5147 >--------------------------------------------------------------- b7583b6650e2b6f9bb4742d182c503aad2827fc9 compiler/types/TyCoRep.hs | 105 ++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 93 insertions(+), 12 deletions(-) diff --git a/compiler/types/TyCoRep.hs b/compiler/types/TyCoRep.hs index d512eff..b4b88da 100644 --- a/compiler/types/TyCoRep.hs +++ b/compiler/types/TyCoRep.hs @@ -1847,15 +1847,16 @@ tyCoVarsOfTypes tys = ty_co_vars_of_types tys emptyVarSet emptyVarSet ty_co_vars_of_type :: Type -> TyCoVarSet -> TyCoVarSet -> TyCoVarSet ty_co_vars_of_type (TyVarTy v) is acc + -- See Note [Closing over free variable kinds] | v `elemVarSet` is = acc | v `elemVarSet` acc = acc - | otherwise = ty_co_vars_of_type (tyVarKind v) is (extendVarSet acc v) + | otherwise = ty_co_vars_of_type (tyVarKind v) emptyVarSet (extendVarSet acc v) ty_co_vars_of_type (TyConApp _ tys) is acc = ty_co_vars_of_types tys is acc ty_co_vars_of_type (LitTy {}) _ acc = acc ty_co_vars_of_type (AppTy fun arg) is acc = ty_co_vars_of_type fun is (ty_co_vars_of_type arg is acc) ty_co_vars_of_type (FunTy arg res) is acc = ty_co_vars_of_type arg is (ty_co_vars_of_type res is acc) -ty_co_vars_of_type (ForAllTy (TvBndr tv _) ty) is acc = ty_co_vars_of_type (tyVarKind tv) is $ - ty_co_vars_of_type ty (extendVarSet is tv) acc +ty_co_vars_of_type (ForAllTy (Bndr tv _) ty) is acc = ty_co_vars_of_type (tyVarKind tv) is $ + ty_co_vars_of_type ty (extendVarSet is tv) acc ty_co_vars_of_type (CastTy ty co) is acc = ty_co_vars_of_type ty is (ty_co_vars_of_co co is acc) ty_co_vars_of_type (CoercionTy co) is acc = ty_co_vars_of_co co is acc @@ -1977,15 +1978,19 @@ tyCoVarsOfTypesList tys = fvVarList $ tyCoFVsOfTypes tys -- Eta-expanded because that makes it run faster (apparently) -- See Note [FV eta expansion] in FV for explanation. tyCoFVsOfType :: Type -> FV --- See Note [Free variables of types] -tyCoFVsOfType (TyVarTy v) a b c = (unitFV v `unionFV` tyCoFVsOfType (varType v)) a b c -tyCoFVsOfType (TyConApp _ tys) a b c = tyCoFVsOfTypes tys a b c -tyCoFVsOfType (LitTy {}) a b c = emptyFV a b c -tyCoFVsOfType (AppTy fun arg) a b c = (tyCoFVsOfType fun `unionFV` tyCoFVsOfType arg) a b c -tyCoFVsOfType (FunTy arg res) a b c = (tyCoFVsOfType arg `unionFV` tyCoFVsOfType res) a b c -tyCoFVsOfType (ForAllTy bndr ty) a b c = tyCoFVsBndr bndr (tyCoFVsOfType ty) a b c -tyCoFVsOfType (CastTy ty co) a b c = (tyCoFVsOfType ty `unionFV` tyCoFVsOfCo co) a b c -tyCoFVsOfType (CoercionTy co) a b c = tyCoFVsOfCo co a b c +-- See Note [Free variables of types] and Note [Closing over free variable kinds] +tyCoFVsOfType (TyVarTy v) f bound_vars (acc_list, acc_set) + | not (f v) = (acc_list, acc_set) + | v `elemVarSet` bound_vars = (acc_list, acc_set) + | v `elemVarSet` acc_set = (acc_list, acc_set) + | otherwise = tyCoFVsOfType (tyVarKind v) f emptyVarSet (v:acc_list, extendVarSet acc_set v) +tyCoFVsOfType (TyConApp _ tys) f bound_vars acc = tyCoFVsOfTypes tys f bound_vars acc +tyCoFVsOfType (LitTy {}) f bound_vars acc = emptyFV f bound_vars acc +tyCoFVsOfType (AppTy fun arg) f bound_vars acc = (tyCoFVsOfType fun `unionFV` tyCoFVsOfType arg) f bound_vars acc +tyCoFVsOfType (FunTy arg res) f bound_vars acc = (tyCoFVsOfType arg `unionFV` tyCoFVsOfType res) f bound_vars acc +tyCoFVsOfType (ForAllTy bndr ty) f bound_vars acc = tyCoFVsBndr bndr (tyCoFVsOfType ty) f bound_vars acc +tyCoFVsOfType (CastTy ty co) f bound_vars acc = (tyCoFVsOfType ty `unionFV` tyCoFVsOfCo co) f bound_vars acc +tyCoFVsOfType (CoercionTy co) f bound_vars acc = tyCoFVsOfCo co f bound_vars acc tyCoFVsBndr :: TyCoVarBinder -> FV -> FV -- Free vars of (forall b. ) @@ -2060,6 +2065,82 @@ tyCoFVsOfCos :: [Coercion] -> FV tyCoFVsOfCos [] fv_cand in_scope acc = emptyFV fv_cand in_scope acc tyCoFVsOfCos (co:cos) fv_cand in_scope acc = (tyCoFVsOfCo co `unionFV` tyCoFVsOfCos cos) fv_cand in_scope acc +{- + +Note [Closing over free variable kinds] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +tyCoVarsOfType and tyCoFVsOfType, while traversing a type, will also close over +free variable kinds. In previous GHC versions, this happened naively: whenever +we would encounter an occurrence of a free type variable, we would close over +its kind. This, however is wrong for two reasons (see Trac #14880): + +1. Efficiency. If we have Proxy (a::k) -> Proxy (a::k) -> Proxy (a::k), then + we don't want to have to traverse k more than once. + +2. Correctness. Imagine we have forall k. b -> k, where b has + kind k, for some k bound in an outer scope. If we look at b's kind inside + the forall, we'll collect that k is free and then remove k from the set of + free variables. This is plain wrong. We must instead compute that b is free + and then conclude that b's kind is free. + +An obvious first approach is to move the closing-over-kinds from the +occurrences of a type variable to after finding the free vars - however, this +turns out to introduce performance regressions, and isn't even entirely +correct. + +In fact, it isn't even important *when* we close over kinds; what matters is +that we handle each type var exactly once, and that we do it in the right +context. + +So the next approach we tried was to use the "in-scope set" part of FV or the +equivalent argument in the accumulator-style `ty_co_vars_of_type` function, to +say "don't bother with variables we have already closed over". This should work +fine in theory, but the code is complicated and doesn't perform well. + +But there is a simpler way, which is implemented here. Consider the two points +above: + +1. Efficiency: we now have an accumulator, so the second time we encounter 'a', + we'll ignore it, certainly not looking at its kind - this is why + pre-checking set membership before inserting ends up not only being faster, + but also being correct. + +2. Correctness: we have an "in-scope set" (I think we should call it it a + "bound-var set"), specifying variables that are bound by a forall in the type + we are traversing; we simply ignore these variables, certainly not looking at + their kind. + +So consider: + + forall k. b -> k + +where b :: k->Type is free; but of course, it's a different k! When looking at +b -> k we'll have k in the bound-var set. So we'll ignore the k. But suppose +this is our first encounter with b; we want the free vars of its kind. But we +want to behave as if we took the free vars of its kind at the end; that is, +with no bound vars in scope. + +So the solution is easy. The old code was this: + + ty_co_vars_of_type (TyVarTy v) is acc + | v `elemVarSet` is = acc + | v `elemVarSet` acc = acc + | otherwise = ty_co_vars_of_type (tyVarKind v) is (extendVarSet acc v) + +Now all we need to do is take the free vars of tyVarKind v *with an empty +bound-var set*, thus: + +ty_co_vars_of_type (TyVarTy v) is acc + | v `elemVarSet` is = acc + | v `elemVarSet` acc = acc + | otherwise = ty_co_vars_of_type (tyVarKind v) emptyVarSet (extendVarSet acc v) + ^^^^^^^^^^^ + +And that's it. + +-} + ------------- Extracting the CoVars of a type or coercion ----------- {- From git at git.haskell.org Fri Oct 12 09:30:44 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 12 Oct 2018 09:30:44 +0000 (UTC) Subject: [commit: ghc] wip/T14880-2-step2-c123: Fix some test wibbles (834dcd2) Message-ID: <20181012093044.1E0A23ABC0@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T14880-2-step2-c123 Link : http://ghc.haskell.org/trac/ghc/changeset/834dcd2bf6513e697bf65379bdab7ea1a116fdbd/ghc >--------------------------------------------------------------- commit 834dcd2bf6513e697bf65379bdab7ea1a116fdbd Author: Tobias Dammers Date: Fri Oct 12 11:22:40 2018 +0200 Fix some test wibbles >--------------------------------------------------------------- 834dcd2bf6513e697bf65379bdab7ea1a116fdbd testsuite/tests/partial-sigs/should_compile/T12844.stderr | 2 +- testsuite/tests/partial-sigs/should_compile/T15039a.stderr | 2 +- testsuite/tests/partial-sigs/should_compile/T15039b.stderr | 2 +- testsuite/tests/partial-sigs/should_compile/T15039c.stderr | 2 +- testsuite/tests/partial-sigs/should_compile/T15039d.stderr | 2 +- testsuite/tests/partial-sigs/should_run/T15415.stderr | 8 ++++---- testsuite/tests/polykinds/T14265.stderr | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/testsuite/tests/partial-sigs/should_compile/T12844.stderr b/testsuite/tests/partial-sigs/should_compile/T12844.stderr index 7049818..0e01cd3 100644 --- a/testsuite/tests/partial-sigs/should_compile/T12844.stderr +++ b/testsuite/tests/partial-sigs/should_compile/T12844.stderr @@ -2,7 +2,7 @@ T12844.hs:12:9: warning: [-Wpartial-type-signatures (in -Wdefault)] • Found type wildcard ‘_’ standing for ‘(Foo rngs, Head rngs ~ '(r, r'))’ - Where: ‘rngs’, ‘r’, ‘k’, ‘r'’, ‘k1’ + Where: ‘rngs’, ‘k’, ‘r’, ‘k1’, ‘r'’ are rigid type variables bound by the inferred type of bar :: (Foo rngs, Head rngs ~ '(r, r')) => FooData rngs diff --git a/testsuite/tests/partial-sigs/should_compile/T15039a.stderr b/testsuite/tests/partial-sigs/should_compile/T15039a.stderr index d9c8e10..1563a2e 100644 --- a/testsuite/tests/partial-sigs/should_compile/T15039a.stderr +++ b/testsuite/tests/partial-sigs/should_compile/T15039a.stderr @@ -25,7 +25,7 @@ T15039a.hs:22:14: warning: [-Wpartial-type-signatures (in -Wdefault)] T15039a.hs:25:14: warning: [-Wpartial-type-signatures (in -Wdefault)] • Found type wildcard ‘_’ standing for ‘Dict (a ~~ b)’ - Where: ‘a’, ‘b’, ‘k’ are rigid type variables bound by + Where: ‘a’, ‘k’, ‘b’ are rigid type variables bound by the type signature for: ex3 :: forall k a (b :: k). Dict (a ~~ b) -> () at T15039a.hs:24:1-43 diff --git a/testsuite/tests/partial-sigs/should_compile/T15039b.stderr b/testsuite/tests/partial-sigs/should_compile/T15039b.stderr index 5726c7f..21ec20a 100644 --- a/testsuite/tests/partial-sigs/should_compile/T15039b.stderr +++ b/testsuite/tests/partial-sigs/should_compile/T15039b.stderr @@ -26,7 +26,7 @@ T15039b.hs:22:14: warning: [-Wpartial-type-signatures (in -Wdefault)] T15039b.hs:25:14: warning: [-Wpartial-type-signatures (in -Wdefault)] • Found type wildcard ‘_’ standing for ‘Dict ((a :: *) ~~ (b :: k))’ - Where: ‘a’, ‘b’, ‘k’ are rigid type variables bound by + Where: ‘a’, ‘k’, ‘b’ are rigid type variables bound by the type signature for: ex3 :: forall k a (b :: k). Dict ((a :: *) ~~ (b :: k)) -> () at T15039b.hs:24:1-43 diff --git a/testsuite/tests/partial-sigs/should_compile/T15039c.stderr b/testsuite/tests/partial-sigs/should_compile/T15039c.stderr index 29989c2..b1f76f3 100644 --- a/testsuite/tests/partial-sigs/should_compile/T15039c.stderr +++ b/testsuite/tests/partial-sigs/should_compile/T15039c.stderr @@ -25,7 +25,7 @@ T15039c.hs:22:14: warning: [-Wpartial-type-signatures (in -Wdefault)] T15039c.hs:25:14: warning: [-Wpartial-type-signatures (in -Wdefault)] • Found type wildcard ‘_’ standing for ‘Dict (a ~~ b)’ - Where: ‘a’, ‘b’, ‘k’ are rigid type variables bound by + Where: ‘a’, ‘k’, ‘b’ are rigid type variables bound by the type signature for: ex3 :: forall k a (b :: k). Dict (a ~~ b) -> () at T15039c.hs:24:1-43 diff --git a/testsuite/tests/partial-sigs/should_compile/T15039d.stderr b/testsuite/tests/partial-sigs/should_compile/T15039d.stderr index 7a0f4ac..d0369d6 100644 --- a/testsuite/tests/partial-sigs/should_compile/T15039d.stderr +++ b/testsuite/tests/partial-sigs/should_compile/T15039d.stderr @@ -27,7 +27,7 @@ T15039d.hs:22:14: warning: [-Wpartial-type-signatures (in -Wdefault)] T15039d.hs:25:14: warning: [-Wpartial-type-signatures (in -Wdefault)] • Found type wildcard ‘_’ standing for ‘Dict ((a :: *) ~~ (b :: k))’ - Where: ‘a’, ‘b’, ‘k’ are rigid type variables bound by + Where: ‘a’, ‘k’, ‘b’ are rigid type variables bound by the type signature for: ex3 :: forall k a (b :: k). Dict ((a :: *) ~~ (b :: k)) -> () at T15039d.hs:24:1-43 diff --git a/testsuite/tests/partial-sigs/should_run/T15415.stderr b/testsuite/tests/partial-sigs/should_run/T15415.stderr index c11d54e..daa791f 100644 --- a/testsuite/tests/partial-sigs/should_run/T15415.stderr +++ b/testsuite/tests/partial-sigs/should_run/T15415.stderr @@ -1,8 +1,8 @@ :1:7: error: Found type wildcard ‘_’ standing for ‘w0 :: k0’ - Where: ‘w0’ is an ambiguous type variable - ‘k0’ is an ambiguous type variable + Where: ‘k0’ is an ambiguous type variable + ‘w0’ is an ambiguous type variable To use the inferred type, enable PartialTypeSignatures :1:17: error: @@ -16,8 +16,8 @@ :1:7: warning: [-Wpartial-type-signatures (in -Wdefault)] Found type wildcard ‘_’ standing for ‘w0 :: k0’ - Where: ‘w0’ is an ambiguous type variable - ‘k0’ is an ambiguous type variable + Where: ‘k0’ is an ambiguous type variable + ‘w0’ is an ambiguous type variable :1:17: warning: [-Wpartial-type-signatures (in -Wdefault)] Found type wildcard ‘_’ standing for ‘* -> *’ diff --git a/testsuite/tests/polykinds/T14265.stderr b/testsuite/tests/polykinds/T14265.stderr index be6868f..43366fc 100644 --- a/testsuite/tests/polykinds/T14265.stderr +++ b/testsuite/tests/polykinds/T14265.stderr @@ -1,7 +1,7 @@ T14265.hs:7:12: error: • Found type wildcard ‘_’ standing for ‘w :: k’ - Where: ‘w’, ‘k’ are rigid type variables bound by + Where: ‘k’, ‘w’ are rigid type variables bound by the inferred type of f :: proxy w -> () at T14265.hs:8:1-8 To use the inferred type, enable PartialTypeSignatures From git at git.haskell.org Fri Oct 12 09:30:47 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 12 Oct 2018 09:30:47 +0000 (UTC) Subject: [commit: ghc] wip/T14880-2-step2-c123's head updated: Fix some test wibbles (834dcd2) Message-ID: <20181012093047.5BB7D3ABC0@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc Branch 'wip/T14880-2-step2-c123' now includes: 3cc3edf Update UnsafeReenter test d36b1ff Build debugged prof runtimes 36740b4 Revert incorrect STM wakeup optimisation 5d67d06 rts.cabal.in: advertise new default profiling ways for hadrian 03b779f Make CoreMonad independent of TcEnv (#14391) ce23451 Refactor info table entry error messages 0e6d42f Be a bit more aggressive about let-to-case 7ab8007 Revert "ghc: Remove warning of StaticPointers not being supported by GHCi" 5c48c41 template-haskell: Fix typo in changelog 900c47f rts/Printer.c: always define the findPtr symbol b9b1f99 Honor INLINE on 0-arity bindings (#15578) 1ad3c82 Typo in user guide wrongly claims DeriveLift was added in 7.2 0c07208 Comments about join-point return types 6bf11e6 Delete duplicated comment line 291b0f8 Comments only (on IfDataInstance) bd76875 Allow (~) in the head of a quantified constraints 0d4f394 Add regression test for Trac #15629 02edb8f More info for Implication with -dppr-debug 8533428 Remove dead variable binding 9912cdf Fix build 5f5898a eventlog: Factor out eventlog header generation into separate function e71e341 base: showEFloat: Handle negative precisions the same of zero precision ce240b3 Update hsc2hs submodule 9c6b749 Add support for ImplicitParams and RecursiveDo in TH 3040444 tests: increase (compile) timeout multiplier for T13701 and MultiLayerModules ecbe26b Fix T15502 on 32-bit 64c54ff Mark system and internal symbols as private symbols in asm c23f057 Mark code related symbols as @function not @object ea5ade3 Coercion Quantification a3bce95 Correct submodule update for haddock c6bff52 Fix for #13862: Optional "-v" not allowed with :load in GHCi d1c2f29 Stable name comment wibbles 88130db base: Add bangs to GHC.IO.Handle.Text hGet* functions 43967c0 users-guide: Fix code-block layout for QuantifiedConstraints e655aac Make sure forM_ and related functions fuse cleanly 5840734 Updated PE linker, section alignment and cleanup. 4edc6d6 Users guide: EmptyDataDecls on by default 01f7cd7 NoImplicitPrelude in ghc-boot-th, ghc-boot, ghc-heap, ghci ce3897f Fix check whether GCC supports __atomic_ builtins 6bb9bc7 Invert FP conditions to eliminate the explicit NaN check. e40b388 Bump stm submodule 989dca6 Bump text submodule 2b763b5 Bump deepseq submodule 1971e99 Don't shortcut SRTs for static functions (#15544) a4ae97e docs: fix example code 45befe2 Use predefined known-key names when possible 077b92f Remove -Waggregate-return when building RTS 4e3f6a0 users guide: Fix a few issues ba086ca Add testcase for #14251 d7fa869 Revert "adds -latomic to. ghc-prim" 4eebc80 users-guide: Fix build with sphinx 1.8 8c7d33a users_guide: fix sphinx error caused by non-explicit override a257782 user-guide: Allow build with sphinx < 1.8 66c1729 Fix slop zeroing for AP_STACK eager blackholes in debug build 29f1c55 Remove redundant slop zeroing d0d7484 testsuite: Don't force run of llvm ways in T14251 73d9cad testsuite: Mark readFail032 and readFail048 as broken on Darwin 3e5b8e3 testsuite: Fix readFail048 and readFail032 brokenness declarations fd89bb4 testsuite: Bump expected allocations of T9675 78beade testsuite: Bump expected allocations for T12707 7e77f41 testsuite: Bump T9630 expected allocations cad5d0b Buglet in reporting out of scope errors in rules 4bde71d Don't look up unnecessary return in LastStmt ab44ff8 Comments only 2dbf88b Fix get getIdFromTrivialExpr e68b439 Add a recursivity check in nonVoid d90946c Fix a MSG_BLACKHOLE sanity check, add some comments a38eaa6 aclocal.m4: fix shell comment syntax: '#', not '$' 9bfbc4e Don't show constraint tuples in errors (#14907) 2a9cead Add regression test for #15666 a744134 Expand the Note on let-bound skolems 4bdb10c Fix Lint of unsaturated type families d25fa45 Fix constant-folding for Integer shifts 1d7b61f users' guide: document -freverse-errors d00c308 Fix for recover with -fexternal-interpreter (#15418) e72d788 Normalise EmptyCase types using the constraint solver c89297e Expose wopt_set/unset_fatal in DynFlags df67f95 Add -fkeep-cafs e44c992 Always check the relocation value for x86_64 139ef7e CodeGen: Teach CodeGen about aliasing of XMM/YMM/ZMM registers 99eb459 ghc-bin.cabal.in: add a 'threaded' flag for hadrian d157762 primops: Fix documentation of compactAllocateBlock# 4578548 ghc-prim: Add missing changelog entry 0ac86cb ghc-prim: Fix typo in traceBinaryEvent# changelog entry 64475db circleci: Run slowtest with multiple threads 309438e Fix #15637 by using VTA more in GND a57fa24 Quantify class variables first in associated families' kinds caffff1 circleci: Create missing test-results directory abfb91f resolve T13704 e3355b7 rts.cabal.in: add more flags to control the extra flavours (for hadrian) 21efbc7 GHCi should not filter instances involving cTuples a838ae3 Drop GHC 8.2 compatibility deceb21 Drop accidental write-attributes request 3dedffa distrib: Remove mention of no-longer-existent make target fc2ff6d Make GHC (the library) flexible in the choice of integer library 44d2302 Use an accumulator version of tyCoVarsOfType 0effa62 Remove commented-out code, turn it into Note text instead. 1681eac Document TyCoRep changes better 1ea447a Use an accumulator version of tyCoVarsOfType b7f2ad3 Bugfix b7583b6 Close over kinds exactly once per var (#14880) 834dcd2 Fix some test wibbles From git at git.haskell.org Fri Oct 12 15:06:07 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 12 Oct 2018 15:06:07 +0000 (UTC) Subject: [commit: ghc] master: Comments about dataToTag# only (05b2587) Message-ID: <20181012150607.F09643ABC0@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/05b2587b00d0a69ae98b2c4976b85cc3e33a7b49/ghc >--------------------------------------------------------------- commit 05b2587b00d0a69ae98b2c4976b85cc3e33a7b49 Author: Simon Peyton Jones Date: Fri Oct 12 16:04:57 2018 +0100 Comments about dataToTag# only >--------------------------------------------------------------- 05b2587b00d0a69ae98b2c4976b85cc3e33a7b49 compiler/prelude/PrelRules.hs | 4 ++- compiler/prelude/primops.txt.pp | 74 +++++++++++++++++++++++++++++------------ 2 files changed, 56 insertions(+), 22 deletions(-) diff --git a/compiler/prelude/PrelRules.hs b/compiler/prelude/PrelRules.hs index 28c0628..3d419ba 100644 --- a/compiler/prelude/PrelRules.hs +++ b/compiler/prelude/PrelRules.hs @@ -1020,7 +1020,7 @@ tagToEnumRule = do ------------------------------ dataToTagRule :: RuleM CoreExpr --- Rules for dataToTag# +-- See Note [dataToTag#] in primops.txt.pp dataToTagRule = a `mplus` b where -- dataToTag (tagToEnum x) ==> x @@ -2105,6 +2105,8 @@ Instead, we deal with turning one branch into DEFAULT in SimplUtils Note [caseRules for dataToTag] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +See also Note [dataToTag#] in primpops.txt.pp + We want to transform case dataToTag x of DEFAULT -> e1 diff --git a/compiler/prelude/primops.txt.pp b/compiler/prelude/primops.txt.pp index 303c902..8b327dd 100644 --- a/compiler/prelude/primops.txt.pp +++ b/compiler/prelude/primops.txt.pp @@ -2992,27 +2992,59 @@ primop DataToTagOp "dataToTag#" GenPrimOp primop TagToEnumOp "tagToEnum#" GenPrimOp Int# -> a --- Note [dataToTag#] --- ~~~~~~~~~~~~~~~~~ --- dataToTag# evaluates its argument, so we don't want to float it out. --- Consider: --- --- \z. case x of y -> let v = dataToTag# y in ... --- --- To improve floating, the FloatOut pass (deliberately) does a --- binder-swap on the case, to give --- --- \z. case x of y -> let v = dataToTag# x in ... --- --- Now FloatOut might float that v-binding outside the \z --- --- let v = dataToTag# x in \z. case x of y -> ... --- --- But that is bad because that might mean x gets evaluated much too early! --- --- Solution: make dataToTag# into a can_fail primop. That will stop it floating --- (see Note [PrimOp can_fail and has_side_effects] in PrimOp). It's a bit of --- a hack but never mind. +{- Note [dataToTag#] +~~~~~~~~~~~~~~~~~~~~ +The primop dataToTag# is unusual because it evaluates its argument. +Only `SeqOp` shares that property. (Other primops do not do anything +as fancy as argument evaluation.) The special handling for dataToTag# +is: + +* CoreUtils.exprOkForSpeculation has a special case for DataToTagOp, + (actually in app_ok). Most primops with lifted arguments do not + evaluate those arguments, but DataToTagOp and SeqOp are two + exceptions. We say that they are /never/ ok-for-speculation, + regardless of the evaluated-ness of their argument. + See CoreUtils Note [PrimOps that evaluate their arguments] + +* There is a special case for DataToTagOp in StgCmmExpr.cgExpr, + that evaluates its argument and then extracts the tag from + the returned value. + +* An application like (dataToTag# (Just x)) is optimised by + dataToTagRule in PrelRules. + +* A case expression like + case (dataToTag# e) of + gets transformed t + case e of + by PrelRules.caseRules; see Note [caseRules for dataToTag] + +See Trac #15696 for a long saga. + +Note [dataToTag# hack] +~~~~~~~~~~~~~~~~~~~~~~ +(This a temporary hack: see Trac #15696 commment:60.) + +dataToTag# evaluates its argument, so we don't want to float it out. +Consider: + + \z. case x of y -> let v = dataToTag# y in ... + +To improve floating, the FloatOut pass (deliberately) does a +binder-swap on the case, to give + + \z. case x of y -> let v = dataToTag# x in ... + +Now FloatOut might float that v-binding outside the \z + + let v = dataToTag# x in \z. case x of y -> ... + +But that is bad because that might mean x gets evaluated much too early! + +Solution: make dataToTag# into a can_fail primop. That will stop it floating +(see Note [PrimOp can_fail and has_side_effects] in PrimOp). It's a bit of +a hack but never mind. +-} ------------------------------------------------------------------------ section "Bytecode operations" From git at git.haskell.org Fri Oct 12 15:58:05 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 12 Oct 2018 15:58:05 +0000 (UTC) Subject: [commit: ghc] master: Include -fwarn-star-is-type in -Wcompat (5b2388b) Message-ID: <20181012155805.9E43D3ABC0@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/5b2388b2cb657771c3c578eaf552b300b79f8260/ghc >--------------------------------------------------------------- commit 5b2388b2cb657771c3c578eaf552b300b79f8260 Author: Vladislav Zavialov Date: Fri Oct 12 11:15:26 2018 -0400 Include -fwarn-star-is-type in -Wcompat According to the deprecation schedule in the accepted proposal, the first step is to include `-fwarn-star-is-type` in `-Wcompat`. Test Plan: Validate Reviewers: bgamari Reviewed By: bgamari Subscribers: rwbarton, carter GHC Trac Issues: #15476 Differential Revision: https://phabricator.haskell.org/D5044 >--------------------------------------------------------------- 5b2388b2cb657771c3c578eaf552b300b79f8260 compiler/main/DynFlags.hs | 1 + compiler/parser/RdrHsSyn.hs | 3 ++- docs/users_guide/8.8.1-notes.rst | 2 ++ docs/users_guide/using-warnings.rst | 4 ++++ testsuite/tests/wcompat-warnings/Template.hs | 5 ++++- testsuite/tests/wcompat-warnings/WCompatWarningsOn.stderr | 6 ++++++ 6 files changed, 19 insertions(+), 2 deletions(-) diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index f9ccc25..2c8f134 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -4614,6 +4614,7 @@ minusWcompatOpts , Opt_WarnSemigroup , Opt_WarnNonCanonicalMonoidInstances , Opt_WarnImplicitKindVars + , Opt_WarnStarIsType ] enableUnusedBinds :: DynP () diff --git a/compiler/parser/RdrHsSyn.hs b/compiler/parser/RdrHsSyn.hs index 1015319..1e89d5a 100644 --- a/compiler/parser/RdrHsSyn.hs +++ b/compiler/parser/RdrHsSyn.hs @@ -2049,7 +2049,8 @@ warnStarIsType span = addWarning Opt_WarnStarIsType span msg msg = text "Using" <+> quotes (text "*") <+> text "(or its Unicode variant) to mean" <+> quotes (text "Data.Kind.Type") - $$ text "relies on the StarIsType extension." + $$ text "relies on the StarIsType extension, which will become" + $$ text "deprecated in the future." $$ text "Suggested fix: use" <+> quotes (text "Type") <+> text "from" <+> quotes (text "Data.Kind") <+> text "instead." diff --git a/docs/users_guide/8.8.1-notes.rst b/docs/users_guide/8.8.1-notes.rst index a27aee7..d3da37e 100644 --- a/docs/users_guide/8.8.1-notes.rst +++ b/docs/users_guide/8.8.1-notes.rst @@ -59,6 +59,8 @@ Compiler - New :ghc-flag:`-keep-hscpp-files` to keep the output of the CPP pre-processor. +- The :ghc-flag:`-Wcompat` warning group now includes :ghc-flag:`-Wstar-is-type`. + Runtime system ~~~~~~~~~~~~~~ diff --git a/docs/users_guide/using-warnings.rst b/docs/users_guide/using-warnings.rst index dba30db..aeabbe9 100644 --- a/docs/users_guide/using-warnings.rst +++ b/docs/users_guide/using-warnings.rst @@ -117,6 +117,7 @@ The following flags are simple ways to select standard "packages" of warnings: * :ghc-flag:`-Wsemigroup` * :ghc-flag:`-Wnoncanonical-monoid-instances` * :ghc-flag:`-Wimplicit-kind-vars` + * :ghc-flag:`-Wstar-is-type` .. ghc-flag:: -Wno-compat :shortdesc: Disables all warnings enabled by :ghc-flag:`-Wcompat`. @@ -1194,6 +1195,9 @@ of ``-W(no-)*``. breaking change takes place. The recommended fix is to replace ``*`` with ``Type`` imported from ``Data.Kind``. + Being part of the :ghc-flag:`-Wcompat` option group, this warning is off by + default, but will be switched on in a future GHC release. + .. ghc-flag:: -Wstar-binder :shortdesc: warn about binding the ``(*)`` type operator despite :ghc-flag:`-XStarIsType` diff --git a/testsuite/tests/wcompat-warnings/Template.hs b/testsuite/tests/wcompat-warnings/Template.hs index e3423c8..03f9a49 100644 --- a/testsuite/tests/wcompat-warnings/Template.hs +++ b/testsuite/tests/wcompat-warnings/Template.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE NoMonadFailDesugaring #-} +{-# LANGUAGE NoMonadFailDesugaring, KindSignatures #-} module WCompatWarningsOnOff where @@ -21,3 +21,6 @@ instance Monoid S where S a `mappend` S b = S (a+b) mempty = S 0 +-- -fwarn-star-is-type +b :: (Bool :: *) +b = True diff --git a/testsuite/tests/wcompat-warnings/WCompatWarningsOn.stderr b/testsuite/tests/wcompat-warnings/WCompatWarningsOn.stderr index 5c2d9c5..3c3e73d 100644 --- a/testsuite/tests/wcompat-warnings/WCompatWarningsOn.stderr +++ b/testsuite/tests/wcompat-warnings/WCompatWarningsOn.stderr @@ -33,3 +33,9 @@ Template.hs:21:3: warning: [-Wnoncanonical-monoid-instances (in -Wcompat)] Noncanonical ‘mappend’ definition detected in the instance declaration for ‘Monoid S’. Define as ‘mappend = (<>)’ + +Template.hs:25:15: warning: [-Wstar-is-type (in -Wcompat)] + Using ‘*’ (or its Unicode variant) to mean ‘Data.Kind.Type’ + relies on the StarIsType extension, which will become + deprecated in the future. + Suggested fix: use ‘Type’ from ‘Data.Kind’ instead. From git at git.haskell.org Fri Oct 12 18:14:43 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 12 Oct 2018 18:14:43 +0000 (UTC) Subject: [commit: ghc] master: Fix dataToTag# comment syntax again (primops.txt.pp) (fc4c3df) Message-ID: <20181012181443.D93723ABC1@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/fc4c3df046d7059f67c064dc755e9e40961c80f6/ghc >--------------------------------------------------------------- commit fc4c3df046d7059f67c064dc755e9e40961c80f6 Author: Ömer Sinan Ağacan Date: Fri Oct 12 20:49:50 2018 +0300 Fix dataToTag# comment syntax again (primops.txt.pp) >--------------------------------------------------------------- fc4c3df046d7059f67c064dc755e9e40961c80f6 compiler/prelude/primops.txt.pp | 105 ++++++++++++++++++++-------------------- 1 file changed, 52 insertions(+), 53 deletions(-) diff --git a/compiler/prelude/primops.txt.pp b/compiler/prelude/primops.txt.pp index 8b327dd..1d879c4 100644 --- a/compiler/prelude/primops.txt.pp +++ b/compiler/prelude/primops.txt.pp @@ -2992,59 +2992,58 @@ primop DataToTagOp "dataToTag#" GenPrimOp primop TagToEnumOp "tagToEnum#" GenPrimOp Int# -> a -{- Note [dataToTag#] -~~~~~~~~~~~~~~~~~~~~ -The primop dataToTag# is unusual because it evaluates its argument. -Only `SeqOp` shares that property. (Other primops do not do anything -as fancy as argument evaluation.) The special handling for dataToTag# -is: - -* CoreUtils.exprOkForSpeculation has a special case for DataToTagOp, - (actually in app_ok). Most primops with lifted arguments do not - evaluate those arguments, but DataToTagOp and SeqOp are two - exceptions. We say that they are /never/ ok-for-speculation, - regardless of the evaluated-ness of their argument. - See CoreUtils Note [PrimOps that evaluate their arguments] - -* There is a special case for DataToTagOp in StgCmmExpr.cgExpr, - that evaluates its argument and then extracts the tag from - the returned value. - -* An application like (dataToTag# (Just x)) is optimised by - dataToTagRule in PrelRules. - -* A case expression like - case (dataToTag# e) of - gets transformed t - case e of - by PrelRules.caseRules; see Note [caseRules for dataToTag] - -See Trac #15696 for a long saga. - -Note [dataToTag# hack] -~~~~~~~~~~~~~~~~~~~~~~ -(This a temporary hack: see Trac #15696 commment:60.) - -dataToTag# evaluates its argument, so we don't want to float it out. -Consider: - - \z. case x of y -> let v = dataToTag# y in ... - -To improve floating, the FloatOut pass (deliberately) does a -binder-swap on the case, to give - - \z. case x of y -> let v = dataToTag# x in ... - -Now FloatOut might float that v-binding outside the \z - - let v = dataToTag# x in \z. case x of y -> ... - -But that is bad because that might mean x gets evaluated much too early! - -Solution: make dataToTag# into a can_fail primop. That will stop it floating -(see Note [PrimOp can_fail and has_side_effects] in PrimOp). It's a bit of -a hack but never mind. --} +-- Note [dataToTag#] +-- ~~~~~~~~~~~~~~~~~ +-- The primop dataToTag# is unusual because it evaluates its argument. +-- Only `SeqOp` shares that property. (Other primops do not do anything +-- as fancy as argument evaluation.) The special handling for dataToTag# +-- is: +-- +-- * CoreUtils.exprOkForSpeculation has a special case for DataToTagOp, +-- (actually in app_ok). Most primops with lifted arguments do not +-- evaluate those arguments, but DataToTagOp and SeqOp are two +-- exceptions. We say that they are /never/ ok-for-speculation, +-- regardless of the evaluated-ness of their argument. +-- See CoreUtils Note [PrimOps that evaluate their arguments] +-- +-- * There is a special case for DataToTagOp in StgCmmExpr.cgExpr, +-- that evaluates its argument and then extracts the tag from +-- the returned value. +-- +-- * An application like (dataToTag# (Just x)) is optimised by +-- dataToTagRule in PrelRules. +-- +-- * A case expression like +-- case (dataToTag# e) of +-- gets transformed t +-- case e of +-- by PrelRules.caseRules; see Note [caseRules for dataToTag] +-- +-- See Trac #15696 for a long saga. +-- +-- Note [dataToTag# hack] +-- ~~~~~~~~~~~~~~~~~~~~~~ +-- (This a temporary hack: see Trac #15696 commment:60.) +-- +-- dataToTag# evaluates its argument, so we don't want to float it out. +-- Consider: +-- +-- \z. case x of y -> let v = dataToTag# y in ... +-- +-- To improve floating, the FloatOut pass (deliberately) does a +-- binder-swap on the case, to give +-- +-- \z. case x of y -> let v = dataToTag# x in ... +-- +-- Now FloatOut might float that v-binding outside the \z +-- +-- let v = dataToTag# x in \z. case x of y -> ... +-- +-- But that is bad because that might mean x gets evaluated much too early! +-- +-- Solution: make dataToTag# into a can_fail primop. That will stop it floating +-- (see Note [PrimOp can_fail and has_side_effects] in PrimOp). It's a bit of +-- a hack but never mind. ------------------------------------------------------------------------ section "Bytecode operations" From git at git.haskell.org Sat Oct 13 17:17:30 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 13 Oct 2018 17:17:30 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: Don't show constraint tuples in errors (#14907) (87266ea) Message-ID: <20181013171730.C33363ABA8@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/87266ea717de2df11d7b491bf3c525b7c1a1a47a/ghc >--------------------------------------------------------------- commit 87266ea717de2df11d7b491bf3c525b7c1a1a47a Author: Alec Theriault Date: Tue Sep 25 11:58:12 2018 +0200 Don't show constraint tuples in errors (#14907) Summary: This means that 'GHC.Classes.(%,%)' is no longer mentioned in error messages for things like class (a,b,c) -- outside of 'GHC.Classes' class (a,Bool) Test Plan: make TEST=T14907a && make TEST=T14907b Reviewers: RyanGlScott, bgamari Reviewed By: RyanGlScott Subscribers: rwbarton, carter GHC Trac Issues: #14907 Differential Revision: https://phabricator.haskell.org/D5172 (cherry picked from commit 9bfbc4e16d511678cffa9f7f76b369c8cfca7a66) >--------------------------------------------------------------- 87266ea717de2df11d7b491bf3c525b7c1a1a47a compiler/parser/RdrHsSyn.hs | 22 +++++++++++++++++++--- compiler/prelude/TysWiredIn.hs | 14 ++++++++++++++ compiler/rename/RnEnv.hs | 4 ++-- testsuite/tests/rename/should_fail/T14907a.hs | 3 +++ testsuite/tests/rename/should_fail/T14907a.stderr | 6 ++++++ testsuite/tests/rename/should_fail/T14907b.hs | 7 +++++++ testsuite/tests/rename/should_fail/T14907b.stderr | 6 ++++++ testsuite/tests/rename/should_fail/all.T | 2 ++ 8 files changed, 59 insertions(+), 5 deletions(-) diff --git a/compiler/parser/RdrHsSyn.hs b/compiler/parser/RdrHsSyn.hs index 1ffde22..572636b 100644 --- a/compiler/parser/RdrHsSyn.hs +++ b/compiler/parser/RdrHsSyn.hs @@ -25,6 +25,7 @@ module RdrHsSyn ( mkTyClD, mkInstD, mkRdrRecordCon, mkRdrRecordUpd, setRdrNameSpace, + filterCTuple, cvBindGroup, cvBindsAndSigs, @@ -92,7 +93,8 @@ import Lexeme ( isLexCon ) import Type ( TyThing(..) ) import TysWiredIn ( cTupleTyConName, tupleTyCon, tupleDataCon, nilDataConName, nilDataConKey, - listTyConName, listTyConKey ) + listTyConName, listTyConKey, + cTupleTyConNameArity_maybe ) import ForeignCall import PrelNames ( forall_tv_RDR, eqTyCon_RDR, allNameStrings ) import SrcLoc @@ -766,6 +768,13 @@ data_con_ty_con dc | otherwise -- See Note [setRdrNameSpace for wired-in names] = Unqual (setOccNameSpace tcClsName (getOccName dc)) +-- | Replaces constraint tuple names with corresponding boxed ones. +filterCTuple :: RdrName -> RdrName +filterCTuple (Exact n) + | Just arity <- cTupleTyConNameArity_maybe n + = Exact $ tupleTyConName BoxedTuple arity +filterCTuple rdr = rdr + {- Note [setRdrNameSpace for wired-in names] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -810,12 +819,19 @@ checkTyVars pp_what equals_or_where tc tparms chk t@(L loc _) = Left (loc, vcat [ text "Unexpected type" <+> quotes (ppr t) - , text "In the" <+> pp_what <+> ptext (sLit "declaration for") <+> quotes (ppr tc) + , text "In the" <+> pp_what <+> ptext (sLit "declaration for") <+> quotes tc' , vcat[ (text "A" <+> pp_what <+> ptext (sLit "declaration should have form")) - , nest 2 (pp_what <+> ppr tc + , nest 2 (pp_what <+> tc' <+> hsep (map text (takeList tparms allNameStrings)) <+> equals_or_where) ] ]) + -- Avoid printing a constraint tuple in the error message. Print + -- a plain old tuple instead (since that's what the user probably + -- wrote). See #14907 + tc' = ppr $ fmap filterCTuple tc + + + whereDots, equalsDots :: SDoc -- Second argument to checkTyVars whereDots = text "where ..." diff --git a/compiler/prelude/TysWiredIn.hs b/compiler/prelude/TysWiredIn.hs index b96581e..c2e2a37 100644 --- a/compiler/prelude/TysWiredIn.hs +++ b/compiler/prelude/TysWiredIn.hs @@ -80,6 +80,7 @@ module TysWiredIn ( -- ** Constraint tuples cTupleTyConName, cTupleTyConNames, isCTupleTyConName, + cTupleTyConNameArity_maybe, cTupleDataConName, cTupleDataConNames, -- * Any @@ -159,6 +160,8 @@ import BooleanFormula ( mkAnd ) import qualified Data.ByteString.Char8 as BS +import Data.List ( elemIndex ) + alpha_tyvar :: [TyVar] alpha_tyvar = [alphaTyVar] @@ -765,6 +768,17 @@ isCTupleTyConName n nameModule n == gHC_CLASSES && n `elemNameSet` cTupleTyConNameSet +-- | If the given name is that of a constraint tuple, return its arity. +-- Note that this is inefficient. +cTupleTyConNameArity_maybe :: Name -> Maybe Arity +cTupleTyConNameArity_maybe n + | not (isCTupleTyConName n) = Nothing + | otherwise = fmap adjustArity (n `elemIndex` cTupleTyConNames) + where + -- Since `cTupleTyConNames` jumps straight from the `0` to the `2` + -- case, we have to adjust accordingly our calculated arity. + adjustArity a = if a > 0 then a + 1 else a + cTupleDataConName :: Arity -> Name cTupleDataConName arity = mkExternalName (mkCTupleDataConUnique arity) gHC_CLASSES diff --git a/compiler/rename/RnEnv.hs b/compiler/rename/RnEnv.hs index 16897c2..516c43c 100644 --- a/compiler/rename/RnEnv.hs +++ b/compiler/rename/RnEnv.hs @@ -53,7 +53,7 @@ import RdrName import HscTypes import TcEnv import TcRnMonad -import RdrHsSyn ( setRdrNameSpace ) +import RdrHsSyn ( filterCTuple, setRdrNameSpace ) import TysWiredIn import Name import NameSet @@ -1653,4 +1653,4 @@ badOrigBinding name -- -- (See Trac #13968.) where - occ = rdrNameOcc name + occ = rdrNameOcc $ filterCTuple name diff --git a/testsuite/tests/rename/should_fail/T14907a.hs b/testsuite/tests/rename/should_fail/T14907a.hs new file mode 100644 index 0000000..d68e706 --- /dev/null +++ b/testsuite/tests/rename/should_fail/T14907a.hs @@ -0,0 +1,3 @@ +module T14907a where + +class (Bool, a, b) diff --git a/testsuite/tests/rename/should_fail/T14907a.stderr b/testsuite/tests/rename/should_fail/T14907a.stderr new file mode 100644 index 0000000..26ce914 --- /dev/null +++ b/testsuite/tests/rename/should_fail/T14907a.stderr @@ -0,0 +1,6 @@ + +T14907a.hs:3:8: error: + Unexpected type ‘Bool’ + In the class declaration for ‘(,,)’ + A class declaration should have form + class (,,) a b c where ... diff --git a/testsuite/tests/rename/should_fail/T14907b.hs b/testsuite/tests/rename/should_fail/T14907b.hs new file mode 100644 index 0000000..4cd4f28 --- /dev/null +++ b/testsuite/tests/rename/should_fail/T14907b.hs @@ -0,0 +1,7 @@ +module T14907b where + +-- This is effectively trying to redefine the constraint tuples already +-- defined in 'GHC.Classes'. +class () +class (a,b) +class (a,b,c) diff --git a/testsuite/tests/rename/should_fail/T14907b.stderr b/testsuite/tests/rename/should_fail/T14907b.stderr new file mode 100644 index 0000000..b76cc11 --- /dev/null +++ b/testsuite/tests/rename/should_fail/T14907b.stderr @@ -0,0 +1,6 @@ + +T14907b.hs:5:1: error: Illegal binding of built-in syntax: () + +T14907b.hs:6:1: error: Illegal binding of built-in syntax: (,) + +T14907b.hs:7:1: error: Illegal binding of built-in syntax: (,,) diff --git a/testsuite/tests/rename/should_fail/all.T b/testsuite/tests/rename/should_fail/all.T index 413b24f..ab16ac3 100644 --- a/testsuite/tests/rename/should_fail/all.T +++ b/testsuite/tests/rename/should_fail/all.T @@ -130,4 +130,6 @@ test('T13947', normal, compile_fail, ['']) test('T13847', normal, multimod_compile_fail, ['T13847','-v0']) test('T14307', normal, compile_fail, ['']) test('T14591', normal, compile_fail, ['']) +test('T14907a', normal, compile_fail, ['']) +test('T14907b', normal, compile_fail, ['']) test('T15214', normal, compile_fail, ['']) From git at git.haskell.org Sat Oct 13 17:17:41 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 13 Oct 2018 17:17:41 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: testsuite: Add test for #15053 (377975e) Message-ID: <20181013171741.D177F3ABA8@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/377975e0609a52c1ac008f03df06d8d5193234b2/ghc >--------------------------------------------------------------- commit 377975e0609a52c1ac008f03df06d8d5193234b2 Author: Ben Gamari Date: Fri Jul 6 11:01:38 2018 -0400 testsuite: Add test for #15053 Reviewers: Phyx Reviewed By: Phyx Subscribers: Phyx, rwbarton, thomie, carter GHC Trac Issues: #15053 Differential Revision: https://phabricator.haskell.org/D4883 (cherry picked from commit f03f0d61bebe287e0df0254c175eb2f183d697aa) >--------------------------------------------------------------- 377975e0609a52c1ac008f03df06d8d5193234b2 testsuite/tests/parser/should_fail/T15053.hs | 3 +++ testsuite/tests/parser/should_fail/all.T | 1 + 2 files changed, 4 insertions(+) diff --git a/testsuite/tests/parser/should_fail/T15053.hs b/testsuite/tests/parser/should_fail/T15053.hs new file mode 100644 index 0000000..44154a4 --- /dev/null +++ b/testsuite/tests/parser/should_fail/T15053.hs @@ -0,0 +1,3 @@ +{-# OPTIONS_GHC -O1 } +" + #-} diff --git a/testsuite/tests/parser/should_fail/all.T b/testsuite/tests/parser/should_fail/all.T index 1e71e40..93d0e0a 100644 --- a/testsuite/tests/parser/should_fail/all.T +++ b/testsuite/tests/parser/should_fail/all.T @@ -125,3 +125,4 @@ test('typeops_A', normal, compile_fail, ['']) test('typeops_B', normal, compile_fail, ['']) test('typeops_C', normal, compile_fail, ['']) test('typeops_D', normal, compile_fail, ['']) +test('T15053', expect_broken(15053), compile_fail, ['']) # shouldn't panic From git at git.haskell.org Sat Oct 13 17:17:53 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 13 Oct 2018 17:17:53 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: Compiler panic on invalid syntax (unterminated pragma) (5230477) Message-ID: <20181013171753.5A54E3ABA8@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/523047768913836177f49768d1070996ebabf242/ghc >--------------------------------------------------------------- commit 523047768913836177f49768d1070996ebabf242 Author: roland Date: Tue Sep 4 14:09:20 2018 +0200 Compiler panic on invalid syntax (unterminated pragma) Summary: After a parse error in OPTIONS_GHC issue an error message instead of a compiler panic. Test Plan: make test TEST=T15053 Reviewers: Phyx, thomie, bgamari, monoidal, osa1 Reviewed By: Phyx, monoidal, osa1 Subscribers: tdammers, osa1, rwbarton, carter GHC Trac Issues: #15053 Differential Revision: https://phabricator.haskell.org/D5093 (cherry picked from commit df363a646b66f4dd13d63ec70f18e427cabc8878) >--------------------------------------------------------------- 523047768913836177f49768d1070996ebabf242 compiler/main/HeaderInfo.hs | 22 ++++++++++++++++------ testsuite/tests/parser/should_fail/T15053.stderr | 5 +++++ testsuite/tests/parser/should_fail/all.T | 2 +- 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/compiler/main/HeaderInfo.hs b/compiler/main/HeaderInfo.hs index 76f67b2..127cc6d 100644 --- a/compiler/main/HeaderInfo.hs +++ b/compiler/main/HeaderInfo.hs @@ -244,7 +244,8 @@ getOptions' dflags toks | IToptions_prag str <- getToken open , ITclose_prag <- getToken close = case toArgs str of - Left err -> panic ("getOptions'.parseToks: " ++ err) + Left _err -> optionsParseError str dflags $ -- #15053 + combineSrcSpans (getLoc open) (getLoc close) Right args -> map (L (getLoc open)) args ++ parseToks xs parseToks (open:close:xs) | ITinclude_prag str <- getToken open @@ -314,17 +315,15 @@ checkExtension dflags (L l ext) languagePragParseError :: DynFlags -> SrcSpan -> a languagePragParseError dflags loc = - throw $ mkSrcErr $ unitBag $ - (mkPlainErrMsg dflags loc $ + throwErr dflags loc $ vcat [ text "Cannot parse LANGUAGE pragma" , text "Expecting comma-separated list of language options," , text "each starting with a capital letter" - , nest 2 (text "E.g. {-# LANGUAGE TemplateHaskell, GADTs #-}") ]) + , nest 2 (text "E.g. {-# LANGUAGE TemplateHaskell, GADTs #-}") ] unsupportedExtnError :: DynFlags -> SrcSpan -> String -> a unsupportedExtnError dflags loc unsup = - throw $ mkSrcErr $ unitBag $ - mkPlainErrMsg dflags loc $ + throwErr dflags loc $ text "Unsupported extension: " <> text unsup $$ if null suggestions then Outputable.empty else text "Perhaps you meant" <+> quotedListWithOr (map text suggestions) where @@ -340,3 +339,14 @@ optionsErrorMsgs dflags unhandled_flags flags_lines _filename ErrUtils.mkPlainErrMsg dflags flagSpan $ text "unknown flag in {-# OPTIONS_GHC #-} pragma:" <+> text flag +optionsParseError :: String -> DynFlags -> SrcSpan -> a -- #15053 +optionsParseError str dflags loc = + throwErr dflags loc $ + vcat [ text "Error while parsing OPTIONS_GHC pragma." + , text "Expecting whitespace-separated list of GHC options." + , text " E.g. {-# OPTIONS_GHC -Wall -O2 #-}" + , text ("Input was: " ++ show str) ] + +throwErr :: DynFlags -> SrcSpan -> SDoc -> a -- #15053 +throwErr dflags loc doc = + throw $ mkSrcErr $ unitBag $ mkPlainErrMsg dflags loc doc diff --git a/testsuite/tests/parser/should_fail/T15053.stderr b/testsuite/tests/parser/should_fail/T15053.stderr new file mode 100644 index 0000000..0544327 --- /dev/null +++ b/testsuite/tests/parser/should_fail/T15053.stderr @@ -0,0 +1,5 @@ +T15053.hs:1:16: + Error while parsing OPTIONS_GHC pragma. + Expecting whitespace-separated list of GHC options. + E.g. {-# OPTIONS_GHC -Wall -O2 #-} + Input was: " -O1 }/n/"/n " diff --git a/testsuite/tests/parser/should_fail/all.T b/testsuite/tests/parser/should_fail/all.T index 93d0e0a..cf1202f 100644 --- a/testsuite/tests/parser/should_fail/all.T +++ b/testsuite/tests/parser/should_fail/all.T @@ -125,4 +125,4 @@ test('typeops_A', normal, compile_fail, ['']) test('typeops_B', normal, compile_fail, ['']) test('typeops_C', normal, compile_fail, ['']) test('typeops_D', normal, compile_fail, ['']) -test('T15053', expect_broken(15053), compile_fail, ['']) # shouldn't panic +test('T15053', normal, compile_fail, ['']) From git at git.haskell.org Sat Oct 13 17:18:04 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 13 Oct 2018 17:18:04 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: Fix slop zeroing for AP_STACK eager blackholes in debug build (10e3125) Message-ID: <20181013171804.1A6C93ABA8@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/10e3125d4f6ea0684cbe1315b35a2a213d2765cd/ghc >--------------------------------------------------------------- commit 10e3125d4f6ea0684cbe1315b35a2a213d2765cd Author: Ömer Sinan Ağacan Date: Fri Sep 21 09:33:38 2018 +0300 Fix slop zeroing for AP_STACK eager blackholes in debug build As #15571 reports, eager blackholing breaks sanity checks as we can't zero the payload when eagerly blackholing (because we'll be using the payload after blackholing), but by the time we blackhole a previously eagerly blackholed object (in `threadPaused()`) we don't have the correct size information for the object (because the object's type becomes BLACKHOLE when we eagerly blackhole it) so can't properly zero the slop. This problem can be solved for AP_STACK eager blackholing (which unlike eager blackholing in general, is not optional) by zeroing the payload after entering the stack. This patch implements this idea. Fixes #15571. Test Plan: Previously concprog001 when compiled and run with sanity checks ghc-stage2 Mult.hs -debug -rtsopts ./Mult +RTS -DS was failing with Mult: internal error: checkClosure: stack frame (GHC version 8.7.20180821 for x86_64_unknown_linux) Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug thic patch fixes this panic. The test still panics, but it runs for a while before panicking (instead of directly panicking as before), and the new problem seems unrelated: Mult: internal error: ASSERTION FAILED: file rts/sm/Sanity.c, line 296 (GHC version 8.7.20180919 for x86_64_unknown_linux) Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug The new problem will be fixed in another diff. I also tried slow validate (which requires D5164): this does not introduce any new failures. Reviewers: simonmar, bgamari, erikd Reviewed By: simonmar Subscribers: rwbarton, carter GHC Trac Issues: #15571 Differential Revision: https://phabricator.haskell.org/D5165 (cherry picked from commit 66c17293648fd03a04aabfd807b3c8336e8f843a) >--------------------------------------------------------------- 10e3125d4f6ea0684cbe1315b35a2a213d2765cd includes/Cmm.h | 5 ++-- includes/rts/storage/ClosureMacros.h | 47 +++++++++++++++--------------------- rts/Apply.cmm | 5 ++++ 3 files changed, 28 insertions(+), 29 deletions(-) diff --git a/includes/Cmm.h b/includes/Cmm.h index 059220a..7334eab 100644 --- a/includes/Cmm.h +++ b/includes/Cmm.h @@ -617,10 +617,11 @@ #define mutArrPtrsCardWords(n) ROUNDUP_BYTES_TO_WDS(mutArrPtrCardUp(n)) #if defined(PROFILING) || (!defined(THREADED_RTS) && defined(DEBUG)) +#define OVERWRITING_CLOSURE_SIZE(c, size) foreign "C" overwritingClosureSize(c "ptr", size) #define OVERWRITING_CLOSURE(c) foreign "C" overwritingClosure(c "ptr") -#define OVERWRITING_CLOSURE_OFS(c,n) \ - foreign "C" overwritingClosureOfs(c "ptr", n) +#define OVERWRITING_CLOSURE_OFS(c,n) foreign "C" overwritingClosureOfs(c "ptr", n) #else +#define OVERWRITING_CLOSURE_SIZE(c, size) /* nothing */ #define OVERWRITING_CLOSURE(c) /* nothing */ #define OVERWRITING_CLOSURE_OFS(c,n) /* nothing */ #endif diff --git a/includes/rts/storage/ClosureMacros.h b/includes/rts/storage/ClosureMacros.h index 71d53ae..e52059e 100644 --- a/includes/rts/storage/ClosureMacros.h +++ b/includes/rts/storage/ClosureMacros.h @@ -530,8 +530,7 @@ INLINE_HEADER StgWord8 *mutArrPtrsCard (StgMutArrPtrs *a, W_ n) #if ZERO_SLOP_FOR_LDV_PROF || ZERO_SLOP_FOR_SANITY_CHECK #define OVERWRITING_CLOSURE(c) overwritingClosure(c) -#define OVERWRITING_CLOSURE_OFS(c,n) \ - overwritingClosureOfs(c,n) +#define OVERWRITING_CLOSURE_OFS(c,n) overwritingClosureOfs(c,n) #else #define OVERWRITING_CLOSURE(c) /* nothing */ #define OVERWRITING_CLOSURE_OFS(c,n) /* nothing */ @@ -541,28 +540,32 @@ INLINE_HEADER StgWord8 *mutArrPtrsCard (StgMutArrPtrs *a, W_ n) void LDV_recordDead (const StgClosure *c, uint32_t size); #endif -EXTERN_INLINE void overwritingClosure (StgClosure *p); -EXTERN_INLINE void overwritingClosure (StgClosure *p) +EXTERN_INLINE void overwritingClosure_ (StgClosure *p, + uint32_t offset /* in words */, + uint32_t size /* closure size, in words */); +EXTERN_INLINE void overwritingClosure_ (StgClosure *p, uint32_t offset, uint32_t size) { - uint32_t size, i; - #if ZERO_SLOP_FOR_LDV_PROF && !ZERO_SLOP_FOR_SANITY_CHECK // see Note [zeroing slop], also #8402 if (era <= 0) return; #endif - size = closure_sizeW(p); - // For LDV profiling, we need to record the closure as dead #if defined(PROFILING) LDV_recordDead(p, size); #endif - for (i = 0; i < size - sizeofW(StgThunkHeader); i++) { - ((StgThunk *)(p))->payload[i] = 0; + for (uint32_t i = offset; i < size; i++) { + ((StgWord *)p)[i] = 0; } } +EXTERN_INLINE void overwritingClosure (StgClosure *p); +EXTERN_INLINE void overwritingClosure (StgClosure *p) +{ + overwritingClosure_(p, sizeofW(StgThunkHeader), closure_sizeW(p)); +} + // Version of 'overwritingClosure' which overwrites only a suffix of a // closure. The offset is expressed in words relative to 'p' and shall // be less than or equal to closure_sizeW(p), and usually at least as @@ -573,22 +576,12 @@ EXTERN_INLINE void overwritingClosure (StgClosure *p) EXTERN_INLINE void overwritingClosureOfs (StgClosure *p, uint32_t offset); EXTERN_INLINE void overwritingClosureOfs (StgClosure *p, uint32_t offset) { - uint32_t size, i; - -#if ZERO_SLOP_FOR_LDV_PROF && !ZERO_SLOP_FOR_SANITY_CHECK - // see Note [zeroing slop], also #8402 - if (era <= 0) return; -#endif - - size = closure_sizeW(p); - - ASSERT(offset <= size); - - // For LDV profiling, we need to record the closure as dead -#if defined(PROFILING) - LDV_recordDead(p, size); -#endif + overwritingClosure_(p, offset, closure_sizeW(p)); +} - for (i = offset; i < size; i++) - ((StgWord *)p)[i] = 0; +// Version of 'overwritingClosure' which takes closure size as argument. +EXTERN_INLINE void overwritingClosureSize (StgClosure *p, uint32_t size /* in words */); +EXTERN_INLINE void overwritingClosureSize (StgClosure *p, uint32_t size) +{ + overwritingClosure_(p, sizeofW(StgThunkHeader), size); } diff --git a/rts/Apply.cmm b/rts/Apply.cmm index 15d8250..40f890d 100644 --- a/rts/Apply.cmm +++ b/rts/Apply.cmm @@ -679,6 +679,11 @@ for: R1 = StgAP_STACK_fun(ap); + // Because of eager blackholing the closure no longer has correct size so + // threadPaused() can't correctly zero the slop, so we do it here. See #15571 + // and Note [zeroing slop]. + OVERWRITING_CLOSURE_SIZE(ap, BYTES_TO_WDS(SIZEOF_StgThunkHeader) + 2 + Words); + ENTER_R1(); } From git at git.haskell.org Sat Oct 13 17:18:14 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 13 Oct 2018 17:18:14 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: Add -Wstar-is-type to the User's Guide (4ab2f34) Message-ID: <20181013171814.B333C3ABA8@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/4ab2f347b76d65a405959fb01a058a45e791c41b/ghc >--------------------------------------------------------------- commit 4ab2f347b76d65a405959fb01a058a45e791c41b Author: Vladislav Zavialov Date: Thu Oct 4 13:43:47 2018 -0400 Add -Wstar-is-type to the User's Guide The -Wstar-is-type flag was added without documentation. Now it has documentation. Test Plan: Validate Reviewers: bgamari Reviewed By: bgamari Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5203 (cherry picked from commit 07083fc44ebf3f0510ae1d71ae5c9c88c87ae1d8) >--------------------------------------------------------------- 4ab2f347b76d65a405959fb01a058a45e791c41b docs/users_guide/using-warnings.rst | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/docs/users_guide/using-warnings.rst b/docs/users_guide/using-warnings.rst index 2643f8f..d2a39df 100644 --- a/docs/users_guide/using-warnings.rst +++ b/docs/users_guide/using-warnings.rst @@ -34,6 +34,7 @@ generally likely to indicate bugs in your program. These are: * :ghc-flag:`-Wtabs` * :ghc-flag:`-Wunrecognised-warning-flags` * :ghc-flag:`-Winaccessible-code` + * :ghc-flag:`-Wstar-is-type` * :ghc-flag:`-Wstar-binder` The following flags are simple ways to select standard "packages" of warnings: @@ -1188,6 +1189,24 @@ of ``-W(no-)*``. since we're passing ``Foo1`` and ``Foo2`` here, it follows that ``t ~ Char``, and ``u ~ Int``, and thus ``t ~ u`` cannot hold. +.. ghc-flag:: -Wstar-is-type + :shortdesc: warn when ``*`` is used to mean ``Data.Kind.Type`` + :type: dynamic + :reverse: -Wno-star-is-type + :category: + + :since: 8.6 + + The use of ``*`` to denote the kind of inhabited types relies on the + :extension:`StarIsType` extension, which in a future release will be + turned off by default and then possibly removed. The reasons for this and + the deprecation schedule are described in `GHC proposal #30 + `__. + + This warning allows to detect such uses of ``*`` before the actual + breaking change takes place. The recommended fix is to replace ``*`` with + ``Type`` imported from ``Data.Kind``. + .. ghc-flag:: -Wstar-binder :shortdesc: warn about binding the ``(*)`` type operator despite :ghc-flag:`-XStarIsType` From git at git.haskell.org Sat Oct 13 17:18:26 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 13 Oct 2018 17:18:26 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: GHCi should not filter instances involving cTuples (51c4479) Message-ID: <20181013171826.5874B3ABA8@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/51c447936ef3f2f3f67c54d2dd62de537f443e89/ghc >--------------------------------------------------------------- commit 51c447936ef3f2f3f67c54d2dd62de537f443e89 Author: Alec Theriault Date: Tue Oct 2 14:48:00 2018 +0200 GHCi should not filter instances involving cTuples Summary: See the new T12005 test case for an example of this. Test Plan: make TEST=T12005 Reviewers: bgamari, osa1 Reviewed By: osa1 Subscribers: osa1, rwbarton, carter GHC Trac Issues: #12005 Differential Revision: https://phabricator.haskell.org/D5182 (cherry picked from commit 21efbc7599e39ec93b8b13b7d7b84811226e6f6f) >--------------------------------------------------------------- 51c447936ef3f2f3f67c54d2dd62de537f443e89 compiler/main/InteractiveEval.hs | 2 ++ compiler/parser/RdrHsSyn.hs | 3 ++- testsuite/tests/ghci/scripts/T12005.script | 8 ++++++++ testsuite/tests/ghci/scripts/T12005.stdout | 6 ++++++ testsuite/tests/ghci/scripts/all.T | 1 + 5 files changed, 19 insertions(+), 1 deletion(-) diff --git a/compiler/main/InteractiveEval.hs b/compiler/main/InteractiveEval.hs index cdca053..a808439 100644 --- a/compiler/main/InteractiveEval.hs +++ b/compiler/main/InteractiveEval.hs @@ -76,6 +76,7 @@ import UniqSupply import MonadUtils import Module import PrelNames ( toDynName, pretendNameIsInScope ) +import TysWiredIn ( isCTupleTyConName ) import Panic import Maybes import ErrUtils @@ -758,6 +759,7 @@ getInfo allInfo name -- The one we looked for in the first place! | pretendNameIsInScope n = True | isBuiltInSyntax n = True + | isCTupleTyConName n = True | isExternalName n = isJust (lookupGRE_Name rdr_env n) | otherwise = True diff --git a/compiler/parser/RdrHsSyn.hs b/compiler/parser/RdrHsSyn.hs index 572636b..cad6b60 100644 --- a/compiler/parser/RdrHsSyn.hs +++ b/compiler/parser/RdrHsSyn.hs @@ -91,7 +91,8 @@ import TcEvidence ( idHsWrapper ) import Lexer import Lexeme ( isLexCon ) import Type ( TyThing(..) ) -import TysWiredIn ( cTupleTyConName, tupleTyCon, tupleDataCon, +import TysWiredIn ( cTupleTyConName, tupleTyConName, tupleTyCon, + tupleDataCon, nilDataConName, nilDataConKey, listTyConName, listTyConKey, cTupleTyConNameArity_maybe ) diff --git a/testsuite/tests/ghci/scripts/T12005.script b/testsuite/tests/ghci/scripts/T12005.script new file mode 100644 index 0000000..a86e7d5 --- /dev/null +++ b/testsuite/tests/ghci/scripts/T12005.script @@ -0,0 +1,8 @@ +:set -XKindSignatures -XRank2Types -XConstraintKinds -XAllowAmbiguousTypes -XInstanceSigs + +import Data.Kind + +class Defer (p :: Constraint) where defer :: (p => r) -> r +instance Defer () where defer :: r -> r; defer = id + +:i Defer diff --git a/testsuite/tests/ghci/scripts/T12005.stdout b/testsuite/tests/ghci/scripts/T12005.stdout new file mode 100644 index 0000000..34cde4a --- /dev/null +++ b/testsuite/tests/ghci/scripts/T12005.stdout @@ -0,0 +1,6 @@ +class Defer (p :: Constraint) where + defer :: (p => r) -> r + {-# MINIMAL defer #-} + -- Defined at :5:1 +instance [safe] Defer (() :: Constraint) + -- Defined at :6:10 diff --git a/testsuite/tests/ghci/scripts/all.T b/testsuite/tests/ghci/scripts/all.T index 8954594..c0cceca 100755 --- a/testsuite/tests/ghci/scripts/all.T +++ b/testsuite/tests/ghci/scripts/all.T @@ -240,6 +240,7 @@ test('T12007', normal, ghci_script, ['T12007.script']) test('T11975', normal, ghci_script, ['T11975.script']) test('T10963', normal, ghci_script, ['T10963.script']) test('T11721', normal, ghci_script, ['T11721.script']) +test('T12005', normal, ghci_script, ['T12005.script']) test('T12023', normal, run_command, ['$MAKE -s --no-print-directory T12023']) test('T12520', normal, ghci_script, ['T12520.script']) From git at git.haskell.org Sat Oct 13 19:11:15 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 13 Oct 2018 19:11:15 +0000 (UTC) Subject: [commit: ghc] ghc-8.4: Fix PrelRules.caseRules to account for out-of-range tags (2ca7ced) Message-ID: <20181013191115.B6DE13ABA8@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.4 Link : http://ghc.haskell.org/trac/ghc/changeset/2ca7ced93b41e98c2f0fbd8a4d958a1640432937/ghc >--------------------------------------------------------------- commit 2ca7ced93b41e98c2f0fbd8a4d958a1640432937 Author: Simon Peyton Jones Date: Wed Jul 25 16:41:16 2018 +0100 Fix PrelRules.caseRules to account for out-of-range tags As Trac #15436 points out, it is possible to get case dataToTag# (x :: T) of DEFAULT -> blah1 -1# -> blah2 0 -> blah3 The (-1#) alterantive is unreachable, because dataToTag# returns tags in the range [0..n-1] where n is the number of data constructors in type T. This actually made GHC crash; now we simply discard the unreachable alterantive. See Note [Unreachable caseRules alternatives] in PrelRules (cherry picked from commit 9897f6783a58265d5eaef5fb06f04320c7737e87) >--------------------------------------------------------------- 2ca7ced93b41e98c2f0fbd8a4d958a1640432937 compiler/prelude/PrelRules.hs | 64 +++++++++++++++------- compiler/prelude/primops.txt.pp | 2 +- compiler/simplCore/SimplUtils.hs | 33 +++++++---- testsuite/tests/simplCore/should_run/T15436.hs | 21 +++++++ testsuite/tests/simplCore/should_run/T15436.stdout | 1 + testsuite/tests/simplCore/should_run/all.T | 1 + 6 files changed, 90 insertions(+), 32 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 2ca7ced93b41e98c2f0fbd8a4d958a1640432937 From git at git.haskell.org Sat Oct 13 19:11:30 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 13 Oct 2018 19:11:30 +0000 (UTC) Subject: [commit: ghc] ghc-8.4: testsuite: Fix hashbangs (4bf6804) Message-ID: <20181013191130.D5E3D3ABA8@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.4 Link : http://ghc.haskell.org/trac/ghc/changeset/4bf6804e916396ed7168ec5d6b74d1d4527b9c8f/ghc >--------------------------------------------------------------- commit 4bf6804e916396ed7168ec5d6b74d1d4527b9c8f Author: Ben Gamari Date: Wed May 30 15:19:30 2018 -0400 testsuite: Fix hashbangs (cherry picked from commit 50301093515c97e9c9e7249367ec9c32b52d34b5) >--------------------------------------------------------------- 4bf6804e916396ed7168ec5d6b74d1d4527b9c8f testsuite/tests/perf/compiler/genMultiLayerModules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testsuite/tests/perf/compiler/genMultiLayerModules b/testsuite/tests/perf/compiler/genMultiLayerModules index b98c481..8220c08 100755 --- a/testsuite/tests/perf/compiler/genMultiLayerModules +++ b/testsuite/tests/perf/compiler/genMultiLayerModules @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Generate $DEPTH layers of modules with $WIDTH modules on each layer # Every module on layer N imports all the modules on layer N-1 # MultiLayerModules.hs imports all the modules from the last layer From git at git.haskell.org Sat Oct 13 19:11:44 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 13 Oct 2018 19:11:44 +0000 (UTC) Subject: [commit: ghc] ghc-8.4: testsuite: Use /usr/bin/env instead of /bin/bash (97f6de1) Message-ID: <20181013191144.5EB613ABA8@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.4 Link : http://ghc.haskell.org/trac/ghc/changeset/97f6de1225a87c9804d8ea0bf1c5533cc0600e6e/ghc >--------------------------------------------------------------- commit 97f6de1225a87c9804d8ea0bf1c5533cc0600e6e Author: Ben Gamari Date: Tue May 29 17:37:01 2018 -0400 testsuite: Use /usr/bin/env instead of /bin/bash Namely in T13719 and T13701. (cherry picked from commit 12458359c9312b0e2b7332a6b527d7dfa4325667) >--------------------------------------------------------------- 97f6de1225a87c9804d8ea0bf1c5533cc0600e6e testsuite/tests/perf/compiler/genT13701 | 3 ++- testsuite/tests/perf/compiler/genT13719 | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/testsuite/tests/perf/compiler/genT13701 b/testsuite/tests/perf/compiler/genT13701 index f2b7c4e..7401cdd 100755 --- a/testsuite/tests/perf/compiler/genT13701 +++ b/testsuite/tests/perf/compiler/genT13701 @@ -1,4 +1,5 @@ -#!/bin/bash +#!/usr/bin/env bash + # Generate $DEPTH layers of modules with $WIDTH modules on each layer # Every module on layer N imports all the modules on layer N-1 # MultiLayerModules.hs imports all the modules from the last layer diff --git a/testsuite/tests/perf/compiler/genT13719 b/testsuite/tests/perf/compiler/genT13719 index ccc078e..886fdd1 100755 --- a/testsuite/tests/perf/compiler/genT13719 +++ b/testsuite/tests/perf/compiler/genT13719 @@ -1,4 +1,5 @@ -#!/bin/bash +#!/usr/bin/env bash + # Generate $DEPTH layers of modules with $WIDTH modules on each layer # Every module on layer N imports all the modules on layer N-1 # $ROOT.hs imports all the modules from the last layer From git at git.haskell.org Sun Oct 14 06:13:16 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 14 Oct 2018 06:13:16 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: Fix for recover with -fexternal-interpreter (#15418) (a04ecd7) Message-ID: <20181014061316.157623ABA8@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/a04ecd7ba8c7f012369eeb5864b813a130e043e3/ghc >--------------------------------------------------------------- commit a04ecd7ba8c7f012369eeb5864b813a130e043e3 Author: Simon Marlow Date: Wed Sep 26 15:32:29 2018 -0500 Fix for recover with -fexternal-interpreter (#15418) Summary: When using -fexternal-interpreter, recover was not treating a Q compuation that simply registered an error with addErrTc as failing. Test Plan: New unit tests: * T15418 is the repro from in the ticket * TH_recover_warns is a new test to ensure that we're keeping warnings when the body of recover succeeds. Reviewers: bgamari, RyanGlScott, angerman, goldfire, erikd Subscribers: rwbarton, carter GHC Trac Issues: #15418 Differential Revision: https://phabricator.haskell.org/D5185 (cherry picked from commit d00c308633fe7d216d31a1087e00e63532d87d6d) >--------------------------------------------------------------- a04ecd7ba8c7f012369eeb5864b813a130e043e3 compiler/typecheck/TcSplice.hs | 28 +++++++++++++++++++--------- libraries/ghci/GHCi/Message.hs | 17 ++++++++++------- libraries/ghci/GHCi/TH.hs | 13 +++++++------ testsuite/tests/th/T15481.hs | 10 ++++++++++ testsuite/tests/th/T15481.stderr | 8 ++++++++ testsuite/tests/th/TH_recover_warns.hs | 10 ++++++++++ testsuite/tests/th/TH_recover_warns.stderr | 15 +++++++++++++++ testsuite/tests/th/all.T | 2 ++ 8 files changed, 81 insertions(+), 22 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc a04ecd7ba8c7f012369eeb5864b813a130e043e3 From git at git.haskell.org Sun Oct 14 06:13:19 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 14 Oct 2018 06:13:19 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: Do not mark CoVars as dead in the occur-anal (a22ee70) Message-ID: <20181014061319.4E5173ABA8@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/a22ee7050b610b862ebe1eb725e7aa141b766e05/ghc >--------------------------------------------------------------- commit a22ee7050b610b862ebe1eb725e7aa141b766e05 Author: Simon Peyton Jones Date: Wed Oct 3 15:41:43 2018 +0100 Do not mark CoVars as dead in the occur-anal For years we have been marking CoVars as dead, becuase we don't gather occurrence info from types. This is obviously wrong and caused Trac #15695. See Note [Do not mark CoVars as dead] in OccurAnal. (cherry picked from commit 02b303eed0170983921877801e57f55d012db301) >--------------------------------------------------------------- a22ee7050b610b862ebe1eb725e7aa141b766e05 compiler/simplCore/OccurAnal.hs | 23 ++++++++++++ testsuite/tests/patsyn/should_fail/T15695.hs | 48 ++++++++++++++++++++++++ testsuite/tests/patsyn/should_fail/T15695.stderr | 45 ++++++++++++++++++++++ testsuite/tests/patsyn/should_fail/all.T | 1 + 4 files changed, 117 insertions(+) diff --git a/compiler/simplCore/OccurAnal.hs b/compiler/simplCore/OccurAnal.hs index a8cfbc0..0d15b83 100644 --- a/compiler/simplCore/OccurAnal.hs +++ b/compiler/simplCore/OccurAnal.hs @@ -2498,6 +2498,10 @@ zapDetails = markAllMany . markAllNonTailCalled -- effectively sets to noOccInfo lookupDetails :: UsageDetails -> Id -> OccInfo lookupDetails ud id + | isCoVar id -- We do not currenly gather occurrence info (from types) + = noOccInfo -- for CoVars, so we must conservatively mark them as used + -- See Note [DoO not mark CoVars as dead] + | otherwise = case lookupVarEnv (ud_env ud) id of Just occ -> doZapping ud id occ Nothing -> IAmDead @@ -2509,6 +2513,25 @@ udFreeVars :: VarSet -> UsageDetails -> VarSet -- Find the subset of bndrs that are mentioned in uds udFreeVars bndrs ud = restrictUniqSetToUFM bndrs (ud_env ud) +{- Note [Do not mark CoVars as dead] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +It's obviously wrong to mark CoVars as dead if they are used. +Currently we don't traverse types to gather usase info for CoVars, +so we had better treat them as having noOccInfo. + +This showed up in Trac #15696 we had something like + case eq_sel d of co -> ...(typeError @(...co...) "urk")... + +Then 'd' was substitued by a dictionary, so the expression +simpified to + case (Coercion ) of co -> ...(typeError @(...co...) "urk")... + +But then the "drop the case altogether" equation of rebuildCase +thought that 'co' was dead, and discarded the entire case. Urk! + +I have no idea how we managed to avoid this pitfall for so long! +-} + ------------------- -- Auxiliary functions for UsageDetails implementation diff --git a/testsuite/tests/patsyn/should_fail/T15695.hs b/testsuite/tests/patsyn/should_fail/T15695.hs new file mode 100644 index 0000000..de8035c --- /dev/null +++ b/testsuite/tests/patsyn/should_fail/T15695.hs @@ -0,0 +1,48 @@ +{-# Language RankNTypes, PatternSynonyms, DataKinds, PolyKinds, GADTs, + TypeOperators, MultiParamTypeClasses, TypeFamilies, + TypeSynonymInstances, FlexibleInstances, InstanceSigs, FlexibleContexts #-} + +{-# Options_GHC -fdefer-type-errors #-} + +module T15695 where + +import Data.Kind +import Data.Type.Equality + +data TyVar :: Type -> Type -> Type where + VO :: TyVar (a -> as) a + VS :: TyVar as a -> TyVar (b -> as) a + +data NP :: (k -> Type) -> ([k] -> Type) where + Nil :: NP f '[] + (:*) :: f a -> NP f as -> NP f (a:as) + +data NS :: (k -> Type) -> ([k] -> Type) where + Here :: f a -> NS f (a:as) + There :: NS f as -> NS f (a:as) + +infixr 6 :&: +data Ctx :: Type -> Type where + E :: Ctx(Type) + (:&:) :: a -> Ctx(as) -> Ctx(a -> as) + +data NA a + +type SOP(kind::Type) code = NS (NP NA) code + +data ApplyT(kind::Type) :: kind -> Ctx(kind) -> Type where + AO :: a -> ApplyT(Type) a E + AS :: ApplyT(ks) (f a) ctx + -> ApplyT(k -> ks) f (a:&:ctx) + +from' :: ApplyT(Type -> Type -> Type) Either ctx -> NS (NP NA) '[ '[VO] ] +from' (ASSO (Left a)) = Here (a :* Nil) +from' (ASSO (Right b)) = There (Here undefined) + +pattern ASSO + :: () => + forall (ks :: Type) k (f :: k -> ks) (a1 :: k) (ks1 :: Type) k1 (f1 :: k1 -> ks1) (a2 :: k1) a3. + (kind ~ (k -> k1 -> Type), a ~~ f, b ~~ (a1 :&: a2 :&: E), + f a1 ~~ f1, f1 a2 ~~ a3) => + a3 -> ApplyT kind a b +pattern ASSO a = AS (AS (AO a)) diff --git a/testsuite/tests/patsyn/should_fail/T15695.stderr b/testsuite/tests/patsyn/should_fail/T15695.stderr new file mode 100644 index 0000000..6ef415a --- /dev/null +++ b/testsuite/tests/patsyn/should_fail/T15695.stderr @@ -0,0 +1,45 @@ + +T15695.hs:39:14: warning: [-Wdeferred-type-errors (in -Wdefault)] + • Could not deduce: a2 ~ NA 'VO + from the context: ((* -> * -> *) ~ (k1 -> k2 -> *), Either ~~ f, + ctx ~~ (a2 ':&: (a3 ':&: 'E)), f a2 ~~ f1, f1 a3 ~~ a4) + bound by a pattern with pattern synonym: + ASSO :: forall kind (a :: kind) (b :: Ctx kind). + () => + forall ks k (f :: k -> ks) (a1 :: k) ks1 k1 (f1 :: k1 -> ks1) + (a2 :: k1) a3. + (kind ~ (k -> k1 -> *), a ~~ f, b ~~ (a1 ':&: (a2 ':&: 'E)), + f a1 ~~ f1, f1 a2 ~~ a3) => + a3 -> ApplyT kind a b, + in an equation for ‘from'’ + at T15695.hs:39:8-21 + ‘a2’ is a rigid type variable bound by + a pattern with pattern synonym: + ASSO :: forall kind (a :: kind) (b :: Ctx kind). + () => + forall ks k (f :: k -> ks) (a1 :: k) ks1 k1 (f1 :: k1 -> ks1) + (a2 :: k1) a3. + (kind ~ (k -> k1 -> *), a ~~ f, b ~~ (a1 ':&: (a2 ':&: 'E)), + f a1 ~~ f1, f1 a2 ~~ a3) => + a3 -> ApplyT kind a b, + in an equation for ‘from'’ + at T15695.hs:39:8-21 + Expected type: a4 + Actual type: Either (NA 'VO) a3 + • In the pattern: Left a + In the pattern: ASSO (Left a) + In an equation for ‘from'’: from' (ASSO (Left a)) = Here (a :* Nil) + • Relevant bindings include + from' :: ApplyT (* -> * -> *) Either ctx -> NS (NP NA) '[ '[ 'VO]] + (bound at T15695.hs:39:1) + +T15695.hs:40:26: warning: [-Wdeferred-type-errors (in -Wdefault)] + • Couldn't match type ‘a0 : as0’ with ‘'[]’ + Expected type: NS (NP NA) '[ '[ 'VO]] + Actual type: NS (NP NA) ('[ 'VO] : a0 : as0) + • In the expression: There (Here undefined) + In an equation for ‘from'’: + from' (ASSO (Right b)) = There (Here undefined) + • Relevant bindings include + from' :: ApplyT (* -> * -> *) Either ctx -> NS (NP NA) '[ '[ 'VO]] + (bound at T15695.hs:39:1) diff --git a/testsuite/tests/patsyn/should_fail/all.T b/testsuite/tests/patsyn/should_fail/all.T index c029f20..81e6644 100644 --- a/testsuite/tests/patsyn/should_fail/all.T +++ b/testsuite/tests/patsyn/should_fail/all.T @@ -34,6 +34,7 @@ test('T11667', normal, compile_fail, ['']) test('T12165', normal, compile_fail, ['']) test('T12819', normal, compile_fail, ['']) test('UnliftedPSBind', normal, compile_fail, ['']) +test('T15695', normal, compile, ['']) # It has -fdefer-type-errors inside test('T13349', normal, compile_fail, ['']) test('T13470', normal, compile_fail, ['']) test('T14112', normal, compile_fail, ['']) From git at git.haskell.org Sun Oct 14 20:05:21 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 14 Oct 2018 20:05:21 +0000 (UTC) Subject: [commit: ghc] master: rts: Stop tracing environment variables (fixes #15371) (68a747c) Message-ID: <20181014200521.5F2F23ABA8@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/68a747c702d2432cc90d2a79a6aba0e67ac3e2c0/ghc >--------------------------------------------------------------- commit 68a747c702d2432cc90d2a79a6aba0e67ac3e2c0 Author: Mitsutoshi Aoe Date: Sun Oct 14 20:23:21 2018 +0200 rts: Stop tracing environment variables (fixes #15371) Summary: This tracing may cause a security issue as some external tools out there expects user to set credentials in environment variables. Reviewers: bgamari, erikd, simonmar, monoidal Reviewed By: monoidal Subscribers: tdammers, rwbarton, carter GHC Trac Issues: #15371 Differential Revision: https://phabricator.haskell.org/D5187 >--------------------------------------------------------------- 68a747c702d2432cc90d2a79a6aba0e67ac3e2c0 rts/Trace.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/rts/Trace.c b/rts/Trace.c index 5b485c4..5abd1d9 100644 --- a/rts/Trace.c +++ b/rts/Trace.c @@ -478,16 +478,6 @@ void traceOSProcessInfo_(void) { argc, argv); } } - { - int envc = 0; char **envv; - getProgEnvv(&envc, &envv); - if (envc != 0) { - postCapsetVecEvent(EVENT_PROGRAM_ENV, - CAPSET_OSPROCESS_DEFAULT, - envc, envv); - } - freeProgEnvv(envc, envv); - } } } From git at git.haskell.org Sun Oct 14 20:05:25 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 14 Oct 2018 20:05:25 +0000 (UTC) Subject: [commit: ghc] master: Add RubbishLit for absent bindings of UnliftedRep (448b77b) Message-ID: <20181014200525.748883ABA8@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/448b77b93b369745e9bfbc8b46a5b87bb73dd379/ghc >--------------------------------------------------------------- commit 448b77b93b369745e9bfbc8b46a5b87bb73dd379 Author: Sebastian Graf Date: Sun Oct 14 20:32:40 2018 +0200 Add RubbishLit for absent bindings of UnliftedRep Summary: Trac #9279 reminded us that the worker wrapper transformation copes really badly with absent unlifted boxed bindings. As `Note [Absent errors]` in WwLib.hs points out, we can't just use `absentError` for unlifted bindings because there is no bottom to hide the error in. So instead, we synthesise a new `RubbishLit` of type `forall (a :: TYPE 'UnliftedRep). a`, which code-gen may subsitute for any boxed value. We choose `()`, so that there is a good chance that the program crashes instead instead of leading to corrupt data, should absence analysis have been too optimistic (#11126). Reviewers: simonpj, hvr, goldfire, bgamari, simonmar Reviewed By: simonpj Subscribers: osa1, rwbarton, carter GHC Trac Issues: #15627, #9279, #4306, #11126 Differential Revision: https://phabricator.haskell.org/D5153 >--------------------------------------------------------------- 448b77b93b369745e9bfbc8b46a5b87bb73dd379 compiler/basicTypes/Literal.hs | 87 +++++- compiler/codeGen/StgCmmUtils.hs | 1 + compiler/coreSyn/CoreUtils.hs | 11 +- compiler/ghci/ByteCodeAsm.hs | 4 + compiler/ghci/ByteCodeGen.hs | 1 + compiler/prelude/TysPrim.hs | 13 + compiler/prelude/TysWiredIn.hs | 2 +- compiler/stgSyn/CoreToStg.hs | 10 +- compiler/stranal/WwLib.hs | 36 ++- testsuite/tests/stranal/should_compile/T15627.hs | 19 ++ .../tests/stranal/should_compile/T15627.stderr | 338 +++++++++++++++++++++ testsuite/tests/stranal/should_compile/all.T | 6 + 12 files changed, 508 insertions(+), 20 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 448b77b93b369745e9bfbc8b46a5b87bb73dd379 From git at git.haskell.org Sun Oct 14 20:05:28 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 14 Oct 2018 20:05:28 +0000 (UTC) Subject: [commit: ghc] master: Minor documentation markup fix in HsExpr.hs (d52627f) Message-ID: <20181014200528.4B0ED3ABA8@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/d52627fb6952ecdc7d9027b0dff731e332c3d885/ghc >--------------------------------------------------------------- commit d52627fb6952ecdc7d9027b0dff731e332c3d885 Author: Josh Price <2855417+WhistlePayer at users.noreply.github.com> Date: Mon Oct 8 14:58:27 2018 -0400 Minor documentation markup fix in HsExpr.hs PR: https://github.com/ghc/ghc/pull/202/ >--------------------------------------------------------------- d52627fb6952ecdc7d9027b0dff731e332c3d885 compiler/hsSyn/HsExpr.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/hsSyn/HsExpr.hs b/compiler/hsSyn/HsExpr.hs index d7d0b14..dea72c3 100644 --- a/compiler/hsSyn/HsExpr.hs +++ b/compiler/hsSyn/HsExpr.hs @@ -1879,7 +1879,7 @@ data StmtLR idL idR body -- body should always be (LHs**** idR) -- if the pattern match can't fail -- | 'ApplicativeStmt' represents an applicative expression built with - -- <$> and <*>. It is generated by the renamer, and is desugared into the + -- '<$>' and '<*>'. It is generated by the renamer, and is desugared into the -- appropriate applicative expression by the desugarer, but it is intended -- to be invisible in error messages. -- From git at git.haskell.org Sun Oct 14 20:05:31 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 14 Oct 2018 20:05:31 +0000 (UTC) Subject: [commit: ghc] master: Fix typo in documentation (8e6c34f) Message-ID: <20181014200531.1E9C13ABA8@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/8e6c34fdf485bcbd16274896f821448db268c5fa/ghc >--------------------------------------------------------------- commit 8e6c34fdf485bcbd16274896f821448db268c5fa Author: Jan Path Date: Tue Oct 2 15:39:36 2018 +0200 Fix typo in documentation PR: https://github.com/ghc/ghc/pull/201/ >--------------------------------------------------------------- 8e6c34fdf485bcbd16274896f821448db268c5fa compiler/main/HscTypes.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/main/HscTypes.hs b/compiler/main/HscTypes.hs index 0caafb0..445c496 100644 --- a/compiler/main/HscTypes.hs +++ b/compiler/main/HscTypes.hs @@ -1533,7 +1533,7 @@ It's exactly the same for type-family instances. See Trac #7102 -} -- | Interactive context, recording information about the state of the --- context in which statements are executed in a GHC session. +-- context in which statements are executed in a GHCi session. data InteractiveContext = InteractiveContext { ic_dflags :: DynFlags, From git at git.haskell.org Mon Oct 15 09:43:13 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 15 Oct 2018 09:43:13 +0000 (UTC) Subject: [commit: ghc] master: Fix #15725 with an extra Sym (48efbc0) Message-ID: <20181015094313.0C7293ABB2@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/48efbc04bd45d806c52376641e1a7ed7278d1ec7/ghc >--------------------------------------------------------------- commit 48efbc04bd45d806c52376641e1a7ed7278d1ec7 Author: Ryan Scott Date: Mon Oct 15 10:25:02 2018 +0200 Fix #15725 with an extra Sym Summary: We were adding a `Sym` to one argument in the `InstCo` case of `optCoercion` but not another, leading to the two arguments to misaligned when combined via `Trans`. This fixes the issue with a well targeted use of `wrapSym`. Test Plan: make test TEST=T15725 Reviewers: goldfire, ningning, bgamari Reviewed By: goldfire, ningning Subscribers: rwbarton, carter GHC Trac Issues: #15725 Differential Revision: https://phabricator.haskell.org/D5217 >--------------------------------------------------------------- 48efbc04bd45d806c52376641e1a7ed7278d1ec7 compiler/types/OptCoercion.hs | 33 ++++++---- testsuite/tests/dependent/should_compile/T15725.hs | 74 ++++++++++++++++++++++ testsuite/tests/dependent/should_compile/all.T | 1 + 3 files changed, 97 insertions(+), 11 deletions(-) diff --git a/compiler/types/OptCoercion.hs b/compiler/types/OptCoercion.hs index 8a44b86..1d48ed0 100644 --- a/compiler/types/OptCoercion.hs +++ b/compiler/types/OptCoercion.hs @@ -377,9 +377,9 @@ opt_co4 env sym rep r (InstCo co1 arg) -- forall over type... | Just (tv, kind_co, co_body) <- splitForAllCo_ty_maybe co1 = opt_co4_wrap (extendLiftingContext env tv - (mkCoherenceRightCo Nominal t2 (mkSymCo kind_co) arg')) - -- kind_co :: k1 ~ k2 - -- arg' :: (t1 :: k1) ~ (t2 :: k2) + (mkCoherenceRightCo Nominal t2 (mkSymCo kind_co) sym_arg)) + -- mkSymCo kind_co :: k1 ~ k2 + -- sym_arg :: (t1 :: k1) ~ (t2 :: k2) -- tv |-> (t1 :: k1) ~ (((t2 :: k2) |> (sym kind_co)) :: k1) sym rep r co_body @@ -396,23 +396,34 @@ opt_co4 env sym rep r (InstCo co1 arg) -- forall over type... | Just (tv', kind_co', co_body') <- splitForAllCo_ty_maybe co1' = opt_co4_wrap (extendLiftingContext (zapLiftingContext env) tv' - (mkCoherenceRightCo Nominal t2 (mkSymCo kind_co') arg')) + (mkCoherenceRightCo Nominal t2' (mkSymCo kind_co') arg')) False False r' co_body' -- forall over coercion... | Just (cv', kind_co', co_body') <- splitForAllCo_co_maybe co1' - , CoercionTy h1 <- t1 - , CoercionTy h2 <- t2 - = let new_co = mk_new_co cv' kind_co' h1 h2 + , CoercionTy h1' <- t1' + , CoercionTy h2' <- t2' + = let new_co = mk_new_co cv' kind_co' h1' h2' in opt_co4_wrap (extendLiftingContext (zapLiftingContext env) cv' new_co) False False r' co_body' | otherwise = InstCo co1' arg' where - co1' = opt_co4_wrap env sym rep r co1 - r' = chooseRole rep r - arg' = opt_co4_wrap env sym False Nominal arg - Pair t1 t2 = coercionKind arg' + co1' = opt_co4_wrap env sym rep r co1 + r' = chooseRole rep r + arg' = opt_co4_wrap env sym False Nominal arg + sym_arg = wrapSym sym arg' + + -- Performance note: don't be alarmed by the two calls to coercionKind + -- here, as only one call to coercionKind is actually demanded per guard. + -- t1/t2 are used when checking if co1 is a forall, and t1'/t2' are used + -- when checking if co1' (i.e., co1 post-optimization) is a forall. + -- + -- t1/t2 must come from sym_arg, not arg', since it's possible that arg' + -- might have an extra Sym at the front (after being optimized) that co1 + -- lacks, so we need to use sym_arg to balance the number of Syms. (#15725) + Pair t1 t2 = coercionKind sym_arg + Pair t1' t2' = coercionKind arg' mk_new_co cv kind_co h1 h2 = let -- h1 :: (t1 ~ t2) diff --git a/testsuite/tests/dependent/should_compile/T15725.hs b/testsuite/tests/dependent/should_compile/T15725.hs new file mode 100644 index 0000000..a5f259e --- /dev/null +++ b/testsuite/tests/dependent/should_compile/T15725.hs @@ -0,0 +1,74 @@ +{-# LANGUAGE DefaultSignatures #-} +{-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE GADTs #-} +{-# LANGUAGE RankNTypes #-} +{-# LANGUAGE ScopedTypeVariables #-} +{-# LANGUAGE TypeApplications #-} +{-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeInType #-} +{-# LANGUAGE TypeOperators #-} +{-# LANGUAGE UndecidableInstances #-} +module T15725 where + +import Data.Functor.Identity (Identity(..)) +import Data.Kind (Type) +import GHC.Exts (Any) + +----- +-- The important bits +----- + +type instance Meth (x :: Identity a) = GenericMeth x +instance SC Identity + +------------------------------------------------------------------------------- + +data family Sing :: forall k. k -> Type +data instance Sing :: forall a. Identity a -> Type where + SIdentity :: Sing x -> Sing ('Identity x) + +newtype Par1 p = Par1 p +data instance Sing :: forall p. Par1 p -> Type where + SPar1 :: Sing x -> Sing ('Par1 x) + +type family Rep1 (f :: Type -> Type) :: Type -> Type + +class PGeneric1 (f :: Type -> Type) where + type From1 (z :: f a) :: Rep1 f a + type To1 (z :: Rep1 f a) :: f a + +class SGeneric1 (f :: Type -> Type) where + sFrom1 :: forall (a :: Type) (z :: f a). Sing z -> Sing (From1 z) + sTo1 :: forall (a :: Type) (r :: Rep1 f a). Sing r -> Sing (To1 r :: f a) + +type instance Rep1 Identity = Par1 + +instance PGeneric1 Identity where + type From1 ('Identity x) = 'Par1 x + type To1 ('Par1 x) = 'Identity x + +instance SGeneric1 Identity where + sFrom1 (SIdentity x) = SPar1 x + sTo1 (SPar1 x) = SIdentity x + +type family GenericMeth (x :: f a) :: f a where + GenericMeth x = To1 (Meth (From1 x)) + +type family Meth (x :: f a) :: f a + +class SC f where + sMeth :: forall a (x :: f a). + Sing x -> Sing (Meth x) + default sMeth :: forall a (x :: f a). + ( SGeneric1 f, SC (Rep1 f) + , Meth x ~ GenericMeth x + ) + => Sing x -> Sing (Meth x) + sMeth sx = sTo1 (sMeth (sFrom1 sx)) + + dummy :: f a -> () + dummy _ = () + +type instance Meth (x :: Par1 p) = x +instance SC Par1 where + sMeth x = x diff --git a/testsuite/tests/dependent/should_compile/all.T b/testsuite/tests/dependent/should_compile/all.T index 5f6e901..1bf6cc7 100644 --- a/testsuite/tests/dependent/should_compile/all.T +++ b/testsuite/tests/dependent/should_compile/all.T @@ -55,3 +55,4 @@ test('T15346', normal, compile, ['']) test('T15419', normal, compile, ['']) test('T14066h', normal, compile, ['']) test('T15666', normal, compile, ['']) +test('T15725', normal, compile, ['']) From git at git.haskell.org Mon Oct 15 09:43:15 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 15 Oct 2018 09:43:15 +0000 (UTC) Subject: [commit: ghc] master: Use an accumulator version of tyCoVarsOfType (08b3db7) Message-ID: <20181015094315.DC0433ABB2@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/08b3db7e670d7a142244466f1722cb48ab82f1f5/ghc >--------------------------------------------------------------- commit 08b3db7e670d7a142244466f1722cb48ab82f1f5 Author: Tobias Dammers Date: Mon Oct 15 10:26:31 2018 +0200 Use an accumulator version of tyCoVarsOfType Summary: This is part 1 from #14880: factor out a worker for the tyCoVarsOf... family of function, implementing them in terms of VarSet, but with accumulator-style (like in `FV`) built in, and with the same kind of pre-insert lookup; this has shown to perform better than either FV or plain VarSet in this particular scenario. Original notes from simonpj: In TyCoRep we now have tyCoVarsOfType implemented 1) Using FV -- this is the baseline version in GHC today 2) Using VarSets via unionVarSet 3) Using VarSets in accumulator-style In this patch (3) is enabled. When compiling perf/compiler/T5631 we get Compiler allocs (1) 1,144M (2) 1,175M (3) 1,142M The key new insight in (3) is this: ty_co_vars_of_type (TyVarTy v) is acc | v `elemVarSet` is = acc | v `elemVarSet` acc = acc <---- NB! | otherwise = ty_co_vars_of_type (tyVarKind v) is (extendVarSet acc v) Notice the second line! If the variable is already in the accumulator, don't re-add it. This makes big difference. Without it, allocation is 1,169M or so. One cause is that we only take the free vars of its kind once; that problem will go away when we do the main part of #14088 and close over kinds /afterwards/. But still, another cause is perhaps that every insert into a set overwrites the previous item, and so allocates a new path to the item; it's not a no-op even if the item is there already. Why use (3) rather than (1)? Becuase it just /has/ to be better; * FV carries around an InterestingVarFun, which does nothing useful here, but is tested at every variable * FV carries around a [Var] for the deterministic version. For this very hot operation (finding free vars) I think it makes sense to have speical purpose code. On the way I also simplified the (less used) coVarsOfType/Co family to use FV, by making serious use of the InterestingVarFun! Test Plan: validate, nofib Reviewers: simonpj, bgamari Reviewed By: simonpj Subscribers: rwbarton, carter GHC Trac Issues: #14880 Differential Revision: https://phabricator.haskell.org/D5141 >--------------------------------------------------------------- 08b3db7e670d7a142244466f1722cb48ab82f1f5 compiler/types/TyCoRep.hs | 287 +++++++++++++++++++++++++++++----------------- 1 file changed, 184 insertions(+), 103 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 08b3db7e670d7a142244466f1722cb48ab82f1f5 From git at git.haskell.org Mon Oct 15 09:43:18 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 15 Oct 2018 09:43:18 +0000 (UTC) Subject: [commit: ghc] master: Fix test for GCC support for atomics in Autotools (8a9a63b) Message-ID: <20181015094318.BADB83ABB2@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/8a9a63beaad19d4f59ec7ae26925d8b4e9b94cee/ghc >--------------------------------------------------------------- commit 8a9a63beaad19d4f59ec7ae26925d8b4e9b94cee Author: Ondra Pelech Date: Sun Sep 23 23:14:53 2018 +0200 Fix test for GCC support for atomics in Autotools PR: https://github.com/ghc/ghc/pull/198/ >--------------------------------------------------------------- 8a9a63beaad19d4f59ec7ae26925d8b4e9b94cee aclocal.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aclocal.m4 b/aclocal.m4 index 15b9f35..55b4162 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1303,7 +1303,7 @@ AC_DEFUN([FP_GCC_SUPPORTS__ATOMICS], [ AC_REQUIRE([AC_PROG_CC]) AC_MSG_CHECKING([whether GCC supports __atomic_ builtins]) - echo 'int test(int *x) { int y; __atomic_load(&x, &y, __ATOMIC_SEQ_CST); return x; }' > conftest.c + echo 'int test(int *x) { int y; __atomic_load(x, &y, __ATOMIC_SEQ_CST); return y; }' > conftest.c if $CC -c conftest.c > /dev/null 2>&1; then CONF_GCC_SUPPORTS__ATOMICS=YES AC_MSG_RESULT([yes]) From git at git.haskell.org Mon Oct 15 09:49:42 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 15 Oct 2018 09:49:42 +0000 (UTC) Subject: [commit: ghc] master: Correct typo "Deppendency" -> Dependency (f945b7a) Message-ID: <20181015094942.2A60A3ABB2@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/f945b7abc852f52b687db5aefca6e41656559520/ghc >--------------------------------------------------------------- commit f945b7abc852f52b687db5aefca6e41656559520 Author: Nathan van Doorn Date: Mon Oct 15 10:41:37 2018 +0100 Correct typo "Deppendency" -> Dependency PR: https://github.com/ghc/ghc/pull/203/ >--------------------------------------------------------------- f945b7abc852f52b687db5aefca6e41656559520 docs/users_guide/8.6.1-notes.rst | 2 +- docs/users_guide/8.8.1-notes.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/users_guide/8.6.1-notes.rst b/docs/users_guide/8.6.1-notes.rst index cfa2880..13f5b4d 100644 --- a/docs/users_guide/8.6.1-notes.rst +++ b/docs/users_guide/8.6.1-notes.rst @@ -266,7 +266,7 @@ for further change information. libraries/array/array.cabal: Dependency of ``ghc`` library libraries/base/base.cabal: Core library libraries/binary/binary.cabal: Dependency of ``ghc`` library - libraries/bytestring/bytestring.cabal: Deppendency of ``ghc`` library + libraries/bytestring/bytestring.cabal: Dependency of ``ghc`` library libraries/Cabal/Cabal/Cabal.cabal: Dependency of ``ghc-pkg`` utility libraries/containers/containers.cabal: Dependency of ``ghc`` library libraries/deepseq/deepseq.cabal: Dependency of ``ghc`` library diff --git a/docs/users_guide/8.8.1-notes.rst b/docs/users_guide/8.8.1-notes.rst index d3da37e..4de2369 100644 --- a/docs/users_guide/8.8.1-notes.rst +++ b/docs/users_guide/8.8.1-notes.rst @@ -140,7 +140,7 @@ for further change information. libraries/array/array.cabal: Dependency of ``ghc`` library libraries/base/base.cabal: Core library libraries/binary/binary.cabal: Dependency of ``ghc`` library - libraries/bytestring/bytestring.cabal: Deppendency of ``ghc`` library + libraries/bytestring/bytestring.cabal: Dependency of ``ghc`` library libraries/Cabal/Cabal/Cabal.cabal: Dependency of ``ghc-pkg`` utility libraries/containers/containers.cabal: Dependency of ``ghc`` library libraries/deepseq/deepseq.cabal: Dependency of ``ghc`` library From git at git.haskell.org Mon Oct 15 16:07:45 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 15 Oct 2018 16:07:45 +0000 (UTC) Subject: [commit: ghc] ghc-8.4: Release notes for GHC 8.4.4 (3ceffaa) Message-ID: <20181015160745.B1C763ABB2@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.4 Link : http://ghc.haskell.org/trac/ghc/changeset/3ceffaaad71b75beadd8b559aa31eb73e19dfe4f/ghc >--------------------------------------------------------------- commit 3ceffaaad71b75beadd8b559aa31eb73e19dfe4f Author: Ben Gamari Date: Sat Oct 13 15:25:08 2018 -0400 Release notes for GHC 8.4.4 And embarrassingly, the release notes for 8.4.3 weren't included in the ToC. >--------------------------------------------------------------- 3ceffaaad71b75beadd8b559aa31eb73e19dfe4f .../{8.4.3-notes.rst => 8.4.4-notes.rst} | 35 +++++++++++++--------- docs/users_guide/index.rst | 2 ++ 2 files changed, 23 insertions(+), 14 deletions(-) diff --git a/docs/users_guide/8.4.3-notes.rst b/docs/users_guide/8.4.4-notes.rst similarity index 74% copy from docs/users_guide/8.4.3-notes.rst copy to docs/users_guide/8.4.4-notes.rst index f931c10..8faf374 100644 --- a/docs/users_guide/8.4.3-notes.rst +++ b/docs/users_guide/8.4.4-notes.rst @@ -1,6 +1,6 @@ -.. _release-8-4-3: +.. _release-8-4-4: -Release notes for version 8.4.3 +Release notes for version 8.4.4 =============================== Highlights @@ -8,18 +8,24 @@ Highlights This is a bug-fix release resolving several regressions introduced in 8.4.1. -The highlights, since the 8.4.2 release, are: +The highlights, since the 8.4.3 release, are: -- A bug (:ghc-ticket:`15068`) causing GHC to produce assembler that would be rejected by - some versions of GNU Binutils, has been fixed. +- A bug which could result in memory unsafety with certain uses of ``touch#`` + has been resolved. (:ghc-ticket:`14346`) -- ``GHC.Compact.compact`` now properly handles ``SmallArray``\ s (:ghc-ticket:`13857`) +- A compiler panic triggered by some GADT record updates has been fixed + (:ghc-ticket:`15499`) -- A bug (:ghc-ticket:`15038`) resulting in memory corruption and crashes in some uses of - unboxed sums has been fixed. +- The ``text`` library has been updated, fixing several serious bugs in the + version shipped with GHC 8.4.3 (see `#227 + `_, + `#221 `_, and `#197 + `_. + +- A serious code generation bug in the LLVM code generation, potentially resulting + in incorrect evaluation of floating point expressions, has been fixed + (:ghc-ticket:`14251`) -- GHC now logs a message when an :ref:`environment file ` - is loaded (:ghc-ticket:`15145`). Full details ------------ @@ -30,15 +36,16 @@ other issues, described below. Compiler ~~~~~~~~ -No changes beyond those listed in Highlights. +- A compiler panic triggered by case alternatives matching on invalid tags + returned by ``dataToTag#``, has been fixed (:ghc-ticket:`15436`) +- Package environments can now be explicitly disabled using the new + ``-package-env -`` flag. (:ghc-ticket:`13753`) Runtime system ~~~~~~~~~~~~~~ -- A bug causing aggressive potentially resulting in crashes when - (:rts-flag:`nursery chunks <-n ⟨size⟩>`) are used with a changing capability - count has been fixed. +No changes. Template Haskell ~~~~~~~~~~~~~~~~ diff --git a/docs/users_guide/index.rst b/docs/users_guide/index.rst index 3ddeb64..5de9aca 100644 --- a/docs/users_guide/index.rst +++ b/docs/users_guide/index.rst @@ -14,6 +14,8 @@ Contents: intro 8.4.1-notes 8.4.2-notes + 8.4.3-notes + 8.4.4-notes ghci runghc usage From git at git.haskell.org Mon Oct 15 16:07:48 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 15 Oct 2018 16:07:48 +0000 (UTC) Subject: [commit: ghc] ghc-8.4: Bump version (3bed09b) Message-ID: <20181015160748.7AB233ABB2@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.4 Link : http://ghc.haskell.org/trac/ghc/changeset/3bed09b2efd3df678c5d0752d2cdfba20d7c4863/ghc >--------------------------------------------------------------- commit 3bed09b2efd3df678c5d0752d2cdfba20d7c4863 Author: Ben Gamari Date: Sat Oct 13 15:49:48 2018 -0400 Bump version >--------------------------------------------------------------- 3bed09b2efd3df678c5d0752d2cdfba20d7c4863 configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 255f0f3..838ed12 100644 --- a/configure.ac +++ b/configure.ac @@ -13,7 +13,7 @@ dnl # see what flags are available. (Better yet, read the documentation!) # -AC_INIT([The Glorious Glasgow Haskell Compilation System], [8.4.3], [glasgow-haskell-bugs at haskell.org], [ghc-AC_PACKAGE_VERSION]) +AC_INIT([The Glorious Glasgow Haskell Compilation System], [8.4.4], [glasgow-haskell-bugs at haskell.org], [ghc-AC_PACKAGE_VERSION]) # Set this to YES for a released version, otherwise NO : ${RELEASE=YES} From git at git.haskell.org Mon Oct 15 16:07:51 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 15 Oct 2018 16:07:51 +0000 (UTC) Subject: [commit: ghc] ghc-8.4: Set RELEASE=NO (2cac5d4) Message-ID: <20181015160751.440A13ABB2@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.4 Link : http://ghc.haskell.org/trac/ghc/changeset/2cac5d406443a01fb1ca64104b54af8d3b5e2c98/ghc >--------------------------------------------------------------- commit 2cac5d406443a01fb1ca64104b54af8d3b5e2c98 Author: Ben Gamari Date: Sat Oct 13 15:56:58 2018 -0400 Set RELEASE=NO >--------------------------------------------------------------- 2cac5d406443a01fb1ca64104b54af8d3b5e2c98 configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 838ed12..15db912 100644 --- a/configure.ac +++ b/configure.ac @@ -16,7 +16,7 @@ dnl AC_INIT([The Glorious Glasgow Haskell Compilation System], [8.4.4], [glasgow-haskell-bugs at haskell.org], [ghc-AC_PACKAGE_VERSION]) # Set this to YES for a released version, otherwise NO -: ${RELEASE=YES} +: ${RELEASE=NO} # The primary version (e.g. 7.5, 7.4.1) is set in the AC_INIT line # above. If this is not a released version, then we will append the From git at git.haskell.org Mon Oct 15 16:07:54 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 15 Oct 2018 16:07:54 +0000 (UTC) Subject: [commit: ghc] ghc-8.4: Add missing paren (22e13c1) Message-ID: <20181015160754.0E0F33ABB2@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.4 Link : http://ghc.haskell.org/trac/ghc/changeset/22e13c1525c117919541437e60bc4352f0bc6517/ghc >--------------------------------------------------------------- commit 22e13c1525c117919541437e60bc4352f0bc6517 Author: Ben Gamari Date: Sun Oct 14 18:16:35 2018 -0400 Add missing paren >--------------------------------------------------------------- 22e13c1525c117919541437e60bc4352f0bc6517 docs/users_guide/8.4.4-notes.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/users_guide/8.4.4-notes.rst b/docs/users_guide/8.4.4-notes.rst index 8faf374..5f8692d 100644 --- a/docs/users_guide/8.4.4-notes.rst +++ b/docs/users_guide/8.4.4-notes.rst @@ -20,7 +20,7 @@ The highlights, since the 8.4.3 release, are: version shipped with GHC 8.4.3 (see `#227 `_, `#221 `_, and `#197 - `_. + `_). - A serious code generation bug in the LLVM code generation, potentially resulting in incorrect evaluation of floating point expressions, has been fixed From git at git.haskell.org Mon Oct 15 21:43:27 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 15 Oct 2018 21:43:27 +0000 (UTC) Subject: [commit: ghc] master: Deprecate -fllvm-pass-vectors-in-regs (58dffa0) Message-ID: <20181015214327.0F8B13ABB2@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/58dffa0aa4c2b30ac270e32ccb26b58f53cc69ef/ghc >--------------------------------------------------------------- commit 58dffa0aa4c2b30ac270e32ccb26b58f53cc69ef Author: Ben Gamari Date: Mon Oct 15 13:17:46 2018 -0400 Deprecate -fllvm-pass-vectors-in-regs Summary: The behavior previously enabled by this flag is as been the default since 8.6.1. Reviewers: simonmar Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5193 >--------------------------------------------------------------- 58dffa0aa4c2b30ac270e32ccb26b58f53cc69ef compiler/cmm/CmmCallConv.hs | 17 +++++------------ compiler/main/DynFlags.hs | 9 ++++----- docs/users_guide/8.8.1-notes.rst | 3 +++ 3 files changed, 12 insertions(+), 17 deletions(-) diff --git a/compiler/cmm/CmmCallConv.hs b/compiler/cmm/CmmCallConv.hs index e1067e9..f338415 100644 --- a/compiler/cmm/CmmCallConv.hs +++ b/compiler/cmm/CmmCallConv.hs @@ -102,19 +102,12 @@ passFloatArgsInXmm dflags = case platformArch (targetPlatform dflags) of ArchX86_64 -> True _ -> False --- On X86_64, we always pass 128-bit-wide vectors in registers. On 32-bit X86 --- and for all larger vector sizes on X86_64, LLVM's GHC calling convention --- does not currently pass vectors in registers. The patch to update the GHC --- calling convention to support passing SIMD vectors in registers is small and --- well-contained, so it may make it into LLVM 3.4. The hidden --- -fllvm-pass-vectors-in-regs flag will generate LLVM code that attempts to --- pass vectors in registers, but it must only be used with a version of LLVM --- that has an updated GHC calling convention. +-- We used to spill vector registers to the stack since the LLVM backend didn't +-- support vector registers in its calling convention. However, this has now +-- been fixed. This function remains only as a convenient way to re-enable +-- spilling when debugging code generation. passVectorInReg :: Width -> DynFlags -> Bool -passVectorInReg W128 dflags = case platformArch (targetPlatform dflags) of - ArchX86_64 -> True - _ -> gopt Opt_LlvmPassVectorsInRegisters dflags -passVectorInReg _ dflags = gopt Opt_LlvmPassVectorsInRegisters dflags +passVectorInReg _ _ = True assignStack :: DynFlags -> ByteOff -> (a -> CmmType) -> [a] -> ( diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index 2c8f134..3a14b29 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -474,7 +474,6 @@ data GeneralFlag | Opt_RegsIterative -- do iterative coalescing graph coloring register allocation | Opt_PedanticBottoms -- Be picky about how we treat bottom | Opt_LlvmTBAA -- Use LLVM TBAA infastructure for improving AA (hidden flag) - | Opt_LlvmPassVectorsInRegisters -- Pass SIMD vectors in registers (requires a patched LLVM) (hidden flag) | Opt_LlvmFillUndefWithGarbage -- Testing for undef bugs (hidden flag) | Opt_IrrefutableTuples | Opt_CmmSink @@ -680,7 +679,6 @@ optimisationFlags = EnumSet.fromList , Opt_RegsIterative , Opt_PedanticBottoms , Opt_LlvmTBAA - , Opt_LlvmPassVectorsInRegisters , Opt_LlvmFillUndefWithGarbage , Opt_IrrefutableTuples , Opt_CmmSink @@ -3380,6 +3378,9 @@ dynamic_flags_deps = [ , make_ord_flag defFlag "fno-refinement-level-hole-fits" (noArg (\d -> d { refLevelHoleFits = Nothing })) + , make_dep_flag defGhcFlag "fllvm-pass-vectors-in-regs" + (noArg id) + "vectors registers are now passed in registers by default." , make_ord_flag defFlag "fmax-uncovered-patterns" (intSuffix (\n d -> d { maxUncoveredPatterns = n })) , make_ord_flag defFlag "fsimplifier-phases" @@ -3957,7 +3958,6 @@ fFlagsDeps = [ flagSpec "late-dmd-anal" Opt_LateDmdAnal, flagSpec "late-specialise" Opt_LateSpecialise, flagSpec "liberate-case" Opt_LiberateCase, - flagSpec "llvm-pass-vectors-in-regs" Opt_LlvmPassVectorsInRegisters, flagHiddenSpec "llvm-tbaa" Opt_LlvmTBAA, flagHiddenSpec "llvm-fill-undef-with-garbage" Opt_LlvmFillUndefWithGarbage, flagSpec "loopification" Opt_Loopification, @@ -4283,8 +4283,7 @@ defaultFlags settings Opt_RPath, Opt_SharedImplib, Opt_SimplPreInlining, - Opt_VersionMacros, - Opt_LlvmPassVectorsInRegisters + Opt_VersionMacros ] ++ [f | (ns,f) <- optLevelFlags, 0 `elem` ns] diff --git a/docs/users_guide/8.8.1-notes.rst b/docs/users_guide/8.8.1-notes.rst index 4de2369..37bad13 100644 --- a/docs/users_guide/8.8.1-notes.rst +++ b/docs/users_guide/8.8.1-notes.rst @@ -61,6 +61,9 @@ Compiler - The :ghc-flag:`-Wcompat` warning group now includes :ghc-flag:`-Wstar-is-type`. +- The :ghc-flag:`-fllvm-pass-vectors-in-regs` flag is now deprecated as vector + arguments are now passed in registers by default. + Runtime system ~~~~~~~~~~~~~~ From git at git.haskell.org Mon Oct 15 21:43:30 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 15 Oct 2018 21:43:30 +0000 (UTC) Subject: [commit: ghc] master: Typeable: Only render saturated tuple types with tuple syntax (846fe90) Message-ID: <20181015214330.8950C3ABB2@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/846fe90464a1916df4ea72659255963a596eec84/ghc >--------------------------------------------------------------- commit 846fe90464a1916df4ea72659255963a596eec84 Author: Ben Gamari Date: Mon Oct 15 13:36:16 2018 -0400 Typeable: Only render saturated tuple types with tuple syntax This isn't as efficient as it could be since it needs to compute the kind of the type. However, this is `show` so there shouldn't be any particular expectation of speed. Fixes #14341. Test Plan: Validate Reviewers: hvr Subscribers: monoidal, rwbarton, carter GHC Trac Issues: #14341 Differential Revision: https://phabricator.haskell.org/D5080 >--------------------------------------------------------------- 846fe90464a1916df4ea72659255963a596eec84 libraries/base/Data/Typeable/Internal.hs | 6 +++++- testsuite/tests/typecheck/should_run/T14341.hs | 9 +++++++++ testsuite/tests/typecheck/should_run/T14341.stdout | 3 +++ testsuite/tests/typecheck/should_run/all.T | 1 + 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/libraries/base/Data/Typeable/Internal.hs b/libraries/base/Data/Typeable/Internal.hs index 0d4fc82..06d225a 100644 --- a/libraries/base/Data/Typeable/Internal.hs +++ b/libraries/base/Data/Typeable/Internal.hs @@ -773,7 +773,11 @@ showTypeable _ TrType = showChar '*' showTypeable _ rep | isListTyCon tc, [ty] <- tys = showChar '[' . shows ty . showChar ']' - | isTupleTyCon tc = + + -- Take care only to render saturated tuple tycon applications + -- with tuple notation (#14341). + | isTupleTyCon tc, + Just _ <- TrType `eqTypeRep` typeRepKind rep = showChar '(' . showArgs (showChar ',') tys . showChar ')' where (tc, tys) = splitApps rep showTypeable _ (TrTyCon {trTyCon = tycon, trKindVars = []}) diff --git a/testsuite/tests/typecheck/should_run/T14341.hs b/testsuite/tests/typecheck/should_run/T14341.hs new file mode 100644 index 0000000..72d2f63 --- /dev/null +++ b/testsuite/tests/typecheck/should_run/T14341.hs @@ -0,0 +1,9 @@ +{-# LANGUAGE TypeApplications #-} + +import Type.Reflection + +main :: IO () +main = do + print $ typeRep @((,,)) + print $ typeRep @((,,) Int) + print $ typeRep @((,,) Int Int Int) diff --git a/testsuite/tests/typecheck/should_run/T14341.stdout b/testsuite/tests/typecheck/should_run/T14341.stdout new file mode 100644 index 0000000..ea3d344 --- /dev/null +++ b/testsuite/tests/typecheck/should_run/T14341.stdout @@ -0,0 +1,3 @@ +(,,) +(,,) Int +(Int,Int,Int) \ No newline at end of file diff --git a/testsuite/tests/typecheck/should_run/all.T b/testsuite/tests/typecheck/should_run/all.T index a96c2b7..4f75c70 100755 --- a/testsuite/tests/typecheck/should_run/all.T +++ b/testsuite/tests/typecheck/should_run/all.T @@ -136,3 +136,4 @@ test('T13838', [exit_code(1), omit_ways(['ghci'])], compile_and_run, ['-fdefer-t test('T14218', normal, compile_and_run, ['']) test('T14236', normal, compile_and_run, ['']) test('T14925', normal, compile_and_run, ['']) +test('T14341', normal, compile_and_run, ['']) From git at git.haskell.org Mon Oct 15 21:43:34 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 15 Oct 2018 21:43:34 +0000 (UTC) Subject: [commit: ghc] master: Surprising error message with bang pattern (0b0cb48) Message-ID: <20181015214334.B14933ABB2@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/0b0cb484eb0b51bf5485dfadff7cd8a079ceb16e/ghc >--------------------------------------------------------------- commit 0b0cb484eb0b51bf5485dfadff7cd8a079ceb16e Author: Sasa Bogicevic Date: Mon Oct 15 13:47:48 2018 -0400 Surprising error message with bang pattern Reviewers: bgamari, alanz Reviewed By: bgamari Subscribers: sgraf, mpickering, rwbarton, thomie, carter GHC Trac Issues: #13600 Differential Revision: https://phabricator.haskell.org/D5040 >--------------------------------------------------------------- 0b0cb484eb0b51bf5485dfadff7cd8a079ceb16e compiler/main/DynFlags.hs | 5 +++- compiler/parser/Parser.y | 27 +++++++++++++++++++--- docs/users_guide/using-warnings.rst | 7 ++++++ testsuite/tests/parser/should_compile/T13600a.hs | 7 ++++++ .../tests/parser/should_compile/T13600a.stderr | 0 testsuite/tests/parser/should_compile/T13600b.hs | 9 ++++++++ .../tests/parser/should_compile/T13600b.stderr | 20 ++++++++++++++++ testsuite/tests/parser/should_compile/all.T | 2 ++ testsuite/tests/parser/should_compile/read029.hs | 4 ++-- 9 files changed, 75 insertions(+), 6 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 0b0cb484eb0b51bf5485dfadff7cd8a079ceb16e From git at git.haskell.org Mon Oct 15 21:43:37 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 15 Oct 2018 21:43:37 +0000 (UTC) Subject: [commit: ghc] master: Fix plugin tests requirements (01c3d00) Message-ID: <20181015214337.91ECF3ABB2@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/01c3d00a4ef49c3f7310402d8d635f69cbf9ee64/ghc >--------------------------------------------------------------- commit 01c3d00a4ef49c3f7310402d8d635f69cbf9ee64 Author: Tamar Christina Date: Mon Oct 15 13:23:51 2018 -0400 Fix plugin tests requirements Unfortunately the implementation has confused the ability to make dynamic libraries with dynamic way. This constraint is only true for systems that require `-fPIC` for shared libraries. Since the implementation has this implicit assumption, mark the tests as requiring dynway. Test Plan: ./validate Reviewers: bgamari Reviewed By: bgamari Subscribers: simonpj, rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5174 >--------------------------------------------------------------- 01c3d00a4ef49c3f7310402d8d635f69cbf9ee64 testsuite/config/ghc | 21 ++++++++++++++-- testsuite/tests/plugins/all.T | 34 +++++++++++++++++++++++--- testsuite/tests/simplCore/should_compile/all.T | 1 + 3 files changed, 50 insertions(+), 6 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 01c3d00a4ef49c3f7310402d8d635f69cbf9ee64 From git at git.haskell.org Mon Oct 15 21:43:40 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 15 Oct 2018 21:43:40 +0000 (UTC) Subject: [commit: ghc] master: Cleanup boot and validate (a816ac4) Message-ID: <20181015214340.659603ABB2@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/a816ac48b01bfc2419c11c9f2ef999e9bda7e95f/ghc >--------------------------------------------------------------- commit a816ac48b01bfc2419c11c9f2ef999e9bda7e95f Author: Krzysztof Gogolewski Date: Mon Oct 15 13:32:54 2018 -0400 Cleanup boot and validate - Remove dph from validate; dph was removed - The required-tag argument to boot was used only for dph, remove - check_boot_packages() was not called at all, and didn't work. I fixed it based on previous Perl version. Test Plan: Harbormaster Reviewers: bgamari, thomie Reviewed By: bgamari Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5129 >--------------------------------------------------------------- a816ac48b01bfc2419c11c9f2ef999e9bda7e95f boot | 12 ++++++------ validate | 14 +------------- 2 files changed, 7 insertions(+), 19 deletions(-) diff --git a/boot b/boot index 29643e4..f534c30 100755 --- a/boot +++ b/boot @@ -13,7 +13,6 @@ cwd = os.getcwd() parser = argparse.ArgumentParser() parser.add_argument('--validate', action='store_true', help='Run in validate mode') -parser.add_argument('--required-tag', type=str, action='append', default=set()) parser.add_argument('--hadrian', action='store_true', help='Do not assume the make base build system') args = parser.parse_args() @@ -65,16 +64,16 @@ def check_boot_packages(): if l.startswith('#'): continue - parts = l.split(' ') + parts = [part for part in l.split(' ') if part] if len(parts) != 4: die("Error: Bad line in packages file: " + l) dir_ = parts[0] tag = parts[1] - # If $tag is not "-" then it is an optional repository, so its + # If tag is not "-" then it is an optional repository, so its # absence isn't an error. - if tag in args.required_tag: + if tag == '-': # We would like to just check for a .git directory here, # but in an lndir tree we avoid making .git directories, # so it doesn't exist. We therefore require that every repo @@ -82,9 +81,9 @@ def check_boot_packages(): license_path = os.path.join(dir_, 'LICENSE') if not os.path.isfile(license_path): die("""\ - Error: %s doesn't exist" % license_path) + Error: %s doesn't exist Maybe you haven't run 'git submodule update --init'? - """) + """ % license_path) # Create libraries/*/{ghc.mk,GNUmakefile} def boot_pkgs(): @@ -191,6 +190,7 @@ def check_build_mk(): """)) check_for_url_rewrites() +check_boot_packages() if not args.hadrian: boot_pkgs() autoreconf() diff --git a/validate b/validate index 2f82b28..8ceaa61 100755 --- a/validate +++ b/validate @@ -23,7 +23,6 @@ Flags: --slow Build stage2 with -DDEBUG. Run tests for all WAYS, but skip those that call compiler_stats_num_field. 2008-07-01: 14% slower than the default. - --dph Also build libraries/dph and run associated tests. --quiet More pretty build log. See Note [Default build system verbosity]. --help shows this usage help. @@ -50,7 +49,6 @@ testsuite_only=0 build_only=0 hpc=NO speed=NORMAL -use_dph=0 be_quiet=0 # Validate uses gzip compression for the binary distribution to avoid the rather # heavy cost of xz, which is the typical default. The options are defined in @@ -81,12 +79,6 @@ do --normal) # for backward compat speed=NORMAL ;; - --no-dph) # for backward compat - use_dph=0 - ;; - --dph) - use_dph=1 - ;; --quiet) be_quiet=1 ;; @@ -158,11 +150,7 @@ if [ $no_clean -eq 0 ]; then INSTDIR="$thisdir/inst" - if [ $use_dph -eq 1 ]; then - python3 ./boot --validate --required-tag=dph - else - python3 ./boot --validate - fi + python3 ./boot --validate ./configure --prefix="$INSTDIR" $config_args fi From git at git.haskell.org Mon Oct 15 22:34:43 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 15 Oct 2018 22:34:43 +0000 (UTC) Subject: [commit: ghc] master: Fix cardinality change of fields in addDataConStrictness (c5b477c) Message-ID: <20181015223443.EC1883ABB3@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/c5b477c29127d8375b3f23d37f877278b52547f6/ghc >--------------------------------------------------------------- commit c5b477c29127d8375b3f23d37f877278b52547f6 Author: Ömer Sinan Ağacan Date: Mon Oct 15 13:48:53 2018 -0400 Fix cardinality change of fields in addDataConStrictness Test Plan: This validates Reviewers: simonpj, bgamari Reviewed By: bgamari Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5225 >--------------------------------------------------------------- c5b477c29127d8375b3f23d37f877278b52547f6 compiler/basicTypes/Demand.hs | 6 +++++- compiler/stranal/DmdAnal.hs | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/compiler/basicTypes/Demand.hs b/compiler/basicTypes/Demand.hs index 0719453..4707be7 100644 --- a/compiler/basicTypes/Demand.hs +++ b/compiler/basicTypes/Demand.hs @@ -56,7 +56,7 @@ module Demand ( useCount, isUsedOnce, reuseEnv, killUsageDemand, killUsageSig, zapUsageDemand, zapUsageEnvSig, zapUsedOnceDemand, zapUsedOnceSig, - strictifyDictDmd + strictifyDictDmd, strictifyDmd ) where @@ -2033,6 +2033,10 @@ strictifyDictDmd ty dmd = case getUseDmd dmd of -- the superclass dicts are always a prefix _ -> dmd -- unused or not a dictionary +strictifyDmd :: Demand -> Demand +strictifyDmd dmd@(JD { sd = str }) + = dmd { sd = str `bothArgStr` Str VanStr HeadStr } + {- Note [HyperStr and Use demands] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/compiler/stranal/DmdAnal.hs b/compiler/stranal/DmdAnal.hs index b606804..9959119 100644 --- a/compiler/stranal/DmdAnal.hs +++ b/compiler/stranal/DmdAnal.hs @@ -1222,7 +1222,7 @@ addDataConStrictness con ds where strs = dataConRepStrictness con add dmd str | isMarkedStrict str - , not (isAbsDmd dmd) = dmd `bothDmd` seqDmd + , not (isAbsDmd dmd) = strictifyDmd dmd | otherwise = dmd findBndrsDmds :: AnalEnv -> DmdType -> [Var] -> (DmdType, [Demand]) From git at git.haskell.org Mon Oct 15 22:34:47 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 15 Oct 2018 22:34:47 +0000 (UTC) Subject: [commit: ghc] master: Fix #12430 by expanding type synonyms in injTyVarsOfType (26e81e9) Message-ID: <20181015223447.A7C4A3ABB3@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/26e81e90281685af37c8f2cf149c242b4039117a/ghc >--------------------------------------------------------------- commit 26e81e90281685af37c8f2cf149c242b4039117a Author: Ryan Scott Date: Mon Oct 15 13:48:21 2018 -0400 Fix #12430 by expanding type synonyms in injTyVarsOfType We weren't expanding type synonyms when determining the injective type variables of a type, leading to certain non-injective families being mistakenly labeled as injective (#12430). Easily fixed with a tactical use of `coreView`. Test Plan: make test TEST=T12430 Reviewers: bgamari, goldfire Reviewed By: goldfire Subscribers: goldfire, rwbarton, carter GHC Trac Issues: #12430 Differential Revision: https://phabricator.haskell.org/D5228 >--------------------------------------------------------------- 26e81e90281685af37c8f2cf149c242b4039117a compiler/typecheck/FamInst.hs | 3 +++ testsuite/tests/typecheck/should_fail/T12430.hs | 6 ++++++ testsuite/tests/typecheck/should_fail/T12430.stderr | 8 ++++++++ testsuite/tests/typecheck/should_fail/all.T | 1 + 4 files changed, 18 insertions(+) diff --git a/compiler/typecheck/FamInst.hs b/compiler/typecheck/FamInst.hs index dc6eab8..8f1f7ba 100644 --- a/compiler/typecheck/FamInst.hs +++ b/compiler/typecheck/FamInst.hs @@ -792,6 +792,9 @@ injTyVarsOfType :: TcTauType -> TcTyVarSet -- E.g. Suppose F is injective in its second arg, but not its first -- then injVarOfType (Either a (F [b] (a,c))) = {a,c} -- Determining the overall type determines a,c but not b. +injTyVarsOfType ty + | Just ty' <- coreView ty -- #12430 + = injTyVarsOfType ty' injTyVarsOfType (TyVarTy v) = unitVarSet v `unionVarSet` injTyVarsOfType (tyVarKind v) injTyVarsOfType (TyConApp tc tys) diff --git a/testsuite/tests/typecheck/should_fail/T12430.hs b/testsuite/tests/typecheck/should_fail/T12430.hs new file mode 100644 index 0000000..03cded2 --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T12430.hs @@ -0,0 +1,6 @@ +{-# LANGUAGE TypeFamilyDependencies #-} +module T12430 where + +type C a = Int +type family F x = y | y -> x where + F x = C x diff --git a/testsuite/tests/typecheck/should_fail/T12430.stderr b/testsuite/tests/typecheck/should_fail/T12430.stderr new file mode 100644 index 0000000..c3d9446 --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T12430.stderr @@ -0,0 +1,8 @@ + +T12430.hs:6:3: error: + • Type family equation violates injectivity annotation. + Type variable ‘x’ cannot be inferred from the right-hand side. + In the type family equation: + F x = C x -- Defined at T12430.hs:6:3 + • In the equations for closed type family ‘F’ + In the type family declaration for ‘F’ diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T index 274dcc6..501c5e1 100644 --- a/testsuite/tests/typecheck/should_fail/all.T +++ b/testsuite/tests/typecheck/should_fail/all.T @@ -413,6 +413,7 @@ test('T12177', normal, compile_fail, ['']) test('T12406', normal, compile_fail, ['']) test('T12170a', normal, compile_fail, ['']) test('T12124', normal, compile_fail, ['']) +test('T12430', normal, compile_fail, ['']) test('T12589', normal, compile_fail, ['']) test('T12529', normal, compile_fail, ['']) test('T12563', normal, compile_fail, ['']) From git at git.haskell.org Mon Oct 15 22:34:51 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 15 Oct 2018 22:34:51 +0000 (UTC) Subject: [commit: ghc] master: Fix #15738 by defining (and using) parenthesizeHsContext (02b2116) Message-ID: <20181015223451.382AB3ABB3@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/02b2116e458357e87718e7378a80579a7021e2a7/ghc >--------------------------------------------------------------- commit 02b2116e458357e87718e7378a80579a7021e2a7 Author: Ryan Scott Date: Mon Oct 15 13:49:11 2018 -0400 Fix #15738 by defining (and using) parenthesizeHsContext With `QuantifiedConstraints`, `forall`s can appear in more nested positions than they could before, but `Convert` and the TH pretty-printer were failing to take this into account. On the `Convert` side, this is fixed by using a `parenthesizeHsContext` to parenthesize singleton quantified constraints that appear to the left of a `=>`. (A similar fix is applied to the TH pretty-printer.) Test Plan: make test TEST=T15738 Reviewers: goldfire, bgamari Reviewed By: bgamari Subscribers: rwbarton, carter GHC Trac Issues: #15738 Differential Revision: https://phabricator.haskell.org/D5222 >--------------------------------------------------------------- 02b2116e458357e87718e7378a80579a7021e2a7 compiler/hsSyn/Convert.hs | 3 ++- compiler/hsSyn/HsTypes.hs | 14 +++++++++++++- libraries/template-haskell/Language/Haskell/TH/Ppr.hs | 1 + testsuite/tests/th/T15738.hs | 13 +++++++++++++ testsuite/tests/th/T15738.stderr | 11 +++++++++++ testsuite/tests/th/all.T | 1 + 6 files changed, 41 insertions(+), 2 deletions(-) diff --git a/compiler/hsSyn/Convert.hs b/compiler/hsSyn/Convert.hs index d094e17..af2c603 100644 --- a/compiler/hsSyn/Convert.hs +++ b/compiler/hsSyn/Convert.hs @@ -1341,10 +1341,11 @@ cvtTypeKind ty_str ty | null tys' -> do { tvs' <- cvtTvs tvs ; cxt' <- cvtContext cxt + ; let pcxt = parenthesizeHsContext funPrec cxt' ; ty' <- cvtType ty ; loc <- getL ; let hs_ty = mkHsForAllTy tvs loc tvs' rho_ty - rho_ty = mkHsQualTy cxt loc cxt' ty' + rho_ty = mkHsQualTy cxt loc pcxt ty' ; return hs_ty } diff --git a/compiler/hsSyn/HsTypes.hs b/compiler/hsSyn/HsTypes.hs index 3d853db..c36a54f 100644 --- a/compiler/hsSyn/HsTypes.hs +++ b/compiler/hsSyn/HsTypes.hs @@ -65,7 +65,7 @@ module HsTypes ( -- Printing pprHsType, pprHsForAll, pprHsForAllTvs, pprHsForAllExtra, pprHsContext, pprHsContextNoArrow, pprHsContextMaybe, - hsTypeNeedsParens, parenthesizeHsType + hsTypeNeedsParens, parenthesizeHsType, parenthesizeHsContext ) where import GhcPrelude @@ -1495,3 +1495,15 @@ parenthesizeHsType :: PprPrec -> LHsType (GhcPass p) -> LHsType (GhcPass p) parenthesizeHsType p lty@(L loc ty) | hsTypeNeedsParens p ty = L loc (HsParTy NoExt lty) | otherwise = lty + +-- | @'parenthesizeHsContext' p ctxt@ checks if @ctxt@ is a single constraint +-- @c@ such that @'hsTypeNeedsParens' p c@ is true, and if so, surrounds @c@ +-- with an 'HsParTy' to form a parenthesized @ctxt at . Otherwise, it simply +-- returns @ctxt@ unchanged. +parenthesizeHsContext :: PprPrec + -> LHsContext (GhcPass p) -> LHsContext (GhcPass p) +parenthesizeHsContext p lctxt@(L loc ctxt) = + case ctxt of + [c] -> L loc [parenthesizeHsType p c] + _ -> lctxt -- Other contexts are already "parenthesized" by virtue of + -- being tuples. diff --git a/libraries/template-haskell/Language/Haskell/TH/Ppr.hs b/libraries/template-haskell/Language/Haskell/TH/Ppr.hs index 8158af6..7df8c98 100644 --- a/libraries/template-haskell/Language/Haskell/TH/Ppr.hs +++ b/libraries/template-haskell/Language/Haskell/TH/Ppr.hs @@ -795,6 +795,7 @@ pprCxt ts = ppr_cxt_preds ts <+> text "=>" ppr_cxt_preds :: Cxt -> Doc ppr_cxt_preds [] = empty ppr_cxt_preds [t at ImplicitParamT{}] = parens (ppr t) +ppr_cxt_preds [t at ForallT{}] = parens (ppr t) ppr_cxt_preds [t] = ppr t ppr_cxt_preds ts = parens (commaSep ts) diff --git a/testsuite/tests/th/T15738.hs b/testsuite/tests/th/T15738.hs new file mode 100644 index 0000000..4bc2d45 --- /dev/null +++ b/testsuite/tests/th/T15738.hs @@ -0,0 +1,13 @@ +{-# LANGUAGE QuantifiedConstraints #-} +{-# LANGUAGE TemplateHaskell #-} +module T15738 where + +import Language.Haskell.TH +import System.IO + +data Foo x = MkFoo x + +$(do d <- [d| f :: (forall a. Eq (Foo a)) => Foo x -> Foo x -> Bool + f = (==) |] + runIO $ hPutStrLn stderr $ pprint d + pure d) diff --git a/testsuite/tests/th/T15738.stderr b/testsuite/tests/th/T15738.stderr new file mode 100644 index 0000000..57a2db5 --- /dev/null +++ b/testsuite/tests/th/T15738.stderr @@ -0,0 +1,11 @@ +f_0 :: (forall a_1 . GHC.Classes.Eq (T15738.Foo a_1)) => + T15738.Foo x_2 -> T15738.Foo x_2 -> GHC.Types.Bool +f_0 = (GHC.Classes.==) +T15738.hs:(10,3)-(13,11): Splicing declarations + do d <- [d| f :: (forall a. Eq (Foo a)) => Foo x -> Foo x -> Bool + f = (==) |] + runIO $ hPutStrLn stderr $ pprint d + pure d + ======> + f :: (forall a. Eq (Foo a)) => Foo x -> Foo x -> Bool + f = (==) diff --git a/testsuite/tests/th/all.T b/testsuite/tests/th/all.T index 249493e..df114b5 100644 --- a/testsuite/tests/th/all.T +++ b/testsuite/tests/th/all.T @@ -438,3 +438,4 @@ test('TH_implicitParamsErr3', normal, compile_fail, ['-v0 -dsuppress-uniques']) test('TH_recursiveDo', normal, compile_and_run, ['-v0 -dsuppress-uniques']) test('T15481', normal, compile, ['-v0 -ddump-splices -dsuppress-uniques']) test('TH_recover_warns', normal, compile, ['-v0 -ddump-splices -dsuppress-uniques']) +test('T15738', normal, compile, ['-v0 -ddump-splices -dsuppress-uniques']) From git at git.haskell.org Mon Oct 15 22:34:54 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 15 Oct 2018 22:34:54 +0000 (UTC) Subject: [commit: ghc] master: Generate correct relocation for external cost centre (95ec7c8) Message-ID: <20181015223454.A0CB13ABB3@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/95ec7c88c7223508db3ba91d6ab9e303d0b062ad/ghc >--------------------------------------------------------------- commit 95ec7c88c7223508db3ba91d6ab9e303d0b062ad Author: Zejun Wu Date: Mon Oct 15 13:51:24 2018 -0400 Generate correct relocation for external cost centre We used to always generate direct access for cost centre labels. We fixed this by generating indirect data load for cost centre defined in external module. Test Plan: The added test used to fail with error message ``` /bin/ld.gold: error: T15723B.o: requires dynamic R_X86_64_PC32 reloc against 'T15723A_foo1_EXPR_cc' which may overflow at runtime; recompile with -fPIC ``` and now passes. Also check that `R_X86_64_PC32` is generated for CostCentre from the same module and `R_X86_64_GOTPCREL` is generated for CostCentre from external module: ``` $ objdump -rdS T15723B.o 0000000000000028 : 28: 48 8d 45 f0 lea -0x10(%rbp),%rax 2c: 4c 39 f8 cmp %r15,%rax 2f: 72 70 jb a1 31: 48 83 ec 08 sub $0x8,%rsp 35: 48 8d 35 00 00 00 00 lea 0x0(%rip),%rsi # 3c 38: R_X86_64_PC32 T15723B_test1_EXPR_cc-0x4 3c: 49 8b bd 60 03 00 00 mov 0x360(%r13),%rdi 43: 31 c0 xor %eax,%eax 45: e8 00 00 00 00 callq 4a 46: R_X86_64_PLT32 pushCostCentre-0x4 4a: 48 83 c4 08 add $0x8,%rsp 4e: 48 ff 40 30 incq 0x30(%rax) 52: 49 89 85 60 03 00 00 mov %rax,0x360(%r13) 59: 48 83 ec 08 sub $0x8,%rsp 5d: 49 8b bd 60 03 00 00 mov 0x360(%r13),%rdi 64: 48 8b 35 00 00 00 00 mov 0x0(%rip),%rsi # 6b 67: R_X86_64_GOTPCREL T15723A_foo1_EXPR_cc-0x4 6b: 31 c0 xor %eax,%eax 6d: e8 00 00 00 00 callq 72 6e: R_X86_64_PLT32 pushCostCentre-0x4 72: 48 83 c4 08 add $0x8,%rsp 76: 48 ff 40 30 incq 0x30(%rax) ``` Reviewers: simonmar, bgamari Reviewed By: simonmar Subscribers: rwbarton, carter GHC Trac Issues: #15723 Differential Revision: https://phabricator.haskell.org/D5214 >--------------------------------------------------------------- 95ec7c88c7223508db3ba91d6ab9e303d0b062ad compiler/cmm/CLabel.hs | 15 +++++++++++---- testsuite/tests/codeGen/should_compile/Makefile | 5 +++++ .../should_compile/T15723.stderr} | 2 -- testsuite/tests/codeGen/should_compile/T15723A.hs | 9 +++++++++ testsuite/tests/codeGen/should_compile/T15723B.hs | 6 ++++++ testsuite/tests/codeGen/should_compile/all.T | 5 +++++ 6 files changed, 36 insertions(+), 6 deletions(-) diff --git a/compiler/cmm/CLabel.hs b/compiler/cmm/CLabel.hs index f07abeb..dbb92e5 100644 --- a/compiler/cmm/CLabel.hs +++ b/compiler/cmm/CLabel.hs @@ -1019,7 +1019,7 @@ labelDynamic dflags this_mod lbl = case lbl of -- is the RTS in a DLL or not? RtsLabel _ -> - (gopt Opt_ExternalDynamicRefs dflags) && (this_pkg /= rtsUnitId) + externalDynamicRefs && (this_pkg /= rtsUnitId) IdLabel n _ _ -> isDllName dflags this_mod n @@ -1028,7 +1028,7 @@ labelDynamic dflags this_mod lbl = -- its own shared library. CmmLabel pkg _ _ | os == OSMinGW32 -> - (gopt Opt_ExternalDynamicRefs dflags) && (this_pkg /= pkg) + externalDynamicRefs && (this_pkg /= pkg) | otherwise -> gopt Opt_ExternalDynamicRefs dflags @@ -1048,19 +1048,26 @@ labelDynamic dflags this_mod lbl = -- When compiling in the "dyn" way, each package is to be -- linked into its own DLL. ForeignLabelInPackage pkgId -> - (gopt Opt_ExternalDynamicRefs dflags) && (this_pkg /= pkgId) + externalDynamicRefs && (this_pkg /= pkgId) else -- On Mac OS X and on ELF platforms, false positives are OK, -- so we claim that all foreign imports come from dynamic -- libraries True + CC_Label cc -> + externalDynamicRefs && not (ccFromThisModule cc this_mod) + + -- CCS_Label always contains a CostCentre defined in the current module + CCS_Label _ -> False + HpcTicksLabel m -> - (gopt Opt_ExternalDynamicRefs dflags) && this_mod /= m + externalDynamicRefs && this_mod /= m -- Note that DynamicLinkerLabels do NOT require dynamic linking themselves. _ -> False where + externalDynamicRefs = gopt Opt_ExternalDynamicRefs dflags os = platformOS (targetPlatform dflags) this_pkg = moduleUnitId this_mod diff --git a/testsuite/tests/codeGen/should_compile/Makefile b/testsuite/tests/codeGen/should_compile/Makefile index a1fc58f..c072944 100644 --- a/testsuite/tests/codeGen/should_compile/Makefile +++ b/testsuite/tests/codeGen/should_compile/Makefile @@ -38,3 +38,8 @@ T14999: T15196: '$(TEST_HC)' $(TEST_HC_OPTS) -c -O -ddump-asm T15196.hs | grep "jp " ; echo $$? + +T15723: + '$(TEST_HC)' $(TEST_HC_OPTS) -prof -fPIC -fexternal-dynamic-refs -fforce-recomp -O2 -c T15723A.hs -o T15723A.o + '$(TEST_HC)' $(TEST_HC_OPTS) -prof -fPIC -fexternal-dynamic-refs -fforce-recomp -O2 -c T15723B.hs -o T15723B.o + '$(TEST_HC)' $(TEST_HC_OPTS) -dynamic -shared T15723B.o -o T15723B.so diff --git a/testsuite/tests/typecheck/T13168/T13168.stderr b/testsuite/tests/codeGen/should_compile/T15723.stderr similarity index 50% copy from testsuite/tests/typecheck/T13168/T13168.stderr copy to testsuite/tests/codeGen/should_compile/T15723.stderr index e69dbaa..cd2812b 100644 --- a/testsuite/tests/typecheck/T13168/T13168.stderr +++ b/testsuite/tests/codeGen/should_compile/T15723.stderr @@ -1,4 +1,2 @@ Warning: -rtsopts and -with-rtsopts have no effect with -shared. Call hs_init_ghc() from your main() function to set these options. -Warning: -rtsopts and -with-rtsopts have no effect with -shared. - Call hs_init_ghc() from your main() function to set these options. diff --git a/testsuite/tests/codeGen/should_compile/T15723A.hs b/testsuite/tests/codeGen/should_compile/T15723A.hs new file mode 100644 index 0000000..aa47ece --- /dev/null +++ b/testsuite/tests/codeGen/should_compile/T15723A.hs @@ -0,0 +1,9 @@ +module T15723A where + +{-# INLINE foo #-} +foo :: Int -> Int +foo x = {-# SCC foo1 #-} bar x + +{-# NOINLINE bar #-} +bar :: Int -> Int +bar x = x diff --git a/testsuite/tests/codeGen/should_compile/T15723B.hs b/testsuite/tests/codeGen/should_compile/T15723B.hs new file mode 100644 index 0000000..5b7b44d --- /dev/null +++ b/testsuite/tests/codeGen/should_compile/T15723B.hs @@ -0,0 +1,6 @@ +module T15723B where + +import T15723A + +test :: Int -> Int +test x = {-# SCC test1 #-} foo $ foo x diff --git a/testsuite/tests/codeGen/should_compile/all.T b/testsuite/tests/codeGen/should_compile/all.T index a5d5a47..f8e2fb0 100644 --- a/testsuite/tests/codeGen/should_compile/all.T +++ b/testsuite/tests/codeGen/should_compile/all.T @@ -46,3 +46,8 @@ test('T15196', [ unless(arch('x86_64'),skip), only_ways('normal'), ], run_command, ['$MAKE -s --no-print-directory T15196']) + +test('T15723', + [ unless(have_profiling(), skip), + unless(have_dynamic(), skip), + ], run_command, ['$MAKE -s --no-print-directory T15723']) From git at git.haskell.org Tue Oct 16 00:00:21 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 16 Oct 2018 00:00:21 +0000 (UTC) Subject: [commit: ghc] master: ghc-heap: Fix writing closures on big endian (058c281) Message-ID: <20181016000021.530BD3ABB3@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/058c2813d882266309e8045af7a72eedecbf2dbb/ghc >--------------------------------------------------------------- commit 058c2813d882266309e8045af7a72eedecbf2dbb Author: Peter Trommler Date: Mon Oct 15 13:51:53 2018 -0400 ghc-heap: Fix writing closures on big endian We need to write the closure type as a HalfWord not an Int. On big endian systems the closure type ends up being zero (the upper word of the Int) making the closure an invalid object. Test Plan: validate (preferably on a big endian system) Reviewers: bgamari, hvr, erikd, simonmar Reviewed By: simonmar Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5212 >--------------------------------------------------------------- 058c2813d882266309e8045af7a72eedecbf2dbb libraries/ghc-heap/GHC/Exts/Heap/InfoTable.hsc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libraries/ghc-heap/GHC/Exts/Heap/InfoTable.hsc b/libraries/ghc-heap/GHC/Exts/Heap/InfoTable.hsc index 25fe498..95151b4 100644 --- a/libraries/ghc-heap/GHC/Exts/Heap/InfoTable.hsc +++ b/libraries/ghc-heap/GHC/Exts/Heap/InfoTable.hsc @@ -59,7 +59,7 @@ pokeItbl a0 itbl = do #endif (#poke StgInfoTable, layout.payload.ptrs) a0 (ptrs itbl) (#poke StgInfoTable, layout.payload.nptrs) a0 (nptrs itbl) - (#poke StgInfoTable, type) a0 (fromEnum (tipe itbl)) + (#poke StgInfoTable, type) a0 (toHalfWord (fromEnum (tipe itbl))) #if __GLASGOW_HASKELL__ > 804 (#poke StgInfoTable, srt) a0 (srtlen itbl) #else @@ -72,6 +72,9 @@ pokeItbl a0 itbl = do Just (Left xs) -> pokeArray code_offset xs Just (Right xs) -> pokeArray code_offset xs #endif + where + toHalfWord :: Int -> HalfWord + toHalfWord i = fromIntegral i -- | Size in bytes of a standard InfoTable itblSize :: Int From git at git.haskell.org Tue Oct 16 00:00:24 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 16 Oct 2018 00:00:24 +0000 (UTC) Subject: [commit: ghc] master: Enable -Wcompat=error in the testsuite (165d3d5) Message-ID: <20181016000024.42CDE3ABB3@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/165d3d5ddaecc7dbe7f5ac051834a7619463efb0/ghc >--------------------------------------------------------------- commit 165d3d5ddaecc7dbe7f5ac051834a7619463efb0 Author: Vladislav Zavialov Date: Mon Oct 15 13:52:12 2018 -0400 Enable -Wcompat=error in the testsuite Enabling -Werror=compat in the testsuite allows us to easily see the impact that a new warning has on code. It also means that in the period between adding the warning and making the actual breaking change, all new test cases that are being added to the testsuite will be forwards-compatible. This is good because it will make the actual breaking change contain less irrelevant testsuite updates. Things that -Wcompat warns about are things that are going to break in the future, so we can be proactive and keep our testsuite forwards-compatible. This patch consists of two main changes: * Add `TEST_HC_OPTS += -Werror=compat` to the testsuite configuration. * Fix all broken test cases. Test Plan: Validate Reviewers: hvr, goldfire, bgamari, simonpj, RyanGlScott Reviewed By: goldfire, RyanGlScott Subscribers: rwbarton, carter GHC Trac Issues: #15278 Differential Revision: https://phabricator.haskell.org/D5200 >--------------------------------------------------------------- 165d3d5ddaecc7dbe7f5ac051834a7619463efb0 libraries/base/tests/CatPairs.hs | 6 +- testsuite/mk/test.mk | 3 + testsuite/tests/deSugar/should_compile/T10767.hs | 3 +- testsuite/tests/deSugar/should_compile/T12944.hs | 4 +- testsuite/tests/deSugar/should_run/dsrun010.hs | 1 + testsuite/tests/dependent/should_compile/Dep1.hs | 2 +- testsuite/tests/dependent/should_compile/Dep3.hs | 8 +- .../dependent/should_compile/KindEqualities.hs | 6 +- .../dependent/should_compile/KindEqualities2.hs | 4 +- .../tests/dependent/should_compile/KindLevels.hs | 8 +- .../tests/dependent/should_compile/RaeJobTalk.hs | 8 +- testsuite/tests/dependent/should_compile/T11311.hs | 2 +- testsuite/tests/dependent/should_compile/T11635.hs | 2 +- testsuite/tests/dependent/should_compile/T15264.hs | 2 +- testsuite/tests/dependent/should_compile/T15346.hs | 2 +- testsuite/tests/dependent/should_compile/T9632.hs | 4 +- .../tests/dependent/should_compile/mkGADTVars.hs | 4 +- testsuite/tests/dependent/should_run/T11311.hs | 2 +- testsuite/tests/deriving/should_compile/T11416.hs | 4 +- testsuite/tests/deriving/should_compile/T11732c.hs | 6 +- testsuite/tests/deriving/should_compile/T11833.hs | 6 +- .../tests/deriving/should_compile/T12144_1.hs | 4 +- testsuite/tests/deriving/should_compile/T13297.hs | 4 +- testsuite/tests/deriving/should_compile/T13758.hs | 3 + testsuite/tests/deriving/should_compile/T14933.hs | 4 +- testsuite/tests/deriving/should_compile/T8165.hs | 6 +- testsuite/tests/deriving/should_compile/T8678.hs | 4 +- testsuite/tests/deriving/should_compile/T9359.hs | 4 +- .../should_compile/deriving-via-standalone.hs | 9 +- testsuite/tests/determinism/determ004/determ004.hs | 29 +-- testsuite/tests/driver/T13803/E.hs | 4 +- testsuite/tests/gadt/Gadt23_AST.hs | 4 +- testsuite/tests/gadt/Session.hs | 4 +- testsuite/tests/gadt/T14320.hs | 8 +- testsuite/tests/gadt/T9380.hs | 5 +- testsuite/tests/gadt/gadt20.hs | 6 +- testsuite/tests/gadt/gadt22.hs | 3 +- testsuite/tests/gadt/gadt8.hs | 4 +- testsuite/tests/gadt/josef.hs | 4 +- testsuite/tests/gadt/karl1.hs | 4 +- testsuite/tests/gadt/karl2.hs | 6 +- testsuite/tests/generics/T10604/T10604_deriving.hs | 5 +- testsuite/tests/generics/T8479.hs | 7 +- testsuite/tests/generics/T9563.hs | 3 +- testsuite/tests/ghci/scripts/GhciKinds.hs | 4 +- testsuite/tests/ghci/scripts/T12550.script | 1 + testsuite/tests/ghci/scripts/T4175.hs | 4 +- testsuite/tests/ghci/scripts/T4175.stdout | 10 +- testsuite/tests/ghci/scripts/T5417.stdout | 2 +- testsuite/tests/ghci/scripts/T5417a.hs | 4 +- testsuite/tests/ghci/scripts/T6018ghcifail.script | 4 +- testsuite/tests/ghci/scripts/T9293.stdout | 20 ++ testsuite/tests/ghci/scripts/TypeAppData.script | 4 +- testsuite/tests/ghci/scripts/TypeAppData.stdout | 1 - testsuite/tests/ghci/scripts/ghci024.stdout | 5 + testsuite/tests/ghci/scripts/ghci050.script | 3 +- testsuite/tests/ghci/scripts/ghci050.stderr | 11 +- testsuite/tests/ghci/scripts/ghci057.stdout | 20 ++ .../indexed-types/should_compile/ATLoop_help.hs | 4 +- .../tests/indexed-types/should_compile/Class1.hs | 4 +- .../tests/indexed-types/should_compile/GADT12.hs | 6 +- .../tests/indexed-types/should_compile/GADT13.hs | 4 +- .../indexed-types/should_compile/Ind2_help.hs | 4 +- .../should_compile/InstContextNorm.hs | 4 +- .../tests/indexed-types/should_compile/Kind.hs | 4 +- .../indexed-types/should_compile/OversatDecomp.hs | 6 +- .../tests/indexed-types/should_compile/Refl.hs | 4 +- .../tests/indexed-types/should_compile/Refl2.hs | 4 +- .../tests/indexed-types/should_compile/Roman1.hs | 11 +- .../tests/indexed-types/should_compile/Simple1.hs | 8 +- .../tests/indexed-types/should_compile/Simple16.hs | 4 +- .../tests/indexed-types/should_compile/Simple19.hs | 4 +- .../tests/indexed-types/should_compile/Simple24.hs | 4 +- .../tests/indexed-types/should_compile/Simple3.hs | 4 +- .../tests/indexed-types/should_compile/Simple4.hs | 4 +- .../tests/indexed-types/should_compile/Simple5.hs | 4 +- .../tests/indexed-types/should_compile/Simple6.hs | 3 +- .../tests/indexed-types/should_compile/Simple7.hs | 4 +- .../tests/indexed-types/should_compile/Simple9.hs | 4 +- .../tests/indexed-types/should_compile/Sock.hs | 8 +- .../tests/indexed-types/should_compile/T10139.hs | 7 +- .../tests/indexed-types/should_compile/T10318.hs | 4 +- .../tests/indexed-types/should_compile/T10753.hs | 3 +- .../tests/indexed-types/should_compile/T10931.hs | 8 +- .../tests/indexed-types/should_compile/T11361.hs | 4 +- .../tests/indexed-types/should_compile/T11581.hs | 4 +- .../tests/indexed-types/should_compile/T12526.hs | 6 +- .../tests/indexed-types/should_compile/T13662.hs | 4 +- .../tests/indexed-types/should_compile/T14131.hs | 10 +- .../tests/indexed-types/should_compile/T2291.hs | 6 +- .../tests/indexed-types/should_compile/T2448.hs | 4 +- .../tests/indexed-types/should_compile/T2715.hs | 8 +- .../tests/indexed-types/should_compile/T2767.hs | 6 +- .../tests/indexed-types/should_compile/T2850.hs | 4 +- .../tests/indexed-types/should_compile/T2944.hs | 4 +- .../tests/indexed-types/should_compile/T3220.hs | 4 +- .../tests/indexed-types/should_compile/T3590.hs | 4 +- .../tests/indexed-types/should_compile/T3787.hs | 5 +- .../tests/indexed-types/should_compile/T3851.hs | 6 +- .../tests/indexed-types/should_compile/T4120.hs | 3 +- .../tests/indexed-types/should_compile/T4160.hs | 9 +- .../tests/indexed-types/should_compile/T4185.hs | 4 +- .../tests/indexed-types/should_compile/T4200.hs | 4 +- .../tests/indexed-types/should_compile/T4356.hs | 4 +- .../tests/indexed-types/should_compile/T4484.hs | 8 +- .../tests/indexed-types/should_compile/T5591b.hs | 4 +- .../tests/indexed-types/should_compile/T7082.hs | 4 +- .../tests/indexed-types/should_compile/T7280.hs | 6 +- .../tests/indexed-types/should_compile/T7282.hs | 4 +- .../tests/indexed-types/should_compile/T7474.hs | 6 +- .../tests/indexed-types/should_compile/T7489.hs | 4 +- .../tests/indexed-types/should_compile/T8913.hs | 4 +- .../tests/indexed-types/should_compile/T8978.hs | 4 +- .../tests/indexed-types/should_compile/T9316.hs | 10 +- .../tests/indexed-types/should_compile/T9840.hs | 5 +- .../indexed-types/should_compile/T9840.hs-boot | 6 +- .../tests/indexed-types/should_compile/ind1.hs | 4 +- .../should_compile/red-black-delete.hs | 3 +- .../indexed-types/should_fail/ClosedFam3.hs-boot | 4 +- .../indexed-types/should_fail/ClosedFam3.stderr | 6 +- .../indexed-types/should_fail/NonLinearSigErr.hs | 4 +- testsuite/tests/indexed-types/should_fail/OverA.hs | 6 +- .../should_fail/OverDirectThisModA.hs | 6 +- .../should_fail/OverIndirectThisModA.hs | 6 +- .../indexed-types/should_fail/SimpleFail10.hs | 4 +- .../tests/indexed-types/should_fail/SimpleFail4.hs | 4 +- .../indexed-types/should_fail/SimpleFail4.stderr | 2 +- .../tests/indexed-types/should_fail/T7354b.hs | 4 +- testsuite/tests/indexed-types/should_fail/T8227.hs | 3 +- .../tests/indexed-types/should_fail/T8227.stderr | 8 +- .../tests/indexed-types/should_fail/T8227a.hs | 4 +- .../tests/indexed-types/should_fail/T9580a.hs | 4 +- .../tests/indexed-types/should_run/GMapAssoc.hs | 4 +- .../tests/indexed-types/should_run/GMapTop.hs | 3 +- .../tests/indexed-types/should_run/T11465a.hs | 2 +- testsuite/tests/monadfail/MonadFailWarnings.hs | 2 +- .../tests/monadfail/MonadFailWarningsDisabled.hs | 1 + .../MonadFailWarningsWithRebindableSyntax.hs | 2 +- .../tests/parser/should_compile/DumpRenamedAst.hs | 8 +- .../parser/should_compile/DumpRenamedAst.stderr | 257 ++++++++++++--------- testsuite/tests/parser/should_compile/T10379.hs | 1 + testsuite/tests/parser/should_compile/T13747.hs | 6 +- testsuite/tests/parser/should_compile/read026.hs | 2 + testsuite/tests/parser/should_compile/read050.hs | 4 +- testsuite/tests/parser/should_compile/read051.hs | 4 +- .../tests/partial-sigs/should_compile/T13482.hs | 4 +- .../partial-sigs/should_compile/T13482.stderr | 18 +- .../should_compile/TypeFamilyInstanceLHS.hs | 4 +- .../should_compile/TypeFamilyInstanceLHS.stderr | 4 +- testsuite/tests/patsyn/should_compile/T10997_1a.hs | 6 +- testsuite/tests/patsyn/should_compile/T12968.hs | 3 +- testsuite/tests/patsyn/should_compile/T8966.hs | 4 +- testsuite/tests/patsyn/should_compile/T8968-1.hs | 4 +- testsuite/tests/patsyn/should_compile/T8968-2.hs | 4 +- testsuite/tests/perf/compiler/T5030.hs | 3 +- testsuite/tests/perf/compiler/T5837.hs | 4 +- .../tests/pmcheck/should_compile/EmptyCase002.hs | 8 +- .../pmcheck/should_compile/EmptyCase002.stderr | 9 +- .../tests/pmcheck/should_compile/EmptyCase003.hs | 16 +- .../pmcheck/should_compile/EmptyCase003.stderr | 7 +- .../tests/pmcheck/should_compile/EmptyCase004.hs | 6 +- .../pmcheck/should_compile/EmptyCase004.stderr | 15 +- .../tests/pmcheck/should_compile/EmptyCase006.hs | 4 +- .../pmcheck/should_compile/EmptyCase006.stderr | 5 +- .../tests/pmcheck/should_compile/EmptyCase007.hs | 4 +- .../pmcheck/should_compile/EmptyCase007.stderr | 13 +- .../tests/pmcheck/should_compile/EmptyCase008.hs | 4 +- .../pmcheck/should_compile/EmptyCase008.stderr | 9 +- .../tests/pmcheck/should_compile/EmptyCase009.hs | 6 +- .../pmcheck/should_compile/EmptyCase009.stderr | 7 +- .../tests/pmcheck/should_compile/EmptyCase010.hs | 10 +- .../pmcheck/should_compile/EmptyCase010.stderr | 17 +- testsuite/tests/pmcheck/should_compile/T8970.hs | 8 +- testsuite/tests/polykinds/Freeman.hs | 40 ++-- testsuite/tests/polykinds/PolyInstances.hs | 4 +- testsuite/tests/polykinds/PolyKinds01.hs | 4 +- testsuite/tests/polykinds/PolyKinds09.hs | 12 +- testsuite/tests/polykinds/RedBlack.hs | 6 +- testsuite/tests/polykinds/T10670.hs | 3 +- testsuite/tests/polykinds/T11362.hs | 8 +- testsuite/tests/polykinds/T11480a.hs | 8 +- testsuite/tests/polykinds/T11821.hs | 7 +- testsuite/tests/polykinds/T14172a.hs | 5 +- testsuite/tests/polykinds/T14723.hs | 2 +- testsuite/tests/polykinds/T14873.hs | 2 +- testsuite/tests/polykinds/T5862.hs | 4 +- testsuite/tests/polykinds/T5937.hs | 4 +- testsuite/tests/polykinds/T5938.hs | 4 +- testsuite/tests/polykinds/T6002.hs | 10 +- testsuite/tests/polykinds/T6049.hs | 8 +- testsuite/tests/polykinds/T6068.hs | 8 +- testsuite/tests/polykinds/T6081.hs | 4 +- testsuite/tests/polykinds/T6093.hs | 6 +- testsuite/tests/polykinds/T6118.hs | 5 +- testsuite/tests/polykinds/T6137.hs | 16 +- testsuite/tests/polykinds/T7053a.hs | 4 +- testsuite/tests/polykinds/T7176.hs | 2 +- testsuite/tests/polykinds/T7332.hs | 3 +- testsuite/tests/polykinds/T7347.hs | 4 +- testsuite/tests/polykinds/T7404.hs | 4 +- testsuite/tests/polykinds/T7438a.hs | 4 +- testsuite/tests/polykinds/T7481.hs | 5 +- testsuite/tests/polykinds/T7601.hs | 4 +- testsuite/tests/polykinds/T7908.hs | 14 +- testsuite/tests/polykinds/T7916.hs | 7 +- testsuite/tests/polykinds/T7973.hs | 4 +- testsuite/tests/polykinds/T9200.hs | 4 +- testsuite/tests/polykinds/T9574.hs | 14 +- testsuite/tests/polykinds/T9725.hs | 10 +- testsuite/tests/polykinds/T9750.hs | 3 +- testsuite/tests/rebindable/rebindable2.hs | 1 + testsuite/tests/rebindable/rebindable3.hs | 1 + testsuite/tests/rebindable/rebindable4.hs | 1 + testsuite/tests/rebindable/rebindable5.hs | 1 + testsuite/tests/rename/should_compile/T15149A.hs | 4 +- testsuite/tests/roles/should_compile/Roles1.hs | 4 +- testsuite/tests/simplCore/should_compile/T11562.hs | 7 +- testsuite/tests/simplCore/should_compile/T11644.hs | 4 +- testsuite/tests/simplCore/should_compile/T13410.hs | 9 +- .../tests/simplCore/should_compile/T14270a.hs | 2 +- testsuite/tests/simplCore/should_compile/T15186.hs | 3 +- .../tests/simplCore/should_compile/T15517a.hs | 19 +- testsuite/tests/simplCore/should_compile/T5303.hs | 15 +- testsuite/tests/simplCore/should_compile/T7785.hs | 4 +- .../tests/simplCore/should_compile/simpl011.hs | 4 +- testsuite/tests/simplCore/should_run/T3591.hs | 9 +- testsuite/tests/th/T10828.hs | 13 +- testsuite/tests/th/T10891.hs | 7 +- testsuite/tests/th/T11463.hs | 8 +- testsuite/tests/th/T11484.hs | 4 +- testsuite/tests/th/T12646.hs | 9 +- testsuite/tests/th/T13123.hs | 16 +- testsuite/tests/th/T13782.hs | 3 +- testsuite/tests/th/T14817.hs | 6 +- testsuite/tests/th/T14817.stderr | 10 +- testsuite/tests/th/T3920.hs | 9 +- testsuite/tests/th/T5452.hs | 8 +- testsuite/tests/th/T5882.hs | 7 +- testsuite/tests/th/T5886a.hs | 5 +- testsuite/tests/th/T8031.hs | 2 +- testsuite/tests/th/T8953.hs | 27 +-- testsuite/tests/th/T9199.hs | 4 +- testsuite/tests/th/T9692.hs | 7 +- testsuite/tests/th/TH_RichKinds.hs | 11 +- testsuite/tests/th/TH_tf1.hs | 4 +- testsuite/tests/typecheck/should_compile/T10195.hs | 4 +- testsuite/tests/typecheck/should_compile/T10432.hs | 4 +- testsuite/tests/typecheck/should_compile/T10564.hs | 8 +- testsuite/tests/typecheck/should_compile/T10592.hs | 3 +- testsuite/tests/typecheck/should_compile/T11401.hs | 8 +- testsuite/tests/typecheck/should_compile/T11811.hs | 2 +- testsuite/tests/typecheck/should_compile/T12797.hs | 3 +- testsuite/tests/typecheck/should_compile/T12911.hs | 2 +- testsuite/tests/typecheck/should_compile/T13333.hs | 2 +- .../tests/typecheck/should_compile/T13585a.hs | 5 +- testsuite/tests/typecheck/should_compile/T13881.hs | 2 +- testsuite/tests/typecheck/should_compile/T1470.hs | 4 +- testsuite/tests/typecheck/should_compile/T14732.hs | 5 +- testsuite/tests/typecheck/should_compile/T14763.hs | 4 +- testsuite/tests/typecheck/should_compile/T15368.hs | 4 +- .../tests/typecheck/should_compile/T15368.stderr | 18 +- testsuite/tests/typecheck/should_compile/T15370.hs | 2 +- testsuite/tests/typecheck/should_compile/T4310.hs | 4 +- testsuite/tests/typecheck/should_compile/T4952.hs | 3 +- testsuite/tests/typecheck/should_compile/T5595.hs | 4 +- testsuite/tests/typecheck/should_compile/T5655.hs | 4 +- testsuite/tests/typecheck/should_compile/T6011.hs | 4 +- testsuite/tests/typecheck/should_compile/T6018.hs | 10 +- .../tests/typecheck/should_compile/T6018.hs-boot | 5 +- .../tests/typecheck/should_compile/T6018.stderr | 8 +- testsuite/tests/typecheck/should_compile/T6018a.hs | 3 +- testsuite/tests/typecheck/should_compile/T7196.hs | 8 +- testsuite/tests/typecheck/should_compile/T7875.hs | 4 +- testsuite/tests/typecheck/should_compile/T7891.hs | 4 +- testsuite/tests/typecheck/should_compile/T7903.hs | 4 +- .../tests/typecheck/should_compile/T7903.stderr | 4 +- .../tests/typecheck/should_compile/Tc245_A.hs | 6 +- .../tests/typecheck/should_compile/Tc251_Help.hs | 4 +- testsuite/tests/typecheck/should_compile/Vta1.hs | 8 +- testsuite/tests/typecheck/should_compile/tc190.hs | 4 +- testsuite/tests/typecheck/should_compile/tc247.hs | 8 +- testsuite/tests/typecheck/should_compile/tc250.hs | 4 +- testsuite/tests/typecheck/should_compile/tc252.hs | 4 +- testsuite/tests/typecheck/should_compile/tc253.hs | 4 +- testsuite/tests/typecheck/should_compile/tc255.hs | 4 +- testsuite/tests/typecheck/should_compile/tc256.hs | 4 +- testsuite/tests/typecheck/should_compile/tc257.hs | 6 +- .../tests/typecheck/should_fail/ContextStack2.hs | 4 +- .../tests/typecheck/should_fail/T6018Afail.hs | 4 +- .../tests/typecheck/should_fail/T6018Bfail.hs | 4 +- testsuite/tests/typecheck/should_fail/T6018fail.hs | 6 +- .../tests/typecheck/should_fail/T6018fail.stderr | 120 +++++----- testsuite/tests/typecheck/should_fail/tcfail188.hs | 8 +- testsuite/tests/typecheck/should_run/T3500a.hs | 4 +- testsuite/tests/typecheck/should_run/T9858c.hs | 4 +- testsuite/tests/typecheck/should_run/TypeOf.hs | 1 + testsuite/tests/typecheck/should_run/TypeRep.hs | 2 + .../tests/warnings/should_compile/StarBinder.hs | 1 + .../warnings/should_compile/StarBinder.stderr | 4 +- .../tests/wcompat-warnings/WCompatWarningsNotOn.hs | 5 - .../tests/wcompat-warnings/WCompatWarningsOn.hs | 2 +- testsuite/tests/wcompat-warnings/all.T | 1 - 302 files changed, 1273 insertions(+), 790 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 165d3d5ddaecc7dbe7f5ac051834a7619463efb0 From git at git.haskell.org Tue Oct 16 00:00:27 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 16 Oct 2018 00:00:27 +0000 (UTC) Subject: [commit: ghc] master: Add a RTS option -xp to load PIC object anywhere in address space (104599f) Message-ID: <20181016000027.1FBF53ABB3@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/104599f3f157613589e78627c915e4dc20ee54b4/ghc >--------------------------------------------------------------- commit 104599f3f157613589e78627c915e4dc20ee54b4 Author: Zejun Wu Date: Mon Oct 15 13:52:36 2018 -0400 Add a RTS option -xp to load PIC object anywhere in address space Add a RTS option -xp to load PIC object anywhere in address space. We do this by relaxing the requirement of <0x80000000 result of `mmapForLinker` and implying USE_CONTIGUOUS_MMAP. We also need to change calls to `ocInit` and `ocGetNames` to avoid dangling pointers when the address of `oc->image` is changed by `ocAllocateSymbolExtra`. Test Plan: ``` $ uname -a Linux localhost 4.18.8-arch1-1-ARCH #1 SMP PREEMPT Sat Sep 15 20:34:48 UTC 2018 x86_64 GNU/Linux $ cat mk/build.mk DYNAMIC_GHC_PROGRAMS = NO DYNAMIC_BY_DEFAULT = NO GhcRTSWays += thr_debug EXTRA_HC_OPTS += -debug WAY_p_HC_OPTS += -fPIC -fexternal-dynamic-refs $ inplace/bin/ghc-stage2 --interactive -prof +RTS -xp GHCi, version 8.7.20180928: http://www.haskell.org/ghc/ :? for help ghc-stage2: R_X86_64_32 relocation out of range: ghczmprim_GHCziTypes_ZMZN_closure = 7f690bffab59 Recompile /data/users/watashi/ghc/libraries/ghc-prim/dist-install/build/HSghc-prim -0.5.3.o with -fPIC -fexternal-dynamic-refs. ghc-stage2: unable to load package `ghc-prim-0.5.3' $ strace -f -e open,mmap inplace/bin/ghc-stage2 --interactive -prof -fexternal-interpreter -opti+RTS -opti-xp ... [pid 1355283] open("/data/users/watashi/ghc/libraries/base/dist-install/build/libHSbas e-4.12.0.0_p.a", O_RDONLY) = 14 [pid 1355283] mmap(NULL, 8192, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f6a84842000 [pid 1355283] open("/data/users/watashi/ghc/libraries/base/dist-install/build/libHSbas e-4.12.0.0_p.a", O_RDONLY) = 14 [pid 1355283] mmap(NULL, 8192, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f6a84676000 ... Prelude> System.Posix.Process.getProcessID ... [pid 1355283] open("/data/users/watashi/ghc/libraries/unix/dist-install/build/libHSuni x-2.7.2.2_p.a", O_RDONLY) = 14 [pid 1355283] mmap(NULL, 45056, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f6a67d60000 [pid 1355283] open("/data/users/watashi/ghc/libraries/unix/dist-install/build/libHSuni x-2.7.2.2_p.a", O_RDONLY) = 14 [pid 1355283] mmap(NULL, 57344, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f6a67d52000 ... ``` ``` $ uname -a Darwin watashis-iMac.local 18.0.0 Darwin Kernel Version 18.0.0: Wed Aug 22 20:13:40 PDT 2018; root:xnu-4903.201.2~1/RELEASE_X86_64 x86_64 $ mv /Users/watashi/gao/ghc/libraries/integer-gmp/dist-install/build/HSintege r-gmp-1.0.2.0.o{,._DISABLE_GHC_ISSUE_15105} $ inplace/bin/ghc-stage2 --interactive +RTS -xp GHCi, version 8.7.20181003: http://www.haskell.org/ghc/ :? for help Prelude> System.Posix.Process.getProcessID 42791 Prelude> Data.Set.fromList [1 .. 10] fromList [1,2,3,4,5,6,7,8,9,10] Prelude> Leaving GHCi. $ inplace/bin/ghc-stage2 --interactive -prof -fexternal-interpreter GHCi, version 8.7.20181003: http://www.haskell.org/ghc/ :? for help Prelude> System.Posix.Process.getProcessID 42806 Prelude> Data.Set.fromList [1 .. 10] fromList [1,2,3,4,5,6,7,8,9,10] Prelude> Leaving GHCi. ``` Also test with something that used to hit the 2Gb limit and it loads and runs without problem. Reviewers: simonmar, bgamari, angerman, Phyx, hvr, erikd Reviewed By: simonmar Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5195 >--------------------------------------------------------------- 104599f3f157613589e78627c915e4dc20ee54b4 docs/users_guide/8.8.1-notes.rst | 4 ++ docs/users_guide/runtime_control.rst | 28 ++++++++++++- includes/rts/Flags.h | 12 ++++++ libraries/base/GHC/RTS/Flags.hsc | 3 ++ rts/Linker.c | 80 ++++++++++++++++++------------------ rts/RtsFlags.c | 11 +++++ rts/linker/Elf.c | 25 ++--------- rts/linker/MachO.c | 21 ++++++---- rts/linker/SymbolExtras.c | 61 +++++++++++++++++---------- 9 files changed, 151 insertions(+), 94 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 104599f3f157613589e78627c915e4dc20ee54b4 From git at git.haskell.org Tue Oct 16 00:00:29 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 16 Oct 2018 00:00:29 +0000 (UTC) Subject: [commit: ghc] master: Fix BLACKHOLE inspection in RtClosureInspect (45ed461) Message-ID: <20181016000029.E276D3ABB3@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/45ed4619fd5cfe785bbf1142b9d16e4f3c5148ce/ghc >--------------------------------------------------------------- commit 45ed4619fd5cfe785bbf1142b9d16e4f3c5148ce Author: Ömer Sinan Ağacan Date: Mon Oct 15 13:53:21 2018 -0400 Fix BLACKHOLE inspection in RtClosureInspect When inspecing a BLACKHOLE if the BLACKHOLE points to a TSO or a BLOCKING_QUEUE we should return a suspension to the BLACKHOLE itself (instead of returning a suspension to the indirectee). The reason is because in the debugger when we want to evaluate this term we need to enter the BLACKHOLE and not to the TSO or BLOCKING_QUEUE. See the runtime panic caused by this in #8316. Note that while with this patch we do the right thing to evaluate thunks in GHCi, evaluating thunks that are owned by the evaluator thread in a breakpoint will cause a deadlock as we don't release the breakMVar, which is what blocks the evaluator thread from continuing with evaluation. So the GHCi thread will enter the BLACKHOLE, but owner of the BLACKHOLE is also blocked. Reviewers: simonmar, hvr, bgamari Reviewed By: bgamari Subscribers: rwbarton, carter GHC Trac Issues: #8316 Differential Revision: https://phabricator.haskell.org/D5179 >--------------------------------------------------------------- 45ed4619fd5cfe785bbf1142b9d16e4f3c5148ce compiler/ghci/RtClosureInspect.hs | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/compiler/ghci/RtClosureInspect.hs b/compiler/ghci/RtClosureInspect.hs index 18feeb5..167ea1b 100644 --- a/compiler/ghci/RtClosureInspect.hs +++ b/compiler/ghci/RtClosureInspect.hs @@ -692,12 +692,24 @@ cvObtainTerm hsc_env max_depth force old_ty hval = runTR hsc_env $ do traceTR (text "Forcing a " <> text (show (fmap (const ()) t))) liftIO $ GHCi.seqHValue hsc_env a go (pred max_depth) my_ty old_ty a --- Blackholes are indirections iff the payload is not TSO or BLOCKING_QUEUE. So we --- treat them like indirections; if the payload is TSO or BLOCKING_QUEUE, we'll end up --- showing '_' which is what we want. +-- Blackholes are indirections iff the payload is not TSO or BLOCKING_QUEUE. If +-- the indirection is a TSO or BLOCKING_QUEUE, we return the BLACKHOLE itself as +-- the suspension so that entering it in GHCi will enter the BLACKHOLE instead +-- of entering the TSO or BLOCKING_QUEUE (which leads to runtime panic). BlackholeClosure{indirectee=ind} -> do traceTR (text "Following a BLACKHOLE") - go max_depth my_ty old_ty ind + ind_clos <- trIO (GHCi.getClosure hsc_env ind) + let return_bh_value = return (Suspension BLACKHOLE my_ty a Nothing) + case ind_clos of + -- TSO and BLOCKING_QUEUE cases + BlockingQueueClosure{} -> return_bh_value + OtherClosure info _ _ + | tipe info == TSO -> return_bh_value + UnsupportedClosure info + | tipe info == TSO -> return_bh_value + -- Otherwise follow the indirectee + -- (NOTE: This code will break if we support TSO in ghc-heap one day) + _ -> go max_depth my_ty old_ty ind -- We always follow indirections IndClosure{indirectee=ind} -> do traceTR (text "Following an indirection" ) From git at git.haskell.org Tue Oct 16 00:00:34 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 16 Oct 2018 00:00:34 +0000 (UTC) Subject: [commit: ghc] master: Allocate bss section within proper range of other sections (8306141) Message-ID: <20181016000034.06C813ABB3@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/8306141397d6e47a169dbe4b7ff1b3319a502aa7/ghc >--------------------------------------------------------------- commit 8306141397d6e47a169dbe4b7ff1b3319a502aa7 Author: Zejun Wu Date: Mon Oct 15 13:52:53 2018 -0400 Allocate bss section within proper range of other sections Allocate bss section within proper range of other sections: * when `+RTS -xp` is passed, allocate it contiguously as we did for jump islands * when we mmap the code to lower 2Gb, we should allocate bss section there too This depends on {D5195} Test Plan: 1. `./validate` 2. with ``` DYNAMIC_GHC_PROGRAMS = NO DYNAMIC_BY_DEFAULT = NO ``` `TEST="T15729" make test` passed in both linux and macos. 3. Also test in a use case where we used to encouter error like: ``` ghc-iserv-prof: R_X86_64_PC32 relocation out of range: (noname) = b90282ba ``` and now, everything works fine. Reviewers: simonmar, bgamari, angerman, erikd Reviewed By: simonmar Subscribers: rwbarton, carter GHC Trac Issues: #15729 Differential Revision: https://phabricator.haskell.org/D5219 >--------------------------------------------------------------- 8306141397d6e47a169dbe4b7ff1b3319a502aa7 rts/Linker.c | 22 +++++---- rts/LinkerInternals.h | 4 ++ rts/linker/Elf.c | 73 ++++++++++++++++++------------ rts/linker/Elf.h | 2 +- rts/linker/MachO.c | 27 ++++++----- rts/linker/MachO.h | 2 +- rts/linker/PEi386.c | 2 +- rts/linker/PEi386.h | 2 +- rts/linker/SymbolExtras.c | 31 ++++++------- rts/linker/SymbolExtras.h | 2 +- rts/sm/OSMem.h | 10 +++- testsuite/tests/ghci/linking/Makefile | 5 ++ testsuite/tests/ghci/linking/T15729.c | 4 ++ testsuite/tests/ghci/linking/T15729.hs | 14 ++++++ testsuite/tests/ghci/linking/T15729.stdout | 2 + testsuite/tests/ghci/linking/all.T | 6 +++ 16 files changed, 132 insertions(+), 76 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 8306141397d6e47a169dbe4b7ff1b3319a502aa7 From git at git.haskell.org Tue Oct 16 00:51:06 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 16 Oct 2018 00:51:06 +0000 (UTC) Subject: [commit: ghc] master: Update integer_gmp_gcdext documentation. (45d5eff) Message-ID: <20181016005106.85D7C3ABB3@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/45d5eff820aefd42454a7b9f25c4a61dbfca1ad5/ghc >--------------------------------------------------------------- commit 45d5eff820aefd42454a7b9f25c4a61dbfca1ad5 Author: David Eichmann Date: Mon Oct 15 13:54:49 2018 -0400 Update integer_gmp_gcdext documentation. Reviewers: hvr, bgamari, monoidal Reviewed By: monoidal Subscribers: rwbarton, carter GHC Trac Issues: #15350 Differential Revision: https://phabricator.haskell.org/D5091 >--------------------------------------------------------------- 45d5eff820aefd42454a7b9f25c4a61dbfca1ad5 libraries/integer-gmp/cbits/wrappers.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/libraries/integer-gmp/cbits/wrappers.c b/libraries/integer-gmp/cbits/wrappers.c index 11e5179..2b5db34 100644 --- a/libraries/integer-gmp/cbits/wrappers.c +++ b/libraries/integer-gmp/cbits/wrappers.c @@ -279,16 +279,16 @@ integer_gmp_mpn_gcd(mp_limb_t r[], /* wraps mpz_gcdext() * - * Set g to the greatest common divisor of x and y, and in addition - * set s and t to coefficients satisfying x*s + y*t = g. + * Set g={g0,gn} to the greatest common divisor of x={x0,xn} and + * y={y0,yn}, and in addition set s={s0,sn} to coefficient + * satisfying x*s + y*t = g. * - * The {gp,gn} array is zero-padded (as otherwise 'gn' can't be - * reconstructed). + * The g0 array is zero-padded (so that gn is fixed). * - * g must have space for exactly gn=min(xn,yn) limbs. - * s must have space for at least yn limbs. + * g0 must have space for exactly gn=min(xn,yn) limbs. + * s0 must have space for at least yn limbs. * - * return value: signed 'sn' of {sp,sn} where |sn| >= 1 + * return value: signed 'sn' of s={s0,sn} where |sn| >= 1 */ mp_size_t integer_gmp_gcdext(mp_limb_t s0[], mp_limb_t g0[], From git at git.haskell.org Tue Oct 16 00:51:21 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 16 Oct 2018 00:51:21 +0000 (UTC) Subject: [commit: ghc] master: Add a strict version of foldMap to Foldable (172b00c) Message-ID: <20181016005121.7DE793ABB3@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/172b00c1954d8eb609ccd58a731ae89fe74a7489/ghc >--------------------------------------------------------------- commit 172b00c1954d8eb609ccd58a731ae89fe74a7489 Author: Simon Jakobi Date: Mon Oct 15 13:55:37 2018 -0400 Add a strict version of foldMap to Foldable Summary: Original proposal by Andrew Martin: https://mail.haskell.org/pipermail/libraries/2018-June/028852.html Reviewers: andrewthad, hvr, bgamari, alpmestan, tdammers Reviewed By: bgamari, alpmestan, tdammers Subscribers: alpmestan, rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4924 >--------------------------------------------------------------- 172b00c1954d8eb609ccd58a731ae89fe74a7489 libraries/base/Data/Foldable.hs | 6 ++++++ libraries/base/changelog.md | 2 ++ 2 files changed, 8 insertions(+) diff --git a/libraries/base/Data/Foldable.hs b/libraries/base/Data/Foldable.hs index f5f3112..cc0f348 100644 --- a/libraries/base/Data/Foldable.hs +++ b/libraries/base/Data/Foldable.hs @@ -130,6 +130,12 @@ class Foldable t where -- This INLINE allows more list functions to fuse. See Trac #9848. foldMap f = foldr (mappend . f) mempty + -- | A variant of 'foldMap' that is strict in the accumulator. + -- + -- @since 4.13.0.0 + foldMap' :: Monoid m => (a -> m) -> t a -> m + foldMap' f = foldl' (\ acc a -> acc <> f a) mempty + -- | Right-associative fold of a structure. -- -- In the case of lists, 'foldr', when applied to a binary operator, a diff --git a/libraries/base/changelog.md b/libraries/base/changelog.md index 3709a0a..bfa8cb9 100644 --- a/libraries/base/changelog.md +++ b/libraries/base/changelog.md @@ -10,6 +10,8 @@ a representational one. There is really no reason to care about the type of the underlying object. + * Add `foldMap'`, a strict version of `foldMap`, to `Foldable`. + ## 4.12.0.0 *TBA* * Bundled with GHC *TBA* From git at git.haskell.org Tue Oct 16 00:51:36 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 16 Oct 2018 00:51:36 +0000 (UTC) Subject: [commit: ghc] master: base: Fill in TBAs in changelog (2e1df7c) Message-ID: <20181016005136.8E5873ABB3@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/2e1df7c1556fc2fb6f7449ae07a382c57a0a536c/ghc >--------------------------------------------------------------- commit 2e1df7c1556fc2fb6f7449ae07a382c57a0a536c Author: Ben Gamari Date: Mon Oct 15 13:59:20 2018 -0400 base: Fill in TBAs in changelog I've added a check in my release script to ensure that this doesn't happen in the future. >--------------------------------------------------------------- 2e1df7c1556fc2fb6f7449ae07a382c57a0a536c libraries/base/changelog.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libraries/base/changelog.md b/libraries/base/changelog.md index bfa8cb9..06f62f5 100644 --- a/libraries/base/changelog.md +++ b/libraries/base/changelog.md @@ -12,8 +12,8 @@ * Add `foldMap'`, a strict version of `foldMap`, to `Foldable`. -## 4.12.0.0 *TBA* - * Bundled with GHC *TBA* +## 4.12.0.0 *21 September 2018* + * Bundled with GHC 8.6.1 * The STM invariant-checking mechanism (`always` and `alwaysSucceeds`), which was deprecated in GHC 8.4, has been removed (as proposed in @@ -54,13 +54,13 @@ `Read1`, `Show1`, `Generic`, `Generic1`. (#15098) -## 4.11.1.0 *TBA* +## 4.11.1.0 *19 April 2018* * Bundled with GHC 8.4.2 * Add the `readFieldHash` function to `GHC.Read` which behaves like `readField`, but for a field that ends with a `#` symbol (#14918). -## 4.11.0.0 *TBA* +## 4.11.0.0 *8 March 2018* * Bundled with GHC 8.4.1 * `System.IO.openTempFile` is now thread-safe on Windows. From git at git.haskell.org Tue Oct 16 15:46:15 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 16 Oct 2018 15:46:15 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: Fix dataToTag# argument evaluation (b11126f) Message-ID: <20181016154615.3A14C3ABB3@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/b11126fc356ad6b02486a6e48101ff662fc773db/ghc >--------------------------------------------------------------- commit b11126fc356ad6b02486a6e48101ff662fc773db Author: Ömer Sinan Ağacan Date: Wed Oct 10 10:07:05 2018 +0300 Fix dataToTag# argument evaluation See #15696 for more details. We now always enter dataToTag# argument (done in generated Cmm, in StgCmmExpr). Any high-level optimisations on dataToTag# applications are done by the simplifier. Looking at tag bits (instead of reading the info table) for small types is left to another diff. Incorrect test T14626 is removed. We no longer do this optimisation (see comment:44, comment:45, comment:60). Comments and notes about special cases around dataToTag# are removed. We no longer have any special cases around it in Core. Other changes related to evaluating primops (seq# and dataToTag#) will be pursued in follow-up diffs. Test Plan: Validates with three regression tests Reviewers: simonpj, simonmar, hvr, bgamari, dfeuer Reviewed By: simonmar Subscribers: rwbarton, carter GHC Trac Issues: #15696 Differential Revision: https://phabricator.haskell.org/D5201 (cherry picked from commit ac977688523e5d77eb6f041f043552410b0c21da) >--------------------------------------------------------------- b11126fc356ad6b02486a6e48101ff662fc773db compiler/codeGen/StgCmmExpr.hs | 12 ++++ compiler/codeGen/StgCmmPrim.hs | 6 -- compiler/coreSyn/CorePrep.hs | 71 ++-------------------- compiler/coreSyn/CoreUtils.hs | 17 ------ compiler/prelude/PrelRules.hs | 13 ---- compiler/prelude/PrimOp.hs | 1 - compiler/prelude/primops.txt.pp | 49 +++++++-------- libraries/base/GHC/Base.hs | 11 +--- testsuite/tests/codeGen/should_compile/Makefile | 3 - testsuite/tests/codeGen/should_compile/T14626.hs | 15 ----- testsuite/tests/codeGen/should_compile/all.T | 3 - testsuite/tests/codeGen/should_run/T15696_1.hs | 26 ++++++++ testsuite/tests/codeGen/should_run/T15696_1.stdout | 1 + testsuite/tests/codeGen/should_run/T15696_2.hs | 17 ++++++ .../should_run/T15696_2.stdout} | 0 testsuite/tests/codeGen/should_run/T15696_3.hs | 9 +++ testsuite/tests/codeGen/should_run/T15696_3.stdout | 1 + testsuite/tests/codeGen/should_run/all.T | 10 ++- 18 files changed, 102 insertions(+), 163 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc b11126fc356ad6b02486a6e48101ff662fc773db From git at git.haskell.org Tue Oct 16 15:46:26 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 16 Oct 2018 15:46:26 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: base: Fill in TBAs in changelog (f7b1ee9) Message-ID: <20181016154626.3D89D3ABB3@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/f7b1ee966244b6ec5df528e3c21eefd8286412b7/ghc >--------------------------------------------------------------- commit f7b1ee966244b6ec5df528e3c21eefd8286412b7 Author: Ben Gamari Date: Mon Oct 15 13:59:20 2018 -0400 base: Fill in TBAs in changelog I've added a check in my release script to ensure that this doesn't happen in the future. (cherry picked from commit 2605458930f2d79738fab4437f10793448d4232c) >--------------------------------------------------------------- f7b1ee966244b6ec5df528e3c21eefd8286412b7 libraries/base/changelog.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/base/changelog.md b/libraries/base/changelog.md index 41c877b..5834ad8 100644 --- a/libraries/base/changelog.md +++ b/libraries/base/changelog.md @@ -28,7 +28,7 @@ * `asinh` for `Float` and `Double` is now numerically stable in the face of non-small negative arguments and enormous arguments of either sign. (#14927) - * `Numeric.showEFloat (Just 0)` and `Numeric.showGFloat (Just 0)` + * `Numeric.showEFloat (Just 0)` and `Numeric.showGFloat (Just 0)` now respect the user's requested precision. (#15115) * `Data.Monoid.Alt` now has `Foldable` and `Traversable` instances. (#15099) From git at git.haskell.org Wed Oct 17 07:54:52 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 17 Oct 2018 07:54:52 +0000 (UTC) Subject: [commit: ghc] wip/T15696: Revert OK-for-spec change for the general app case (648dcd6) Message-ID: <20181017075452.430F13ABB3@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T15696 Link : http://ghc.haskell.org/trac/ghc/changeset/648dcd63164303e73feee05204ccb9cfed7aa658/ghc >--------------------------------------------------------------- commit 648dcd63164303e73feee05204ccb9cfed7aa658 Author: Ömer Sinan Ağacan Date: Wed Oct 17 10:16:37 2018 +0300 Revert OK-for-spec change for the general app case >--------------------------------------------------------------- 648dcd63164303e73feee05204ccb9cfed7aa658 compiler/coreSyn/CoreUtils.hs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compiler/coreSyn/CoreUtils.hs b/compiler/coreSyn/CoreUtils.hs index ebdc31b..578c85e 100644 --- a/compiler/coreSyn/CoreUtils.hs +++ b/compiler/coreSyn/CoreUtils.hs @@ -1566,6 +1566,8 @@ app_ok primop_ok fun args _other -> isUnliftedType (idType fun) -- c.f. the Var case of exprIsHNF || idArity fun > n_val_args -- Partial apps + || (n_val_args == 0 && + isEvaldUnfolding (idUnfolding fun)) -- Let-bound values where n_val_args = valArgCount args where From git at git.haskell.org Wed Oct 17 15:32:14 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 17 Oct 2018 15:32:14 +0000 (UTC) Subject: [commit: ghc] master: Fix #15761 by adding parens (38c28c1) Message-ID: <20181017153214.EAE0B3ABB6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/38c28c1a8bb129141e533866700e7318314f32c1/ghc >--------------------------------------------------------------- commit 38c28c1a8bb129141e533866700e7318314f32c1 Author: Richard Eisenberg Date: Wed Oct 17 10:46:21 2018 -0400 Fix #15761 by adding parens This was just a pretty-printer infelicity. Fixed now. Test case: printer/T15761 >--------------------------------------------------------------- 38c28c1a8bb129141e533866700e7318314f32c1 compiler/hsSyn/HsDecls.hs | 16 +++++++++------- testsuite/tests/printer/T15761.hs | 5 +++++ testsuite/tests/printer/T15761.stderr | 5 +++++ testsuite/tests/printer/all.T | 1 + 4 files changed, 20 insertions(+), 7 deletions(-) diff --git a/compiler/hsSyn/HsDecls.hs b/compiler/hsSyn/HsDecls.hs index 2d2e911..55f3b73 100644 --- a/compiler/hsSyn/HsDecls.hs +++ b/compiler/hsSyn/HsDecls.hs @@ -1764,13 +1764,15 @@ pprFamInstLHS thing typats fixity context mb_kind_sig -- explicit type patterns = hsep [ pprHsContext context, pp_pats typats, pp_kind_sig ] where - pp_pats (patl:patsr) - | fixity == Infix - = hsep [pprHsType (unLoc patl), pprInfixOcc (unLoc thing) - , hsep (map (pprHsType.unLoc) patsr)] - | otherwise = hsep [ pprPrefixOcc (unLoc thing) - , hsep (map (pprHsType.unLoc) (patl:patsr))] - pp_pats [] = pprPrefixOcc (unLoc thing) + pp_pats (patl:patr:pats) + | Infix <- fixity + = let pp_op_app = hsep [ ppr patl, pprInfixOcc (unLoc thing), ppr patr ] in + case pats of + [] -> pp_op_app + _ -> hsep (parens pp_op_app : map ppr pats) + + pp_pats pats = hsep [ pprPrefixOcc (unLoc thing) + , hsep (map ppr pats)] pp_kind_sig | Just k <- mb_kind_sig diff --git a/testsuite/tests/printer/T15761.hs b/testsuite/tests/printer/T15761.hs new file mode 100644 index 0000000..866002f --- /dev/null +++ b/testsuite/tests/printer/T15761.hs @@ -0,0 +1,5 @@ +{-# LANGUAGE TypeFamilies, TypeOperators #-} + +data family (a + b) c d + +data instance (Int + Bool) Double = Float diff --git a/testsuite/tests/printer/T15761.stderr b/testsuite/tests/printer/T15761.stderr new file mode 100644 index 0000000..10425b4 --- /dev/null +++ b/testsuite/tests/printer/T15761.stderr @@ -0,0 +1,5 @@ + +T15761.hs:5:1: error: + • Expecting one more argument to ‘(Int + Bool) Double’ + Expected a type, but ‘(Int + Bool) Double’ has kind ‘* -> *’ + • In the data instance declaration for ‘+’ diff --git a/testsuite/tests/printer/all.T b/testsuite/tests/printer/all.T index 203efa4..7f45c74 100644 --- a/testsuite/tests/printer/all.T +++ b/testsuite/tests/printer/all.T @@ -56,3 +56,4 @@ test('T14289c', ignore_stderr, run_command, ['$MAKE -s --no-print-directory T142 test('T14306', ignore_stderr, run_command, ['$MAKE -s --no-print-directory T14306']) test('T14343', normal, compile_fail, ['']) test('T14343b', normal, compile_fail, ['']) +test('T15761', normal, compile_fail, ['']) From git at git.haskell.org Wed Oct 17 18:45:09 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 17 Oct 2018 18:45:09 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: Fail fast on pattern synonyms (b4fdff4) Message-ID: <20181017184509.563953ABB6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/b4fdff48d39941b3b811bf9c4860ac692922326e/ghc >--------------------------------------------------------------- commit b4fdff48d39941b3b811bf9c4860ac692922326e Author: Simon Peyton Jones Date: Wed Oct 3 15:53:59 2018 +0100 Fail fast on pattern synonyms We were recovering too eagerly from errors in pattern-synonym type inference, leading to a cascade of confusing follow up errors (Trac #15685, #15692). The underlying issue is that a pattern synonym should have a closed, fixed type, with no unification variables in it. But it wasn't! Fixing this made me change the interface to simplifyInfer slightly. Instead of /emitting/ a residual implication constraint, it now /returns/ it, so that the caller can decide what to do. (cherry picked from commit 9ebfa03d9e9cbf79f698b5d4bd39e799e4e9a02c) >--------------------------------------------------------------- b4fdff48d39941b3b811bf9c4860ac692922326e compiler/typecheck/TcBinds.hs | 3 +- compiler/typecheck/TcExpr.hs | 4 +- compiler/typecheck/TcPatSyn.hs | 75 +++++++++++++----------- compiler/typecheck/TcRnDriver.hs | 21 +++---- compiler/typecheck/TcRnMonad.hs | 12 +++- compiler/typecheck/TcRnTypes.hs | 37 +++++++----- compiler/typecheck/TcSimplify.hs | 66 ++++++++++----------- testsuite/tests/patsyn/should_fail/T15685.hs | 13 ++++ testsuite/tests/patsyn/should_fail/T15685.stderr | 10 ++++ testsuite/tests/patsyn/should_fail/T15692.hs | 9 +++ testsuite/tests/patsyn/should_fail/T15692.stderr | 13 ++++ testsuite/tests/patsyn/should_fail/all.T | 2 + 12 files changed, 166 insertions(+), 99 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc b4fdff48d39941b3b811bf9c4860ac692922326e From git at git.haskell.org Wed Oct 17 18:45:12 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 17 Oct 2018 18:45:12 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: Bump haddock submodule (0833668) Message-ID: <20181017184512.27CD63ABB6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/083366859b4a25ee6152ba26702ca61965476a49/ghc >--------------------------------------------------------------- commit 083366859b4a25ee6152ba26702ca61965476a49 Author: Ben Gamari Date: Wed Oct 17 11:19:53 2018 -0400 Bump haddock submodule >--------------------------------------------------------------- 083366859b4a25ee6152ba26702ca61965476a49 utils/haddock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/haddock b/utils/haddock index 3902a80..15b62fc 160000 --- a/utils/haddock +++ b/utils/haddock @@ -1 +1 @@ -Subproject commit 3902a807acf4bccf5cd01d2115bed10d57316661 +Subproject commit 15b62fc13e50470aa396bb7fc6f0143ce14492fe From git at git.haskell.org Wed Oct 17 18:45:14 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 17 Oct 2018 18:45:14 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: fixup! Fail fast on pattern synonyms (bc445eb) Message-ID: <20181017184514.EFECB3ABB6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/bc445eb908f405818bec1bd013b65f4d0726bf14/ghc >--------------------------------------------------------------- commit bc445eb908f405818bec1bd013b65f4d0726bf14 Author: Ben Gamari Date: Wed Oct 17 13:41:35 2018 -0400 fixup! Fail fast on pattern synonyms >--------------------------------------------------------------- bc445eb908f405818bec1bd013b65f4d0726bf14 compiler/typecheck/TcRnDriver.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/typecheck/TcRnDriver.hs b/compiler/typecheck/TcRnDriver.hs index f96385e..4259b04 100644 --- a/compiler/typecheck/TcRnDriver.hs +++ b/compiler/typecheck/TcRnDriver.hs @@ -479,7 +479,7 @@ run_th_modfinalizers = do -- simplified, or some types might not be complete when using reify -- (see #12777). new_ev_binds <- {-# SCC "simplifyTop2" #-} - simplifyTop (lie_th `andWC` lie_top_decls) + simplifyTop lie addTopEvBinds new_ev_binds run_th_modfinalizers -- addTopDecls can add declarations which add new finalizers. From git at git.haskell.org Wed Oct 17 18:45:18 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 17 Oct 2018 18:45:18 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: Fix #15761 by adding parens (bf667f9) Message-ID: <20181017184518.890803ABB6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/bf667f9d6b9c4e39584217f7828952600cfc00a6/ghc >--------------------------------------------------------------- commit bf667f9d6b9c4e39584217f7828952600cfc00a6 Author: Richard Eisenberg Date: Wed Oct 17 10:46:21 2018 -0400 Fix #15761 by adding parens This was just a pretty-printer infelicity. Fixed now. Test case: printer/T15761 (cherry picked from commit 38c28c1a8bb129141e533866700e7318314f32c1) >--------------------------------------------------------------- bf667f9d6b9c4e39584217f7828952600cfc00a6 compiler/hsSyn/HsDecls.hs | 16 +++++++++------- testsuite/tests/printer/T15761.hs | 5 +++++ testsuite/tests/printer/T15761.stderr | 5 +++++ testsuite/tests/printer/all.T | 1 + 4 files changed, 20 insertions(+), 7 deletions(-) diff --git a/compiler/hsSyn/HsDecls.hs b/compiler/hsSyn/HsDecls.hs index 277a6d3..f84fcfd 100644 --- a/compiler/hsSyn/HsDecls.hs +++ b/compiler/hsSyn/HsDecls.hs @@ -1713,13 +1713,15 @@ pprFamInstLHS thing typats fixity context mb_kind_sig -- explicit type patterns = hsep [ pprHsContext context, pp_pats typats, pp_kind_sig ] where - pp_pats (patl:patsr) - | fixity == Infix - = hsep [pprHsType (unLoc patl), pprInfixOcc (unLoc thing) - , hsep (map (pprHsType.unLoc) patsr)] - | otherwise = hsep [ pprPrefixOcc (unLoc thing) - , hsep (map (pprHsType.unLoc) (patl:patsr))] - pp_pats [] = pprPrefixOcc (unLoc thing) + pp_pats (patl:patr:pats) + | Infix <- fixity + = let pp_op_app = hsep [ ppr patl, pprInfixOcc (unLoc thing), ppr patr ] in + case pats of + [] -> pp_op_app + _ -> hsep (parens pp_op_app : map ppr pats) + + pp_pats pats = hsep [ pprPrefixOcc (unLoc thing) + , hsep (map ppr pats)] pp_kind_sig | Just k <- mb_kind_sig diff --git a/testsuite/tests/printer/T15761.hs b/testsuite/tests/printer/T15761.hs new file mode 100644 index 0000000..866002f --- /dev/null +++ b/testsuite/tests/printer/T15761.hs @@ -0,0 +1,5 @@ +{-# LANGUAGE TypeFamilies, TypeOperators #-} + +data family (a + b) c d + +data instance (Int + Bool) Double = Float diff --git a/testsuite/tests/printer/T15761.stderr b/testsuite/tests/printer/T15761.stderr new file mode 100644 index 0000000..10425b4 --- /dev/null +++ b/testsuite/tests/printer/T15761.stderr @@ -0,0 +1,5 @@ + +T15761.hs:5:1: error: + • Expecting one more argument to ‘(Int + Bool) Double’ + Expected a type, but ‘(Int + Bool) Double’ has kind ‘* -> *’ + • In the data instance declaration for ‘+’ diff --git a/testsuite/tests/printer/all.T b/testsuite/tests/printer/all.T index 203efa4..7f45c74 100644 --- a/testsuite/tests/printer/all.T +++ b/testsuite/tests/printer/all.T @@ -56,3 +56,4 @@ test('T14289c', ignore_stderr, run_command, ['$MAKE -s --no-print-directory T142 test('T14306', ignore_stderr, run_command, ['$MAKE -s --no-print-directory T14306']) test('T14343', normal, compile_fail, ['']) test('T14343b', normal, compile_fail, ['']) +test('T15761', normal, compile_fail, ['']) From git at git.haskell.org Wed Oct 17 18:46:34 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 17 Oct 2018 18:46:34 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: Bump haddock submodule (334be77) Message-ID: <20181017184634.612793ABB6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/334be779756a54028c5b83cd89c4665e946c65ea/ghc >--------------------------------------------------------------- commit 334be779756a54028c5b83cd89c4665e946c65ea Author: Ben Gamari Date: Wed Oct 17 11:19:53 2018 -0400 Bump haddock submodule >--------------------------------------------------------------- 334be779756a54028c5b83cd89c4665e946c65ea utils/haddock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/haddock b/utils/haddock index 3902a80..15b62fc 160000 --- a/utils/haddock +++ b/utils/haddock @@ -1 +1 @@ -Subproject commit 3902a807acf4bccf5cd01d2115bed10d57316661 +Subproject commit 15b62fc13e50470aa396bb7fc6f0143ce14492fe From git at git.haskell.org Wed Oct 17 18:46:38 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 17 Oct 2018 18:46:38 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: Fail fast on pattern synonyms (3e05006) Message-ID: <20181017184638.911593ABB6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/3e050064511ce67ee9150d51cb9db487187be39e/ghc >--------------------------------------------------------------- commit 3e050064511ce67ee9150d51cb9db487187be39e Author: Simon Peyton Jones Date: Wed Oct 3 15:53:59 2018 +0100 Fail fast on pattern synonyms We were recovering too eagerly from errors in pattern-synonym type inference, leading to a cascade of confusing follow up errors (Trac #15685, #15692). The underlying issue is that a pattern synonym should have a closed, fixed type, with no unification variables in it. But it wasn't! Fixing this made me change the interface to simplifyInfer slightly. Instead of /emitting/ a residual implication constraint, it now /returns/ it, so that the caller can decide what to do. (cherry picked from commit 9ebfa03d9e9cbf79f698b5d4bd39e799e4e9a02c) >--------------------------------------------------------------- 3e050064511ce67ee9150d51cb9db487187be39e compiler/typecheck/TcBinds.hs | 3 +- compiler/typecheck/TcExpr.hs | 4 +- compiler/typecheck/TcPatSyn.hs | 75 +++++++++++++----------- compiler/typecheck/TcRnDriver.hs | 19 +++--- compiler/typecheck/TcRnMonad.hs | 12 +++- compiler/typecheck/TcRnTypes.hs | 37 +++++++----- compiler/typecheck/TcSimplify.hs | 66 ++++++++++----------- testsuite/tests/patsyn/should_fail/T15685.hs | 13 ++++ testsuite/tests/patsyn/should_fail/T15685.stderr | 10 ++++ testsuite/tests/patsyn/should_fail/T15692.hs | 9 +++ testsuite/tests/patsyn/should_fail/T15692.stderr | 13 ++++ testsuite/tests/patsyn/should_fail/all.T | 2 + 12 files changed, 165 insertions(+), 98 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 3e050064511ce67ee9150d51cb9db487187be39e From git at git.haskell.org Wed Oct 17 18:46:42 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 17 Oct 2018 18:46:42 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: Fix #15761 by adding parens (ba5d0a4) Message-ID: <20181017184642.2310B3ABB6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/ba5d0a4812a1437b11cacc53cc1a4024db6ad160/ghc >--------------------------------------------------------------- commit ba5d0a4812a1437b11cacc53cc1a4024db6ad160 Author: Richard Eisenberg Date: Wed Oct 17 10:46:21 2018 -0400 Fix #15761 by adding parens This was just a pretty-printer infelicity. Fixed now. Test case: printer/T15761 (cherry picked from commit 38c28c1a8bb129141e533866700e7318314f32c1) >--------------------------------------------------------------- ba5d0a4812a1437b11cacc53cc1a4024db6ad160 compiler/hsSyn/HsDecls.hs | 16 +++++++++------- testsuite/tests/printer/T15761.hs | 5 +++++ testsuite/tests/printer/T15761.stderr | 5 +++++ testsuite/tests/printer/all.T | 1 + 4 files changed, 20 insertions(+), 7 deletions(-) diff --git a/compiler/hsSyn/HsDecls.hs b/compiler/hsSyn/HsDecls.hs index 277a6d3..f84fcfd 100644 --- a/compiler/hsSyn/HsDecls.hs +++ b/compiler/hsSyn/HsDecls.hs @@ -1713,13 +1713,15 @@ pprFamInstLHS thing typats fixity context mb_kind_sig -- explicit type patterns = hsep [ pprHsContext context, pp_pats typats, pp_kind_sig ] where - pp_pats (patl:patsr) - | fixity == Infix - = hsep [pprHsType (unLoc patl), pprInfixOcc (unLoc thing) - , hsep (map (pprHsType.unLoc) patsr)] - | otherwise = hsep [ pprPrefixOcc (unLoc thing) - , hsep (map (pprHsType.unLoc) (patl:patsr))] - pp_pats [] = pprPrefixOcc (unLoc thing) + pp_pats (patl:patr:pats) + | Infix <- fixity + = let pp_op_app = hsep [ ppr patl, pprInfixOcc (unLoc thing), ppr patr ] in + case pats of + [] -> pp_op_app + _ -> hsep (parens pp_op_app : map ppr pats) + + pp_pats pats = hsep [ pprPrefixOcc (unLoc thing) + , hsep (map ppr pats)] pp_kind_sig | Just k <- mb_kind_sig diff --git a/testsuite/tests/printer/T15761.hs b/testsuite/tests/printer/T15761.hs new file mode 100644 index 0000000..866002f --- /dev/null +++ b/testsuite/tests/printer/T15761.hs @@ -0,0 +1,5 @@ +{-# LANGUAGE TypeFamilies, TypeOperators #-} + +data family (a + b) c d + +data instance (Int + Bool) Double = Float diff --git a/testsuite/tests/printer/T15761.stderr b/testsuite/tests/printer/T15761.stderr new file mode 100644 index 0000000..10425b4 --- /dev/null +++ b/testsuite/tests/printer/T15761.stderr @@ -0,0 +1,5 @@ + +T15761.hs:5:1: error: + • Expecting one more argument to ‘(Int + Bool) Double’ + Expected a type, but ‘(Int + Bool) Double’ has kind ‘* -> *’ + • In the data instance declaration for ‘+’ diff --git a/testsuite/tests/printer/all.T b/testsuite/tests/printer/all.T index 203efa4..7f45c74 100644 --- a/testsuite/tests/printer/all.T +++ b/testsuite/tests/printer/all.T @@ -56,3 +56,4 @@ test('T14289c', ignore_stderr, run_command, ['$MAKE -s --no-print-directory T142 test('T14306', ignore_stderr, run_command, ['$MAKE -s --no-print-directory T14306']) test('T14343', normal, compile_fail, ['']) test('T14343b', normal, compile_fail, ['']) +test('T15761', normal, compile_fail, ['']) From git at git.haskell.org Wed Oct 17 19:07:58 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 17 Oct 2018 19:07:58 +0000 (UTC) Subject: [commit: ghc] master: testsuite: Fix non-canonical Monoid instance in T3001-2 (17b60f1) Message-ID: <20181017190758.82FB83ABB6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/17b60f18202c9ddeb881a0654e91967506f093f4/ghc >--------------------------------------------------------------- commit 17b60f18202c9ddeb881a0654e91967506f093f4 Author: Ben Gamari Date: Wed Oct 17 15:04:31 2018 -0400 testsuite: Fix non-canonical Monoid instance in T3001-2 >--------------------------------------------------------------- 17b60f18202c9ddeb881a0654e91967506f093f4 testsuite/tests/profiling/should_run/T3001-2.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testsuite/tests/profiling/should_run/T3001-2.hs b/testsuite/tests/profiling/should_run/T3001-2.hs index 17fa0c9..538a435 100644 --- a/testsuite/tests/profiling/should_run/T3001-2.hs +++ b/testsuite/tests/profiling/should_run/T3001-2.hs @@ -289,5 +289,5 @@ instance Semigroup Builder where instance Monoid Builder where mempty = emptyBuilder - mappend = append + mappend = (<>) From git at git.haskell.org Wed Oct 17 19:08:14 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 17 Oct 2018 19:08:14 +0000 (UTC) Subject: [commit: ghc] master: Fix T15729 in master (46f2906) Message-ID: <20181017190814.E0CD93ABB6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/46f2906d1c6e1fb732a90882487479a2ebf19ca1/ghc >--------------------------------------------------------------- commit 46f2906d1c6e1fb732a90882487479a2ebf19ca1 Author: Zejun Wu Date: Wed Oct 17 15:07:07 2018 -0400 Fix T15729 in master Summary: It failed when running ./validate on master T15729 is added by me in D5219 recently, it failed when GHCi is dynamicly linked: ``` Stderr ( T15729 ): /bin/ld.gold: error: bss.o: requires unsupported dynamic reloc 11; recompile with -fPIC collect2: error: ld returned 1 exit status `gcc' failed in phase `Linker'. (Exit code: 1) ``` Test Plan: Both tests pass now. Reviewers: simonmar, bgamari Reviewed By: bgamari Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5235 >--------------------------------------------------------------- 46f2906d1c6e1fb732a90882487479a2ebf19ca1 testsuite/tests/ghci/linking/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testsuite/tests/ghci/linking/Makefile b/testsuite/tests/ghci/linking/Makefile index 3ecc3c3..bfbcf24 100644 --- a/testsuite/tests/ghci/linking/Makefile +++ b/testsuite/tests/ghci/linking/Makefile @@ -137,5 +137,5 @@ T14708: .PHONY: T15729 T15729: - "$(TEST_HC)" -c T15729.c -o bss.o + "$(TEST_HC)" -fPIC -c T15729.c -o bss.o echo "main" | "$(TEST_HC)" $(TEST_HC_OPTS_INTERACTIVE) bss.o T15729.hs From git at git.haskell.org Wed Oct 17 19:32:56 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 17 Oct 2018 19:32:56 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: circleci: Build with in-tree GMP on Darwin (578012b) Message-ID: <20181017193256.3B27F3ABB6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/578012be13eb1548050d51c0a23bd1a98423f03e/ghc >--------------------------------------------------------------- commit 578012be13eb1548050d51c0a23bd1a98423f03e Author: Ben Gamari Date: Wed Oct 17 15:31:36 2018 -0400 circleci: Build with in-tree GMP on Darwin Fixes #15404. >--------------------------------------------------------------- 578012be13eb1548050d51c0a23bd1a98423f03e .circleci/config.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 18ae109..4414357 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -33,7 +33,7 @@ aliases: - &configure_unix run: name: Configure - command: ./configure + command: ./configure $CONFIGURE_OPTS - &configure_unix_32 run: name: Configure @@ -140,6 +140,8 @@ jobs: # Only Sierra and onwards supports clock_gettime. See #12858 ac_cv_func_clock_gettime: "no" GHC_COLLECTOR_FLAVOR: x86_64-darwin + # Build with in-tree GMP since this isn't available on OS X by default. + CONFIGURE_OPTS: --with-intree-gmp <<: *buildenv steps: - checkout From git at git.haskell.org Fri Oct 19 09:43:50 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 19 Oct 2018 09:43:50 +0000 (UTC) Subject: [commit: ghc] master: Adding almost devoid check for covar in ForAllCo (879db55) Message-ID: <20181019094350.73FD33ABB6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/879db5595208fb665ff1a0a2b12b9921d3efae0e/ghc >--------------------------------------------------------------- commit 879db5595208fb665ff1a0a2b12b9921d3efae0e Author: Ningning Xie Date: Fri Oct 19 17:10:08 2018 +0800 Adding almost devoid check for covar in ForAllCo Summary: For the sake of consistency of the dependent core, there is a restriction on where a coercion variable can appear in ForAllCo: the coercion variable can appear nowhere except in coherence coercions. Currently this restriction is missing in Core. The goal of this patch is to add the missing restriction. After discussion, we decide: coercion variables can appear nowhere except in `GRefl` and `Refl`. Relaxing the restriction to include `Refl` should not break consistency, we premuse. Test Plan: ./validate Reviewers: goldfire, simonpj, bgamari Reviewed By: goldfire Subscribers: rwbarton, carter GHC Trac Issues: #15757 Differential Revision: https://phabricator.haskell.org/D5231 >--------------------------------------------------------------- 879db5595208fb665ff1a0a2b12b9921d3efae0e compiler/coreSyn/CoreLint.hs | 4 +- compiler/types/Coercion.hs | 53 +++++++++++++++-------- compiler/types/Coercion.hs-boot | 2 +- compiler/types/TyCoRep.hs | 96 ++++++++++++++++++++++++++++++++++++++++- 4 files changed, 132 insertions(+), 23 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 879db5595208fb665ff1a0a2b12b9921d3efae0e From git at git.haskell.org Fri Oct 19 14:00:38 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 19 Oct 2018 14:00:38 +0000 (UTC) Subject: [commit: ghc] wip/T15696: app_ok case for dataToTag# is now the same as seq# case, update notes (46e5d1e) Message-ID: <20181019140038.695153ABB7@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T15696 Link : http://ghc.haskell.org/trac/ghc/changeset/46e5d1ef17590f05721cb72df7a25da0fecc2b91/ghc >--------------------------------------------------------------- commit 46e5d1ef17590f05721cb72df7a25da0fecc2b91 Author: Ömer Sinan Ağacan Date: Fri Oct 19 16:01:45 2018 +0300 app_ok case for dataToTag# is now the same as seq# case, update notes >--------------------------------------------------------------- 46e5d1ef17590f05721cb72df7a25da0fecc2b91 compiler/coreSyn/CoreUtils.hs | 36 +++++++++++++++++++----------------- compiler/prelude/PrelRules.hs | 2 +- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/compiler/coreSyn/CoreUtils.hs b/compiler/coreSyn/CoreUtils.hs index 578c85e..d314a86 100644 --- a/compiler/coreSyn/CoreUtils.hs +++ b/compiler/coreSyn/CoreUtils.hs @@ -1554,15 +1554,15 @@ app_ok primop_ok fun args -- Often there is a literal divisor, and this -- can get rid of a thunk in an inner loop - | SeqOp <- op -- See Note [seq# and expr_ok] + | SeqOp <- op -- See Note [Evaluating primops and expr_ok] -> all (expr_ok primop_ok) args - | DataToTagOp <- op - -> False -- all (expr_ok primop_ok) args + | DataToTagOp <- op -- See Note [Evaluating primops and expr_ok] + -> all (expr_ok primop_ok) args | otherwise -> primop_ok op -- Check the primop itself - && and (zipWith arg_ok arg_tys args) -- Check the arguments + && and (zipWith primop_arg_ok arg_tys args) -- Check the arguments _other -> isUnliftedType (idType fun) -- c.f. the Var case of exprIsHNF || idArity fun > n_val_args -- Partial apps @@ -1573,9 +1573,9 @@ app_ok primop_ok fun args where (arg_tys, _) = splitPiTys (idType fun) - arg_ok :: TyBinder -> CoreExpr -> Bool - arg_ok (Named _) _ = True -- A type argument - arg_ok (Anon ty) arg -- A term argument + primop_arg_ok :: TyBinder -> CoreExpr -> Bool + primop_arg_ok (Named _) _ = True -- A type argument + primop_arg_ok (Anon ty) arg -- A term argument | isUnliftedType ty = expr_ok primop_ok arg | otherwise = True -- See Note [Primops with lifted arguments] @@ -1701,26 +1701,28 @@ and do not perform evaluation. Bottom line: * in exprOkForSpeculation we simply ignore all lifted arguments. - * except see Note [seq# and expr_ok] for an exception + * except see Note [Evaluating primops and expr_ok] for an exception -Note [seq# and expr_ok] -~~~~~~~~~~~~~~~~~~~~~~~ +Note [Evaluating primops and expr_ok] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Recall that seq# :: forall a s . a -> State# s -> (# State# s, a #) -must always evaluate its first argument. So it's really a -counter-example to Note [Primops with lifted arguments]. In -the case of seq# we must check the argument to seq#. Remember -item (d) of the specification of exprOkForSpeculation: +and + dataToTag# :: forall a . a -> Int# +must always evaluate their first argument. So they're really counter-examples +to Note [Primops with lifted arguments]. In the case of seq# and dataToTag# we +must check the arguments. Remember item (d) of the specification of +exprOkForSpeculation: -- Precisely, it returns @True@ iff: -- a) The expression guarantees to terminate, ... -- d) without throwing a Haskell exception -The lack of this special case caused Trac #5129 to go bad again. -See comment:24 and following - +The lack of this special case caused Trac #5129 to go bad again. See comment:24 +and following. We started treating dataToTag# the same way in #15696, see +comment:60 and following. ************************************************************************ * * diff --git a/compiler/prelude/PrelRules.hs b/compiler/prelude/PrelRules.hs index 28c0628..60ba1b6 100644 --- a/compiler/prelude/PrelRules.hs +++ b/compiler/prelude/PrelRules.hs @@ -1097,7 +1097,7 @@ Implementing seq#. The compiler has magic for SeqOp in - StgCmmExpr.cgExpr, and cgCase: special case for seq# - CoreUtils.exprOkForSpeculation; - see Note [seq# and expr_ok] in CoreUtils + see Note [Evaluating primops and expr_ok] in CoreUtils - Simplify.addEvals records evaluated-ness for the result; see Note [Adding evaluatedness info to pattern-bound variables] From git at git.haskell.org Mon Oct 22 14:26:51 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 22 Oct 2018 14:26:51 +0000 (UTC) Subject: [commit: ghc] wip/t-12758_circleci_push_perf_notes: testsuite: Save performance metrics in git notes. (a4c7ddd) Message-ID: <20181022142651.2ADD33ABB7@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/t-12758_circleci_push_perf_notes Link : http://ghc.haskell.org/trac/ghc/changeset/a4c7ddd48929b394bc4aa4a684cf114285507822/ghc >--------------------------------------------------------------- commit a4c7ddd48929b394bc4aa4a684cf114285507822 Author: David Eichmann Date: Fri Oct 19 16:31:39 2018 +0100 testsuite: Save performance metrics in git notes. Summary: This patch makes the following improvement: - Automatically records test metrics (per test environment) so that the programmer need not supply nor update expected values in *.T files. - On expected metric changes, the programmer need only indicate the direction of change in the git commit message. - Provides a simple python tool "perf_notes.py" to compare metrics over time. Issues: - Using just the previous commit allows performance to drift with each commit. - Currently we allow drift as we have a preference for minimizing false positives. - Some possible alternatives include: - Use metrics from a fixed commit per test: the last commit that allowed a change in performance (else the oldest metric) - Or use some sort of aggregate since the last commit that allowed a change in performance (else all available metrics) - These alternatives may result in a performance issue (with the test driver) having to heavily search git commits/notes. - Run locally, performance tests will trivially pass unless the tests were run locally on the previous commit. This is often not the case e.g. after pulling recent changes. Previously, *.T files contain statements such as: ``` stats_num_field('peak_megabytes_allocated', (2, 1)) compiler_stats_num_field('bytes allocated', [(wordsize(64), 165890392, 10)]) ``` This required the programmer to give the expected values and a tolerance deviation (percentage). With this patch, the above statements are replaced with: ``` collect_stats('peak_megabytes_allocated', 5) collect_compiler_stats('bytes allocated', 10) ``` So that programmer must only enter which metrics to test and a tolerance deviation. No expected value is required. CircleCI will then run the tests per test environment and record the metrics to a git note for that commit and push them to the git.haskell.org ghc repo. Metrics will be compared to the previous commit. If they are different by the tolerance deviation from the *.T file, then the corresponding test will fail. By adding to the git commit message e.g. ``` # Metric (In|De)crease : Metric Increase ['bytes allocated', 'peak_megabytes_allocated'] (test_env='linux_x86', way='default'): Test012, Test345 Metric Decrease 'bytes allocated': Test678 Metric Increase: Test711 ``` This will allow the noted changes (letting the test pass). Note that by omitting metrics or options, the change will apply to all possible metrics/options (i.e. in the above, an increase for all metrics in all test environments is allowed for Test711) phabricator will use the message in the description Reviewers: bgamari, hvr Reviewed By: bgamari Subscribers: rwbarton, carter GHC Trac Issues: #12758 Differential Revision: https://phabricator.haskell.org/D5059 >--------------------------------------------------------------- a4c7ddd48929b394bc4aa4a684cf114285507822 .circleci/config.yml | 132 ++- libraries/Cabal | 2 +- libraries/base/tests/all.T | 18 +- libraries/deepseq | 2 +- libraries/stm | 2 +- libraries/text | 2 +- nofib | 2 +- testsuite/driver/README.md | 133 +++ testsuite/driver/perf_notes.py | 378 +++++++++ testsuite/driver/runtests.py | 63 +- testsuite/driver/testglobals.py | 30 +- testsuite/driver/testlib.py | 228 +++-- testsuite/driver/testutil.py | 18 + testsuite/mk/test.mk | 8 + testsuite/tests/callarity/perf/all.T | 12 +- testsuite/tests/deriving/perf/all.T | 11 +- testsuite/tests/perf/compiler/all.T | 1051 ++---------------------- testsuite/tests/perf/haddock/all.T | 183 +---- testsuite/tests/perf/join_points/all.T | 16 +- testsuite/tests/perf/should_run/all.T | 362 ++------ testsuite/tests/perf/space_leaks/all.T | 75 +- testsuite/tests/pmcheck/should_compile/all.T | 27 +- testsuite/tests/primops/should_run/all.T | 6 +- testsuite/tests/simplCore/should_compile/all.T | 3 +- testsuite/tests/simplStg/should_run/all.T | 5 +- utils/haddock | 2 +- utils/hsc2hs | 2 +- 27 files changed, 1019 insertions(+), 1754 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc a4c7ddd48929b394bc4aa4a684cf114285507822 From git at git.haskell.org Mon Oct 22 14:37:41 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 22 Oct 2018 14:37:41 +0000 (UTC) Subject: [commit: ghc] wip/t-12758_circleci_push_perf_notes: - (6856830) Message-ID: <20181022143741.C7AC23ABB8@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/t-12758_circleci_push_perf_notes Link : http://ghc.haskell.org/trac/ghc/changeset/68568304332d509ba6423aea5b06447e6623376b/ghc >--------------------------------------------------------------- commit 68568304332d509ba6423aea5b06447e6623376b Author: David Eichmann Date: Mon Oct 22 15:37:29 2018 +0100 - >--------------------------------------------------------------- 68568304332d509ba6423aea5b06447e6623376b .circleci/config.yml | 50 ++++++++--------------------------------- .circleci/push-test-metrics.sh | 48 +++++++++++++++++++++++++++++++++++++++ testsuite/driver/perf_notes.py | 16 ++++++++----- testsuite/driver/runtests.py | 10 ++++++++- testsuite/driver/testglobals.py | 3 +++ testsuite/mk/test.mk | 4 ++++ 6 files changed, 83 insertions(+), 48 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 68568304332d509ba6423aea5b06447e6623376b From git at git.haskell.org Mon Oct 22 17:19:26 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 22 Oct 2018 17:19:26 +0000 (UTC) Subject: [commit: ghc] master: Update hsc2hs submodule to work around bug in response file handling. (fce07c9) Message-ID: <20181022171926.E2B483ABB8@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/fce07c99fa6528e95892604edb73fb975d6a01fc/ghc >--------------------------------------------------------------- commit fce07c99fa6528e95892604edb73fb975d6a01fc Author: klebinger.andreas at gmx.at Date: Mon Oct 22 19:15:35 2018 +0200 Update hsc2hs submodule to work around bug in response file handling. Summary: This works around #15758 by bumping hsc2hs. The new version includes support for response files independent of the boot compiler. Test Plan: ci, building formerly broken packages Reviewers: bgamari, RyanGlScott, ckoparkar Reviewed By: ckoparkar Subscribers: rwbarton, carter GHC Trac Issues: #15758 Differential Revision: https://phabricator.haskell.org/D5250 >--------------------------------------------------------------- fce07c99fa6528e95892604edb73fb975d6a01fc testsuite/tests/hsc2hs/Makefile | 5 +++++ testsuite/tests/hsc2hs/{hsc2hs001.hsc => T15758.hsc} | 0 testsuite/tests/hsc2hs/T15758.response | 1 + testsuite/tests/hsc2hs/all.T | 3 +++ utils/hsc2hs | 2 +- 5 files changed, 10 insertions(+), 1 deletion(-) diff --git a/testsuite/tests/hsc2hs/Makefile b/testsuite/tests/hsc2hs/Makefile index fa668e7..b0751f1 100644 --- a/testsuite/tests/hsc2hs/Makefile +++ b/testsuite/tests/hsc2hs/Makefile @@ -49,3 +49,8 @@ ifeq "$(WINDOWS)" "YES" else grep '{-# LINE 1 \"T12504/path/to/$@\.hsc\" #-}' T12504/path/to/$@.hs endif + +.PHONY: T15758 +T15758: + '$(HSC2HS)' $@.hsc @T15758.response + '$(TEST_HC)' $(TEST_HC_OPTS) -c $@.a.hs diff --git a/testsuite/tests/hsc2hs/hsc2hs001.hsc b/testsuite/tests/hsc2hs/T15758.hsc similarity index 100% copy from testsuite/tests/hsc2hs/hsc2hs001.hsc copy to testsuite/tests/hsc2hs/T15758.hsc diff --git a/testsuite/tests/hsc2hs/T15758.response b/testsuite/tests/hsc2hs/T15758.response new file mode 100644 index 0000000..ea0d6b1 --- /dev/null +++ b/testsuite/tests/hsc2hs/T15758.response @@ -0,0 +1 @@ +-o T15758.a.hs diff --git a/testsuite/tests/hsc2hs/all.T b/testsuite/tests/hsc2hs/all.T index 03dd69a..f237d9a 100644 --- a/testsuite/tests/hsc2hs/all.T +++ b/testsuite/tests/hsc2hs/all.T @@ -16,3 +16,6 @@ test('T10272', [], run_command, ['$MAKE -s --no-print-directory T10272']) test('T12504', [extra_files(['T12504']), ignore_stdout], run_command, ['$MAKE -s --no-print-directory T12504']) + +# Make sure response files are read and used. +test('T15758', [], run_command, ['$MAKE -s --no-print-directory T15758']) diff --git a/utils/hsc2hs b/utils/hsc2hs index 769ac3c..8807b4c 160000 --- a/utils/hsc2hs +++ b/utils/hsc2hs @@ -1 +1 @@ -Subproject commit 769ac3cda8bd766e9a41a74eb681e2de1bac6795 +Subproject commit 8807b4cd9b9efc719828b52cd9aecb9892d3d80b From git at git.haskell.org Mon Oct 22 18:59:09 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 22 Oct 2018 18:59:09 +0000 (UTC) Subject: [commit: ghc] master: Clarify Note about ForAllCo coercions. (d069257) Message-ID: <20181022185909.D6E7A3ABB8@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/d06925715b83b805e58615396044fd2e8b6d36c8/ghc >--------------------------------------------------------------- commit d06925715b83b805e58615396044fd2e8b6d36c8 Author: Richard Eisenberg Date: Mon Oct 22 14:58:28 2018 -0400 Clarify Note about ForAllCo coercions. Comments only: [skip ci] >--------------------------------------------------------------- d06925715b83b805e58615396044fd2e8b6d36c8 compiler/types/Coercion.hs | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/compiler/types/Coercion.hs b/compiler/types/Coercion.hs index 198cfd3..919518c 100644 --- a/compiler/types/Coercion.hs +++ b/compiler/types/Coercion.hs @@ -717,10 +717,23 @@ We chose (2) for two reasons: * even if cv occurs in body_co, it is possible that cv does not occur in the kind of body_co. Therefore the check in coercionKind is inevitable. -The last wrinkle is that cv can only appear in Refl and GRefl for the consistency -of the type system. Thus the almostDevoidCoVarOfCo test. -See Section 5.8.5.2 of Richard's thesis for more details. -This check can cause liftCoSubst to fail. +The last wrinkle is that there are restrictions around the use of the cv in the +coercion, as described in Section 5.8.5.2 of Richard's thesis. The idea is that +we cannot prove that the type system is consistent with unrestricted use of this +cv; the consistency proof uses an untyped rewrite relation that works over types +with all coercions and casts removed. So, we can allow the cv to appear only in +positions that are erased. As an approximation of this (and keeping close to the +published theory), we currently allow the cv only within the type in a Refl node +and under a GRefl node (including in the Coercion stored in a GRefl). It's +possible other places are OK, too, but this is a safe approximation. + +Sadly, with heterogeneous equality, this restriction might be able to be violated; +Richard's thesis is unable to prove that it isn't. Specifically, the liftCoSubst +function might create an invalid coercion. Because a violation of the +restriction might lead to a program that "goes wrong", it is checked all the time, +even in a production compiler and without -dcore-list. We *have* proved that the +problem does not occur with homogeneous equality, so this check can be dropped +once ~# is made to be homogeneous. -} From git at git.haskell.org Tue Oct 23 11:13:03 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 11:13:03 +0000 (UTC) Subject: [commit: ghc] wip/t-12758_circleci_push_perf_notes: testsuite: Save performance metrics in git notes. (7521cc3) Message-ID: <20181023111303.48CC53ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/t-12758_circleci_push_perf_notes Link : http://ghc.haskell.org/trac/ghc/changeset/7521cc3f52b6e33488ddcf51dc9b41a2c7cc3b7d/ghc >--------------------------------------------------------------- commit 7521cc3f52b6e33488ddcf51dc9b41a2c7cc3b7d Author: David Eichmann Date: Fri Oct 19 16:31:39 2018 +0100 testsuite: Save performance metrics in git notes. Summary: This patch makes the following improvement: - Automatically records test metrics (per test environment) so that the programmer need not supply nor update expected values in *.T files. - On expected metric changes, the programmer need only indicate the direction of change in the git commit message. - Provides a simple python tool "perf_notes.py" to compare metrics over time. Issues: - Using just the previous commit allows performance to drift with each commit. - Currently we allow drift as we have a preference for minimizing false positives. - Some possible alternatives include: - Use metrics from a fixed commit per test: the last commit that allowed a change in performance (else the oldest metric) - Or use some sort of aggregate since the last commit that allowed a change in performance (else all available metrics) - These alternatives may result in a performance issue (with the test driver) having to heavily search git commits/notes. - Run locally, performance tests will trivially pass unless the tests were run locally on the previous commit. This is often not the case e.g. after pulling recent changes. Previously, *.T files contain statements such as: ``` stats_num_field('peak_megabytes_allocated', (2, 1)) compiler_stats_num_field('bytes allocated', [(wordsize(64), 165890392, 10)]) ``` This required the programmer to give the expected values and a tolerance deviation (percentage). With this patch, the above statements are replaced with: ``` collect_stats('peak_megabytes_allocated', 5) collect_compiler_stats('bytes allocated', 10) ``` So that programmer must only enter which metrics to test and a tolerance deviation. No expected value is required. CircleCI will then run the tests per test environment and record the metrics to a git note for that commit and push them to the git.haskell.org ghc repo. Metrics will be compared to the previous commit. If they are different by the tolerance deviation from the *.T file, then the corresponding test will fail. By adding to the git commit message e.g. ``` Metric Increase ['bytes allocated', 'peak_megabytes_allocated'] (test_env='linux_x86', way='default'): Test012, Test345 Metric Decrease 'bytes allocated': Test678 Metric Increase: Test711 ``` This will allow the noted changes (letting the test pass). Note that by omitting metrics or options, the change will apply to all possible metrics/options (i.e. in the above, an increase for all metrics in all test environments is allowed for Test711) phabricator will use the message in the description Reviewers: bgamari, hvr Reviewed By: bgamari Subscribers: rwbarton, carter GHC Trac Issues: #12758 Differential Revision: https://phabricator.haskell.org/D5059 >--------------------------------------------------------------- 7521cc3f52b6e33488ddcf51dc9b41a2c7cc3b7d .circleci/config.yml | 130 ++- libraries/base/tests/all.T | 18 +- testsuite/driver/README.md | 133 +++ testsuite/driver/perf_notes.py | 378 +++++++++ testsuite/driver/runtests.py | 63 +- testsuite/driver/testglobals.py | 30 +- testsuite/driver/testlib.py | 228 +++-- testsuite/driver/testutil.py | 18 + testsuite/mk/test.mk | 8 + testsuite/tests/callarity/perf/all.T | 12 +- testsuite/tests/deriving/perf/all.T | 11 +- testsuite/tests/perf/compiler/all.T | 1056 ++---------------------- testsuite/tests/perf/haddock/all.T | 184 +---- testsuite/tests/perf/join_points/all.T | 16 +- testsuite/tests/perf/should_run/all.T | 369 ++------- testsuite/tests/perf/space_leaks/all.T | 75 +- testsuite/tests/pmcheck/should_compile/all.T | 27 +- testsuite/tests/primops/should_run/all.T | 6 +- testsuite/tests/simplCore/should_compile/all.T | 3 +- testsuite/tests/simplStg/should_run/all.T | 5 +- 20 files changed, 1012 insertions(+), 1758 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 7521cc3f52b6e33488ddcf51dc9b41a2c7cc3b7d From git at git.haskell.org Tue Oct 23 11:13:06 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 11:13:06 +0000 (UTC) Subject: [commit: ghc] wip/t-12758_circleci_push_perf_notes: - (bb48dcd) Message-ID: <20181023111306.9659F3ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/t-12758_circleci_push_perf_notes Link : http://ghc.haskell.org/trac/ghc/changeset/bb48dcd112e9d5bc4b5bb0a558375d2c4e5442bb/ghc >--------------------------------------------------------------- commit bb48dcd112e9d5bc4b5bb0a558375d2c4e5442bb Author: David Eichmann Date: Mon Oct 22 15:37:29 2018 +0100 - >--------------------------------------------------------------- bb48dcd112e9d5bc4b5bb0a558375d2c4e5442bb .circleci/config.yml | 50 ++++++++--------------------------------- .circleci/push-test-metrics.sh | 48 +++++++++++++++++++++++++++++++++++++++ testsuite/driver/perf_notes.py | 16 ++++++++----- testsuite/driver/runtests.py | 10 ++++++++- testsuite/driver/testglobals.py | 3 +++ testsuite/mk/test.mk | 4 ++++ 6 files changed, 83 insertions(+), 48 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc bb48dcd112e9d5bc4b5bb0a558375d2c4e5442bb From git at git.haskell.org Tue Oct 23 11:13:10 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 11:13:10 +0000 (UTC) Subject: [commit: ghc] wip/t-12758_circleci_push_perf_notes's head updated: - (bb48dcd) Message-ID: <20181023111310.7E5BE3ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc Branch 'wip/t-12758_circleci_push_perf_notes' now includes: db6f1d9 Turn infinite loop into a panic 8c7f90a Fix a typo in TcValidity.checkFamInstRhs 2a54209 Comments only 4293a80 Accommodate API change in transSuperClasses 8d72f87 TcSimplify: Condense MASSERT2() usage onto a single line edb4714 docs: Add changelog and release notes entry for traceBinaryEvent# 14d8838 Update unicode tables to v. 12 of the standard 184a569 Clean up TcHsSyn.zonkEnv 1cca442 Comments only 4b79329 Add comments about pretty-printing via IfaceSyn ff29fc8 Better error reporting for inaccessible code c523525 ghc, ghc-pkg: use getExecutablePath on Windows when base >= 4.11.0 5e6cf2a Fix #15550 by quoting RULE names during TH conversion 7a3cda5 Fix #15502 by not casting to Int during TH conversion 744b034 Take strict fields into account in coverage checking 6e765ae Don't reify redundant class method tyvars/contexts 2d953a6 Fix #10859 by using foldr1 while deriving Eq instances b1f5d2f Bump nofib submodule 154d4e2 Remove dph, vector, primitive and random from .gitmodules 2cf98e2 rts: Handle SMALL_MUT_ARR_PTRS in retainer profilter c18b525 Remove dead code for commandline parsing c46a5f2 Fix #15572 by checking for promoted names in ConT 34b8e61 Fix typo in 8.6.1 notes 102284e Rename kind vars in left-to-right order in bindHsQTyVars 36c1431 Fixed typo in exponent example 65eec9c Fix a constant folding rule f48e276 Finish stable split 97826e3 Fix the __GLASGOW_HASKELL__ comparison 12e6e19 A few typos [ci skip] 140563f fix -ddump-asm description 5d3eb64 Minor improvements to comments [skip ci] 5851885 Comments only fda2ea5 Commets on flatten_args_tc 565ef4c Remove knot-tying bug in TcHsSyn.zonkTyVarOcc 6dea7c1 Reject class instances with type families in kinds ed78951 make iToBase62's inner loop stricter in one of its arguments 2e226a4 canCFunEqCan: use isTcReflexiveCo (not isTcReflCo) d1514e8 Remove duplicate "since" field in glasgow_exts.rst fa3143c Fix typos in -Wsimplifiable-class-constraints flag docs df363a6 Compiler panic on invalid syntax (unterminated pragma) a3a1a17 Add a test for Trac #15586 2254912 testsuite: make CHECK_API_ANNOTATIONS and CHECK_PPR overridable 24d610a Fix tests ghci057 and T9293. (#15071) c0e5087 Skip eventlog tests in GHCi way 49d50b2 testsuite: Add test for #15368 a811d93 base: Add references to Notes for certain special imports ecde954 testsuite: Use bools for booleans, not ints e29ac2d Expose 'moduleToPkgConfAll' from 'PackageState' 1152a3b Define activeAfterInitial, activeDuringFinal 3addf72 Preserve specialisations despite CSE 16bc7ae Remove an incorrect assertion in threadPaused: c6fbac6 Fix a race between GC threads in concurrent scavenging d9a26c7 Various RTS bug fixes: 4caad16 Documentation tweaks 9400a5c ghc: Remove warning of StaticPointers not being supported by GHCi 2b6694a users-guide: Disable syntax highlighting 62cd440 Refactor Foreign.Marshal modules for more modern style 510c5f4 Avoid creating unevaluated Int thunks when iterating in GHC.Foreign 3cc3edf Update UnsafeReenter test d36b1ff Build debugged prof runtimes 36740b4 Revert incorrect STM wakeup optimisation 5d67d06 rts.cabal.in: advertise new default profiling ways for hadrian 03b779f Make CoreMonad independent of TcEnv (#14391) ce23451 Refactor info table entry error messages 0e6d42f Be a bit more aggressive about let-to-case 7ab8007 Revert "ghc: Remove warning of StaticPointers not being supported by GHCi" 5c48c41 template-haskell: Fix typo in changelog 900c47f rts/Printer.c: always define the findPtr symbol b9b1f99 Honor INLINE on 0-arity bindings (#15578) 1ad3c82 Typo in user guide wrongly claims DeriveLift was added in 7.2 0c07208 Comments about join-point return types 6bf11e6 Delete duplicated comment line 291b0f8 Comments only (on IfDataInstance) bd76875 Allow (~) in the head of a quantified constraints 0d4f394 Add regression test for Trac #15629 02edb8f More info for Implication with -dppr-debug 8533428 Remove dead variable binding 9912cdf Fix build 5f5898a eventlog: Factor out eventlog header generation into separate function e71e341 base: showEFloat: Handle negative precisions the same of zero precision ce240b3 Update hsc2hs submodule 9c6b749 Add support for ImplicitParams and RecursiveDo in TH 3040444 tests: increase (compile) timeout multiplier for T13701 and MultiLayerModules ecbe26b Fix T15502 on 32-bit 64c54ff Mark system and internal symbols as private symbols in asm c23f057 Mark code related symbols as @function not @object ea5ade3 Coercion Quantification a3bce95 Correct submodule update for haddock c6bff52 Fix for #13862: Optional "-v" not allowed with :load in GHCi d1c2f29 Stable name comment wibbles 88130db base: Add bangs to GHC.IO.Handle.Text hGet* functions 43967c0 users-guide: Fix code-block layout for QuantifiedConstraints e655aac Make sure forM_ and related functions fuse cleanly 5840734 Updated PE linker, section alignment and cleanup. 4edc6d6 Users guide: EmptyDataDecls on by default 01f7cd7 NoImplicitPrelude in ghc-boot-th, ghc-boot, ghc-heap, ghci ce3897f Fix check whether GCC supports __atomic_ builtins 6bb9bc7 Invert FP conditions to eliminate the explicit NaN check. e40b388 Bump stm submodule 989dca6 Bump text submodule 2b763b5 Bump deepseq submodule 1971e99 Don't shortcut SRTs for static functions (#15544) a4ae97e docs: fix example code 45befe2 Use predefined known-key names when possible 077b92f Remove -Waggregate-return when building RTS 4e3f6a0 users guide: Fix a few issues ba086ca Add testcase for #14251 d7fa869 Revert "adds -latomic to. ghc-prim" 4eebc80 users-guide: Fix build with sphinx 1.8 8c7d33a users_guide: fix sphinx error caused by non-explicit override a257782 user-guide: Allow build with sphinx < 1.8 66c1729 Fix slop zeroing for AP_STACK eager blackholes in debug build 29f1c55 Remove redundant slop zeroing d0d7484 testsuite: Don't force run of llvm ways in T14251 73d9cad testsuite: Mark readFail032 and readFail048 as broken on Darwin 3e5b8e3 testsuite: Fix readFail048 and readFail032 brokenness declarations fd89bb4 testsuite: Bump expected allocations of T9675 78beade testsuite: Bump expected allocations for T12707 7e77f41 testsuite: Bump T9630 expected allocations cad5d0b Buglet in reporting out of scope errors in rules 4bde71d Don't look up unnecessary return in LastStmt ab44ff8 Comments only 2dbf88b Fix get getIdFromTrivialExpr e68b439 Add a recursivity check in nonVoid d90946c Fix a MSG_BLACKHOLE sanity check, add some comments a38eaa6 aclocal.m4: fix shell comment syntax: '#', not '$' 9bfbc4e Don't show constraint tuples in errors (#14907) 2a9cead Add regression test for #15666 a744134 Expand the Note on let-bound skolems 4bdb10c Fix Lint of unsaturated type families d25fa45 Fix constant-folding for Integer shifts 1d7b61f users' guide: document -freverse-errors d00c308 Fix for recover with -fexternal-interpreter (#15418) e72d788 Normalise EmptyCase types using the constraint solver c89297e Expose wopt_set/unset_fatal in DynFlags df67f95 Add -fkeep-cafs e44c992 Always check the relocation value for x86_64 139ef7e CodeGen: Teach CodeGen about aliasing of XMM/YMM/ZMM registers 99eb459 ghc-bin.cabal.in: add a 'threaded' flag for hadrian d157762 primops: Fix documentation of compactAllocateBlock# 4578548 ghc-prim: Add missing changelog entry 0ac86cb ghc-prim: Fix typo in traceBinaryEvent# changelog entry 64475db circleci: Run slowtest with multiple threads 309438e Fix #15637 by using VTA more in GND a57fa24 Quantify class variables first in associated families' kinds caffff1 circleci: Create missing test-results directory abfb91f resolve T13704 e3355b7 rts.cabal.in: add more flags to control the extra flavours (for hadrian) 21efbc7 GHCi should not filter instances involving cTuples a838ae3 Drop GHC 8.2 compatibility deceb21 Drop accidental write-attributes request 3dedffa distrib: Remove mention of no-longer-existent make target fc2ff6d Make GHC (the library) flexible in the choice of integer library bd78985 Parse the (!) type operator and allow type operators in existential context e9e6640 Better -ddump-types 43c2ffe Better comments and debug-print only e7ff934 Make Lint check that for CoVars more carefully 02b303e Do not mark CoVars as dead in the occur-anal 9ebfa03 Fail fast on pattern synonyms 37ef703 Better pretty-printing of forall types 2f09753 Distinguish Inferred from Specified tyvars d25519e tc-trace changes only 60b547b Document the list data type feb8a67 Improve generated `GHC.Prim` docs 8537657 Documentation fixes in 'template-haskell' bace26a Allow (unparenthesized) kind signatures ba163c3 Don't drop arguments in TH type arguments 251e342 Set `infixr -1 ->` 89656c2 Don't leak internal commentary into HasField's Haddocks fa1c827 Bump Cabal submodule 817ba0c testsuite: Skip T3171 for now 07083fc Add -Wstar-is-type to the User's Guide adcb5fb Multiple fixes / improvements for LLVM backend baec358 Update performance numbers on Windows 98daa34 Fix PE linker wibbles e5013a5 Make TcRnMonad independent of TcSplice (#14391) 2287257 Stable name type role 8be27c0 Add a missing write barrier to small array writes 4e3562c UNREG: don't prefix asm prefixes in via-C mode ed1615d testsuite: disable T14075 on non-smp targets 6483ff9 testsuite: disable T10017 on non-smp targets 32ceaaa testsuite: disable nursery-chunks1 on non-smp targets e4bec29 testsuite: disable T11760 on non-smp targets 5d5307f Add Int8# and Word8# 4eeeb51 update amd64 linux/osx stats for haddock.base perf test d728c3c Revert "Add Int8# and Word8#" ac97768 Fix dataToTag# argument evaluation 2f693b3 Re-enable test T14251 ce7a1c4 Support builtin classes like KnownNat in backpack 05b2587 Comments about dataToTag# only 5b2388b Include -fwarn-star-is-type in -Wcompat fc4c3df Fix dataToTag# comment syntax again (primops.txt.pp) 68a747c rts: Stop tracing environment variables (fixes #15371) 448b77b Add RubbishLit for absent bindings of UnliftedRep d52627f Minor documentation markup fix in HsExpr.hs 8e6c34f Fix typo in documentation 48efbc0 Fix #15725 with an extra Sym 08b3db7 Use an accumulator version of tyCoVarsOfType 8a9a63b Fix test for GCC support for atomics in Autotools f945b7a Correct typo "Deppendency" -> Dependency 58dffa0 Deprecate -fllvm-pass-vectors-in-regs 01c3d00 Fix plugin tests requirements a816ac4 Cleanup boot and validate 846fe90 Typeable: Only render saturated tuple types with tuple syntax 0b0cb48 Surprising error message with bang pattern 26e81e9 Fix #12430 by expanding type synonyms in injTyVarsOfType c5b477c Fix cardinality change of fields in addDataConStrictness 02b2116 Fix #15738 by defining (and using) parenthesizeHsContext 95ec7c8 Generate correct relocation for external cost centre 058c281 ghc-heap: Fix writing closures on big endian 165d3d5 Enable -Wcompat=error in the testsuite 104599f Add a RTS option -xp to load PIC object anywhere in address space 8306141 Allocate bss section within proper range of other sections 45ed461 Fix BLACKHOLE inspection in RtClosureInspect 45d5eff Update integer_gmp_gcdext documentation. 172b00c Add a strict version of foldMap to Foldable 2e1df7c base: Fill in TBAs in changelog 38c28c1 Fix #15761 by adding parens 17b60f1 testsuite: Fix non-canonical Monoid instance in T3001-2 46f2906 Fix T15729 in master 879db55 Adding almost devoid check for covar in ForAllCo fce07c9 Update hsc2hs submodule to work around bug in response file handling. 7521cc3 testsuite: Save performance metrics in git notes. bb48dcd - From git at git.haskell.org Tue Oct 23 12:48:59 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 12:48:59 +0000 (UTC) Subject: [commit: ghc] wip/t-12758_circleci_push_perf_notes: - (30fae38) Message-ID: <20181023124859.11DAF3ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/t-12758_circleci_push_perf_notes Link : http://ghc.haskell.org/trac/ghc/changeset/30fae38222503c67ae31dd42204b7f048f651de8/ghc >--------------------------------------------------------------- commit 30fae38222503c67ae31dd42204b7f048f651de8 Author: David Eichmann Date: Mon Oct 22 15:37:29 2018 +0100 - >--------------------------------------------------------------- 30fae38222503c67ae31dd42204b7f048f651de8 .circleci/config.yml | 50 +++++++---------------------------- .circleci/push-test-metrics.sh | 48 +++++++++++++++++++++++++++++++++ testsuite/driver/perf_notes.py | 16 ++++++----- testsuite/driver/runtests.py | 10 ++++++- testsuite/driver/testglobals.py | 3 +++ testsuite/mk/test.mk | 4 +++ testsuite/tests/perf/should_run/all.T | 5 +--- 7 files changed, 84 insertions(+), 52 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 30fae38222503c67ae31dd42204b7f048f651de8 From git at git.haskell.org Tue Oct 23 14:50:37 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 14:50:37 +0000 (UTC) Subject: [commit: ghc] wip/t-12758_circleci_push_perf_notes: - (29bc4a1) Message-ID: <20181023145037.AD27C3ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/t-12758_circleci_push_perf_notes Link : http://ghc.haskell.org/trac/ghc/changeset/29bc4a1ee2238125ca43d1336fd727aa0a74506b/ghc >--------------------------------------------------------------- commit 29bc4a1ee2238125ca43d1336fd727aa0a74506b Author: David Eichmann Date: Mon Oct 22 15:37:29 2018 +0100 - >--------------------------------------------------------------- 29bc4a1ee2238125ca43d1336fd727aa0a74506b .circleci/config.yml | 51 +++++++---------------------------- .circleci/push-test-metrics.sh | 48 +++++++++++++++++++++++++++++++++ testsuite/driver/perf_notes.py | 16 ++++++----- testsuite/driver/runtests.py | 10 ++++++- testsuite/driver/testglobals.py | 3 +++ testsuite/mk/test.mk | 4 +++ testsuite/tests/perf/should_run/all.T | 5 +--- 7 files changed, 85 insertions(+), 52 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 29bc4a1ee2238125ca43d1336fd727aa0a74506b From git at git.haskell.org Tue Oct 23 15:29:55 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 15:29:55 +0000 (UTC) Subject: [commit: ghc] wip/t-12758_circleci_push_perf_notes: - (267937e) Message-ID: <20181023152955.981CA3ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/t-12758_circleci_push_perf_notes Link : http://ghc.haskell.org/trac/ghc/changeset/267937edf1d488ca73f1de17dcc62cab8f54400e/ghc >--------------------------------------------------------------- commit 267937edf1d488ca73f1de17dcc62cab8f54400e Author: David Eichmann Date: Mon Oct 22 15:37:29 2018 +0100 - >--------------------------------------------------------------- 267937edf1d488ca73f1de17dcc62cab8f54400e .circleci/config.yml | 51 +++++++---------------------------- .circleci/push-test-metrics.sh | 48 +++++++++++++++++++++++++++++++++ testsuite/driver/perf_notes.py | 16 ++++++----- testsuite/driver/runtests.py | 10 ++++++- testsuite/driver/testglobals.py | 3 +++ testsuite/mk/test.mk | 4 +++ testsuite/tests/perf/should_run/all.T | 5 +--- 7 files changed, 85 insertions(+), 52 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 267937edf1d488ca73f1de17dcc62cab8f54400e From git at git.haskell.org Tue Oct 23 20:10:31 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:10:31 +0000 (UTC) Subject: [commit: ghc] master: Implement install_docs (#442) (7a85ccf) Message-ID: <20181023201031.D150A3ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/7a85ccf58a5fdd82fa44cc0a2703c4bc621211e1/ghc >--------------------------------------------------------------- commit 7a85ccf58a5fdd82fa44cc0a2703c4bc621211e1 Author: Zhen Zhang Date: Sat Oct 28 06:16:20 2017 +0800 Implement install_docs (#442) >--------------------------------------------------------------- 7a85ccf58a5fdd82fa44cc0a2703c4bc621211e1 src/Rules/Documentation.hs | 4 ++++ src/Rules/Install.hs | 22 ++++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/src/Rules/Documentation.hs b/src/Rules/Documentation.hs index 2cdd4d5..5a5698c 100644 --- a/src/Rules/Documentation.hs +++ b/src/Rules/Documentation.hs @@ -23,12 +23,16 @@ documentationRules = do buildPdfDocumentation buildDocumentationArchives buildManPage + "//docs//gen_contents_index" %> copyFile "libraries/gen_contents_index" + "//docs//prologue.txt" %> copyFile "libraries/prologue.txt" "docs" ~> do root <- buildRoot let html = htmlRoot -/- "index.html" archives = map pathArchive docPaths pdfs = map pathPdf $ docPaths \\ [ "libraries" ] need $ map (root -/-) $ [html] ++ archives ++ pdfs + need [ root -/- htmlRoot -/- "libraries" -/- "gen_contents_index" ] + need [ root -/- htmlRoot -/- "libraries" -/- "prologue.txt" ] need [manPagePath] manPagePath :: FilePath diff --git a/src/Rules/Install.hs b/src/Rules/Install.hs index 4558646..ae4a7b0 100644 --- a/src/Rules/Install.hs +++ b/src/Rules/Install.hs @@ -45,6 +45,7 @@ installRules = do installLibExecScripts installBins installPackages + installDocs -- TODO: Get rid of hard-coded list. -- | Binaries to install. @@ -311,3 +312,24 @@ installIncludes = do (destDir ++ ghcheaderDir ++ "/") where installHeader = installData -- they share same arguments + +-- ref: ghc.mk +-- | Install documentation to @prefix/share/doc/ghc-@. +installDocs :: Action () +installDocs = do + destDir <- getDestDir + docDir <- installDocDir + root <- buildRoot + installDirectory (destDir ++ docDir) + + let usersGuide = root -/- "docs/pdfs/users_guide.pdf" + whenM (doesFileExist usersGuide) $ + installData [usersGuide] (destDir ++ docDir) + + let htmlDocDir = destDir ++ docDir -/- "html" + installDirectory htmlDocDir + installData ["docs/index.html"] htmlDocDir + + forM_ ["Haddock", "libraries", "users_guide"] $ \dirname -> do + let dir = (root -/- "docs/html" -/- dirname) + whenM (doesDirectoryExist dir) $ copyDirectory dir htmlDocDir From git at git.haskell.org Tue Oct 23 20:10:36 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:10:36 +0000 (UTC) Subject: [commit: ghc] master: Replace shortcuts to issues by GitHub links (987240f) Message-ID: <20181023201036.0AC793ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/987240f71ca0467617a0f067bf0e93ab836262b5/ghc >--------------------------------------------------------------- commit 987240f71ca0467617a0f067bf0e93ab836262b5 Author: Andrey Mokhov Date: Sun Oct 29 19:03:57 2017 +0000 Replace shortcuts to issues by GitHub links See #440 >--------------------------------------------------------------- 987240f71ca0467617a0f067bf0e93ab836262b5 src/Builder.hs | 6 +++--- src/Hadrian/Package.hs | 3 ++- src/Rules/Install.hs | 16 +++++++++------- src/Rules/SourceDist.hs | 4 +++- src/Rules/Test.hs | 5 +++-- src/Settings/Packages/Base.hs | 3 ++- src/Settings/Packages/Rts.hs | 6 +++--- 7 files changed, 25 insertions(+), 18 deletions(-) diff --git a/src/Builder.hs b/src/Builder.hs index fdd73e7..8722609 100644 --- a/src/Builder.hs +++ b/src/Builder.hs @@ -208,9 +208,9 @@ instance H.Builder Builder where _ -> cmd echo [path] buildArgs -- TODO: Some builders are required only on certain platforms. For example, --- Objdump is only required on OpenBSD and AIX, as mentioned in #211. Add --- support for platform-specific optional builders as soon as we can reliably --- test this feature. +-- 'Objdump' is only required on OpenBSD and AIX. Add support for platform +-- specific optional builders as soon as we can reliably test this feature. +-- See https://github.com/snowleopard/hadrian/issues/211. isOptional :: Builder -> Bool isOptional = \case Objdump -> True diff --git a/src/Hadrian/Package.hs b/src/Hadrian/Package.hs index c7dc525..11a6998 100644 --- a/src/Hadrian/Package.hs +++ b/src/Hadrian/Package.hs @@ -32,7 +32,8 @@ import Hadrian.Utilities data PackageLanguage = C | Haskell deriving (Generic, Show) --- TODO: Make PackageType more precise, #12. +-- TODO: Make PackageType more precise. +-- See https://github.com/snowleopard/hadrian/issues/12. data PackageType = Library | Program deriving (Generic, Show) type PackageName = String diff --git a/src/Rules/Install.hs b/src/Rules/Install.hs index ae4a7b0..a34536a 100644 --- a/src/Rules/Install.hs +++ b/src/Rules/Install.hs @@ -168,13 +168,13 @@ installPackages = do rtsLibs <- mapM pkgLibraryFile $ map (Context Stage1 rts) ways ffiLibs <- sequence $ map rtsLibffiLibrary ways - -- TODO: Add dynamic ones + -- TODO: Add dynamic libraries. forM_ (rtsLibs ++ ffiLibs) $ \lib -> installData [lib] rtsDir - -- HACK (issue #327) + -- TODO: Remove this hack required for @ghc-cabal copy at . + -- See https://github.com/snowleopard/hadrian/issues/327. ghcBootPlatformHeader <- buildPath (vanillaContext Stage1 compiler) <&> (-/- "ghc_boot_platform.h") - copyFile ghcBootPlatformHeader (pkgPath compiler -/- "ghc_boot_platform.h") installPackages <- filterM ((isJust <$>) . installStage) @@ -182,7 +182,7 @@ installPackages = do installLibPkgs <- topsortPackages (filter isLibrary installPackages) - -- TODO (izgzhen): figure out what is the root cause of the missing ghc-gmp.h error + -- TODO: Figure out what is the root cause of the missing ghc-gmp.h error. copyFile (pkgPath integerGmp -/- "gmp/ghc-gmp.h") (pkgPath integerGmp -/- "ghc-gmp.h") forM_ installLibPkgs $ \pkg -> do @@ -201,13 +201,15 @@ installPackages = do -- Copy over packages strip <- stripCmdPath ways <- interpretInContext context getLibraryWays - let ghcCabalInplace = inplaceBinPath -/- "ghc-cabal" <.> exe -- HACK? + -- TODO: Remove hard-coded @ghc-cabal@ path. + let ghcCabalInplace = inplaceBinPath -/- "ghc-cabal" <.> exe need [ghcCabalInplace] pkgConf <- pkgConfFile context - need [cabalFile, pkgConf] -- TODO: check if need pkgConf + need [cabalFile, pkgConf] -- TODO: Check if we need 'pkgConf'. - -- HACK (#318): copy stuff back to the place favored by ghc-cabal + -- TODO: Drop redundant copies required by @ghc-cabal at . + -- See https://github.com/snowleopard/hadrian/issues/318. quietly $ copyDirectoryContentsUntracked (Not excluded) installDistDir (installDistDir -/- "build") diff --git a/src/Rules/SourceDist.hs b/src/Rules/SourceDist.hs index f8940c3..3143c4b 100644 --- a/src/Rules/SourceDist.hs +++ b/src/Rules/SourceDist.hs @@ -10,7 +10,9 @@ import Rules.Clean sourceDistRules :: Rules () sourceDistRules = do "sdist-ghc" ~> do - cleanSourceTree -- We clean the source tree first, see #384 + -- We clean the source tree first. + -- See https://github.com/snowleopard/hadrian/issues/384. + cleanSourceTree version <- setting ProjectVersion need ["sdistprep/ghc-" ++ version ++ "-src.tar.xz"] putSuccess "| Done" diff --git a/src/Rules/Test.hs b/src/Rules/Test.hs index 294f8f0..ae37343 100644 --- a/src/Rules/Test.hs +++ b/src/Rules/Test.hs @@ -17,9 +17,10 @@ testRules = do needBuilder $ Ghc CompileHs Stage2 needBuilder $ GhcPkg Update Stage1 needBuilder Hpc + -- TODO: Figure out why @needBuilder Hsc2Hs@ doesn't work. + -- TODO: Eliminate explicit filepaths. + -- See https://github.com/snowleopard/hadrian/issues/376. need ["inplace/bin/hp2ps", "inplace/bin/hsc2hs"] - -- TODO: Eliminate explicit filepaths in "need" (#376) - -- FIXME: needBuilder Hsc2Hs doesn't work build $ target (vanillaContext Stage2 compiler) (Make "testsuite/tests") [] [] "test" ~> do diff --git a/src/Settings/Packages/Base.hs b/src/Settings/Packages/Base.hs index bea5210..1124b95 100644 --- a/src/Settings/Packages/Base.hs +++ b/src/Settings/Packages/Base.hs @@ -7,5 +7,6 @@ basePackageArgs :: Args basePackageArgs = package base ? do integerLibrary <- expr integerLibraryName mconcat [ builder GhcCabal ? arg ("--flags=" ++ integerLibrary) - -- Fix the 'unknown symbol stat' issue, see #259. + -- This fixes the 'unknown symbol stat' issue. + -- See: https://github.com/snowleopard/hadrian/issues/259. , builder (Ghc CompileCWithGhc) ? arg "-optc-O2" ] diff --git a/src/Settings/Packages/Rts.hs b/src/Settings/Packages/Rts.hs index 7282a0e..299d1da 100644 --- a/src/Settings/Packages/Rts.hs +++ b/src/Settings/Packages/Rts.hs @@ -109,12 +109,12 @@ rtsPackageArgs = package rts ? do , arg $ "-I" ++ path , flag UseSystemFfi ? arg ("-I" ++ ffiIncludeDir) , arg $ "-DRtsWay=\"rts_" ++ show way ++ "\"" - -- rts *must* be compiled with optimisations. The INLINE_HEADER macro + -- RTS *must* be compiled with optimisations. The INLINE_HEADER macro -- requires that functions are inlined to work as expected. Inlining -- only happens for optimised builds. Otherwise we can assume that - -- there is a non-inlined variant to use instead. But rts does not + -- there is a non-inlined variant to use instead. But RTS does not -- provide non-inlined alternatives and hence needs the function to - -- be inlined. See also #90. + -- be inlined. See https://github.com/snowleopard/hadrian/issues/90. , arg "-O2" , Debug `wayUnit` way ? arg "-DDEBUG" From git at git.haskell.org Tue Oct 23 20:10:40 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:10:40 +0000 (UTC) Subject: [commit: ghc] master: Minor clean up, taking hlint suggestions (f4bbf31) Message-ID: <20181023201040.1A5DB3ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/f4bbf31547cdce3711defbf593e65cc9abb27703/ghc >--------------------------------------------------------------- commit f4bbf31547cdce3711defbf593e65cc9abb27703 Author: Andrey Mokhov Date: Sun Oct 29 21:35:57 2017 +0000 Minor clean up, taking hlint suggestions >--------------------------------------------------------------- f4bbf31547cdce3711defbf593e65cc9abb27703 src/Hadrian/Builder.hs | 13 ++++++------ src/Hadrian/Haskell/Cabal.hs | 2 +- src/Hadrian/Oracles/Path.hs | 4 ++-- src/Hadrian/Oracles/TextFile.hs | 4 ++-- src/Oracles/ModuleFiles.hs | 6 +++--- src/Oracles/PackageData.hs | 2 +- src/Oracles/Setting.hs | 4 ++-- src/Rules/Clean.hs | 4 ++-- src/Rules/Compile.hs | 2 +- src/Rules/Dependencies.hs | 2 +- src/Rules/Install.hs | 31 ++++++++++++++-------------- src/Rules/Libffi.hs | 4 ++-- src/Rules/Selftest.hs | 20 +++++++++--------- src/Settings/Builders/Cc.hs | 40 ++++++++++++++++++------------------ src/Settings/Builders/Common.hs | 2 +- src/Settings/Builders/Make.hs | 2 +- src/Settings/Builders/Tar.hs | 2 +- src/Settings/Flavours/Development.hs | 2 +- src/Settings/Flavours/Performance.hs | 2 +- src/Settings/Flavours/Profiled.hs | 2 +- src/Settings/Flavours/Quick.hs | 2 +- src/Settings/Flavours/QuickCross.hs | 2 +- src/Settings/Flavours/Quickest.hs | 2 +- src/Settings/Packages/Compiler.hs | 1 - 24 files changed, 77 insertions(+), 80 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc f4bbf31547cdce3711defbf593e65cc9abb27703 From git at git.haskell.org Tue Oct 23 20:10:44 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:10:44 +0000 (UTC) Subject: [commit: ghc] master: Move Tar builder into the library (e04d207) Message-ID: <20181023201044.201A43ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/e04d2072d105e3ec6131e7d7b4fc7a0f6114f14b/ghc >--------------------------------------------------------------- commit e04d2072d105e3ec6131e7d7b4fc7a0f6114f14b Author: Andrey Mokhov Date: Sun Oct 29 22:21:56 2017 +0000 Move Tar builder into the library See #347 >--------------------------------------------------------------- e04d2072d105e3ec6131e7d7b4fc7a0f6114f14b hadrian.cabal | 2 +- src/Builder.hs | 8 +------- src/Hadrian/Builder/Tar.hs | 40 ++++++++++++++++++++++++++++++++++++++++ src/Settings/Builders/Tar.hs | 20 -------------------- src/Settings/Default.hs | 5 +++-- 5 files changed, 45 insertions(+), 30 deletions(-) diff --git a/hadrian.cabal b/hadrian.cabal index 54a0273..568b297 100644 --- a/hadrian.cabal +++ b/hadrian.cabal @@ -28,6 +28,7 @@ executable hadrian , GHC , Hadrian.Builder , Hadrian.Builder.Ar + , Hadrian.Builder.Tar , Hadrian.Expression , Hadrian.Haskell.Cabal , Hadrian.Haskell.Cabal.Parse @@ -77,7 +78,6 @@ executable hadrian , Settings.Builders.Ld , Settings.Builders.Make , Settings.Builders.Sphinx - , Settings.Builders.Tar , Settings.Builders.Xelatex , Settings.Default , Settings.Flavours.Development diff --git a/src/Builder.hs b/src/Builder.hs index 8722609..5545d06 100644 --- a/src/Builder.hs +++ b/src/Builder.hs @@ -19,6 +19,7 @@ import GHC.Generics import qualified Hadrian.Builder as H import Hadrian.Builder hiding (Builder) import Hadrian.Builder.Ar +import Hadrian.Builder.Tar import Hadrian.Oracles.Path import Hadrian.Oracles.TextFile import Hadrian.Utilities @@ -77,13 +78,6 @@ instance Binary SphinxMode instance Hashable SphinxMode instance NFData SphinxMode --- | Tar can be used to create an archive or extract from it. -data TarMode = Create | Extract deriving (Eq, Generic, Show) - -instance Binary TarMode -instance Hashable TarMode -instance NFData TarMode - -- | A 'Builder' is an external command invoked in a separate process via 'cmd'. -- @Ghc Stage0@ is the bootstrapping compiler. -- @Ghc StageN@, N > 0, is the one built in stage (N - 1). diff --git a/src/Hadrian/Builder/Tar.hs b/src/Hadrian/Builder/Tar.hs new file mode 100644 index 0000000..d51e3c7 --- /dev/null +++ b/src/Hadrian/Builder/Tar.hs @@ -0,0 +1,40 @@ +----------------------------------------------------------------------------- +-- | +-- Module : Hadrian.Builder.Tar +-- Copyright : (c) Andrey Mokhov 2014-2017 +-- License : MIT (see the file LICENSE) +-- Maintainer : andrey.mokhov at gmail.com +-- Stability : experimental +-- +-- Support for invoking the archiving utility @tar at . +----------------------------------------------------------------------------- +module Hadrian.Builder.Tar (TarMode (..), args) where + +import Development.Shake +import Development.Shake.Classes +import GHC.Generics +import Hadrian.Expression + +-- | Tar can be used to 'Create' an archive or 'Extract' from it. +data TarMode = Create | Extract deriving (Eq, Generic, Show) + +instance Binary TarMode +instance Hashable TarMode +instance NFData TarMode + +-- | Default command line arguments for invoking the archiving utility @tar at . +args :: (ShakeValue c, ShakeValue b) => TarMode -> Args c b +args Create = mconcat + [ arg "-c" + , output "//*.gz" ? arg "--gzip" + , output "//*.bz2" ? arg "--bzip2" + , output "//*.xz" ? arg "--xz" + , arg "-f", arg =<< getOutput + , getInputs ] +args Extract = mconcat + [ arg "-x" + , input "*.gz" ? arg "--gzip" + , input "*.bz2" ? arg "--bzip2" + , input "*.xz" ? arg "--xz" + , arg "-f", arg =<< getInput + , arg "-C", arg =<< getOutput ] diff --git a/src/Settings/Builders/Tar.hs b/src/Settings/Builders/Tar.hs deleted file mode 100644 index 4fb7d97..0000000 --- a/src/Settings/Builders/Tar.hs +++ /dev/null @@ -1,20 +0,0 @@ -module Settings.Builders.Tar (tarBuilderArgs) where - -import Settings.Builders.Common - -tarBuilderArgs :: Args -tarBuilderArgs = - mconcat [ builder (Tar Create) ? mconcat - [ arg "-c" - , output "//*.gz" ? arg "--gzip" - , output "//*.bz2" ? arg "--bzip2" - , output "//*.xz" ? arg "--xz" - , arg "-f", arg =<< getOutput - , getInputs ] - , builder (Tar Extract) ? mconcat - [ arg "-x" - , input "*.gz" ? arg "--gzip" - , input "*.bz2" ? arg "--bzip2" - , input "*.xz" ? arg "--xz" - , arg "-f", arg =<< getInput - , arg "-C", arg =<< getOutput ] ] diff --git a/src/Settings/Default.hs b/src/Settings/Default.hs index cf0047f..18e0d43 100644 --- a/src/Settings/Default.hs +++ b/src/Settings/Default.hs @@ -5,6 +5,7 @@ module Settings.Default ( ) where import qualified Hadrian.Builder.Ar +import qualified Hadrian.Builder.Tar import CommandLine import Expression @@ -28,7 +29,6 @@ import Settings.Builders.HsCpp import Settings.Builders.Ld import Settings.Builders.Make import Settings.Builders.Sphinx -import Settings.Builders.Tar import Settings.Builders.Xelatex import Settings.Packages.Base import Settings.Packages.Cabal @@ -159,7 +159,8 @@ defaultBuilderArgs = mconcat , ldBuilderArgs , makeBuilderArgs , sphinxBuilderArgs - , tarBuilderArgs + , builder (Tar Create ) ? Hadrian.Builder.Tar.args Create + , builder (Tar Extract) ? Hadrian.Builder.Tar.args Extract , xelatexBuilderArgs ] -- TODO: Disable warnings for Windows specifics. From git at git.haskell.org Tue Oct 23 20:10:48 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:10:48 +0000 (UTC) Subject: [commit: ghc] master: Move Sphinx builder into the library (e6e95fc) Message-ID: <20181023201048.074063ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/e6e95fc2d8b157f35e4f8fddb5a9bebd5e2d6e28/ghc >--------------------------------------------------------------- commit e6e95fc2d8b157f35e4f8fddb5a9bebd5e2d6e28 Author: Andrey Mokhov Date: Mon Oct 30 02:03:32 2017 +0000 Move Sphinx builder into the library See #347 >--------------------------------------------------------------- e6e95fc2d8b157f35e4f8fddb5a9bebd5e2d6e28 hadrian.cabal | 2 +- src/Builder.hs | 11 +---------- src/Hadrian/Builder/Sphinx.hs | 39 +++++++++++++++++++++++++++++++++++++++ src/Settings/Builders/Sphinx.hs | 22 ---------------------- src/Settings/Default.hs | 20 ++++++++++++-------- 5 files changed, 53 insertions(+), 41 deletions(-) diff --git a/hadrian.cabal b/hadrian.cabal index 568b297..7bb249e 100644 --- a/hadrian.cabal +++ b/hadrian.cabal @@ -28,6 +28,7 @@ executable hadrian , GHC , Hadrian.Builder , Hadrian.Builder.Ar + , Hadrian.Builder.Sphinx , Hadrian.Builder.Tar , Hadrian.Expression , Hadrian.Haskell.Cabal @@ -77,7 +78,6 @@ executable hadrian , Settings.Builders.HsCpp , Settings.Builders.Ld , Settings.Builders.Make - , Settings.Builders.Sphinx , Settings.Builders.Xelatex , Settings.Default , Settings.Flavours.Development diff --git a/src/Builder.hs b/src/Builder.hs index 5545d06..2b99c03 100644 --- a/src/Builder.hs +++ b/src/Builder.hs @@ -19,6 +19,7 @@ import GHC.Generics import qualified Hadrian.Builder as H import Hadrian.Builder hiding (Builder) import Hadrian.Builder.Ar +import Hadrian.Builder.Sphinx import Hadrian.Builder.Tar import Hadrian.Oracles.Path import Hadrian.Oracles.TextFile @@ -68,16 +69,6 @@ instance Binary HaddockMode instance Hashable HaddockMode instance NFData HaddockMode --- | Sphinx can be used in three different modes: --- * Convert RST to HTML --- * Convert RST to LaTeX --- * Convert RST to Man pages -data SphinxMode = Html | Latex | Man deriving (Eq, Generic, Show) - -instance Binary SphinxMode -instance Hashable SphinxMode -instance NFData SphinxMode - -- | A 'Builder' is an external command invoked in a separate process via 'cmd'. -- @Ghc Stage0@ is the bootstrapping compiler. -- @Ghc StageN@, N > 0, is the one built in stage (N - 1). diff --git a/src/Hadrian/Builder/Sphinx.hs b/src/Hadrian/Builder/Sphinx.hs new file mode 100644 index 0000000..44b522c --- /dev/null +++ b/src/Hadrian/Builder/Sphinx.hs @@ -0,0 +1,39 @@ +----------------------------------------------------------------------------- +-- | +-- Module : Hadrian.Builder.Sphinx +-- Copyright : (c) Andrey Mokhov 2014-2017 +-- License : MIT (see the file LICENSE) +-- Maintainer : andrey.mokhov at gmail.com +-- Stability : experimental +-- +-- Support for invoking the documentation utility Sphinx. +----------------------------------------------------------------------------- +module Hadrian.Builder.Sphinx (SphinxMode (..), args) where + +import Development.Shake +import Development.Shake.Classes +import GHC.Generics +import Hadrian.Expression +import Hadrian.Utilities + +-- | Sphinx can be used in three different modes to convert reStructuredText +-- documents into HTML, LaTeX or Man pages. +data SphinxMode = Html | Latex | Man deriving (Eq, Generic, Show) + +instance Binary SphinxMode +instance Hashable SphinxMode +instance NFData SphinxMode + +-- | Default command line arguments for invoking the archiving utility @tar at . +args :: (ShakeValue c, ShakeValue b) => SphinxMode -> Args c b +args mode = do + outPath <- getOutput + mconcat [ arg "-b", arg modeString + , arg "-d", arg $ outPath -/- (".doctrees-" ++ modeString) + , arg =<< getInput + , arg outPath ] + where + modeString = case mode of + Html -> "html" + Latex -> "latex" + Man -> "man" diff --git a/src/Settings/Builders/Sphinx.hs b/src/Settings/Builders/Sphinx.hs deleted file mode 100644 index 2338cfc..0000000 --- a/src/Settings/Builders/Sphinx.hs +++ /dev/null @@ -1,22 +0,0 @@ -module Settings.Builders.Sphinx (sphinxBuilderArgs) where - -import Settings.Builders.Common - -sphinxBuilderArgs :: Args -sphinxBuilderArgs = do - outPath <- getOutput - mconcat [ builder (Sphinx Html) ? mconcat - [ arg "-b", arg "html" - , arg "-d", arg $ outPath -/- ".doctrees-html" - , arg =<< getInput - , arg outPath ] - , builder (Sphinx Latex) ? mconcat - [ arg "-b", arg "latex" - , arg "-d", arg $ outPath -/- ".doctrees-latex" - , arg =<< getInput - , arg outPath ] - , builder (Sphinx Man) ? mconcat - [ arg "-b", arg "man" - , arg "-d", arg $ outPath -/- ".doctrees-man" - , arg =<< getInput - , arg outPath ] ] diff --git a/src/Settings/Default.hs b/src/Settings/Default.hs index 18e0d43..cb42d66 100644 --- a/src/Settings/Default.hs +++ b/src/Settings/Default.hs @@ -6,6 +6,7 @@ module Settings.Default ( import qualified Hadrian.Builder.Ar import qualified Hadrian.Builder.Tar +import qualified Hadrian.Builder.Sphinx import CommandLine import Expression @@ -28,7 +29,6 @@ import Settings.Builders.Hsc2Hs import Settings.Builders.HsCpp import Settings.Builders.Ld import Settings.Builders.Make -import Settings.Builders.Sphinx import Settings.Builders.Xelatex import Settings.Packages.Base import Settings.Packages.Cabal @@ -39,7 +39,7 @@ import Settings.Packages.Ghci import Settings.Packages.GhcPkg import Settings.Packages.GhcPrim import Settings.Packages.Haddock -import Settings.Packages.Haskeline (haskelinePackageArgs) +import Settings.Packages.Haskeline import Settings.Packages.IntegerGmp import Settings.Packages.Rts import Settings.Packages.RunGhc @@ -140,9 +140,8 @@ defaultSplitObjects = do -- | All 'Builder'-dependent command line arguments. defaultBuilderArgs :: Args defaultBuilderArgs = mconcat + -- GHC-specific builders: [ alexBuilderArgs - , builder (Ar Pack ) ? Hadrian.Builder.Ar.args Pack - , builder (Ar Unpack) ? Hadrian.Builder.Ar.args Unpack , ccBuilderArgs , configureBuilderArgs , deriveConstantsBuilderArgs @@ -158,10 +157,15 @@ defaultBuilderArgs = mconcat , hsCppBuilderArgs , ldBuilderArgs , makeBuilderArgs - , sphinxBuilderArgs - , builder (Tar Create ) ? Hadrian.Builder.Tar.args Create - , builder (Tar Extract) ? Hadrian.Builder.Tar.args Extract - , xelatexBuilderArgs ] + , xelatexBuilderArgs + -- Generic builders from the Hadrian library: + , builder (Ar Pack ) ? Hadrian.Builder.Ar.args Pack + , builder (Ar Unpack ) ? Hadrian.Builder.Ar.args Unpack + , builder (Sphinx Html ) ? Hadrian.Builder.Sphinx.args Html + , builder (Sphinx Latex) ? Hadrian.Builder.Sphinx.args Latex + , builder (Sphinx Man ) ? Hadrian.Builder.Sphinx.args Man + , builder (Tar Create ) ? Hadrian.Builder.Tar.args Create + , builder (Tar Extract ) ? Hadrian.Builder.Tar.args Extract ] -- TODO: Disable warnings for Windows specifics. -- TODO: Move this elsewhere? From git at git.haskell.org Tue Oct 23 20:10:51 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:10:51 +0000 (UTC) Subject: [commit: ghc] master: Update README.md (e0bbd9f) Message-ID: <20181023201051.EEA4F3ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/e0bbd9fcb18fd6a9c944c615124537831738564d/ghc >--------------------------------------------------------------- commit e0bbd9fcb18fd6a9c944c615124537831738564d Author: Andrey Mokhov Date: Mon Oct 30 03:14:53 2017 +0000 Update README.md [skip ci] See #428 >--------------------------------------------------------------- e0bbd9fcb18fd6a9c944c615124537831738564d README.md | 52 +++++++++++++++++++++++++--------------------------- 1 file changed, 25 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index 2530714..b25e31a 100644 --- a/README.md +++ b/README.md @@ -4,14 +4,14 @@ Hadrian [![Linux & OS X status](https://img.shields.io/travis/snowleopard/hadrian/master.svg?label=Linux%20%26%20OS%20X)](https://travis-ci.org/snowleopard/hadrian) [![Windows status](https://img.shields.io/appveyor/ci/snowleopard/hadrian/master.svg?label=Windows)](https://ci.appveyor.com/project/snowleopard/hadrian) [![OS X status](https://img.shields.io/circleci/project/github/snowleopard/hadrian.svg?label=OS%20X)](https://circleci.com/gh/snowleopard/hadrian) Hadrian is a new build system for the [Glasgow Haskell Compiler][ghc]. It is based -on [Shake][shake] and we hope that it will eventually replace the current -[`make`-based build system][make]. If you are curious about the rationale behind the +on [Shake][shake] and we hope that it will soon replace the current +[Make-based build system][make]. If you are curious about the rationale behind the project and the architecture of the build system you can find more details in this [Haskell Symposium 2016 paper][paper] and this [Haskell eXchange 2016 talk][talk]. The new build system can work side-by-side with the existing build system. Note, there is some interaction between them: they put (some) build results in the same directories, -e.g. `inplace/bin/ghc-stage1`. +e.g. the resulting GHC is `inplace/bin/ghc-stage2`. Your first build ---------------- @@ -22,8 +22,8 @@ follow these steps: * If you have never built GHC before, start with the [preparation guide][ghc-preparation]. -* This build system is written in Haskell (obviously) and depends on the following Haskell -packages, which need to be installed: `ansi-terminal extra mtl quickcheck shake`. +* Hadrian is written in Haskell and depends on the following +packages: `ansi-terminal extra mtl quickcheck shake`. * Get the sources. It is important for the build system to be in the `hadrian` directory of the GHC source tree: @@ -36,12 +36,14 @@ of the GHC source tree: * Build GHC using `hadrian/build.sh` or `hadrian/build.bat` (on Windows) instead of `make`. You might want to enable parallelism with `-j`. We will further refer to the -build script simply as `build`. If you are interested in building in a Cabal sandbox -or using Stack, have a look at `build.cabal.sh` and `build.stack.sh` scripts. Also -see [instructions for building GHC on Windows using Stack][windows-build]. Note, Hadrian -runs the `boot` and `configure` scripts automatically on the first build, so that you don't -need to. Use `--skip-configure` to suppress this behaviour (see overview of command line -flags below). +build script simply as `build`. Note that Hadrian runs the `boot` and `configure` +scripts automatically when needed. Use `--skip-configure` to suppress this behaviour +(see overview of command line flags below). + +* If the default build script doesn't work, you might want to give a try to a more +specific one based on Cabal sandboxes (`build.cabal.sh`), Stack (`build.stack.bat`) +or the global package database (`build.global-db.sh`). Also +see [instructions for building GHC on Windows using Stack][windows-build]. Using the build system ---------------------- @@ -79,14 +81,13 @@ settings: `none`, `brief` (one line per build command; this is the default setti `normal` (typically a box per build command), and `unicorn` (when `normal` just won't do). * `--skip-configure`: use this flag to suppress the default behaviour of Hadrian that -runs the `boot` and `configure` scripts automatically if need be, so that you don't have +runs the `boot` and `configure` scripts automatically when needed, so that you don't have to remember to run them manually. With `--skip-configure` you will need to manually run: - ```bash ./boot ./configure # On Windows run ./configure --enable-tarballs-autodownload ``` -as you normally do when using `make`. Beware, by default Hadrian may do network I/O on + as you normally do when using `make`. Beware, by default Hadrian may do network I/O on Windows to download necessary tarballs, which may sometimes be undesirable; `--skip-configure` is your friend in such cases. @@ -98,7 +99,7 @@ by Shake oracles. #### User settings -The `make`-based build system uses `mk/build.mk` to specify user build settings. We +The Make-based build system uses `mk/build.mk` to specify user build settings. We use `hadrian/UserSettings.hs` for the same purpose, see [documentation](doc/user-settings.md). #### Clean and full rebuild @@ -116,12 +117,12 @@ To build a GHC source distribution tarball, run Hadrian with the `sdist-ghc` tar To build and install GHC artifacts, run the `install` target. -By default, the artifacts will be installed to `` on your system -(in this case, the `DESTDIR` is empty, corresponds to the root of the file system). -For example on UNIX, `ghc` will be installed to `/usr/local/bin`. By setting flag `--install-destdir=[DESTDIR]`, -you can install things to non-system path `DESTDIR/` instead. -Make sure you use correct absolute path on Windows, e.g. `C:/path`, -i.e. GHC is installed into `C:/path/usr/local` for the above example. +By default, GHC will be installed to the specified _prefix_ path on your system, +relative to the root of the file system. For example on UNIX, GHC will be installed +to `/usr/local/bin`. By setting the command line flag `--install-destdir=[DESTDIR]`, +you can install GHC to path `DESTDIR/` instead. Make sure you use correct +absolute path as `DESTDIR` on Windows, e.g. `C:/path`, which installs GHC +into `C:/path/usr/local`. #### Testing @@ -141,9 +142,7 @@ Current limitations The new build system still lacks many important features: * Validation is not implemented: [#187][validation-issue]. * Dynamic linking on Windows is not supported [#343][dynamic-windows-issue]. -* Only HTML Haddock documentation is supported (use `--haddock` flag). -* Cross-compilation is not implemented: [#177][cross-compilation-issue]. -* There is no support for binary distribution: [#219][install-issue]. +* There is no support for binary distribution: [#219][bin-dist-issue]. Check out [milestones] to see when we hope to resolve the above limitations. @@ -173,7 +172,7 @@ to all other project [contributors][contributors], who helped me endure and enjoy the project. [ghc]: https://en.wikipedia.org/wiki/Glasgow_Haskell_Compiler -[shake]: https://github.com/ndmitchell/shake/blob/master/README.md +[shake]: https://github.com/ndmitchell/shake [make]: https://ghc.haskell.org/trac/ghc/wiki/Building/Architecture [paper]: https://www.staff.ncl.ac.uk/andrey.mokhov/Hadrian.pdf [talk]: https://skillsmatter.com/skillscasts/8722-meet-hadrian-a-new-build-system-for-ghc @@ -185,7 +184,6 @@ enjoy the project. [test-issue]: https://github.com/snowleopard/hadrian/issues/197 [validation-issue]: https://github.com/snowleopard/hadrian/issues/187 [dynamic-windows-issue]: https://github.com/snowleopard/hadrian/issues/343 -[cross-compilation-issue]: https://github.com/snowleopard/hadrian/issues/177 -[install-issue]: https://github.com/snowleopard/hadrian/issues/219 +[bin-dist-issue]: https://github.com/snowleopard/hadrian/issues/219 [milestones]: https://github.com/snowleopard/hadrian/milestones [contributors]: https://github.com/snowleopard/hadrian/graphs/contributors From git at git.haskell.org Tue Oct 23 20:10:55 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:10:55 +0000 (UTC) Subject: [commit: ghc] master: Update cross-compile.md (3a95faf) Message-ID: <20181023201055.C555A3ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/3a95fafb43d686a1af8e48d205a4173da3e924b7/ghc >--------------------------------------------------------------- commit 3a95fafb43d686a1af8e48d205a4173da3e924b7 Author: Andrey Mokhov Date: Mon Oct 30 03:19:55 2017 +0000 Update cross-compile.md [skip ci] See #428 >--------------------------------------------------------------- 3a95fafb43d686a1af8e48d205a4173da3e924b7 doc/cross-compile.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/cross-compile.md b/doc/cross-compile.md index c51eaa5..1bff4ec 100644 --- a/doc/cross-compile.md +++ b/doc/cross-compile.md @@ -1,6 +1,6 @@ ## Build a cross-compiling GHC -Our host machine is "Ubuntu 16.04.2 LTS, Linux ubuntu 4.4.0-79-generic 86_64". +In this example, our host machine is "Ubuntu 16.04.2 LTS, Linux ubuntu 4.4.0-79-generic 86_64". We need to download necessary tools, including: @@ -17,7 +17,7 @@ After all the dependencies are in place: - `./configure --target=arm-linux-gnueabihf` - `cd hadrian` - Modify `src/Settings.hs`, set `stage1Only` and `crossCompiling` to `True`. -- Build the compiler by e.g. `./build.cabal.sh --flavour=quickest --integer-simple --skip-configure -V -j` +- Build the compiler by e.g. `./build.sh --flavour=quickest --integer-simple --skip-configure -V -j` After that, you should have built `inplace/bin/ghc-stage1` cross compiler. We will go to the next section to validate this. @@ -32,7 +32,7 @@ main = putStrLn "Hello, world!" Compile it with cross-compiling GHC: `/inplace/bin/ghc-stage1 -static Main`. Note that we created a static version of it which packs together all depending libraries. - Install QEMU: `sudo apt-get install qemu-system-arm` -- Download `vmlinuz` (kernel) and `initrd.gz` (initial ramdisk) from mirror like https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/dists/xenial/main/installer-armhf/current/images/generic-lpae/cdrom/. +- Download `vmlinuz` (kernel) and `initrd.gz` (initial ramdisk), e.g. from [this mirror](https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/dists/xenial/main/installer-armhf/current/images/generic-lpae/cdrom/). - Add the ARM Linux executable `Main` to the initial ramdisk so we can load it directly into memory. No need for real installation + `gunzip initrd.gz` to get `initrd` + `mkdir tmp2; cd tmp2; sudo cpio -id < ../initrd` to get a file system @@ -54,4 +54,4 @@ qemu-system-arm \ -M virt ``` -This will lead you to a installer interface. But we don't need to do that, so we can save ourself from the hassel of setup networks etc. We just keep `Go Back`, until see a line `Execute a shell`, and select it. Now you get a shell, go find `/usr/bin/Main` and run it! +This will lead you to a installer interface. But we don't need to do that, so we can save ourself from the hassle of setting up networks etc. We just keep `Go Back`, until see a line `Execute a shell`, and select it. Now you get a shell, go find `/usr/bin/Main` and run it! From git at git.haskell.org Tue Oct 23 20:10:59 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:10:59 +0000 (UTC) Subject: [commit: ghc] master: Add a note on building documentation (f846945) Message-ID: <20181023201059.99BEB3ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/f846945cfa4af667176ec1181c6904a6ba28dff3/ghc >--------------------------------------------------------------- commit f846945cfa4af667176ec1181c6904a6ba28dff3 Author: Andrey Mokhov Date: Wed Nov 1 12:03:12 2017 +0000 Add a note on building documentation See #414 >--------------------------------------------------------------- f846945cfa4af667176ec1181c6904a6ba28dff3 README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index b25e31a..90db95a 100644 --- a/README.md +++ b/README.md @@ -109,6 +109,13 @@ use `hadrian/UserSettings.hs` for the same purpose, see [documentation](doc/user * `build -B` forces Shake to rerun all rules, even if the previous build results are are still up-to-date. +#### Documentation + +To build GHC documentation, run `build docs --haddock`. The `docs` is the documentation +target, and the `--haddock` flag enables building Haddock. This is a temporary solution +and [we plan](https://github.com/snowleopard/hadrian/issues/414) to simplify this command +to `build docs`. + #### Source distribution To build a GHC source distribution tarball, run Hadrian with the `sdist-ghc` target. From git at git.haskell.org Tue Oct 23 20:11:03 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:11:03 +0000 (UTC) Subject: [commit: ghc] master: Make sure build scripts can be run from outside Hadrian directory (c41d1ed) Message-ID: <20181023201103.7394F3ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/c41d1ed7c0e989273a359c653890796957972e8e/ghc >--------------------------------------------------------------- commit c41d1ed7c0e989273a359c653890796957972e8e Author: Andrey Mokhov Date: Fri Nov 3 23:24:53 2017 +0000 Make sure build scripts can be run from outside Hadrian directory See #440 >--------------------------------------------------------------- c41d1ed7c0e989273a359c653890796957972e8e build.bat | 2 ++ build.sh | 34 ++++++++++++++++++++++++++++++++-- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/build.bat b/build.bat index 18cf6cb..01a869f 100644 --- a/build.bat +++ b/build.bat @@ -1,4 +1,6 @@ @echo off +setlocal +cd %~dp0 rem By default on Windows we build Hadrian using Stack ./build.stack.bat %* diff --git a/build.sh b/build.sh index 8e58b66..ad502b3 100755 --- a/build.sh +++ b/build.sh @@ -1,5 +1,35 @@ #!/usr/bin/env bash +set -euo pipefail + +# readlink on os x, doesn't support -f, to prevent the +# need of installing coreutils (e.g. through brew, just +# for readlink, we use the follownig substitute. +# +# source: http://stackoverflow.com/a/1116890 +function rl { + TARGET_FILE="$1" + + cd "$(dirname "$TARGET_FILE")" + TARGET_FILE="$(basename "$TARGET_FILE")" + + # Iterate down a (possible) chain of symlinks + while [ -L "$TARGET_FILE" ] + do + TARGET_FILE="$(readlink "$TARGET_FILE")" + cd "$(dirname "$TARGET_FILE")" + TARGET_FILE="$(basename "$TARGET_FILE")" + done + + # Compute the canonicalized name by finding the physical path + # for the directory we're in and appending the target file. + PHYS_DIR="$(pwd -P)" + RESULT="$PHYS_DIR/$TARGET_FILE" + echo "$RESULT" +} + +root="$(dirname "$(rl "$0")")" + # By default on Linux/MacOS we build Hadrian using Cabal -chmod a+x ./build.cabal.sh -(. ./build.cabal.sh "$@") +chmod a+x "$root/build.cabal.sh" +(. "$root/build.cabal.sh" "$@") From git at git.haskell.org Tue Oct 23 20:11:07 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:11:07 +0000 (UTC) Subject: [commit: ghc] master: Remove the git clone step, preparing for the merge (882c4a6) Message-ID: <20181023201107.7D10D3ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/882c4a602ae7177435730df50648e5de1337231b/ghc >--------------------------------------------------------------- commit 882c4a602ae7177435730df50648e5de1337231b Author: Andrey Mokhov Date: Sat Nov 4 00:04:47 2017 +0000 Remove the git clone step, preparing for the merge See #440 [skip ci] >--------------------------------------------------------------- 882c4a602ae7177435730df50648e5de1337231b README.md | 43 ++++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 90db95a..56e6af7 100644 --- a/README.md +++ b/README.md @@ -16,34 +16,35 @@ e.g. the resulting GHC is `inplace/bin/ghc-stage2`. Your first build ---------------- -Beware, the build system is in the alpha development phase. Things are shaky and often +Beware, the build system is in the alpha development phase. Things are shaky and sometimes break; there are numerous [known issues][issues]. Not afraid? Then put on the helmet and -follow these steps: +run the following command from root of the GHC tree: -* If you have never built GHC before, start with the [preparation guide][ghc-preparation]. +``` +hadrian/build.sh -j +``` -* Hadrian is written in Haskell and depends on the following -packages: `ansi-terminal extra mtl quickcheck shake`. +or on Windows: -* Get the sources. It is important for the build system to be in the `hadrian` directory -of the GHC source tree: +``` +hadrian/build.bat -j +``` - ```bash - git clone --recursive git://git.haskell.org/ghc.git - cd ghc - git clone git://github.com/snowleopard/hadrian - ``` +Here flag `-j` enables parallelism and is optional. We will further refer to the build script +simply as `build`. Note that Hadrian runs the `boot` and `configure` scripts automatically when +needed. Use `--skip-configure` to suppress this behaviour (see the overview of command line +flags below). -* Build GHC using `hadrian/build.sh` or `hadrian/build.bat` (on Windows) instead -of `make`. You might want to enable parallelism with `-j`. We will further refer to the -build script simply as `build`. Note that Hadrian runs the `boot` and `configure` -scripts automatically when needed. Use `--skip-configure` to suppress this behaviour -(see overview of command line flags below). +Notes: -* If the default build script doesn't work, you might want to give a try to a more -specific one based on Cabal sandboxes (`build.cabal.sh`), Stack (`build.stack.bat`) -or the global package database (`build.global-db.sh`). Also -see [instructions for building GHC on Windows using Stack][windows-build]. +* If the default build script doesn't work, you might want to give a try to another one, e.g. based +on Cabal sandboxes (`build.cabal.*`), Stack (`build.stack.*`) or the global package database +(`build.global-db.*`). Also see [instructions for building GHC on Windows using Stack][windows-build]. + +* Hadrian is written in Haskell and depends on the following packages: +`ansi-terminal extra mtl quickcheck shake`. + +* If you have never built GHC before, start with the [preparation guide][ghc-preparation]. Using the build system ---------------------- From git at git.haskell.org Tue Oct 23 20:11:11 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:11:11 +0000 (UTC) Subject: [commit: ghc] master: Finalise documentation build rule (#447) (e25bb01) Message-ID: <20181023201111.735A13ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/e25bb01f5084f137534d2b24ddb8e12480b9dc64/ghc >--------------------------------------------------------------- commit e25bb01f5084f137534d2b24ddb8e12480b9dc64 Author: Andrey Mokhov Date: Sat Nov 4 23:30:56 2017 +0000 Finalise documentation build rule (#447) * Drop --haddock flag and always build Haddock and xthml See #414 * Reorder imports * Update README See #414 >--------------------------------------------------------------- e25bb01f5084f137534d2b24ddb8e12480b9dc64 README.md | 13 +++++-------- src/CommandLine.hs | 20 +++++--------------- src/Flavour.hs | 2 -- src/GHC.hs | 11 ++++------- src/Rules.hs | 9 ++------- src/Settings/Default.hs | 3 +-- src/Settings/Flavours/Development.hs | 2 +- src/Settings/Flavours/Performance.hs | 2 +- src/Settings/Flavours/Profiled.hs | 2 +- src/Settings/Flavours/Quick.hs | 2 +- src/Settings/Flavours/QuickCross.hs | 2 +- src/Settings/Flavours/Quickest.hs | 6 ++---- 12 files changed, 24 insertions(+), 50 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc e25bb01f5084f137534d2b24ddb8e12480b9dc64 From git at git.haskell.org Tue Oct 23 20:11:15 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:11:15 +0000 (UTC) Subject: [commit: ghc] master: Threaded is no longer conditional in the quickest flavour (f6a491d) Message-ID: <20181023201115.76DEB3ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/f6a491d198de127fcce1fdeeb86ca0b062082ca9/ghc >--------------------------------------------------------------- commit f6a491d198de127fcce1fdeeb86ca0b062082ca9 Author: Andrey Mokhov Date: Sun Nov 5 00:40:54 2017 +0000 Threaded is no longer conditional in the quickest flavour See #414 >--------------------------------------------------------------- f6a491d198de127fcce1fdeeb86ca0b062082ca9 doc/flavours.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/flavours.md b/doc/flavours.md index 185cf6b..f276dbb 100644 --- a/doc/flavours.md +++ b/doc/flavours.md @@ -168,8 +168,8 @@ information. The following table lists ways that are built in different flavours quickest vanilla vanilla - vanilla
threaded (when --haddock) - vanilla
threaded (when --haddock) + vanilla
threaded + vanilla
threaded No No From git at git.haskell.org Tue Oct 23 20:11:19 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:11:19 +0000 (UTC) Subject: [commit: ghc] master: Add a note on doc/flavours.md (a0ccea6) Message-ID: <20181023201119.87BC03ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/a0ccea60c4d8d0d3dba5021f67671c2633af1d3b/ghc >--------------------------------------------------------------- commit a0ccea60c4d8d0d3dba5021f67671c2633af1d3b Author: Andrey Mokhov Date: Sun Nov 5 00:50:14 2017 +0000 Add a note on doc/flavours.md >--------------------------------------------------------------- a0ccea60c4d8d0d3dba5021f67671c2633af1d3b src/Settings/Default.hs | 1 + src/Settings/Flavours/Development.hs | 1 + src/Settings/Flavours/Performance.hs | 1 + src/Settings/Flavours/Profiled.hs | 1 + src/Settings/Flavours/Quick.hs | 1 + src/Settings/Flavours/QuickCross.hs | 1 + src/Settings/Flavours/Quickest.hs | 1 + 7 files changed, 7 insertions(+) diff --git a/src/Settings/Default.hs b/src/Settings/Default.hs index 865e078..5dde31b 100644 --- a/src/Settings/Default.hs +++ b/src/Settings/Default.hs @@ -110,6 +110,7 @@ defaultRtsWays = do pure [ dynamic, debugDynamic, threadedDynamic, threadedDebugDynamic , loggingDynamic, threadedLoggingDynamic ] ] +-- Please update doc/flavours.md when changing the default build flavour. -- | Default build flavour. Other build flavours are defined in modules -- @Settings.Flavours.*@. Users can add new build flavours in "UserSettings". defaultFlavour :: Flavour diff --git a/src/Settings/Flavours/Development.hs b/src/Settings/Flavours/Development.hs index 73ea86a..5919026 100644 --- a/src/Settings/Flavours/Development.hs +++ b/src/Settings/Flavours/Development.hs @@ -4,6 +4,7 @@ import Expression import Flavour import {-# SOURCE #-} Settings.Default +-- Please update doc/flavours.md when changing this file. developmentFlavour :: Stage -> Flavour developmentFlavour ghcStage = defaultFlavour { name = "devel" ++ show (fromEnum ghcStage) diff --git a/src/Settings/Flavours/Performance.hs b/src/Settings/Flavours/Performance.hs index 9b2f0e7..64ab4bc 100644 --- a/src/Settings/Flavours/Performance.hs +++ b/src/Settings/Flavours/Performance.hs @@ -4,6 +4,7 @@ import Expression import Flavour import {-# SOURCE #-} Settings.Default +-- Please update doc/flavours.md when changing this file. performanceFlavour :: Flavour performanceFlavour = defaultFlavour { name = "perf" diff --git a/src/Settings/Flavours/Profiled.hs b/src/Settings/Flavours/Profiled.hs index 76563a7..d56cc10 100644 --- a/src/Settings/Flavours/Profiled.hs +++ b/src/Settings/Flavours/Profiled.hs @@ -4,6 +4,7 @@ import Expression import Flavour import {-# SOURCE #-} Settings.Default +-- Please update doc/flavours.md when changing this file. profiledFlavour :: Flavour profiledFlavour = defaultFlavour { name = "prof" diff --git a/src/Settings/Flavours/Quick.hs b/src/Settings/Flavours/Quick.hs index d44d59b..99dade9 100644 --- a/src/Settings/Flavours/Quick.hs +++ b/src/Settings/Flavours/Quick.hs @@ -5,6 +5,7 @@ import Flavour import Oracles.Flag import {-# SOURCE #-} Settings.Default +-- Please update doc/flavours.md when changing this file. quickFlavour :: Flavour quickFlavour = defaultFlavour { name = "quick" diff --git a/src/Settings/Flavours/QuickCross.hs b/src/Settings/Flavours/QuickCross.hs index 3509c56..3d0c410 100644 --- a/src/Settings/Flavours/QuickCross.hs +++ b/src/Settings/Flavours/QuickCross.hs @@ -5,6 +5,7 @@ import Flavour import Oracles.Flag import {-# SOURCE #-} Settings.Default +-- Please update doc/flavours.md when changing this file. quickCrossFlavour :: Flavour quickCrossFlavour = defaultFlavour { name = "quick-cross" diff --git a/src/Settings/Flavours/Quickest.hs b/src/Settings/Flavours/Quickest.hs index a463971..a9dfb70 100644 --- a/src/Settings/Flavours/Quickest.hs +++ b/src/Settings/Flavours/Quickest.hs @@ -4,6 +4,7 @@ import Expression import Flavour import {-# SOURCE #-} Settings.Default +-- Please update doc/flavours.md when changing this file. quickestFlavour :: Flavour quickestFlavour = defaultFlavour { name = "quickest" From git at git.haskell.org Tue Oct 23 20:11:23 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:11:23 +0000 (UTC) Subject: [commit: ghc] master: Update documentation (3bac585) Message-ID: <20181023201123.ED2DE3ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/3bac585ed286936e5eb1cd686dbb24220c5e4d16/ghc >--------------------------------------------------------------- commit 3bac585ed286936e5eb1cd686dbb24220c5e4d16 Author: Andrey Mokhov Date: Sun Nov 5 13:13:04 2017 +0000 Update documentation See #347, #440 >--------------------------------------------------------------- 3bac585ed286936e5eb1cd686dbb24220c5e4d16 doc/user-settings.md | 151 ++++++++++++++++++++++++++------------------------- src/Flavour.hs | 3 +- src/UserSettings.hs | 11 +++- 3 files changed, 88 insertions(+), 77 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 3bac585ed286936e5eb1cd686dbb24220c5e4d16 From git at git.haskell.org Tue Oct 23 20:11:27 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:11:27 +0000 (UTC) Subject: [commit: ghc] master: Update stage1Only docs (4fd94c3) Message-ID: <20181023201127.EFB123ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/4fd94c3fc74e2b48d0ba4b8a1ddd6a42bc421c11/ghc >--------------------------------------------------------------- commit 4fd94c3fc74e2b48d0ba4b8a1ddd6a42bc421c11 Author: Andrey Mokhov Date: Sun Nov 5 13:40:47 2017 +0000 Update stage1Only docs See #440 >--------------------------------------------------------------- 4fd94c3fc74e2b48d0ba4b8a1ddd6a42bc421c11 doc/user-settings.md | 8 +++++++- src/UserSettings.hs | 25 ++++++++++--------------- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/doc/user-settings.md b/doc/user-settings.md index 4567f52..c719045 100644 --- a/doc/user-settings.md +++ b/doc/user-settings.md @@ -49,7 +49,7 @@ others; see `hadrian/doc/flavours.md`), which can be activated from the command e.g. by passing `--flavour=quick`. Users can define new build flavours by adding them to `userFlavours` list: ```haskell --- | User defined build flavours. See 'userFlavour' as an example. +-- | User-defined build flavours. See 'userFlavour' as an example. userFlavours :: [Flavour] userFlavours = [userFlavour] -- Add more build flavours if need be. @@ -186,6 +186,12 @@ verboseCommands = return True ## Miscellaneous +By setting `stage1Only = True` you can disable building Stage2 GHC (i.e. the +`ghc-stage2` executable) and Stage2 utilities, such as `haddock`. Note that all +Stage0 and Stage1 libraries (including `compiler`) will still be built. Enabling +this flag during installation leads to installing `ghc-stage1` instead of +`ghc-stage2`, and `ghc-pkg` that was build with the Stage0 compiler. + To change the default behaviour of Hadrian with respect to building split objects, override the `splitObjects` setting of the `Flavour` record: ```haskell diff --git a/src/UserSettings.hs b/src/UserSettings.hs index bb65764..1b7c3f8 100644 --- a/src/UserSettings.hs +++ b/src/UserSettings.hs @@ -21,7 +21,7 @@ import {-# SOURCE #-} Settings.Default userBuildRoot :: BuildRoot userBuildRoot = BuildRoot "_build" --- | User defined build flavours. See 'userFlavour' as an example. +-- | User-defined build flavours. See 'userFlavour' as an example. userFlavours :: [Flavour] userFlavours = [userFlavour] -- Add more build flavours if need be. @@ -30,7 +30,7 @@ userFlavours = [userFlavour] -- Add more build flavours if need be. userFlavour :: Flavour userFlavour = defaultFlavour { name = "user" } -- Modify other settings here. --- | Add user defined packages. Note, this only lets Hadrian know about the +-- | Add user-defined packages. Note, this only lets Hadrian know about the -- existence of a new package; to actually build it you need to create a new -- build flavour, modifying the list of packages that are built by default. userPackages :: [Package] @@ -52,18 +52,13 @@ buildProgressColour = BuildProgressColour (Dull, Magenta) successColour :: SuccessColour successColour = SuccessColour (Dull, Green) -{- - Stage1Only=YES means: - - don't build ghc-stage2 (the executable) - - don't build utils that rely on ghc-stage2 - See Note [No stage2 packages when CrossCompiling or Stage1Only] in - ./ghc.mk. - - install ghc-stage1 instead of ghc-stage2 - - install the ghc-pkg that was built with the stage0 compiler - - (*do* still build compiler/stage2 (i.e. the ghc library)) - - (*do* still build all other libraries) --} --- | Stage1Only flag, default off --- | TODO: Set this dynamically +-- TODO: Set this flag from the command line. +-- | Set this flag to 'True' to disable building Stage2 GHC (i.e. the @ghc-stage2@ +-- executable) and Stage2 utilities (such as @haddock@). Note that all Stage0 +-- and Stage1 libraries (including 'compiler') will still be built. Enabling +-- this flag during installation leads to installing @ghc-stage1@ instead of +-- @ghc-stage2@, and @ghc-pkg@ that was build with the Stage0 compiler. +-- Also see Note [No stage2 packages when CrossCompiling or Stage1Only] in the +-- top-level @ghc.mk at . stage1Only :: Bool stage1Only = False From git at git.haskell.org Tue Oct 23 20:11:31 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:11:31 +0000 (UTC) Subject: [commit: ghc] master: Finalise warnings-related arguments (#448) (438dc57) Message-ID: <20181023201131.ED81C3ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/438dc576e7b84c473a09d1d7ec7798a30303bc4e/ghc >--------------------------------------------------------------- commit 438dc576e7b84c473a09d1d7ec7798a30303bc4e Author: Andrey Mokhov Date: Mon Nov 6 01:28:34 2017 +0000 Finalise warnings-related arguments (#448) * Fix non-exhaustive pattern match warning * Move warnings-related settings to a separate module * Move defaultHsWarningsArgs to Settings.Warnings, add -Wcpp-undef * Use defaultGhcWarningsArgs in Settings.Builders.Ghc. Add -Wnoncanonical-monad-instances. * Add warnings for ghc-cabal * Add RTS warning flags * Fix build with integer-simple library * There are no tabs in xhtml >--------------------------------------------------------------- 438dc576e7b84c473a09d1d7ec7798a30303bc4e cfg/system.config.in | 1 + hadrian.cabal | 1 + src/Oracles/Flag.hs | 2 ++ src/Rules/Compile.hs | 2 +- src/Rules/Generate.hs | 6 ++-- src/Settings.hs | 6 ++-- src/Settings/Builders/Cc.hs | 4 +-- src/Settings/Builders/Ghc.hs | 24 ++++++++------- src/Settings/Default.hs | 62 ++++----------------------------------- src/Settings/Packages/Base.hs | 4 +-- src/Settings/Packages/GhcCabal.hs | 1 + src/Settings/Packages/Rts.hs | 18 ++++++++++++ src/Settings/Warnings.hs | 57 +++++++++++++++++++++++++++++++++++ 13 files changed, 109 insertions(+), 79 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 438dc576e7b84c473a09d1d7ec7798a30303bc4e From git at git.haskell.org Tue Oct 23 20:11:35 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:11:35 +0000 (UTC) Subject: [commit: ghc] master: Drop GccLtXX flags, require GCC > 4.7 and up (#450) (5ebb69a) Message-ID: <20181023201135.D7B203ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/5ebb69ae1eb063f25c59383bffb3b5449015c6f9/ghc >--------------------------------------------------------------- commit 5ebb69ae1eb063f25c59383bffb3b5449015c6f9 Author: Zhen Zhang Date: Tue Nov 7 23:14:45 2017 +0800 Drop GccLtXX flags, require GCC > 4.7 and up (#450) See https://github.com/snowleopard/hadrian/issues/449. >--------------------------------------------------------------- 5ebb69ae1eb063f25c59383bffb3b5449015c6f9 cfg/system.config.in | 3 --- src/Oracles/Flag.hs | 6 ------ src/Settings/Builders/Common.hs | 7 +++---- src/Settings/Packages/GhcPrim.hs | 1 - src/Settings/Packages/Rts.hs | 4 ++-- src/Settings/Warnings.hs | 5 ++--- 6 files changed, 7 insertions(+), 19 deletions(-) diff --git a/cfg/system.config.in b/cfg/system.config.in index 913a2b4..b007581 100644 --- a/cfg/system.config.in +++ b/cfg/system.config.in @@ -33,9 +33,6 @@ ar-supports-at-file = @ArSupportsAtFile@ cc-clang-backend = @CC_CLANG_BACKEND@ cc-llvm-backend = @CC_LLVM_BACKEND@ gcc-is-clang = @GccIsClang@ -gcc-lt-34 = @GccLT34@ -gcc-lt-44 = @GccLT44@ -gcc-lt-46 = @GccLT46@ hs-cpp-args = @HaskellCPPArgs@ # Build options: diff --git a/src/Oracles/Flag.hs b/src/Oracles/Flag.hs index 447f0bc..1bd4dfe 100644 --- a/src/Oracles/Flag.hs +++ b/src/Oracles/Flag.hs @@ -11,9 +11,6 @@ import Oracles.Setting data Flag = ArSupportsAtFile | CrossCompiling | GccIsClang - | GccLt34 - | GccLt44 - | GccLt46 | GhcUnregisterised | LeadingUnderscore | SolarisBrokenShld @@ -30,9 +27,6 @@ flag f = do ArSupportsAtFile -> "ar-supports-at-file" CrossCompiling -> "cross-compiling" GccIsClang -> "gcc-is-clang" - GccLt34 -> "gcc-lt-34" - GccLt44 -> "gcc-lt-44" - GccLt46 -> "gcc-lt-46" GhcUnregisterised -> "ghc-unregisterised" LeadingUnderscore -> "leading-underscore" SolarisBrokenShld -> "solaris-broken-shld" diff --git a/src/Settings/Builders/Common.hs b/src/Settings/Builders/Common.hs index 5ca594e..340239a 100644 --- a/src/Settings/Builders/Common.hs +++ b/src/Settings/Builders/Common.hs @@ -40,12 +40,11 @@ cArgs = mempty -- TODO: should be in a different file cWarnings :: Args -cWarnings = do - let gccGe46 = notM (flag GccIsClang ||^ flag GccLt46) +cWarnings = mconcat [ arg "-Wall" , flag GccIsClang ? arg "-Wno-unknown-pragmas" - , gccGe46 ? notM windowsHost ? arg "-Werror=unused-but-set-variable" - , gccGe46 ? arg "-Wno-error=inline" ] + , notM (flag GccIsClang) ? notM windowsHost ? arg "-Werror=unused-but-set-variable" + , notM (flag GccIsClang) ? arg "-Wno-error=inline" ] bootPackageDatabaseArgs :: Args bootPackageDatabaseArgs = do diff --git a/src/Settings/Packages/GhcPrim.hs b/src/Settings/Packages/GhcPrim.hs index df1c553..aed8f2f 100644 --- a/src/Settings/Packages/GhcPrim.hs +++ b/src/Settings/Packages/GhcPrim.hs @@ -8,6 +8,5 @@ ghcPrimPackageArgs = package ghcPrim ? mconcat [ builder GhcCabal ? arg "--flag=include-ghc-prim" , builder (Cc CompileC) ? - (not <$> flag GccLt44) ? (not <$> flag GccIsClang) ? input "//cbits/atomic.c" ? arg "-Wno-sync-nand" ] diff --git a/src/Settings/Packages/Rts.hs b/src/Settings/Packages/Rts.hs index 33169fe..b15bb6a 100644 --- a/src/Settings/Packages/Rts.hs +++ b/src/Settings/Packages/Rts.hs @@ -204,7 +204,7 @@ rtsPackageArgs = package rts ? do rtsWarnings :: Args rtsWarnings = mconcat [ pure ["-Wall", "-Werror"] - , flag GccLt34 ? arg "-W", not <$> flag GccLt34 ? arg "-Wextra" + , arg "-Wextra" , arg "-Wstrict-prototypes" , arg "-Wmissing-prototypes" , arg "-Wmissing-declarations" @@ -214,5 +214,5 @@ rtsWarnings = mconcat , arg "-Wmissing-noreturn" , arg "-Wnested-externs" , arg "-Wredundant-decls" - , not <$> flag GccLt46 ? arg "-Wundef" + , arg "-Wundef" , arg "-fno-strict-aliasing" ] diff --git a/src/Settings/Warnings.hs b/src/Settings/Warnings.hs index f8eb4a5..abbc814 100644 --- a/src/Settings/Warnings.hs +++ b/src/Settings/Warnings.hs @@ -12,9 +12,8 @@ defaultGhcWarningsArgs :: Args defaultGhcWarningsArgs = mconcat [ notStage0 ? pure [ "-Werror", "-Wnoncanonical-monad-instances" ] , (not <$> flag GccIsClang) ? mconcat - [ (not <$> flag GccLt46) ? - (not <$> windowsHost ) ? arg "-optc-Werror=unused-but-set-variable" - , (not <$> flag GccLt44) ? arg "-optc-Wno-error=inline" ] + [ (not <$> windowsHost ) ? arg "-optc-Werror=unused-but-set-variable" + , arg "-optc-Wno-error=inline" ] , flag GccIsClang ? arg "-optc-Wno-unknown-pragmas" ] -- | Package-specific warnings-related arguments, mostly suppressing various warnings. From git at git.haskell.org Tue Oct 23 20:11:39 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:11:39 +0000 (UTC) Subject: [commit: ghc] master: Widen bounds on Cabal (#452) (06ec241) Message-ID: <20181023201139.C13D73ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/06ec241ec6bcefc032fc905d43bd7e89e3d6a8cc/ghc >--------------------------------------------------------------- commit 06ec241ec6bcefc032fc905d43bd7e89e3d6a8cc Author: Ben Gamari Date: Fri Nov 10 14:46:15 2017 -0500 Widen bounds on Cabal (#452) GHC's `master` branch now sits on a snapshot of Cabal 2.1.0.0 >--------------------------------------------------------------- 06ec241ec6bcefc032fc905d43bd7e89e3d6a8cc hadrian.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hadrian.cabal b/hadrian.cabal index 566437e..389f553 100644 --- a/hadrian.cabal +++ b/hadrian.cabal @@ -118,7 +118,7 @@ executable hadrian , TypeFamilies build-depends: base >= 4.8 && < 5 , ansi-terminal == 0.6.* - , Cabal == 2.0.0.2 + , Cabal >= 2.0.0.2 && < 2.2 , containers == 0.5.* , directory >= 1.2 && < 1.4 , extra >= 1.4.7 From git at git.haskell.org Tue Oct 23 20:11:43 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:11:43 +0000 (UTC) Subject: [commit: ghc] master: Fix CI scripts (#454) (a679764) Message-ID: <20181023201143.B52433ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/a6797641acc63323a108bfb280ba9dbf502669e9/ghc >--------------------------------------------------------------- commit a6797641acc63323a108bfb280ba9dbf502669e9 Author: Andrey Mokhov Date: Sat Nov 11 02:57:38 2017 +0000 Fix CI scripts (#454) See #453 >--------------------------------------------------------------- a6797641acc63323a108bfb280ba9dbf502669e9 .travis.yml | 4 +++- appveyor.yml | 24 +++++++++++++----------- circle.yml | 3 ++- 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/.travis.yml b/.travis.yml index e2455b2..1943528 100644 --- a/.travis.yml +++ b/.travis.yml @@ -76,10 +76,12 @@ install: - cabal update - cabal install alex happy + # GHC comes with an older version of Hadrian, so we delete it + - rm -r ghc/hadrian/* + # Travis has already cloned Hadrian into ./ and we need to move it # to ./ghc/hadrian -- one way to do it is to move the .git directory # and perform a hard reset in order to regenerate Hadrian files - - mkdir ghc/hadrian - mv .git ghc/hadrian - cd ghc/hadrian - git reset --hard HEAD diff --git a/appveyor.yml b/appveyor.yml index fbedf8f..6da6a33 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,4 @@ -clone_folder: "c:\\ghc\\hadrian" +clone_folder: "c:\\new-hadrian" environment: global: STACK_ROOT: "c:\\sr" @@ -11,24 +11,26 @@ install: - curl -ostack.zip -LsS --insecure https://www.stackage.org/stack/windows-x86_64 - 7z x stack.zip stack.exe + # Note: AppVeyor has already cloned Hadrian into c:\new-hadrian # Fetch GHC sources into c:\ghc - # Note: AppVeyor has already cloned Hadrian into c:\ghc\hadrian, so it's tricky - cd .. - - git init - - git remote add origin git://git.haskell.org/ghc.git - - git pull --recurse-submodules origin master - - git submodule update --init --recursive --quiet + - git clone --recursive git://git.haskell.org/ghc.git + # GHC comes with an older version of Hadrian, so we delete it + - rm -rf ghc\hadrian + # Move new Hadrian into ./ghc/hadrian + - mv new-hadrian ghc\hadrian + + # Install Alex and Happy + - set PATH=C:\Users\appveyor\AppData\Roaming\local\bin;%PATH% + - ghc\hadrian\stack install --install-ghc alex happy > nul # Install all Hadrian and GHC build dependencies - - cd hadrian + - cd ghc\hadrian - stack setup > nul - appveyor-retry stack exec -- pacman -S autoconf automake-wrapper make patch python tar --noconfirm build_script: - # Build Hadrian - - stack build alex happy # Otherwise 'build' fails on AppVeyor - - # Run internal Hadrian tests + # Build Hadrian and run internal Hadrian tests - build selftest # Build GHC diff --git a/circle.yml b/circle.yml index a386d72..763475f 100644 --- a/circle.yml +++ b/circle.yml @@ -21,7 +21,8 @@ compile: - git config --global url."git://github.com/ghc/packages-".insteadOf git://github.com/ghc/packages/ - git clone --depth 1 --recursive git://github.com/ghc/ghc - - mkdir ghc/hadrian + # GHC comes with an older version of Hadrian, so we delete it + - rm -r ghc/hadrian/* # move hadrian's .git into ./ghc/hadrian and perform a hard reset in order to regenerate Hadrian files - mv .git ghc/hadrian # NOTE: we must write them in the same line because each line From git at git.haskell.org Tue Oct 23 20:11:47 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:11:47 +0000 (UTC) Subject: [commit: ghc] master: Fix ghc-cabal build (#455) (94dbe9d) Message-ID: <20181023201147.A312B3ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/94dbe9d711cc7e6e972bd5370b5d767cc5a5d840/ghc >--------------------------------------------------------------- commit 94dbe9d711cc7e6e972bd5370b5d767cc5a5d840 Author: Andrey Mokhov Date: Sat Nov 11 14:47:51 2017 +0000 Fix ghc-cabal build (#455) See #395, #453 >--------------------------------------------------------------- 94dbe9d711cc7e6e972bd5370b5d767cc5a5d840 cabal.project | 8 ++++++-- src/Settings/Packages/GhcCabal.hs | 11 +++++++++-- stack.yaml | 4 ++++ 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/cabal.project b/cabal.project index 1ef81ca..317094f 100644 --- a/cabal.project +++ b/cabal.project @@ -1,2 +1,6 @@ -packages: ../libraries/Cabal/Cabal/ - ./ +packages: ./ + ../libraries/Cabal/Cabal/ + ../libraries/filepath/ + ../libraries/text/ + ../libraries/hpc/ + ../libraries/parsec/ diff --git a/src/Settings/Packages/GhcCabal.hs b/src/Settings/Packages/GhcCabal.hs index 7d2e99e..0e915b3 100644 --- a/src/Settings/Packages/GhcCabal.hs +++ b/src/Settings/Packages/GhcCabal.hs @@ -11,14 +11,21 @@ ghcCabalPackageArgs = stage0 ? package ghcCabal ? builder Ghc ? do cabalDeps <- expr $ stage1Dependencies cabal cabalVersion <- expr $ pkgVersion (unsafePkgCabalFile cabal) -- TODO: improve mconcat - [ pure [ "-package " ++ pkgName pkg | pkg <- cabalDeps, pkg /= parsec ] + [ pure [ "-package " ++ pkgName pkg | pkg <- cabalDeps \\ [parsec, mtl] ] , arg "--make" , arg "-j" , pure ["-Wall", "-fno-warn-unused-imports", "-fno-warn-warnings-deprecations"] , arg ("-DCABAL_VERSION=" ++ replace "." "," cabalVersion) + , arg "-DCABAL_PARSEC" , arg "-DBOOTSTRAPPING" , arg "-DMIN_VERSION_binary_0_8_0" + , arg "libraries/text/cbits/cbits.c" , arg "-ilibraries/Cabal/Cabal" , arg "-ilibraries/binary/src" , arg "-ilibraries/filepath" - , arg "-ilibraries/hpc" ] + , arg "-ilibraries/hpc" + , arg "-ilibraries/mtl" + , arg "-ilibraries/text" + , arg "-Ilibraries/text/include" + , arg "-ilibraries/parsec" ] + diff --git a/stack.yaml b/stack.yaml index da03763..a1b7413 100644 --- a/stack.yaml +++ b/stack.yaml @@ -7,6 +7,10 @@ resolver: lts-9.0 packages: - '.' - '../libraries/Cabal/Cabal' +- '../libraries/filepath/' +- '../libraries/text/' +- '../libraries/hpc/' +- '../libraries/parsec/' extra-deps: - shake-0.16 From git at git.haskell.org Tue Oct 23 20:11:51 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:11:51 +0000 (UTC) Subject: [commit: ghc] master: Fix AppVeyor cache failure (#456) (5baa8db) Message-ID: <20181023201151.C1D913ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/5baa8db6010021b03da6897b2442dacc4b4c07ff/ghc >--------------------------------------------------------------- commit 5baa8db6010021b03da6897b2442dacc4b4c07ff Author: Andrey Mokhov Date: Sat Nov 11 17:23:14 2017 +0000 Fix AppVeyor cache failure (#456) >--------------------------------------------------------------- 5baa8db6010021b03da6897b2442dacc4b4c07ff appveyor.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 6da6a33..bd871ca 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -17,8 +17,8 @@ install: - git clone --recursive git://git.haskell.org/ghc.git # GHC comes with an older version of Hadrian, so we delete it - rm -rf ghc\hadrian - # Move new Hadrian into ./ghc/hadrian - - mv new-hadrian ghc\hadrian + # Copy new Hadrian into ./ghc/hadrian + - cp -r new-hadrian ghc\hadrian # Install Alex and Happy - set PATH=C:\Users\appveyor\AppData\Roaming\local\bin;%PATH% From git at git.haskell.org Tue Oct 23 20:11:55 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:11:55 +0000 (UTC) Subject: [commit: ghc] master: Do not run configure by default (#458) (f15e851) Message-ID: <20181023201155.9E8EB3ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/f15e851ca93515156aa431ae9629925e8e6a88ed/ghc >--------------------------------------------------------------- commit f15e851ca93515156aa431ae9629925e8e6a88ed Author: Andrey Mokhov Date: Sun Nov 12 11:51:25 2017 +0000 Do not run configure by default (#458) See #457 * Do not run configure by default * Enable automated configure on CI * Update docs >--------------------------------------------------------------- f15e851ca93515156aa431ae9629925e8e6a88ed .travis.yml | 8 ++++---- README.md | 28 ++++++++++++++-------------- appveyor.yml | 4 ++-- circle.yml | 4 ++-- doc/cross-compile.md | 4 ++-- src/CommandLine.hs | 32 ++++++++++++++++---------------- src/Rules/Configure.hs | 15 ++++++++------- 7 files changed, 48 insertions(+), 47 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc f15e851ca93515156aa431ae9629925e8e6a88ed From git at git.haskell.org Tue Oct 23 20:11:59 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:11:59 +0000 (UTC) Subject: [commit: ghc] master: hadrian: Disable -Wno-undef in files which include ffi.h (#459) (fa3771f) Message-ID: <20181023201159.7E56D3ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/fa3771fe6baf5008a8506fec48220f8347ac59af/ghc >--------------------------------------------------------------- commit fa3771fe6baf5008a8506fec48220f8347ac59af Author: Ben Gamari Date: Tue Nov 14 12:15:42 2017 -0500 hadrian: Disable -Wno-undef in files which include ffi.h (#459) As pointed out in D4181, these headers refer to undefined macros. >--------------------------------------------------------------- fa3771fe6baf5008a8506fec48220f8347ac59af src/Settings/Packages/Rts.hs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Settings/Packages/Rts.hs b/src/Settings/Packages/Rts.hs index b15bb6a..cdc89da 100644 --- a/src/Settings/Packages/Rts.hs +++ b/src/Settings/Packages/Rts.hs @@ -177,9 +177,15 @@ rtsPackageArgs = package rts ? do , input "//StgCRun.c" ? windowsHost ? arg "-Wno-return-local-addr" , input "//RetainerProfile.c" ? flag GccIsClang ? arg "-Wno-incompatible-pointer-types" + , windowsHost ? arg ("-DWINVER=" ++ windowsVersion) + + -- libffi's ffi.h triggers various warnings , inputs [ "//Interpreter.c", "//Storage.c", "//Adjustor.c" ] ? arg "-Wno-strict-prototypes" - , windowsHost ? arg ("-DWINVER=" ++ windowsVersion) ] + , inputs ["//Interpreter.c", "//Adjustor.c", "//sm/Storage.c"] ? + anyTargetArch ["powerpc"] ? arg "-Wno-undef" + ] + mconcat [ builder (Cc FindCDependencies) ? cArgs , builder (Ghc CompileCWithGhc) ? map ("-optc" ++) <$> cArgs From git at git.haskell.org Tue Oct 23 20:12:03 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:12:03 +0000 (UTC) Subject: [commit: ghc] master: Unbreak `cabal new-build` (#466) (fa95caa) Message-ID: <20181023201203.B5E203ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/fa95caa8dfdd450b7a9eddcef2bd610703b9313e/ghc >--------------------------------------------------------------- commit fa95caa8dfdd450b7a9eddcef2bd610703b9313e Author: Herbert Valerio Riedel Date: Thu Nov 16 14:33:12 2017 +0100 Unbreak `cabal new-build` (#466) Using a local `filepath` forces new-build to build the non-local build-tool `alex` as in-place which however isn't supported properly by `cabal new-build` yet (this will be fixed at the earliest in cabal 2.2) and thus breaks `hadrian/build.sh` for me. >--------------------------------------------------------------- fa95caa8dfdd450b7a9eddcef2bd610703b9313e cabal.project | 1 - 1 file changed, 1 deletion(-) diff --git a/cabal.project b/cabal.project index 317094f..79ab575 100644 --- a/cabal.project +++ b/cabal.project @@ -1,6 +1,5 @@ packages: ./ ../libraries/Cabal/Cabal/ - ../libraries/filepath/ ../libraries/text/ ../libraries/hpc/ ../libraries/parsec/ From git at git.haskell.org Tue Oct 23 20:12:07 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:12:07 +0000 (UTC) Subject: [commit: ghc] master: Fix Windows build (9aff81d) Message-ID: <20181023201207.AE6303ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/9aff81d42413ba18ce90369a10d9d24cb77cccd3/ghc >--------------------------------------------------------------- commit 9aff81d42413ba18ce90369a10d9d24cb77cccd3 Author: Andrey Mokhov Date: Sun Nov 19 01:17:15 2017 +0000 Fix Windows build See https://phabricator.haskell.org/D4121#117481 >--------------------------------------------------------------- 9aff81d42413ba18ce90369a10d9d24cb77cccd3 src/Settings/Warnings.hs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Settings/Warnings.hs b/src/Settings/Warnings.hs index abbc814..8c42217 100644 --- a/src/Settings/Warnings.hs +++ b/src/Settings/Warnings.hs @@ -32,6 +32,8 @@ warningArgs = builder Ghc ? do , package binary ? pure [ "-Wno-deprecations" ] , package bytestring ? pure [ "-Wno-inline-rule-shadowing" ] , package compiler ? pure [ "-Wcpp-undef" ] + -- FIXME: See https://phabricator.haskell.org/D4121#117481. + , input "//SysTools.hs" ? pure [ "-Wno-unused-imports" ] , package directory ? pure [ "-Wno-unused-imports" ] , package ghc ? pure [ "-Wcpp-undef" ] , package ghcPrim ? pure [ "-Wno-trustworthy-safe" ] From git at git.haskell.org Tue Oct 23 20:12:11 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:12:11 +0000 (UTC) Subject: [commit: ghc] master: Minor clean up of Hadrian dependencies (6c5f5c9) Message-ID: <20181023201211.A14F23ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/6c5f5c9bd9a274cd24b909784b71d0e63cfb31c5/ghc >--------------------------------------------------------------- commit 6c5f5c9bd9a274cd24b909784b71d0e63cfb31c5 Author: Andrey Mokhov Date: Sun Nov 19 15:25:26 2017 +0000 Minor clean up of Hadrian dependencies >--------------------------------------------------------------- 6c5f5c9bd9a274cd24b909784b71d0e63cfb31c5 README.md | 4 ++-- cabal.project | 2 +- hadrian.cabal | 11 +++++------ stack.yaml | 8 ++++---- 4 files changed, 12 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 916edc2..d188a4a 100644 --- a/README.md +++ b/README.md @@ -41,8 +41,8 @@ Notes: on Cabal sandboxes (`build.cabal.*`), Stack (`build.stack.*`) or the global package database (`build.global-db.*`). Also see [instructions for building GHC on Windows using Stack][windows-build]. -* Hadrian is written in Haskell and depends on the following packages: -`ansi-terminal extra mtl quickcheck shake`. +* Hadrian is written in Haskell and depends on `shake` (plus a few packages that `shake` depends on), +`ansi-terminal`, `mtl`, `quickcheck`, and GHC core libraries. * If you have never built GHC before, start with the [preparation guide][ghc-preparation]. diff --git a/cabal.project b/cabal.project index 79ab575..0d2b509 100644 --- a/cabal.project +++ b/cabal.project @@ -1,5 +1,5 @@ packages: ./ ../libraries/Cabal/Cabal/ - ../libraries/text/ ../libraries/hpc/ ../libraries/parsec/ + ../libraries/text/ diff --git a/hadrian.cabal b/hadrian.cabal index 389f553..53b0de2 100644 --- a/hadrian.cabal +++ b/hadrian.cabal @@ -116,17 +116,16 @@ executable hadrian , TupleSections other-extensions: MultiParamTypeClasses , TypeFamilies - build-depends: base >= 4.8 && < 5 + build-depends: base >= 4.8 && < 5 , ansi-terminal == 0.6.* , Cabal >= 2.0.0.2 && < 2.2 , containers == 0.5.* - , directory >= 1.2 && < 1.4 + , directory >= 1.2 && < 1.4 , extra >= 1.4.7 - , mtl == 2.2.* - , QuickCheck >= 2.6 && < 2.10 + , QuickCheck >= 2.6 && < 2.10 , shake == 0.16.* - , transformers >= 0.4 && < 0.6 - , unordered-containers == 0.2.* + , transformers >= 0.4 && < 0.6 + , unordered-containers >= 0.2.1 && < 0.3 build-tools: alex >= 3.1 , happy >= 1.19.4 ghc-options: -Wall diff --git a/stack.yaml b/stack.yaml index a1b7413..4acc4ed 100644 --- a/stack.yaml +++ b/stack.yaml @@ -7,10 +7,10 @@ resolver: lts-9.0 packages: - '.' - '../libraries/Cabal/Cabal' -- '../libraries/filepath/' -- '../libraries/text/' -- '../libraries/hpc/' -- '../libraries/parsec/' +- '../libraries/filepath' +- '../libraries/hpc' +- '../libraries/parsec' +- '../libraries/text' extra-deps: - shake-0.16 From git at git.haskell.org Tue Oct 23 20:12:15 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:12:15 +0000 (UTC) Subject: [commit: ghc] master: Bring mtl dependency back (4971843) Message-ID: <20181023201215.7F0163ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/497184390e713494b051401e3f160d9863a6744a/ghc >--------------------------------------------------------------- commit 497184390e713494b051401e3f160d9863a6744a Author: Andrey Mokhov Date: Sun Nov 19 16:50:58 2017 +0000 Bring mtl dependency back >--------------------------------------------------------------- 497184390e713494b051401e3f160d9863a6744a hadrian.cabal | 1 + 1 file changed, 1 insertion(+) diff --git a/hadrian.cabal b/hadrian.cabal index 53b0de2..9c170bc 100644 --- a/hadrian.cabal +++ b/hadrian.cabal @@ -122,6 +122,7 @@ executable hadrian , containers == 0.5.* , directory >= 1.2 && < 1.4 , extra >= 1.4.7 + , mtl == 2.2.* , QuickCheck >= 2.6 && < 2.10 , shake == 0.16.* , transformers >= 0.4 && < 0.6 From git at git.haskell.org Tue Oct 23 20:12:19 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:12:19 +0000 (UTC) Subject: [commit: ghc] master: Fix dependencies (#477) (9dd7ad2) Message-ID: <20181023201219.54D123ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/9dd7ad2accc79efbbfb7847c89e881fa02f7c911/ghc >--------------------------------------------------------------- commit 9dd7ad2accc79efbbfb7847c89e881fa02f7c911 Author: Andrey Mokhov Date: Mon Nov 20 03:26:15 2017 +0000 Fix dependencies (#477) See #464 * Drop non-source dependencies during compilation * Drop duplicated dependencies on package configuration * Compute transitive closure of context dependencies * Don't depend on a temporary file >--------------------------------------------------------------- 9dd7ad2accc79efbbfb7847c89e881fa02f7c911 src/Rules/Compile.hs | 2 -- src/Rules/Dependencies.hs | 4 ++-- src/Settings/Builders/Ghc.hs | 8 ++++---- src/Settings/Packages/GhcCabal.hs | 5 +++-- src/Utilities.hs | 30 +++++++++++++++++++----------- 5 files changed, 28 insertions(+), 21 deletions(-) diff --git a/src/Rules/Compile.hs b/src/Rules/Compile.hs index a4b1278..b7f3bc8 100644 --- a/src/Rules/Compile.hs +++ b/src/Rules/Compile.hs @@ -22,8 +22,6 @@ compilePackage rs context at Context {..} = do path <- buildPath context (src, deps) <- lookupDependencies (path -/- ".dependencies") obj need $ src : deps - when (isLibrary package) $ need =<< return <$> pkgConfFile context - needLibrary =<< contextDependencies context buildWithResources rs $ target context (Ghc CompileHs stage) [src] [obj] priority 2.0 $ do diff --git a/src/Rules/Dependencies.hs b/src/Rules/Dependencies.hs index f27ef0d..f9d17e9 100644 --- a/src/Rules/Dependencies.hs +++ b/src/Rules/Dependencies.hs @@ -19,11 +19,11 @@ buildPackageDependencies rs context at Context {..} = orderOnly =<< interpretInContext context generatedDependencies let mk = deps <.> "mk" if null srcs - then writeFileChanged mk "" + then writeFile' mk "" else buildWithResources rs $ target context (Ghc FindHsDependencies stage) srcs [mk] removeFile $ mk <.> "bak" - mkDeps <- readFile' mk + mkDeps <- liftIO $ readFile mk writeFileChanged deps . unlines . map (\(src, deps) -> unwords $ src : deps) . map (bimap unifyPath (map unifyPath)) diff --git a/src/Settings/Builders/Ghc.hs b/src/Settings/Builders/Ghc.hs index a975e7e..af78b74 100644 --- a/src/Settings/Builders/Ghc.hs +++ b/src/Settings/Builders/Ghc.hs @@ -87,10 +87,10 @@ haddockGhcArgs = mconcat [ commonGhcArgs, getPkgDataList HsArgs ] -- Used in ghcBuilderArgs, ghcCBuilderArgs, ghcMBuilderArgs and haddockGhcArgs. commonGhcArgs :: Args commonGhcArgs = do - way <- getWay - path <- getBuildPath - pkg <- getPackage - when (isLibrary pkg) $ do + way <- getWay + path <- getBuildPath + pkg <- getPackage + when (pkg == rts) $ do context <- getContext conf <- expr $ pkgConfFile context expr $ need [conf] diff --git a/src/Settings/Packages/GhcCabal.hs b/src/Settings/Packages/GhcCabal.hs index 0e915b3..c88617b 100644 --- a/src/Settings/Packages/GhcCabal.hs +++ b/src/Settings/Packages/GhcCabal.hs @@ -8,10 +8,11 @@ import Utilities ghcCabalPackageArgs :: Args ghcCabalPackageArgs = stage0 ? package ghcCabal ? builder Ghc ? do - cabalDeps <- expr $ stage1Dependencies cabal + cabalDeps <- expr $ stage1Dependencies cabal + let bootDeps = cabalDeps \\ [integerGmp, integerSimple, mtl, parsec, text] cabalVersion <- expr $ pkgVersion (unsafePkgCabalFile cabal) -- TODO: improve mconcat - [ pure [ "-package " ++ pkgName pkg | pkg <- cabalDeps \\ [parsec, mtl] ] + [ pure [ "-package " ++ pkgName pkg | pkg <- bootDeps ] , arg "--make" , arg "-j" , pure ["-Wall", "-fno-warn-unused-imports", "-fno-warn-warnings-deprecations"] diff --git a/src/Utilities.hs b/src/Utilities.hs index 3c61dae..fc898c3 100644 --- a/src/Utilities.hs +++ b/src/Utilities.hs @@ -24,21 +24,29 @@ buildWithResources rs target = H.buildWithResources rs target getArgs buildWithCmdOptions :: [CmdOption] -> Target -> Action () buildWithCmdOptions opts target = H.buildWithCmdOptions opts target getArgs --- | Given a 'Context' this 'Action' look up the package dependencies and wrap +-- TODO: Cache the computation. +-- | Given a 'Context' this 'Action' looks up the package dependencies and wraps -- the results in appropriate contexts. The only subtlety here is that we never -- depend on packages built in 'Stage2' or later, therefore the stage of the -- resulting dependencies is bounded from above at 'Stage1'. To compute package --- dependencies we scan package @.cabal@ files, see 'pkgDependencies' defined --- in "Hadrian.Haskell.Cabal". +-- dependencies we transitively scan @.cabal@ files using 'pkgDependencies' +-- defined in "Hadrian.Haskell.Cabal". contextDependencies :: Context -> Action [Context] -contextDependencies Context {..} = case pkgCabalFile package of - Nothing -> return [] -- Non-Cabal packages have no dependencies. - Just cabalFile -> do - let depStage = min stage Stage1 - depContext = \pkg -> Context depStage pkg way - deps <- pkgDependencies cabalFile - pkgs <- sort <$> stagePackages depStage - return . map depContext $ intersectOrd (compare . pkgName) pkgs deps +contextDependencies Context {..} = do + depPkgs <- go [package] + return [ Context depStage pkg way | pkg <- depPkgs, pkg /= package ] + where + depStage = min stage Stage1 + go pkgs = do + deps <- concatMapM step pkgs + let newPkgs = nubOrd $ sort (deps ++ pkgs) + if pkgs == newPkgs then return pkgs else go newPkgs + step pkg = case pkgCabalFile pkg of + Nothing -> return [] -- Non-Cabal packages have no dependencies. + Just cabalFile -> do + deps <- pkgDependencies cabalFile + active <- sort <$> stagePackages depStage + return $ intersectOrd (compare . pkgName) active deps -- | Lookup dependencies of a 'Package' in the vanilla Stage1 context. stage1Dependencies :: Package -> Action [Package] From git at git.haskell.org Tue Oct 23 20:12:23 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:12:23 +0000 (UTC) Subject: [commit: ghc] master: Do not depend on the in-tree filepath library (#478) (e5c7a29) Message-ID: <20181023201223.301873ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/e5c7a29c234c08a72ff1446ceeda3d61a54cae78/ghc >--------------------------------------------------------------- commit e5c7a29c234c08a72ff1446ceeda3d61a54cae78 Author: Andrey Mokhov Date: Mon Nov 20 05:00:22 2017 +0000 Do not depend on the in-tree filepath library (#478) See #465, #466 >--------------------------------------------------------------- e5c7a29c234c08a72ff1446ceeda3d61a54cae78 stack.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/stack.yaml b/stack.yaml index 4acc4ed..1d3f6e3 100644 --- a/stack.yaml +++ b/stack.yaml @@ -7,7 +7,6 @@ resolver: lts-9.0 packages: - '.' - '../libraries/Cabal/Cabal' -- '../libraries/filepath' - '../libraries/hpc' - '../libraries/parsec' - '../libraries/text' From git at git.haskell.org Tue Oct 23 20:12:27 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:12:27 +0000 (UTC) Subject: [commit: ghc] master: Add ways to build hadrian using nix (#473) (8fd6818) Message-ID: <20181023201227.21E863ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/8fd68186b24e7fbb447401dd482e5b42f60b40f8/ghc >--------------------------------------------------------------- commit 8fd68186b24e7fbb447401dd482e5b42f60b40f8 Author: Moritz Angermann Date: Tue Nov 21 04:06:25 2017 +0800 Add ways to build hadrian using nix (#473) * Add ways to build hadrian using nix This adds two new files to the hadrian directory shell.nix sets up the build envrionment you need to build ghc build-nix is a simple wrapper which invokes hadrian in the correct environment Note: this patch was authored by @mpickering, however it ended up on phabricator due to the subtree as https://phabricator.haskell.org/D4207. * Comments and renamed build-nix >--------------------------------------------------------------- 8fd68186b24e7fbb447401dd482e5b42f60b40f8 build.stack.nix.sh => build.nix.sh | 18 ++++++----- shell.nix | 61 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+), 8 deletions(-) diff --git a/build.stack.nix.sh b/build.nix.sh similarity index 66% copy from build.stack.nix.sh copy to build.nix.sh index 59ac061..4b03ea8 100755 --- a/build.stack.nix.sh +++ b/build.nix.sh @@ -1,12 +1,9 @@ -#!/usr/bin/env bash +#!/usr/bin/env nix-shell +#! nix-shell -i bash shell.nix -set -euo pipefail +# This script sets up the build environment by invoking nix-shell shell.nix +# and then runs the hadrian executable. -# readlink on os x, doesn't support -f, to prevent the -# need of installing coreutils (e.g. through brew, just -# for readlink, we use the follownig substitute. -# -# source: http://stackoverflow.com/a/1116890 function rl { TARGET_FILE="$1" @@ -29,5 +26,10 @@ function rl { } absoluteRoot="$(dirname "$(rl "$0")")" +echo $absoluteRoot +cd "$absoluteRoot" -HADRIAN_NIX=YES ${absoluteRoot}/build.stack.sh +hadrian \ + --lint \ + --directory="$absoluteRoot/.." \ + "$@" diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..e9a5ecc --- /dev/null +++ b/shell.nix @@ -0,0 +1,61 @@ +# Invoking nix-shell sets up an environment where we can build ghc +# by only invoking hadrian. + + +{ nixpkgs ? import {} }: + +let + haskellPackages = nixpkgs.haskell.packages.ghc821; + + removeBuild = path: type: + let baseName = baseNameOf (toString path); + in + ! (baseName == "_build" + || baseName == "dist" + || baseName == "dist-newstyle" + || baseName == ".stack-work" + || baseName == "config.log" + || baseName == "config.status" + || nixpkgs.lib.hasSuffix ".sh" baseName + || !(nixpkgs.lib.cleanSourceFilter path type)) ; + + filterSrc = path: builtins.filterSource removeBuild path; + + + hadrianPackages = nixpkgs.haskell.packages.ghc821.override { + overrides = self: super: let + localPackage = name: path: self.callCabal2nix name (filterSrc path) {}; + in { + hadrian = localPackage "hadrian" ./. ; + shake = self.callHackage "shake" "0.16" {}; + Cabal = localPackage "Cabal" ./../libraries/Cabal/Cabal ; + filepath = localPackage "filepath" ./../libraries/filepath ; + text = localPackage "text" ./../libraries/text ; + hpc = localPackage"hpc" ./../libraries/hpc ; + parsec = localPackage "parsec" ./../libraries/parsec ; + HUnit = nixpkgs.haskell.lib.dontCheck (self.callHackage "HUnit" "1.3.1.2" {}); + process = localPackage "process" ./../libraries/process ; + directory = localPackage "directory" ./../libraries/directory ; + }; }; + +in + + nixpkgs.stdenv.mkDerivation { + name = "ghc-dev"; + buildInputs = [ + hadrianPackages.hadrian + nixpkgs.haskell.compiler.ghc821 + haskellPackages.alex + haskellPackages.happy + nixpkgs.python3 + nixpkgs.git + nixpkgs.autoconf + nixpkgs.automake + nixpkgs.perl + nixpkgs.gcc + nixpkgs.python3Packages.sphinx + nixpkgs.ncurses + nixpkgs.m4 + nixpkgs.gmp + nixpkgs.file ]; + } From git at git.haskell.org Tue Oct 23 20:12:30 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:12:30 +0000 (UTC) Subject: [commit: ghc] master: Follow GHC changes (#479) (4499b29) Message-ID: <20181023201230.ECC843ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/4499b294e4a53f71f8808d6eb55a7dd0b341cfb8/ghc >--------------------------------------------------------------- commit 4499b294e4a53f71f8808d6eb55a7dd0b341cfb8 Author: Andrey Mokhov Date: Mon Nov 20 22:51:40 2017 +0000 Follow GHC changes (#479) >--------------------------------------------------------------- 4499b294e4a53f71f8808d6eb55a7dd0b341cfb8 src/Rules/Program.hs | 3 --- src/Settings/Warnings.hs | 2 -- 2 files changed, 5 deletions(-) diff --git a/src/Rules/Program.hs b/src/Rules/Program.hs index ba4dab0..dca177f 100644 --- a/src/Rules/Program.hs +++ b/src/Rules/Program.hs @@ -92,7 +92,6 @@ buildWrapper context at Context {..} wrapper wrapperPath wrapped = do putSuccess $ "| Successfully created wrapper for " ++ quote (pkgName package) ++ " (" ++ show stage ++ ")." --- TODO: Get rid of the Paths_hsc2hs.o hack. buildBinary :: [(Resource, Int)] -> FilePath -> Context -> Action () buildBinary rs bin context at Context {..} = do binDeps <- if stage == Stage0 && package == ghcCabal @@ -107,8 +106,6 @@ buildBinary rs bin context at Context {..} = do cObjs <- mapM (objectPath context) cSrcs hsObjs <- hsObjects context return $ cObjs ++ hsObjs - ++ [ path -/- "Paths_hsc2hs.o" | package == hsc2hs ] - ++ [ path -/- "Paths_haddock.o" | package == haddock ] need binDeps buildWithResources rs $ target context (Ghc LinkHs stage) binDeps [bin] synopsis <- traverse pkgSynopsis (pkgCabalFile package) diff --git a/src/Settings/Warnings.hs b/src/Settings/Warnings.hs index 8c42217..abbc814 100644 --- a/src/Settings/Warnings.hs +++ b/src/Settings/Warnings.hs @@ -32,8 +32,6 @@ warningArgs = builder Ghc ? do , package binary ? pure [ "-Wno-deprecations" ] , package bytestring ? pure [ "-Wno-inline-rule-shadowing" ] , package compiler ? pure [ "-Wcpp-undef" ] - -- FIXME: See https://phabricator.haskell.org/D4121#117481. - , input "//SysTools.hs" ? pure [ "-Wno-unused-imports" ] , package directory ? pure [ "-Wno-unused-imports" ] , package ghc ? pure [ "-Wcpp-undef" ] , package ghcPrim ? pure [ "-Wno-trustworthy-safe" ] From git at git.haskell.org Tue Oct 23 20:12:34 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:12:34 +0000 (UTC) Subject: [commit: ghc] master: Extend ghcHEAD derivation rather than make a new derivation (#486) (dc8032e) Message-ID: <20181023201234.CF0673ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/dc8032e261f7205a70e7fc738656374c127bb476/ghc >--------------------------------------------------------------- commit dc8032e261f7205a70e7fc738656374c127bb476 Author: Matthew Pickering Date: Tue Dec 5 21:23:50 2017 +0000 Extend ghcHEAD derivation rather than make a new derivation (#486) This allows you to use configurePhase/buildPhase as usual and set the right configureFlags rather than end up with a broken executable. >--------------------------------------------------------------- dc8032e261f7205a70e7fc738656374c127bb476 shell.nix | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/shell.nix b/shell.nix index e9a5ecc..f15f72b 100644 --- a/shell.nix +++ b/shell.nix @@ -16,6 +16,7 @@ let || baseName == ".stack-work" || baseName == "config.log" || baseName == "config.status" + || baseName == "shell.nix" || nixpkgs.lib.hasSuffix ".sh" baseName || !(nixpkgs.lib.cleanSourceFilter path type)) ; @@ -39,23 +40,12 @@ let }; }; in - - nixpkgs.stdenv.mkDerivation { - name = "ghc-dev"; - buildInputs = [ + nixpkgs.lib.overrideDerivation nixpkgs.haskell.packages.ghcHEAD.ghc + (drv: { + name = "ghc-dev"; + buildInputs = drv.buildInputs ++ [ hadrianPackages.hadrian - nixpkgs.haskell.compiler.ghc821 - haskellPackages.alex - haskellPackages.happy - nixpkgs.python3 - nixpkgs.git - nixpkgs.autoconf - nixpkgs.automake - nixpkgs.perl - nixpkgs.gcc - nixpkgs.python3Packages.sphinx - nixpkgs.ncurses - nixpkgs.m4 - nixpkgs.gmp - nixpkgs.file ]; - } + nixpkgs.arcanist + ]; + }) + From git at git.haskell.org Tue Oct 23 20:12:38 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:12:38 +0000 (UTC) Subject: [commit: ghc] master: Drop -Werror (#487) (86216e2) Message-ID: <20181023201238.A95233ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/86216e249f307a778bef3755afb7474910bc60cc/ghc >--------------------------------------------------------------- commit 86216e249f307a778bef3755afb7474910bc60cc Author: Andrey Mokhov Date: Tue Dec 5 23:40:06 2017 +0000 Drop -Werror (#487) * Drop -Werror from default arguments See #483, #485. >--------------------------------------------------------------- 86216e249f307a778bef3755afb7474910bc60cc src/Settings/Builders/Cc.hs | 2 +- src/Settings/Builders/Common.hs | 10 +++++----- src/Settings/Packages/Rts.hs | 2 +- src/Settings/Warnings.hs | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Settings/Builders/Cc.hs b/src/Settings/Builders/Cc.hs index 70d043f..fdd9fc5 100644 --- a/src/Settings/Builders/Cc.hs +++ b/src/Settings/Builders/Cc.hs @@ -11,7 +11,7 @@ ccBuilderArgs = do , cIncludeArgs , builder (Cc CompileC) ? mconcat - [ pure ["-Wall", "-Werror"] + [ arg "-Wall" , Dynamic `wayUnit` way ? pure [ "-fPIC", "-DDYNAMIC" ] , arg "-c", arg =<< getInput , arg "-o", arg =<< getOutput ] diff --git a/src/Settings/Builders/Common.hs b/src/Settings/Builders/Common.hs index 340239a..bfcddeb 100644 --- a/src/Settings/Builders/Common.hs +++ b/src/Settings/Builders/Common.hs @@ -40,11 +40,11 @@ cArgs = mempty -- TODO: should be in a different file cWarnings :: Args -cWarnings = - mconcat [ arg "-Wall" - , flag GccIsClang ? arg "-Wno-unknown-pragmas" - , notM (flag GccIsClang) ? notM windowsHost ? arg "-Werror=unused-but-set-variable" - , notM (flag GccIsClang) ? arg "-Wno-error=inline" ] +cWarnings = mconcat + [ arg "-Wall" + , flag GccIsClang ? arg "-Wno-unknown-pragmas" + , notM (flag GccIsClang) ? notM windowsHost ? arg "-Werror=unused-but-set-variable" + , notM (flag GccIsClang) ? arg "-Wno-error=inline" ] bootPackageDatabaseArgs :: Args bootPackageDatabaseArgs = do diff --git a/src/Settings/Packages/Rts.hs b/src/Settings/Packages/Rts.hs index cdc89da..7b3bb2d 100644 --- a/src/Settings/Packages/Rts.hs +++ b/src/Settings/Packages/Rts.hs @@ -209,7 +209,7 @@ rtsPackageArgs = package rts ? do -- See @rts/ghc.mk at . rtsWarnings :: Args rtsWarnings = mconcat - [ pure ["-Wall", "-Werror"] + [ arg "-Wall" , arg "-Wextra" , arg "-Wstrict-prototypes" , arg "-Wmissing-prototypes" diff --git a/src/Settings/Warnings.hs b/src/Settings/Warnings.hs index abbc814..19a12df 100644 --- a/src/Settings/Warnings.hs +++ b/src/Settings/Warnings.hs @@ -10,7 +10,7 @@ import Settings -- | Default Haskell warning-related arguments. defaultGhcWarningsArgs :: Args defaultGhcWarningsArgs = mconcat - [ notStage0 ? pure [ "-Werror", "-Wnoncanonical-monad-instances" ] + [ notStage0 ? arg "-Wnoncanonical-monad-instances" , (not <$> flag GccIsClang) ? mconcat [ (not <$> windowsHost ) ? arg "-optc-Werror=unused-but-set-variable" , arg "-optc-Wno-error=inline" ] From git at git.haskell.org Tue Oct 23 20:12:42 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:12:42 +0000 (UTC) Subject: [commit: ghc] master: Add a free ACM download link for the paper (d2e83f2) Message-ID: <20181023201242.88F8C3ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/d2e83f2a1d07000688e4e7e994a82f49613c9213/ghc >--------------------------------------------------------------- commit d2e83f2a1d07000688e4e7e994a82f49613c9213 Author: Andrey Mokhov Date: Mon Dec 11 19:43:31 2017 +0000 Add a free ACM download link for the paper Fix #488 >--------------------------------------------------------------- d2e83f2a1d07000688e4e7e994a82f49613c9213 README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d188a4a..0684380 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,8 @@ Hadrian is a new build system for the [Glasgow Haskell Compiler][ghc]. It is bas on [Shake][shake] and we hope that it will soon replace the current [Make-based build system][make]. If you are curious about the rationale behind the project and the architecture of the build system you can find more details in -this [Haskell Symposium 2016 paper][paper] and this [Haskell eXchange 2016 talk][talk]. +this [Haskell Symposium 2016 paper](https://dl.acm.org/authorize?N41275) and this +[Haskell eXchange 2016 talk][talk]. The new build system can work side-by-side with the existing build system. Note, there is some interaction between them: they put (some) build results in the same directories, @@ -179,7 +180,6 @@ enjoy the project. [ghc]: https://en.wikipedia.org/wiki/Glasgow_Haskell_Compiler [shake]: https://github.com/ndmitchell/shake [make]: https://ghc.haskell.org/trac/ghc/wiki/Building/Architecture -[paper]: https://www.staff.ncl.ac.uk/andrey.mokhov/Hadrian.pdf [talk]: https://skillsmatter.com/skillscasts/8722-meet-hadrian-a-new-build-system-for-ghc [issues]: https://github.com/snowleopard/hadrian/issues [ghc-preparation]: https://ghc.haskell.org/trac/ghc/wiki/Building/Preparation From git at git.haskell.org Tue Oct 23 20:12:46 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:12:46 +0000 (UTC) Subject: [commit: ghc] master: Fix CI (#489) (2609bd0) Message-ID: <20181023201246.617483ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/2609bd02b6f517777175a8f34e05a9e36570e511/ghc >--------------------------------------------------------------- commit 2609bd02b6f517777175a8f34e05a9e36570e511 Author: Andrey Mokhov Date: Mon Dec 11 21:43:25 2017 +0000 Fix CI (#489) Delete the .git folder explicitly >--------------------------------------------------------------- 2609bd02b6f517777175a8f34e05a9e36570e511 .travis.yml | 2 +- circle.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index b89f42b..63b3e31 100644 --- a/.travis.yml +++ b/.travis.yml @@ -77,7 +77,7 @@ install: - cabal install alex happy # GHC comes with an older version of Hadrian, so we delete it - - rm -r ghc/hadrian/* + - rm -rf ghc/hadrian/.git # Travis has already cloned Hadrian into ./ and we need to move it # to ./ghc/hadrian -- one way to do it is to move the .git directory diff --git a/circle.yml b/circle.yml index e9a4b6a..f04f4c7 100644 --- a/circle.yml +++ b/circle.yml @@ -22,7 +22,7 @@ compile: - git clone --depth 1 --recursive git://github.com/ghc/ghc # GHC comes with an older version of Hadrian, so we delete it - - rm -r ghc/hadrian/* + - rm -rf ghc/hadrian/.git # move hadrian's .git into ./ghc/hadrian and perform a hard reset in order to regenerate Hadrian files - mv .git ghc/hadrian # NOTE: we must write them in the same line because each line From git at git.haskell.org Tue Oct 23 20:12:50 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:12:50 +0000 (UTC) Subject: [commit: ghc] master: Drop redundant dependencies on in-tree packages (#491) (7d2368d) Message-ID: <20181023201250.5958C3ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/7d2368d714c7ed3fb8c096882564575aacf2b396/ghc >--------------------------------------------------------------- commit 7d2368d714c7ed3fb8c096882564575aacf2b396 Author: Andrey Mokhov Date: Thu Dec 14 02:32:37 2017 +0000 Drop redundant dependencies on in-tree packages (#491) See #481 >--------------------------------------------------------------- 7d2368d714c7ed3fb8c096882564575aacf2b396 cabal.project | 3 --- stack.yaml | 3 --- 2 files changed, 6 deletions(-) diff --git a/cabal.project b/cabal.project index 0d2b509..176d1ee 100644 --- a/cabal.project +++ b/cabal.project @@ -1,5 +1,2 @@ packages: ./ ../libraries/Cabal/Cabal/ - ../libraries/hpc/ - ../libraries/parsec/ - ../libraries/text/ diff --git a/stack.yaml b/stack.yaml index 1d3f6e3..da03763 100644 --- a/stack.yaml +++ b/stack.yaml @@ -7,9 +7,6 @@ resolver: lts-9.0 packages: - '.' - '../libraries/Cabal/Cabal' -- '../libraries/hpc' -- '../libraries/parsec' -- '../libraries/text' extra-deps: - shake-0.16 From git at git.haskell.org Tue Oct 23 20:12:54 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:12:54 +0000 (UTC) Subject: [commit: ghc] master: Fix broken colours with `-j` (#484) (fdc35b1) Message-ID: <20181023201254.31B763ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/fdc35b1859c5b0781f26bb8b1754f4087f2afdbd/ghc >--------------------------------------------------------------- commit fdc35b1859c5b0781f26bb8b1754f4087f2afdbd Author: Patrick Dougherty Date: Sat Dec 16 20:25:50 2017 -0600 Fix broken colours with `-j` (#484) * Fix colours * Simplify data types * Fix doc typo >--------------------------------------------------------------- fdc35b1859c5b0781f26bb8b1754f4087f2afdbd README.md | 2 +- circle.yml | 2 +- doc/user-settings.md | 15 +++++++-- hadrian.cabal | 1 - src/Hadrian/Utilities.hs | 87 +++++++++++++++++++++++++++++++++++++----------- src/UserSettings.hs | 5 ++- 6 files changed, 85 insertions(+), 27 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc fdc35b1859c5b0781f26bb8b1754f4087f2afdbd From git at git.haskell.org Tue Oct 23 20:12:58 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:12:58 +0000 (UTC) Subject: [commit: ghc] master: [WIP] Support run GHC's test from hadrian. (#495) (63a5563) Message-ID: <20181023201258.141D63ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/63a556382f4b3154ed2ce3a6c8a36f79d9b8e3b1/ghc >--------------------------------------------------------------- commit 63a556382f4b3154ed2ce3a6c8a36f79d9b8e3b1 Author: HE, Tao Date: Fri Jan 26 07:10:48 2018 -0600 [WIP] Support run GHC's test from hadrian. (#495) * Support run GHC's test from hadrian. 1. Necessary command line arguments to run test driver. + `--test-only=` + `--test-skip-perf` + `--test-summary=` + `--test-junit=` + `--test-config=` 2. Synchronize configurations from test.mk. 3. Synchronize GHC's compilation flags from test.mk (that's very important). * The `RunTest` builder and `test` rule to run GHC's test. * Timeout rules. * Reduce boilerplate. * Fix warning. * Move getTestArgs into Settings.Builders.RunTest. * Drop `validate` related code to avoid confusion. * Replace explicit `chmod +x` with `makeExecutable`. * Fix executable's extension. >--------------------------------------------------------------- 63a556382f4b3154ed2ce3a6c8a36f79d9b8e3b1 cfg/system.config.in | 4 ++ hadrian.cabal | 1 + src/Builder.hs | 6 ++ src/CommandLine.hs | 59 ++++++++++++++++-- src/Hadrian/Utilities.hs | 22 ++++++- src/Rules/Test.hs | 131 ++++++++++++++++++++++++--------------- src/Settings/Builders/RunTest.hs | 107 ++++++++++++++++++++++++++++++++ src/Settings/Default.hs | 2 + 8 files changed, 276 insertions(+), 56 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 63a556382f4b3154ed2ce3a6c8a36f79d9b8e3b1 From git at git.haskell.org Tue Oct 23 20:13:02 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:13:02 +0000 (UTC) Subject: [commit: ghc] master: Fix Haddock (#496) (8d6945d) Message-ID: <20181023201302.195EB3ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/8d6945d970926ae77ea0d05a2b6590920eabc985/ghc >--------------------------------------------------------------- commit 8d6945d970926ae77ea0d05a2b6590920eabc985 Author: Andrey Mokhov Date: Sat Feb 3 01:56:47 2018 +0000 Fix Haddock (#496) See #492. >--------------------------------------------------------------- 8d6945d970926ae77ea0d05a2b6590920eabc985 src/Rules/Documentation.hs | 13 ++++++++----- src/Rules/Generate.hs | 6 ++++++ 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/Rules/Documentation.hs b/src/Rules/Documentation.hs index 5a5698c..3043f8b 100644 --- a/src/Rules/Documentation.hs +++ b/src/Rules/Documentation.hs @@ -117,8 +117,11 @@ allHaddocks = do sequence [ pkgHaddockFile $ vanillaContext Stage1 pkg | pkg <- pkgs, isLibrary pkg, isHsPackage pkg ] -haddockHtmlLib :: FilePath -haddockHtmlLib = "inplace/lib/html/haddock-util.js" +-- TODO: This is fragile and will break if @README.md@ is removed. We need to +-- improve the story of program runtime dependencies on directories. +-- See: https://github.com/snowleopard/hadrian/issues/492. +haddockHtmlResourcesStamp :: FilePath +haddockHtmlResourcesStamp = "inplace/lib/html/README.md" -- | Find the haddock files for the dependencies of the current library haddockDependencies :: Context -> Action [FilePath] @@ -135,8 +138,8 @@ buildPackageDocumentation :: Context -> Rules () buildPackageDocumentation context at Context {..} = when (stage == Stage1) $ do -- Js and Css files for haddock output - when (package == haddock) $ haddockHtmlLib %> \_ -> do - let dir = takeDirectory haddockHtmlLib + when (package == haddock) $ haddockHtmlResourcesStamp %> \_ -> do + let dir = takeDirectory haddockHtmlResourcesStamp liftIO $ removeFiles dir ["//*"] copyDirectory "utils/haddock/haddock-api/resources/html" dir @@ -144,7 +147,7 @@ buildPackageDocumentation context at Context {..} = when (stage == Stage1) $ do "//" ++ pkgName package <.> "haddock" %> \file -> do haddocks <- haddockDependencies context srcs <- hsSources context - need $ srcs ++ haddocks ++ [haddockHtmlLib] + need $ srcs ++ haddocks ++ [haddockHtmlResourcesStamp] -- Build Haddock documentation -- TODO: pass the correct way from Rules via Context diff --git a/src/Rules/Generate.hs b/src/Rules/Generate.hs index 8e2b65d..8616da0 100644 --- a/src/Rules/Generate.hs +++ b/src/Rules/Generate.hs @@ -141,6 +141,12 @@ generatePackageCode context@(Context stage pkg _) = when (pkg == rts) $ "//" ++ dir -/- "cmm/AutoApply.cmm" %> \file -> build $ target context GenApply [] [file] +-- TODO: These rules copy runtime dependencies of some executables, such as GHC +-- itself (file @ghc-usage.txt@) or Hsc2Hs (file @template-hsc.h@). Ideally, +-- these rules should be moved to package-specific settings, so that they can be +-- discovered more easily. We also need to add proper support for runtime +-- dependencies on directories, which is the case for Haddock -- for the current +-- workaround see "Rules.Documentation.haddockHtmlResourcesStamp". copyRules :: Rules () copyRules = do (inplaceLibPath -/- "ghc-usage.txt") <~ return "driver" From git at git.haskell.org Tue Oct 23 20:13:05 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:13:05 +0000 (UTC) Subject: [commit: ghc] master: Drop custom logic for Scav_thr and Evac_thr (#497) (1232d26) Message-ID: <20181023201306.007CC3ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/1232d26576eb156301aedab77f17d509c6887c48/ghc >--------------------------------------------------------------- commit 1232d26576eb156301aedab77f17d509c6887c48 Author: Andrey Mokhov Date: Sun Feb 4 02:31:10 2018 +0000 Drop custom logic for Scav_thr and Evac_thr (#497) See https://phabricator.haskell.org/D3237 >--------------------------------------------------------------- 1232d26576eb156301aedab77f17d509c6887c48 doc/user-settings.md | 2 +- src/Rules/Compile.hs | 2 +- src/Rules/Generate.hs | 9 ++------- src/Rules/Library.hs | 5 +---- src/Rules/PackageData.hs | 4 +--- src/Settings/Builders/RunTest.hs | 2 -- src/Settings/Packages/Rts.hs | 14 ++++++-------- 7 files changed, 12 insertions(+), 26 deletions(-) diff --git a/doc/user-settings.md b/doc/user-settings.md index e800d51..1a89dd4 100644 --- a/doc/user-settings.md +++ b/doc/user-settings.md @@ -87,7 +87,7 @@ You can combine several custom command line settings using `mconcat`: userArgs :: Args userArgs = mconcat [ builder Ghc ? package cabal ? arg "-O0" - , package rts ? input "//Evac_thr.c" ? pure [ "-DPARALLEL_GC", "-Irts/sm" ] ] + , package rts ? input "//PrimOps.c" ? pure ["-fno-PIC", "-static"] ] ``` You can match any combination of the `builder`, `stage`, `package`, `way`, `input` and `output` predicates when specifying custom command line arguments. File diff --git a/src/Rules/Compile.hs b/src/Rules/Compile.hs index b7f3bc8..8bca888 100644 --- a/src/Rules/Compile.hs +++ b/src/Rules/Compile.hs @@ -25,7 +25,7 @@ compilePackage rs context at Context {..} = do buildWithResources rs $ target context (Ghc CompileHs stage) [src] [obj] priority 2.0 $ do - nonHs "c" %> compile (Ghc CompileCWithGhc) (obj2src "c" isGeneratedCFile ) + nonHs "c" %> compile (Ghc CompileCWithGhc) (obj2src "c" $ const False ) nonHs "cmm" %> compile (Ghc CompileHs) (obj2src "cmm" isGeneratedCmmFile) nonHs "s" %> compile (Ghc CompileHs) (obj2src "S" $ const False ) diff --git a/src/Rules/Generate.hs b/src/Rules/Generate.hs index 8616da0..a8f3956 100644 --- a/src/Rules/Generate.hs +++ b/src/Rules/Generate.hs @@ -1,6 +1,6 @@ module Rules.Generate ( - isGeneratedCFile, isGeneratedCmmFile, generatePackageCode, generateRules, - copyRules, includesDependencies, generatedDependencies + isGeneratedCmmFile, generatePackageCode, generateRules, copyRules, + includesDependencies, generatedDependencies ) where import Base @@ -29,9 +29,6 @@ primopsTxt stage = contextDir (vanillaContext stage compiler) -/- "primops.txt" platformH :: Stage -> FilePath platformH stage = contextDir (vanillaContext stage compiler) -/- "ghc_boot_platform.h" -isGeneratedCFile :: FilePath -> Bool -isGeneratedCFile file = takeBaseName file `elem` ["Evac_thr", "Scav_thr"] - isGeneratedCmmFile :: FilePath -> Bool isGeneratedCmmFile file = takeBaseName file == "AutoApply" @@ -155,8 +152,6 @@ copyRules = do (inplaceLibPath -/- "platformConstants") <~ (buildRoot <&> (-/- generatedDir)) (inplaceLibPath -/- "settings") <~ return "." (inplaceLibPath -/- "template-hsc.h") <~ return (pkgPath hsc2hs) - "//c/sm/Evac_thr.c" %> copyFile (pkgPath rts -/- "sm/Evac.c") - "//c/sm/Scav_thr.c" %> copyFile (pkgPath rts -/- "sm/Scav.c") where pattern <~ mdir = pattern %> \file -> do dir <- mdir diff --git a/src/Rules/Library.hs b/src/Rules/Library.hs index e6e5b16..7b7a179 100644 --- a/src/Rules/Library.hs +++ b/src/Rules/Library.hs @@ -89,10 +89,7 @@ cObjects :: Context -> Action [FilePath] cObjects context = do path <- buildPath context srcs <- pkgDataList (CSrcs path) - objs <- mapM (objectPath context) srcs - return $ if way context == threaded - then objs - else filter ((`notElem` ["Evac_thr", "Scav_thr"]) . takeBaseName) objs + mapM (objectPath context) srcs extraObjects :: Context -> Action [FilePath] extraObjects context diff --git a/src/Rules/PackageData.hs b/src/Rules/PackageData.hs index 2442b03..32a9117 100644 --- a/src/Rules/PackageData.hs +++ b/src/Rules/PackageData.hs @@ -75,12 +75,10 @@ packageCSources pkg | pkg /= rts = getDirectoryFiles (pkgPath pkg) ["*.c"] | otherwise = do windows <- windowsHost - rtsPath <- rtsBuildPath sources <- fmap (map unifyPath) . getDirectoryFiles (pkgPath pkg) . map (-/- "*.c") $ [ ".", "hooks", "sm", "eventlog", "linker" ] ++ [ if windows then "win32" else "posix" ] - return $ sources ++ [ rtsPath -/- "c/sm/Evac_thr.c" ] - ++ [ rtsPath -/- "c/sm/Scav_thr.c" ] + return sources packageAsmSources :: Package -> Action [FilePath] packageAsmSources pkg diff --git a/src/Settings/Builders/RunTest.hs b/src/Settings/Builders/RunTest.hs index 1f70a03..3094e8d 100644 --- a/src/Settings/Builders/RunTest.hs +++ b/src/Settings/Builders/RunTest.hs @@ -1,12 +1,10 @@ module Settings.Builders.RunTest (runTestBuilderArgs) where import Hadrian.Utilities -import Hadrian.Haskell.Cabal import Flavour import Rules.Test import Settings.Builders.Common -import Settings.Builders.Ghc import CommandLine ( TestArgs(..), defaultTestArgs ) -- Arguments to send to the runtest.py script. diff --git a/src/Settings/Packages/Rts.hs b/src/Settings/Packages/Rts.hs index 7b3bb2d..fcbd795 100644 --- a/src/Settings/Packages/Rts.hs +++ b/src/Settings/Packages/Rts.hs @@ -59,11 +59,13 @@ rtsLibffiLibrary way = do -- This apparently doesn't work on OS X (Darwin) nor on Solaris. -- On Darwin we get errors of the form -- --- ld: absolute addressing (perhaps -mdynamic-no-pic) used in _stg_ap_0_fast from rts/dist/build/Apply.dyn_o not allowed in slidable image +-- ld: absolute addressing (perhaps -mdynamic-no-pic) used in _stg_ap_0_fast +-- from rts/dist/build/Apply.dyn_o not allowed in slidable image -- -- and lots of these warnings: -- --- ld: warning codegen in _stg_ap_pppv_fast (offset 0x0000005E) prevents image from loading in dyld shared cache +-- ld: warning codegen in _stg_ap_pppv_fast (offset 0x0000005E) prevents image +-- from loading in dyld shared cache -- -- On Solaris we get errors like: -- @@ -75,7 +77,7 @@ rtsLibffiLibrary way = do -- collect2: ld returned 1 exit status speedHack :: Action Bool speedHack = do - i386 <- anyTargetArch ["i386"] + i386 <- anyTargetArch ["i386"] goodOS <- not <$> anyTargetOs ["darwin", "solaris2"] return $ i386 && goodOS @@ -171,9 +173,6 @@ rtsPackageArgs = package rts ? do , (not <$> flag GccIsClang) ? inputs ["//Compact.c"] ? arg "-finline-limit=2500" - , inputs ["//Evac_thr.c", "//Scav_thr.c"] ? - pure ["-DPARALLEL_GC", "-Irts/sm"] - , input "//StgCRun.c" ? windowsHost ? arg "-Wno-return-local-addr" , input "//RetainerProfile.c" ? flag GccIsClang ? arg "-Wno-incompatible-pointer-types" @@ -183,8 +182,7 @@ rtsPackageArgs = package rts ? do , inputs [ "//Interpreter.c", "//Storage.c", "//Adjustor.c" ] ? arg "-Wno-strict-prototypes" , inputs ["//Interpreter.c", "//Adjustor.c", "//sm/Storage.c"] ? - anyTargetArch ["powerpc"] ? arg "-Wno-undef" - ] + anyTargetArch ["powerpc"] ? arg "-Wno-undef" ] mconcat [ builder (Cc FindCDependencies) ? cArgs From git at git.haskell.org Tue Oct 23 20:13:10 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:13:10 +0000 (UTC) Subject: [commit: ghc] master: Fix Hadrian after Cabal changes (#498) (fd51234) Message-ID: <20181023201310.0DB0B3ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/fd51234fd35a5aa367be63f89bc27e96e2190978/ghc >--------------------------------------------------------------- commit fd51234fd35a5aa367be63f89bc27e96e2190978 Author: Andrey Mokhov Date: Wed Feb 7 02:50:26 2018 +0000 Fix Hadrian after Cabal changes (#498) * Fix Hadrian after Cabal changes * Bump Cabal's lower bound >--------------------------------------------------------------- fd51234fd35a5aa367be63f89bc27e96e2190978 hadrian.cabal | 2 +- src/Hadrian/Haskell/Cabal/Parse.hs | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/hadrian.cabal b/hadrian.cabal index efc1251..0405601 100644 --- a/hadrian.cabal +++ b/hadrian.cabal @@ -118,7 +118,7 @@ executable hadrian other-extensions: MultiParamTypeClasses , TypeFamilies build-depends: base >= 4.8 && < 5 - , Cabal >= 2.0.0.2 && < 2.2 + , Cabal >= 2.1.0.0 && < 2.2 , containers == 0.5.* , directory >= 1.2 && < 1.4 , extra >= 1.4.7 diff --git a/src/Hadrian/Haskell/Cabal/Parse.hs b/src/Hadrian/Haskell/Cabal/Parse.hs index 578eeac..f097b62 100644 --- a/src/Hadrian/Haskell/Cabal/Parse.hs +++ b/src/Hadrian/Haskell/Cabal/Parse.hs @@ -13,12 +13,12 @@ module Hadrian.Haskell.Cabal.Parse (Cabal (..), parseCabal) where import Data.List.Extra import Development.Shake import Development.Shake.Classes -import qualified Distribution.Package as C -import qualified Distribution.PackageDescription as C -import qualified Distribution.PackageDescription.Parse as C -import qualified Distribution.Text as C -import qualified Distribution.Types.CondTree as C -import qualified Distribution.Verbosity as C +import qualified Distribution.Package as C +import qualified Distribution.PackageDescription as C +import qualified Distribution.PackageDescription.Parsec as C +import qualified Distribution.Text as C +import qualified Distribution.Types.CondTree as C +import qualified Distribution.Verbosity as C import Hadrian.Package From git at git.haskell.org Tue Oct 23 20:13:13 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:13:13 +0000 (UTC) Subject: [commit: ghc] master: Add support for runtime dependencies (c01865f) Message-ID: <20181023201313.EA99D3ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/c01865f4a844af0d11d95d3d2697c2de026a51b7/ghc >--------------------------------------------------------------- commit c01865f4a844af0d11d95d3d2697c2de026a51b7 Author: Andrey Mokhov Date: Fri Feb 9 01:32:55 2018 +0000 Add support for runtime dependencies >--------------------------------------------------------------- c01865f4a844af0d11d95d3d2697c2de026a51b7 src/Base.hs | 24 +++++++++++++++++++----- src/Builder.hs | 36 +++++++++++++++++++++++++++--------- src/GHC.hs | 20 +------------------- src/Hadrian/Builder.hs | 22 ++++++++++++++-------- src/Rules/Documentation.hs | 8 +------- src/Rules/Install.hs | 15 ++++++++++++++- src/Rules/Test.hs | 5 ++--- src/Settings/Builders/Ghc.hs | 13 +------------ 8 files changed, 79 insertions(+), 64 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc c01865f4a844af0d11d95d3d2697c2de026a51b7 From git at git.haskell.org Tue Oct 23 20:13:18 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:13:18 +0000 (UTC) Subject: [commit: ghc] master: Minor revision (63b9d5f) Message-ID: <20181023201318.2302E3ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/63b9d5f0676f5accad2032b1853722dde51d5ee6/ghc >--------------------------------------------------------------- commit 63b9d5f0676f5accad2032b1853722dde51d5ee6 Author: Andrey Mokhov Date: Fri Feb 9 02:23:44 2018 +0000 Minor revision >--------------------------------------------------------------- 63b9d5f0676f5accad2032b1853722dde51d5ee6 src/Base.hs | 32 ++++++++++++++++---------------- src/Rules/Test.hs | 4 +--- src/Settings/Builders/Hsc2Hs.hs | 1 - src/Settings/Builders/RunTest.hs | 12 ++++++------ 4 files changed, 23 insertions(+), 26 deletions(-) diff --git a/src/Base.hs b/src/Base.hs index 6bfa460..c3cb353 100644 --- a/src/Base.hs +++ b/src/Base.hs @@ -70,6 +70,18 @@ configH = "mk/config.h" shakeFilesDir :: FilePath shakeFilesDir = "hadrian" +-- | Directory for binaries that are built "in place". +inplaceBinPath :: FilePath +inplaceBinPath = "inplace/bin" + +-- | Directory for libraries that are built "in place". +inplaceLibPath :: FilePath +inplaceLibPath = "inplace/lib" + +-- | Directory for binary wrappers, and auxiliary binaries such as @touchy at . +inplaceLibBinPath :: FilePath +inplaceLibBinPath = inplaceLibPath -/- "bin" + -- | The directory in 'buildRoot' containing generated source files that are not -- package-specific, e.g. @ghcplatform.h at . generatedDir :: FilePath @@ -81,7 +93,7 @@ stage0PackageDbDir = "stage0/bootstrapping.conf" -- | Path to the inplace package database used in 'Stage1' and later. inplacePackageDbPath :: FilePath -inplacePackageDbPath = "inplace/lib/package.conf.d" +inplacePackageDbPath = inplaceLibPath -/- "package.conf.d" -- | Path to the package database used in a given 'Stage'. packageDbPath :: Stage -> Action FilePath @@ -92,21 +104,8 @@ packageDbPath _ = return inplacePackageDbPath packageDbStamp :: FilePath packageDbStamp = ".stamp" --- | Directory for binaries that are built "in place". -inplaceBinPath :: FilePath -inplaceBinPath = "inplace/bin" - --- | Directory for libraries that are built "in place". -inplaceLibPath :: FilePath -inplaceLibPath = "inplace/lib" - --- | Directory for binary wrappers, and auxiliary binaries such as @touchy at . -inplaceLibBinPath :: FilePath -inplaceLibBinPath = inplaceLibPath -/- "bin" - --- ref: ghc/ghc.mk:142 --- ref: driver/ghc.mk --- ref: utils/hsc2hs/ghc.mk:35 +-- ref: GHC_DEPENDENCIES in ghc/ghc.mk +-- ref: INSTALL_LIBS in driver/ghc.mk -- TODO: Derive this from Builder.runtimeDependencies -- | Files that need to be copied over to 'inplaceLibPath'. inplaceLibCopyTargets :: [FilePath] @@ -125,6 +124,7 @@ inplaceLibCopyTargets = map (inplaceLibPath -/-) haddockHtmlResourcesStamp :: FilePath haddockHtmlResourcesStamp = inplaceLibPath -/- "html/README.md" +-- ref: utils/hsc2hs/ghc.mk -- | Path to 'hsc2hs' template. templateHscPath :: FilePath templateHscPath = inplaceLibPath -/- "template-hsc.h" diff --git a/src/Rules/Test.hs b/src/Rules/Test.hs index 0fedd70..1205051 100644 --- a/src/Rules/Test.hs +++ b/src/Rules/Test.hs @@ -35,11 +35,9 @@ testRules = do "validate" ~> do needBuilder $ Ghc CompileHs Stage2 needBuilder $ GhcPkg Update Stage1 + needBuilder Hp2Ps needBuilder Hpc needBuilder Hsc2Hs - -- TODO: Eliminate explicit filepaths. - -- See https://github.com/snowleopard/hadrian/issues/376. - need ["inplace/bin/hp2ps"] build $ target (vanillaContext Stage2 compiler) (Make "testsuite/tests") [] [] "test" ~> do diff --git a/src/Settings/Builders/Hsc2Hs.hs b/src/Settings/Builders/Hsc2Hs.hs index 6185f6b..80e80db 100644 --- a/src/Settings/Builders/Hsc2Hs.hs +++ b/src/Settings/Builders/Hsc2Hs.hs @@ -28,7 +28,6 @@ hsc2hsBuilderArgs = builder Hsc2Hs ? do , notStage0 ? arg ("--cflag=-D" ++ tOs ++ "_HOST_OS=1" ) , arg $ "--cflag=-D__GLASGOW_HASKELL__=" ++ version , arg $ "--template=" ++ top -/- templateHscPath - , arg $ "-I" ++ top -/- "inplace/lib/include/" , arg =<< getInput , arg "-o", arg =<< getOutput ] diff --git a/src/Settings/Builders/RunTest.hs b/src/Settings/Builders/RunTest.hs index 3094e8d..c348bf1 100644 --- a/src/Settings/Builders/RunTest.hs +++ b/src/Settings/Builders/RunTest.hs @@ -2,10 +2,10 @@ module Settings.Builders.RunTest (runTestBuilderArgs) where import Hadrian.Utilities +import CommandLine (TestArgs(..), defaultTestArgs) import Flavour import Rules.Test import Settings.Builders.Common -import CommandLine ( TestArgs(..), defaultTestArgs ) -- Arguments to send to the runtest.py script. runTestBuilderArgs :: Args @@ -29,11 +29,11 @@ runTestBuilderArgs = builder RunTest ? do verbose <- shakeVerbosity <$> expr getShakeOptions top <- expr topDirectory - compiler <- expr $ builderPath $ Ghc CompileHs Stage2 - ghcPkg <- expr $ builderPath $ GhcPkg Update Stage1 - haddock <- expr $ builderPath $ Haddock BuildPackage - hp2ps <- expr $ builderPath $ Hp2Ps - hpc <- expr $ builderPath $ Hpc + compiler <- getBuilderPath $ Ghc CompileHs Stage2 + ghcPkg <- getBuilderPath $ GhcPkg Update Stage1 + haddock <- getBuilderPath $ Haddock BuildPackage + hp2ps <- getBuilderPath $ Hp2Ps + hpc <- getBuilderPath $ Hpc ghcFlags <- expr runTestGhcFlags timeoutProg <- expr buildRoot <&> (-/- timeoutProgPath) From git at git.haskell.org Tue Oct 23 20:13:22 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:13:22 +0000 (UTC) Subject: [commit: ghc] master: Add unlit to GHC's runtime dependencies (81f180a) Message-ID: <20181023201322.264CB3ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/81f180a0e3d485b388171c7b29946f7690177b3a/ghc >--------------------------------------------------------------- commit 81f180a0e3d485b388171c7b29946f7690177b3a Author: Andrey Mokhov Date: Fri Feb 9 02:30:00 2018 +0000 Add unlit to GHC's runtime dependencies >--------------------------------------------------------------- 81f180a0e3d485b388171c7b29946f7690177b3a src/Builder.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Builder.hs b/src/Builder.hs index ae967ab..67e1634 100644 --- a/src/Builder.hs +++ b/src/Builder.hs @@ -145,12 +145,14 @@ instance H.Builder Builder where Ghc _ _ -> do win <- windowsHost touchyPath <- programPath (vanillaContext Stage0 touchy) - return $ [ inplaceLibPath -/- "ghc-usage.txt" + unlitPath <- builderPath Unlit + return $ [ ghcSplitPath -- TODO: Make conditional on --split-objects + , inplaceLibPath -/- "ghc-usage.txt" , inplaceLibPath -/- "ghci-usage.txt" , inplaceLibPath -/- "llvm-targets" , inplaceLibPath -/- "platformConstants" , inplaceLibPath -/- "settings" - , ghcSplitPath ] -- TODO: Make conditional on --split-objects + , unlitPath ] ++ [ touchyPath | win ] Haddock _ -> return [haddockHtmlResourcesStamp] From git at git.haskell.org Tue Oct 23 20:13:26 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:13:26 +0000 (UTC) Subject: [commit: ghc] master: Merge pull request #500 from snowleopard/runtime-deps (8ffd5bd) Message-ID: <20181023201326.110243ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/8ffd5bd970646998967306a708ac6c7ea0f0dc4a/ghc >--------------------------------------------------------------- commit 8ffd5bd970646998967306a708ac6c7ea0f0dc4a Merge: fd51234 81f180a Author: Andrey Mokhov Date: Fri Feb 9 11:22:05 2018 +0000 Merge pull request #500 from snowleopard/runtime-deps Add support for runtime dependencies >--------------------------------------------------------------- 8ffd5bd970646998967306a708ac6c7ea0f0dc4a src/Base.hs | 54 +++++++++++++++++++++++++--------------- src/Builder.hs | 38 +++++++++++++++++++++------- src/GHC.hs | 20 +-------------- src/Hadrian/Builder.hs | 22 ++++++++++------ src/Rules/Documentation.hs | 8 +----- src/Rules/Install.hs | 15 ++++++++++- src/Rules/Test.hs | 7 ++---- src/Settings/Builders/Ghc.hs | 13 +--------- src/Settings/Builders/Hsc2Hs.hs | 1 - src/Settings/Builders/RunTest.hs | 12 ++++----- 10 files changed, 102 insertions(+), 88 deletions(-) From git at git.haskell.org Tue Oct 23 20:13:29 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:13:29 +0000 (UTC) Subject: [commit: ghc] master: Relax Cabal constraint (5029444) Message-ID: <20181023201329.D690F3ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/502944442d00a4dd592a28bcf72b7681f6ad6bde/ghc >--------------------------------------------------------------- commit 502944442d00a4dd592a28bcf72b7681f6ad6bde Author: Moritz Angermann Date: Thu Feb 15 18:29:19 2018 +0800 Relax Cabal constraint As the Cabal 2.2 release branch has been cut, we need to relax the constraint on Cabal in hadrian. >--------------------------------------------------------------- 502944442d00a4dd592a28bcf72b7681f6ad6bde hadrian.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hadrian.cabal b/hadrian.cabal index 0405601..3eeaf71 100644 --- a/hadrian.cabal +++ b/hadrian.cabal @@ -118,7 +118,7 @@ executable hadrian other-extensions: MultiParamTypeClasses , TypeFamilies build-depends: base >= 4.8 && < 5 - , Cabal >= 2.1.0.0 && < 2.2 + , Cabal >= 2.1.0.0 && < 2.3 , containers == 0.5.* , directory >= 1.2 && < 1.4 , extra >= 1.4.7 From git at git.haskell.org Tue Oct 23 20:13:33 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:13:33 +0000 (UTC) Subject: [commit: ghc] master: Merge pull request #503 from snowleopard/angerman-patch-1 (7805b98) Message-ID: <20181023201333.F28223ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/7805b98a95710e4a5b0b7d4fd528825cd903998c/ghc >--------------------------------------------------------------- commit 7805b98a95710e4a5b0b7d4fd528825cd903998c Merge: 8ffd5bd 5029444 Author: Andrey Mokhov Date: Thu Feb 15 11:48:57 2018 +0000 Merge pull request #503 from snowleopard/angerman-patch-1 Relax Cabal constraint >--------------------------------------------------------------- 7805b98a95710e4a5b0b7d4fd528825cd903998c hadrian.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) From git at git.haskell.org Tue Oct 23 20:13:38 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:13:38 +0000 (UTC) Subject: [commit: ghc] master: Add iserv library (#504) (386cd49) Message-ID: <20181023201338.1A3313ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/386cd490356daabea2d9fd4bd09c929517d7acb4/ghc >--------------------------------------------------------------- commit 386cd490356daabea2d9fd4bd09c929517d7acb4 Author: Andrey Mokhov Date: Sat Feb 17 00:18:01 2018 +0000 Add iserv library (#504) See https://phabricator.haskell.org/D4377 >--------------------------------------------------------------- 386cd490356daabea2d9fd4bd09c929517d7acb4 src/GHC.hs | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/GHC.hs b/src/GHC.hs index 771d37e..e14cdb6 100644 --- a/src/GHC.hs +++ b/src/GHC.hs @@ -5,9 +5,9 @@ module GHC ( deepseq, deriveConstants, directory, filepath, genapply, genprimopcode, ghc, ghcBoot, ghcBootTh, ghcCabal, ghcCompact, ghci, ghcPkg, ghcPrim, ghcTags, ghcSplit, haddock, haskeline, hsc2hs, hp2ps, hpc, hpcBin, integerGmp, - integerSimple, iservBin, libffi, mtl, parsec, parallel, pretty, primitive, - process, rts, runGhc, stm, templateHaskell, terminfo, text, time, touchy, - transformers, unlit, unix, win32, xhtml, ghcPackages, isGhcPackage, + integerSimple, iservBin, iservLib, libffi, mtl, parsec, parallel, pretty, + primitive, process, rts, runGhc, stm, templateHaskell, terminfo, text, time, + touchy, transformers, unlit, unix, win32, xhtml, ghcPackages, isGhcPackage, defaultPackages, -- * Package information @@ -34,9 +34,9 @@ ghcPackages = , deepseq, deriveConstants, directory, filepath, genapply, genprimopcode , ghc, ghcBoot, ghcBootTh, ghcCabal, ghcCompact, ghci, ghcPkg, ghcPrim , ghcTags, haddock, haskeline, hsc2hs, hp2ps, hpc, hpcBin, integerGmp - , integerSimple, iservBin, libffi, mtl, parsec, parallel, pretty, primitive - , process, rts, runGhc, stm, templateHaskell, terminfo, text, time, touchy - , transformers, unlit, unix, win32, xhtml ] + , integerSimple, iservBin, iservLib, libffi, mtl, parsec, parallel, pretty + , primitive, process, rts, runGhc, stm, templateHaskell, terminfo, text + , time, touchy, transformers, unlit, unix, win32, xhtml ] -- TODO: Optimise by switching to sets of packages. isGhcPackage :: Package -> Bool @@ -75,7 +75,8 @@ hpc = hsLib "hpc" hpcBin = hsUtil "hpc-bin" `setPath` "utils/hpc" integerGmp = hsLib "integer-gmp" integerSimple = hsLib "integer-simple" -iservBin = hsPrg "iserv-bin" `setPath` "iserv" +iservBin = hsUtil "iserv" +iservLib = hsLib "libiserv" libffi = cTop "libffi" mtl = hsLib "mtl" parsec = hsLib "parsec" @@ -159,9 +160,9 @@ stage0Packages = do , templateHaskell , text , transformers - , unlit ] + , unlit ] ++ [ terminfo | not win, not ios, not cross ] - ++ [ touchy | win ] + ++ [ touchy | win ] stage1Packages :: Action [Package] stage1Packages = do @@ -192,6 +193,7 @@ stage1Packages = do , time , xhtml ] ++ [ iservBin | not win ] + ++ [ iservLib | not win ] ++ [ unix | not win ] ++ [ win32 | win ] From git at git.haskell.org Tue Oct 23 20:13:42 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:13:42 +0000 (UTC) Subject: [commit: ghc] master: Add --quickjump to Haddock (#505) (2e0e8ae) Message-ID: <20181023201342.20CC03ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/2e0e8aeb27ac9ac7a1746350c2ef782d29bf7c89/ghc >--------------------------------------------------------------- commit 2e0e8aeb27ac9ac7a1746350c2ef782d29bf7c89 Author: Andrey Mokhov Date: Sun Feb 18 20:17:11 2018 +0000 Add --quickjump to Haddock (#505) Also reorder other flags as in the Make build system See https://phabricator.haskell.org/D4365 >--------------------------------------------------------------- 2e0e8aeb27ac9ac7a1746350c2ef782d29bf7c89 src/Settings/Builders/Haddock.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Settings/Builders/Haddock.hs b/src/Settings/Builders/Haddock.hs index b381047..ed29012 100644 --- a/src/Settings/Builders/Haddock.hs +++ b/src/Settings/Builders/Haddock.hs @@ -39,13 +39,14 @@ haddockBuilderArgs = withHsPackage $ \cabalFile -> mconcat hVersion <- expr $ pkgVersion (unsafePkgCabalFile haddock) -- TODO: improve ghcOpts <- haddockGhcArgs mconcat - [ arg $ "--odir=" ++ takeDirectory output - , arg "--verbosity=0" + [ arg "--verbosity=0" + , arg $ "--odir=" ++ takeDirectory output , arg "--no-tmp-comp-dir" , arg $ "--dump-interface=" ++ output , arg "--html" , arg "--hyperlinked-source" , arg "--hoogle" + , arg "--quickjump" , arg $ "--title=" ++ pkgName pkg ++ "-" ++ version ++ ": " ++ synopsis , arg $ "--prologue=" ++ path -/- "haddock-prologue.txt" From git at git.haskell.org Tue Oct 23 20:13:46 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:13:46 +0000 (UTC) Subject: [commit: ghc] master: Move a bunch of types into dedicated modules (#502) (cc8f62c) Message-ID: <20181023201346.238A43ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/cc8f62c0f6438bc342d9f49bf38629591c793ff1/ghc >--------------------------------------------------------------- commit cc8f62c0f6438bc342d9f49bf38629591c793ff1 Author: Alp Mestanogullari Date: Mon Feb 19 21:23:10 2018 +0100 Move a bunch of types into dedicated modules (#502) * move a bunch of types into dedicated modules * address review feedback * do away with Hadrian.Builder.Mode for now >--------------------------------------------------------------- cc8f62c0f6438bc342d9f49bf38629591c793ff1 hadrian.cabal | 5 +++ src/Context.hs | 14 +------ src/Context/Type.hs | 20 +++++++++ src/Expression.hs | 18 ++------ src/Expression/Type.hs | 17 ++++++++ src/Hadrian/Builder/Tar.hs | 1 + src/Hadrian/Haskell/Cabal/Parse.hs | 22 +--------- src/Hadrian/Haskell/Cabal/Type.hs | 23 +++++++++++ src/Hadrian/Package.hs | 44 +------------------- src/Hadrian/Package/Type.hs | 45 ++++++++++++++++++++ src/Way.hs | 83 +------------------------------------ src/Way/Type.hs | 84 ++++++++++++++++++++++++++++++++++++++ 12 files changed, 202 insertions(+), 174 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc cc8f62c0f6438bc342d9f49bf38629591c793ff1 From git at git.haskell.org Tue Oct 23 20:13:50 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:13:50 +0000 (UTC) Subject: [commit: ghc] master: Fix ghc-cabal: Parsec modules are now found in libraries/parsec/src (#506) (7fa577c) Message-ID: <20181023201350.48B953ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/7fa577c2322e0efc147a007a4edcf5849802e8b2/ghc >--------------------------------------------------------------- commit 7fa577c2322e0efc147a007a4edcf5849802e8b2 Author: Ben Gamari Date: Tue Feb 20 09:05:55 2018 -0500 Fix ghc-cabal: Parsec modules are now found in libraries/parsec/src (#506) This has been the case since haskell/parsec at 89d4541. >--------------------------------------------------------------- 7fa577c2322e0efc147a007a4edcf5849802e8b2 src/Settings/Packages/GhcCabal.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Settings/Packages/GhcCabal.hs b/src/Settings/Packages/GhcCabal.hs index c88617b..70f2449 100644 --- a/src/Settings/Packages/GhcCabal.hs +++ b/src/Settings/Packages/GhcCabal.hs @@ -28,5 +28,5 @@ ghcCabalPackageArgs = stage0 ? package ghcCabal ? builder Ghc ? do , arg "-ilibraries/mtl" , arg "-ilibraries/text" , arg "-Ilibraries/text/include" - , arg "-ilibraries/parsec" ] + , arg "-ilibraries/parsec/src" ] From git at git.haskell.org Tue Oct 23 20:13:54 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:13:54 +0000 (UTC) Subject: [commit: ghc] master: Undo iserv changes (#507) (5edcca7) Message-ID: <20181023201354.92A033ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/5edcca746578c798bed34c3bf84ede39fc91c265/ghc >--------------------------------------------------------------- commit 5edcca746578c798bed34c3bf84ede39fc91c265 Author: Andrey Mokhov Date: Tue Feb 20 21:05:09 2018 +0000 Undo iserv changes (#507) * Undo iserv changes See #504 and https://phabricator.haskell.org/D4377 * Update comments >--------------------------------------------------------------- 5edcca746578c798bed34c3bf84ede39fc91c265 src/GHC.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/GHC.hs b/src/GHC.hs index e14cdb6..2a87d68 100644 --- a/src/GHC.hs +++ b/src/GHC.hs @@ -75,7 +75,8 @@ hpc = hsLib "hpc" hpcBin = hsUtil "hpc-bin" `setPath` "utils/hpc" integerGmp = hsLib "integer-gmp" integerSimple = hsLib "integer-simple" -iservBin = hsUtil "iserv" +-- iservBin = hsUtil "iserv" -- FIXME: See #507 +iservBin = hsPrg "iserv-bin" `setPath` "iserv" iservLib = hsLib "libiserv" libffi = cTop "libffi" mtl = hsLib "mtl" @@ -193,7 +194,7 @@ stage1Packages = do , time , xhtml ] ++ [ iservBin | not win ] - ++ [ iservLib | not win ] + -- ++ [ iservLib | not win ] -- FIXME: See #507 ++ [ unix | not win ] ++ [ win32 | win ] From git at git.haskell.org Tue Oct 23 20:13:58 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:13:58 +0000 (UTC) Subject: [commit: ghc] master: Add --configure flag to the script (b6d83c4) Message-ID: <20181023201358.8A39F3ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/b6d83c4b12abfaa416f62e95bd8f3d610e4adeac/ghc >--------------------------------------------------------------- commit b6d83c4b12abfaa416f62e95bd8f3d610e4adeac Author: Andrey Mokhov Date: Thu Feb 22 18:55:36 2018 +0000 Add --configure flag to the script See #508 >--------------------------------------------------------------- b6d83c4b12abfaa416f62e95bd8f3d610e4adeac doc/windows.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/windows.md b/doc/windows.md index b374074..0ad2086 100644 --- a/doc/windows.md +++ b/doc/windows.md @@ -22,7 +22,8 @@ stack exec -- pacman -S autoconf automake-wrapper make patch python tar --noconf stack build # Build GHC -stack exec hadrian -- --directory ".." -j --flavour=quickest +# Note that the --configure flag is required only for the first build +stack exec hadrian -- --directory ".." -j --flavour=quickest --configure # Test GHC cd .. From git at git.haskell.org Tue Oct 23 20:14:03 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:14:03 +0000 (UTC) Subject: [commit: ghc] master: Make shell.nix less broken (#510) (da39729) Message-ID: <20181023201403.343873ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/da397291a9052387862c27c87ec29b6fce2c7d77/ghc >--------------------------------------------------------------- commit da397291a9052387862c27c87ec29b6fce2c7d77 Author: Sebastian Graf Date: Fri Feb 23 16:50:23 2018 +0100 Make shell.nix less broken (#510) * shell.nix: Use ghc822 (ghc821 is no longer available) * shell.nix: It's nativeBuildInputs now * shell.nix: ./validate needs sphinx to be available >--------------------------------------------------------------- da397291a9052387862c27c87ec29b6fce2c7d77 shell.nix | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/shell.nix b/shell.nix index f15f72b..d8767cd 100644 --- a/shell.nix +++ b/shell.nix @@ -5,7 +5,7 @@ { nixpkgs ? import {} }: let - haskellPackages = nixpkgs.haskell.packages.ghc821; + haskellPackages = nixpkgs.haskell.packages.ghc822; removeBuild = path: type: let baseName = baseNameOf (toString path); @@ -23,7 +23,7 @@ let filterSrc = path: builtins.filterSource removeBuild path; - hadrianPackages = nixpkgs.haskell.packages.ghc821.override { + hadrianPackages = nixpkgs.haskell.packages.ghc822.override { overrides = self: super: let localPackage = name: path: self.callCabal2nix name (filterSrc path) {}; in { @@ -43,9 +43,10 @@ in nixpkgs.lib.overrideDerivation nixpkgs.haskell.packages.ghcHEAD.ghc (drv: { name = "ghc-dev"; - buildInputs = drv.buildInputs ++ [ - hadrianPackages.hadrian - nixpkgs.arcanist - ]; + nativeBuildInputs = drv.nativeBuildInputs ++ + [ hadrianPackages.hadrian + nixpkgs.arcanist + nixpkgs.python3Packages.sphinx + ]; }) From git at git.haskell.org Tue Oct 23 20:14:07 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:14:07 +0000 (UTC) Subject: [commit: ghc] master: Add troubleshooting section (c1706f6) Message-ID: <20181023201407.50DC73ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/c1706f68bc18b7465ee1bf30ba9ae30d633ca36b/ghc >--------------------------------------------------------------- commit c1706f68bc18b7465ee1bf30ba9ae30d633ca36b Author: Andrey Mokhov Date: Tue Feb 27 12:44:21 2018 +0000 Add troubleshooting section See #308 >--------------------------------------------------------------- c1706f68bc18b7465ee1bf30ba9ae30d633ca36b README.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/README.md b/README.md index 23e8586..bdd8ed8 100644 --- a/README.md +++ b/README.md @@ -143,6 +143,28 @@ replace the `validate` script (see [#187][validation-issue]). * `build selftest` runs tests of the build system. Current test coverage is close to zero (see [#197][test-issue]). +Troubleshooting +--------------- + +Here are a few simple suggestions that might help you fix the build: + +* The Hadrian submodule in GHC is occasionally behind the master branch of this repository, + which contains most recent bug fixes. To switch to the most recent version of Hadrian, + run `git pull https://github.com/snowleopard/hadrian.git`. Beware: the most recent version + contains the most recent bugs too! If this works, please raise an issue and we will try to + push the changes to the GHC submodule as soon as possible. + +* Hadrian is occasionally broken by changes in GHC. If this happens, you might want to switch + to an earlier GHC commit. + +* If Hadrian fails with the message `Configuration file hadrian/cfg/system.config is missing`, + you have probably forgotten to pass the `--configure` flag during the first build. + +* If you need help in debugging Hadrian, read the [wiki](https://github.com/snowleopard/hadrian/wiki) + and Shake's [debugging tutorial](https://shakebuild.com/debugging). + +If everything fails, don't hesitate to [raise an issue](https://github.com/snowleopard/hadrian/issues/new). + Current limitations ------------------- The new build system still lacks many important features: From git at git.haskell.org Tue Oct 23 20:14:11 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:14:11 +0000 (UTC) Subject: [commit: ghc] master: Pin nixpkgs and all-cabal-hashes in shell.nix (#511) (37bd95f) Message-ID: <20181023201411.373563ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/37bd95fee83b50c2567914a6e6c2a4cc73803f30/ghc >--------------------------------------------------------------- commit 37bd95fee83b50c2567914a6e6c2a4cc73803f30 Author: Matthew Pickering Date: Wed Feb 28 18:09:34 2018 +0000 Pin nixpkgs and all-cabal-hashes in shell.nix (#511) * Pin shell.nix Also adds a new option to build `cabal-install` HEAD which is sometimes useful. * Bump QuickCheck bound * Remove cabal-install which snuck in >--------------------------------------------------------------- 37bd95fee83b50c2567914a6e6c2a4cc73803f30 hadrian.cabal | 2 +- shell.nix | 38 ++++++++++++++++++++++++++++++++++++-- 2 files changed, 37 insertions(+), 3 deletions(-) diff --git a/hadrian.cabal b/hadrian.cabal index fef9bd9..84aecef 100644 --- a/hadrian.cabal +++ b/hadrian.cabal @@ -128,7 +128,7 @@ executable hadrian , directory >= 1.2 && < 1.4 , extra >= 1.4.7 , mtl == 2.2.* - , QuickCheck >= 2.6 && < 2.10 + , QuickCheck >= 2.6 && < 2.11 , shake == 0.16.* , transformers >= 0.4 && < 0.6 , unordered-containers >= 0.2.1 && < 0.3 diff --git a/shell.nix b/shell.nix index d8767cd..1b17905 100644 --- a/shell.nix +++ b/shell.nix @@ -2,9 +2,26 @@ # by only invoking hadrian. -{ nixpkgs ? import {} }: +{ _nixpkgs ? import {} }: let + + nixpkgs = import (_nixpkgs.fetchFromGitHub { + owner = "NixOS"; + repo = "nixpkgs"; + rev = "e7a327da5cffdf5e77e1924906a4f0983591bd3e"; + sha256 = "1xzil4mayhggg2miwspbk12nihlszg0y4n6i4qacrxql5n75f0hr"; + }){ overlays = [cabalHashes]; }; + + + + cabalHashes = sel: super: { + all-cabal-hashes = super.fetchurl { + url = "https://github.com/commercialhaskell/all-cabal-hashes/archive/b2b93ae610f5f1b51d22b191f972dc3dec8f94c6.tar.gz"; + sha256 = "0bffclpqbw62xff36qlzxghr042mhv0m06k5ml4298w6fv7ly1xw"; + }; + }; + haskellPackages = nixpkgs.haskell.packages.ghc822; removeBuild = path: type: @@ -28,7 +45,10 @@ let localPackage = name: path: self.callCabal2nix name (filterSrc path) {}; in { hadrian = localPackage "hadrian" ./. ; - shake = self.callHackage "shake" "0.16" {}; + happy = nixpkgs.haskell.lib.dontCheck (super.happy); + shake = self.callHackage "shake" "0.16.2" {}; + extra = self.callHackage "extra" "1.6.4" {}; + QuickCheck = self.callHackage "QuickCheck" "2.10" {}; Cabal = localPackage "Cabal" ./../libraries/Cabal/Cabal ; filepath = localPackage "filepath" ./../libraries/filepath ; text = localPackage "text" ./../libraries/text ; @@ -39,6 +59,15 @@ let directory = localPackage "directory" ./../libraries/directory ; }; }; + cabalPackages = nixpkgs.haskell.packages.ghc822.override { + overrides = self: super: let + localPackage = name: path: self.callCabal2nix name (filterSrc path) {}; + in { + Cabal = localPackage "Cabal" ./../../cabal/Cabal ; + cabal-install = self.callPackage ./../../cabal/cabal-install.nix {}; + }; }; + + in nixpkgs.lib.overrideDerivation nixpkgs.haskell.packages.ghcHEAD.ghc (drv: { @@ -47,6 +76,11 @@ in [ hadrianPackages.hadrian nixpkgs.arcanist nixpkgs.python3Packages.sphinx + nixpkgs.texlive.combined.scheme-basic + (nixpkgs.haskell.packages.ghc822.ghcWithPackages + (ps: [ps.html ps.regex-compat ps.dump-core])) + + #cabalPackages.cabal-install ]; }) From git at git.haskell.org Tue Oct 23 20:14:15 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:14:15 +0000 (UTC) Subject: [commit: ghc] master: Change permission bits for build.cabal.sh, fixes #517 (#520) (7894c96) Message-ID: <20181023201415.659D53ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/7894c96e4776e4bfb84d499a7d32999cf4e27e65/ghc >--------------------------------------------------------------- commit 7894c96e4776e4bfb84d499a7d32999cf4e27e65 Author: Zhen Zhang Date: Mon Mar 5 09:59:05 2018 +0800 Change permission bits for build.cabal.sh, fixes #517 (#520) >--------------------------------------------------------------- 7894c96e4776e4bfb84d499a7d32999cf4e27e65 build.cabal.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/build.cabal.sh b/build.cabal.sh old mode 100644 new mode 100755 From git at git.haskell.org Tue Oct 23 20:14:19 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:14:19 +0000 (UTC) Subject: [commit: ghc] master: Drop the no longer necessary chmod (764be7e) Message-ID: <20181023201419.941C13ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/764be7eb9fbc387673d322c066996884b9933e08/ghc >--------------------------------------------------------------- commit 764be7eb9fbc387673d322c066996884b9933e08 Author: Andrey Mokhov Date: Mon Mar 5 02:08:14 2018 +0000 Drop the no longer necessary chmod See #517 >--------------------------------------------------------------- 764be7eb9fbc387673d322c066996884b9933e08 build.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/build.sh b/build.sh index ad502b3..13daebe 100755 --- a/build.sh +++ b/build.sh @@ -31,5 +31,4 @@ function rl { root="$(dirname "$(rl "$0")")" # By default on Linux/MacOS we build Hadrian using Cabal -chmod a+x "$root/build.cabal.sh" (. "$root/build.cabal.sh" "$@") From git at git.haskell.org Tue Oct 23 20:14:23 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:14:23 +0000 (UTC) Subject: [commit: ghc] master: Fix Hadrian after Cabal changes (eda173b) Message-ID: <20181023201423.6D84A3ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/eda173b7c0be97a4bd5f81fcf83788ddc874e900/ghc >--------------------------------------------------------------- commit eda173b7c0be97a4bd5f81fcf83788ddc874e900 Author: Andrey Mokhov Date: Mon Mar 5 02:43:47 2018 +0000 Fix Hadrian after Cabal changes >--------------------------------------------------------------- eda173b7c0be97a4bd5f81fcf83788ddc874e900 hadrian.cabal | 2 +- stack.yaml | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/hadrian.cabal b/hadrian.cabal index 84aecef..c81340f 100644 --- a/hadrian.cabal +++ b/hadrian.cabal @@ -123,7 +123,7 @@ executable hadrian other-extensions: MultiParamTypeClasses , TypeFamilies build-depends: base >= 4.8 && < 5 - , Cabal >= 2.1.0.0 && < 2.3 + , Cabal >= 2.2.0.0 && < 2.3 , containers == 0.5.* , directory >= 1.2 && < 1.4 , extra >= 1.4.7 diff --git a/stack.yaml b/stack.yaml index da03763..663389f 100644 --- a/stack.yaml +++ b/stack.yaml @@ -1,12 +1,13 @@ # For more information, see: http://docs.haskellstack.org/en/stable/yaml_configuration.html # Specifies the GHC version and set of packages available (e.g., lts-3.5, nightly-2015-09-21, ghc-7.10.2) -resolver: lts-9.0 +resolver: lts-10.8 # Local packages, usually specified by relative directory name packages: - '.' - '../libraries/Cabal/Cabal' +- '../libraries/text' extra-deps: - shake-0.16 From git at git.haskell.org Tue Oct 23 20:14:27 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:14:27 +0000 (UTC) Subject: [commit: ghc] master: Merge pull request #521 from snowleopard/drop-chmod (9eef6a7) Message-ID: <20181023201427.5CB163ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/9eef6a7c7cce150f39740beb8570f4cbc38b947e/ghc >--------------------------------------------------------------- commit 9eef6a7c7cce150f39740beb8570f4cbc38b947e Merge: 7894c96 eda173b Author: Andrey Mokhov Date: Mon Mar 5 03:17:48 2018 +0000 Merge pull request #521 from snowleopard/drop-chmod Drop the no longer necessary chmod >--------------------------------------------------------------- 9eef6a7c7cce150f39740beb8570f4cbc38b947e build.sh | 1 - hadrian.cabal | 2 +- stack.yaml | 3 ++- 3 files changed, 3 insertions(+), 3 deletions(-) From git at git.haskell.org Tue Oct 23 20:14:31 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:14:31 +0000 (UTC) Subject: [commit: ghc] master: Bump Cabal version (f4d12c0) Message-ID: <20181023201431.5B5DF3ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/f4d12c0f8943818d41b97c295eb26ed7eaf8edfc/ghc >--------------------------------------------------------------- commit f4d12c0f8943818d41b97c295eb26ed7eaf8edfc Author: Andrey Mokhov Date: Tue Mar 13 21:21:03 2018 +0000 Bump Cabal version See #527 >--------------------------------------------------------------- f4d12c0f8943818d41b97c295eb26ed7eaf8edfc hadrian.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hadrian.cabal b/hadrian.cabal index c81340f..6248df3 100644 --- a/hadrian.cabal +++ b/hadrian.cabal @@ -123,7 +123,7 @@ executable hadrian other-extensions: MultiParamTypeClasses , TypeFamilies build-depends: base >= 4.8 && < 5 - , Cabal >= 2.2.0.0 && < 2.3 + , Cabal >= 2.3 && < 2.4 , containers == 0.5.* , directory >= 1.2 && < 1.4 , extra >= 1.4.7 From git at git.haskell.org Tue Oct 23 20:14:35 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:14:35 +0000 (UTC) Subject: [commit: ghc] master: Merge pull request #528 from snowleopard/bump-cabal (3fa914a) Message-ID: <20181023201435.420D63ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/3fa914a648b5e9e5efff380854625284276fd867/ghc >--------------------------------------------------------------- commit 3fa914a648b5e9e5efff380854625284276fd867 Merge: 9eef6a7 f4d12c0 Author: Andrey Mokhov Date: Tue Mar 13 21:36:42 2018 +0000 Merge pull request #528 from snowleopard/bump-cabal Bump Cabal version >--------------------------------------------------------------- 3fa914a648b5e9e5efff380854625284276fd867 hadrian.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) From git at git.haskell.org Tue Oct 23 20:14:39 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:14:39 +0000 (UTC) Subject: [commit: ghc] master: Add extra include paths when invoking ghc-cabal (#526) (7a5ee60) Message-ID: <20181023201439.1B1D23ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/7a5ee60910cc3571d5f4b6f90f9818367ad71f97/ghc >--------------------------------------------------------------- commit 7a5ee60910cc3571d5f4b6f90f9818367ad71f97 Author: Andrey Mokhov Date: Wed Mar 14 19:34:29 2018 +0000 Add extra include paths when invoking ghc-cabal (#526) See #523 >--------------------------------------------------------------- 7a5ee60910cc3571d5f4b6f90f9818367ad71f97 src/Settings/Builders/GhcCabal.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Settings/Builders/GhcCabal.hs b/src/Settings/Builders/GhcCabal.hs index bfb84a7..78b4587 100644 --- a/src/Settings/Builders/GhcCabal.hs +++ b/src/Settings/Builders/GhcCabal.hs @@ -56,13 +56,17 @@ configureArgs :: Args configureArgs = do top <- expr topDirectory root <- getBuildRoot + pkg <- getPackage let conf key expr = do values <- unwords <$> expr not (null values) ? arg ("--configure-option=" ++ key ++ "=" ++ values) cFlags = mconcat [ remove ["-Werror"] cArgs , getStagedSettingList ConfCcArgs - , arg $ "-I" ++ top -/- root -/- generatedDir ] + , arg $ "-I" ++ top -/- root -/- generatedDir + -- See https://github.com/snowleopard/hadrian/issues/523 + , arg $ "-I" ++ top -/- pkgPath pkg + , arg $ "-I" ++ top -/- "includes" ] ldFlags = ldArgs <> (getStagedSettingList ConfGccLinkerArgs) cppFlags = cppArgs <> (getStagedSettingList ConfCppArgs) cldFlags <- unwords <$> (cFlags <> ldFlags) From git at git.haskell.org Tue Oct 23 20:14:42 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:14:42 +0000 (UTC) Subject: [commit: ghc] master: Add 'git' to nativeBuildInputs in shell.nix (#530) (57d0fca) Message-ID: <20181023201442.F2CF13ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/57d0fca0ebbc2907004d7a7ee5c263f536ad64cb/ghc >--------------------------------------------------------------- commit 57d0fca0ebbc2907004d7a7ee5c263f536ad64cb Author: Vladislav Zavialov Date: Mon Mar 19 16:41:26 2018 +0300 Add 'git' to nativeBuildInputs in shell.nix (#530) >--------------------------------------------------------------- 57d0fca0ebbc2907004d7a7ee5c263f536ad64cb shell.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/shell.nix b/shell.nix index 1b17905..f193000 100644 --- a/shell.nix +++ b/shell.nix @@ -75,6 +75,7 @@ in nativeBuildInputs = drv.nativeBuildInputs ++ [ hadrianPackages.hadrian nixpkgs.arcanist + nixpkgs.git nixpkgs.python3Packages.sphinx nixpkgs.texlive.combined.scheme-basic (nixpkgs.haskell.packages.ghc822.ghcWithPackages From git at git.haskell.org Tue Oct 23 20:14:46 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:14:46 +0000 (UTC) Subject: [commit: ghc] master: Add clean routines for fs (#533) (47678ea) Message-ID: <20181023201446.CD5493ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/47678ea67682ce49b37d5b3109a5b42030c09fc3/ghc >--------------------------------------------------------------- commit 47678ea67682ce49b37d5b3109a5b42030c09fc3 Author: Tamar Christina Date: Tue Mar 20 08:51:53 2018 +0000 Add clean routines for fs (#533) >--------------------------------------------------------------- 47678ea67682ce49b37d5b3109a5b42030c09fc3 src/Rules/Clean.hs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/Rules/Clean.hs b/src/Rules/Clean.hs index d11cbf5..7592c60 100644 --- a/src/Rules/Clean.hs +++ b/src/Rules/Clean.hs @@ -18,6 +18,19 @@ cleanSourceTree = do removeDirectory inplaceBinPath removeDirectory inplaceLibPath removeDirectory "sdistprep" + cleanFsUtils + +-- Clean all temporary fs files copied by configure into the source folder +cleanFsUtils :: Action () +cleanFsUtils = do + let dirs = [ "utils/lndir/" + , "utils/unlit/" + , "rts/" + , "libraries/base/include/" + , "libraries/base/cbits/" + ] + liftIO $ forM_ dirs (flip removeFiles ["fs.*"]) + cleanRules :: Rules () cleanRules = "clean" ~> clean From git at git.haskell.org Tue Oct 23 20:14:50 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:14:50 +0000 (UTC) Subject: [commit: ghc] master: Add user-defined flavour example for turning off dynamic linking (#535) (2fcfde2) Message-ID: <20181023201450.9FE563ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/2fcfde2a455b2d0c5f6a0f6003dcc8af669aea80/ghc >--------------------------------------------------------------- commit 2fcfde2a455b2d0c5f6a0f6003dcc8af669aea80 Author: Alp Mestanogullari Date: Thu Mar 22 01:38:11 2018 +0100 Add user-defined flavour example for turning off dynamic linking (#535) See #534 and https://ghc.haskell.org/trac/ghc/ticket/10536 >--------------------------------------------------------------- 2fcfde2a455b2d0c5f6a0f6003dcc8af669aea80 doc/user-settings.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/doc/user-settings.md b/doc/user-settings.md index 1a89dd4..05e4efc 100644 --- a/doc/user-settings.md +++ b/doc/user-settings.md @@ -149,6 +149,16 @@ Note that `rtsWays` is computed from `libraryWays` by default, therefore the abo change will lead to the removal of `threadedProfiling` way from `rtsWays`. To change this behaviour, you can override the default `rtsWays` setting. +Similarly, if we want to completely turn off dynamic linking, +we can define a custom `Flavour` to this effect: +``` haskell +noDynamicFlavour :: Flavour +noDynamicFlavour = defaultFlavour + { name = "no-dynamic" + , libraryWays = remove [dynamic] defaultLibraryWays + } +``` + ## Verbose command lines By default Hadrian does not print full command lines during the build process From git at git.haskell.org Tue Oct 23 20:14:54 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:14:54 +0000 (UTC) Subject: [commit: ghc] master: fix end (fe5759b) Message-ID: <20181023201454.7528D3ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/fe5759b46cb9f04ba78a975c99a6d99b866d448e/ghc >--------------------------------------------------------------- commit fe5759b46cb9f04ba78a975c99a6d99b866d448e Author: Tamar Christina Date: Wed Mar 28 00:53:12 2018 +0100 fix end >--------------------------------------------------------------- fe5759b46cb9f04ba78a975c99a6d99b866d448e src/Settings/Packages/Rts.hs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Settings/Packages/Rts.hs b/src/Settings/Packages/Rts.hs index fcbd795..212bd72 100644 --- a/src/Settings/Packages/Rts.hs +++ b/src/Settings/Packages/Rts.hs @@ -112,6 +112,8 @@ rtsPackageArgs = package rts ? do , arg $ "-I" ++ path , flag UseSystemFfi ? arg ("-I" ++ ffiIncludeDir) , arg $ "-DRtsWay=\"rts_" ++ show way ++ "\"" + -- Set the namespace for the rts fs functions + , arg $ "-DFS_NAMESPACE=rts" -- RTS *must* be compiled with optimisations. The INLINE_HEADER macro -- requires that functions are inlined to work as expected. Inlining -- only happens for optimised builds. Otherwise we can assume that @@ -145,6 +147,14 @@ rtsPackageArgs = package rts ? do , "-DGhcUnregisterised=" ++ show ghcUnreg , "-DGhcEnableTablesNextToCode=" ++ show ghcEnableTNC ] + -- We're after pur performance here. So make sure fast math and + -- vectorization is enabled. + , input "//xxhash.c" ? pure + [ "-O3" + , "-ffast-math" + , "-ftree-vectorize" + ] + , inputs ["//Evac.c", "//Evac_thr.c"] ? arg "-funroll-loops" , speedHack ? From git at git.haskell.org Tue Oct 23 20:14:58 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:14:58 +0000 (UTC) Subject: [commit: ghc] master: Use Cabal directly in place of ghc-cabal + make build root configurable (#531) (3a68f11) Message-ID: <20181023201458.5CB6C3ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/3a68f11c9d6ceebdb09f85804143dd2f1d49a502/ghc >--------------------------------------------------------------- commit 3a68f11c9d6ceebdb09f85804143dd2f1d49a502 Author: Alp Mestanogullari Date: Fri Mar 30 20:31:03 2018 +0200 Use Cabal directly in place of ghc-cabal + make build root configurable (#531) * Use Cabal directly in place of ghc-cabal; make build root configurable. This commit implements two significant changes (that were not easy to separate): - Don't use ghc-cabal anymore for getting information about Haskell packages. We now instead directly use Cabal-the-library. - Make the build root configurable. This effectively gets rid of the inplace logic and allows us to place _all_ build artefacts in some directory of our choice, by passing '--build-root ' to hadrian. The code for this was mostly taken from #445. * fix documentation rules * remove some leftover unrelated, commented-out code * more documentation fixes, address some feedback * cleanup * more cleanup * boot and configure explicitly in travis CI scripts * update cabal/ghc versions in .travis.yml (8.0.x not supported anymore) * temporarily disable dynamic ways in Settings.Default * update appveyor script * travis: when booting with 8.2.2, build a complete stage2 compiler * Fix CI? Try to fix the CI by adding the `debug` rts way back in. * Update Quickest.hs Replicate the make build systems build flavours. * Update .travis.yml - Run selftest, and build in separate instances. - try with python2 - and unify mac to stage2 * Update .travis.yml upgrade python on mac * [travis] os x: test the freshly built ghc * Get rid of two unused GhcCabalMode constructors * fix ghc-split rule, get rid of Install/Wrappers rules * address more feedback * ConfiguredCabal -> PackageData, more comments, more feedback addressed * make the complete stage 2 build the default * use a dummy package instead of base in Rules.hs * update CI scripts * attempt at fixing hadrian's -c option * .travis.yml: use -c everywhere again * travis: back to explicit './boot && ./configure' * update README.md and doc/user-settings.md to reflect configurable build root * some more feedback >--------------------------------------------------------------- 3a68f11c9d6ceebdb09f85804143dd2f1d49a502 .travis.yml | 71 +++++-- README.md | 19 +- appveyor.yml | 11 +- doc/user-settings.md | 10 - hadrian.cabal | 19 +- src/Base.hs | 91 ++++---- src/Builder.hs | 93 ++++++-- src/Builder.hs-boot | 46 ++++ src/CommandLine.hs | 22 +- src/Context.hs | 60 +++--- src/Context/Paths.hs | 39 ++++ src/Expression.hs | 26 ++- src/Expression/Type.hs | 5 +- src/GHC.hs | 199 +++++------------- src/GHC/Packages.hs | 105 ++++++++++ src/Hadrian/Builder.hs | 40 +++- src/Hadrian/Haskell/Cabal.hs | 29 +-- src/Hadrian/Haskell/Cabal/PackageData.hs | 46 ++++ src/Hadrian/Haskell/Cabal/Parse.hs | 314 +++++++++++++++++++++++++-- src/Hadrian/Haskell/Cabal/Parse.hs-boot | 9 + src/Hadrian/Haskell/Cabal/Type.hs | 22 +- src/Hadrian/Oracles/TextFile.hs | 46 +++- src/Hadrian/Package.hs | 14 +- src/Hadrian/Utilities.hs | 16 +- src/Main.hs | 5 +- src/Oracles/ModuleFiles.hs | 40 ++-- src/Oracles/PackageData.hs | 66 ------ src/Rules.hs | 61 ++++-- src/Rules/Clean.hs | 10 +- src/Rules/Compile.hs | 6 +- src/Rules/Configure.hs | 2 +- src/Rules/Dependencies.hs | 12 +- src/Rules/Documentation.hs | 108 ++++++---- src/Rules/Generate.hs | 140 +++++++------ src/Rules/Gmp.hs | 30 +-- src/Rules/Install.hs | 349 ------------------------------- src/Rules/Libffi.hs | 13 +- src/Rules/Library.hs | 72 +++++-- src/Rules/PackageData.hs | 122 ++--------- src/Rules/Program.hs | 116 ++++------ src/Rules/Register.hs | 103 ++++++--- src/Rules/SourceDist.hs | 2 +- src/Rules/Test.hs | 18 +- src/Rules/Wrappers.hs | 162 -------------- src/Settings.hs | 6 +- src/Settings/Builders/Cc.hs | 6 +- src/Settings/Builders/Common.hs | 38 +++- src/Settings/Builders/DeriveConstants.hs | 1 + src/Settings/Builders/Ghc.hs | 55 +++-- src/Settings/Builders/GhcCabal.hs | 66 +++++- src/Settings/Builders/GhcPkg.hs | 16 +- src/Settings/Builders/Haddock.hs | 32 +-- src/Settings/Builders/HsCpp.hs | 1 + src/Settings/Builders/Hsc2Hs.hs | 25 ++- src/Settings/Builders/RunTest.hs | 5 +- src/Settings/Default.hs | 49 ++--- src/Settings/Flavours/Quickest.hs | 7 +- src/Settings/Packages.hs | 125 +++++++++++ src/Settings/Packages/Haskeline.hs | 8 - src/Settings/Packages/Rts.hs | 1 + src/Settings/Warnings.hs | 1 + src/UserSettings.hs | 8 +- src/Utilities.hs | 46 ++-- 63 files changed, 1752 insertions(+), 1533 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 3a68f11c9d6ceebdb09f85804143dd2f1d49a502 From git at git.haskell.org Tue Oct 23 20:15:02 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:15:02 +0000 (UTC) Subject: [commit: ghc] master: Merge pull request #542 from Mistuke/fix-specific-file (9a46249) Message-ID: <20181023201502.4ECEA3ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/9a46249e974c99a2015d7bba514b252c31ff8575/ghc >--------------------------------------------------------------- commit 9a46249e974c99a2015d7bba514b252c31ff8575 Merge: 3a68f11 fe5759b Author: Moritz Angermann Date: Sat Mar 31 12:58:55 2018 +0800 Merge pull request #542 from Mistuke/fix-specific-file Move rts I/O Functions in different namespace. >--------------------------------------------------------------- 9a46249e974c99a2015d7bba514b252c31ff8575 src/Settings/Packages/Rts.hs | 10 ++++++++++ 1 file changed, 10 insertions(+) From git at git.haskell.org Tue Oct 23 20:15:06 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:15:06 +0000 (UTC) Subject: [commit: ghc] master: Fix warnings (#547) (659b18d) Message-ID: <20181023201506.2698D3ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/659b18d59ea034419f94c2a038d08ea69bc15803/ghc >--------------------------------------------------------------- commit 659b18d59ea034419f94c2a038d08ea69bc15803 Author: Andrey Mokhov Date: Tue Apr 3 09:45:05 2018 +0100 Fix warnings (#547) * Fix warnings * Link to GitHub issues See #544 >--------------------------------------------------------------- 659b18d59ea034419f94c2a038d08ea69bc15803 src/CommandLine.hs | 1 - src/GHC.hs | 13 ----------- src/Hadrian/Haskell/Cabal/Parse.hs | 48 ++++++++++++++++++++------------------ src/Rules/Clean.hs | 2 +- src/Rules/SourceDist.hs | 3 ++- src/Settings/Builders/Common.hs | 1 - src/Settings/Builders/GhcCabal.hs | 13 ++--------- src/Settings/Default.hs | 1 - 8 files changed, 30 insertions(+), 52 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 659b18d59ea034419f94c2a038d08ea69bc15803 From git at git.haskell.org Tue Oct 23 20:15:09 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:15:09 +0000 (UTC) Subject: [commit: ghc] master: Fix Circle CI (#553) (591c425) Message-ID: <20181023201509.ED2423ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/591c4252ec2175c99fce431548c68ae3cd63cbf5/ghc >--------------------------------------------------------------- commit 591c4252ec2175c99fce431548c68ae3cd63cbf5 Author: Zhen Zhang Date: Tue Apr 3 16:52:20 2018 +0800 Fix Circle CI (#553) >--------------------------------------------------------------- 591c4252ec2175c99fce431548c68ae3cd63cbf5 circle.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/circle.yml b/circle.yml index 8ca33cf..66d5193 100644 --- a/circle.yml +++ b/circle.yml @@ -8,11 +8,13 @@ dependencies: override: - brew update - brew install ghc cabal-install python3 + - brew link ghc cabal-install python3 - cabal update - - cabal install alex happy mtl shake quickcheck + - cabal install alex 'happy >= 1.19.4' mtl shake QuickCheck cache_directories: - - $HOME/.cabal - - $HOME/.ghc + - ~/.cabal + - ~/.ghc + - /usr/local/Cellar compile: override: @@ -29,12 +31,14 @@ compile: # in CircleCI is a separate process, thus you can't "cd" for the other lines - cd ghc/hadrian; git reset --hard HEAD + - cd ghc; ./boot && PATH=~/.cabal/bin:$PATH ./configure + # XXX: export PATH doesn't work well either, so we use inline env # Self test - - PATH=$HOME/.cabal/bin:$PATH ghc/hadrian/build.sh -c selftest + - PATH=~/.cabal/bin:$PATH ghc/hadrian/build.sh selftest # Build GHC - - PATH=$HOME/.cabal/bin:$PATH ghc/hadrian/build.sh -j -c $MODE --no-progress --progress-colour=never --profile=- + - PATH=~/.cabal/bin:$PATH ghc/hadrian/build.sh -j $MODE --no-progress --progress-colour=never --profile=- test: override: From git at git.haskell.org Tue Oct 23 20:15:13 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:15:13 +0000 (UTC) Subject: [commit: ghc] master: Unregister stage0 package first if it needs to be cloned (#552) (a8ad5af) Message-ID: <20181023201513.C42B83ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/a8ad5af8537606b0dd8e53051fbcf56d6a30c605/ghc >--------------------------------------------------------------- commit a8ad5af8537606b0dd8e53051fbcf56d6a30c605 Author: Zhen Zhang Date: Tue Apr 3 21:33:03 2018 +0800 Unregister stage0 package first if it needs to be cloned (#552) Fixes #543 >--------------------------------------------------------------- a8ad5af8537606b0dd8e53051fbcf56d6a30c605 src/Builder.hs | 5 +++++ src/Builder.hs-boot | 2 +- src/Rules/Register.hs | 11 +++++++++-- src/Settings/Builders/GhcPkg.hs | 10 ++++++++++ 4 files changed, 25 insertions(+), 3 deletions(-) diff --git a/src/Builder.hs b/src/Builder.hs index 8ce2aea..5ca6c20 100644 --- a/src/Builder.hs +++ b/src/Builder.hs @@ -65,6 +65,7 @@ instance NFData GhcCabalMode data GhcPkgMode = Init -- initialize a new database. | Update -- update a package. | Clone -- clone a package from one pkg database into another. @Copy@ is already taken by GhcCabalMode. + | Unregister -- unregister a package | Dependencies -- compute package dependencies. deriving (Eq, Generic, Show) @@ -265,6 +266,10 @@ instance H.Builder Builder where ] cmd (Stdin pkgDesc) [path] (buildArgs ++ ["-"]) + GhcPkg Unregister _ -> do + Exit _ <- cmd echo [path] (buildArgs ++ [input]) + return () + _ -> cmd echo [path] buildArgs -- TODO: Some builders are required only on certain platforms. For example, diff --git a/src/Builder.hs-boot b/src/Builder.hs-boot index e8eed47..bd38891 100644 --- a/src/Builder.hs-boot +++ b/src/Builder.hs-boot @@ -8,7 +8,7 @@ import Hadrian.Builder.Tar data CcMode = CompileC | FindCDependencies data GhcMode = CompileHs | CompileCWithGhc | FindHsDependencies | LinkHs data GhcCabalMode = Conf | HsColour | Check | Sdist -data GhcPkgMode = Init | Update | Clone | Dependencies +data GhcPkgMode = Init | Update | Clone | Unregister | Dependencies data HaddockMode = BuildPackage | BuildIndex data Builder = Alex diff --git a/src/Rules/Register.hs b/src/Rules/Register.hs index 14b085d..12d3c5b 100644 --- a/src/Rules/Register.hs +++ b/src/Rules/Register.hs @@ -83,8 +83,15 @@ copyConf rs context at Context {..} conf = do depPkgIds <- fmap stdOutToPkgIds . askWithResources rs $ target context (GhcPkg Dependencies stage) [pkgName package] [] need =<< mapM (\pkgId -> packageDbPath stage <&> (-/- pkgId <.> "conf")) depPkgIds - buildWithResources rs $ - target context (GhcPkg Clone stage) [pkgName package] [conf] + -- we should unregister if the file exists since ghc-pkg will complain + -- about existing pkg id (See https://github.com/snowleopard/hadrian/issues/543) + -- also, we don't always do the unregistration + registration to avoid + -- repeated work after a full build + unlessM (doesFileExist conf) $ do + buildWithResources rs $ + target context (GhcPkg Unregister stage) [pkgName package] [] + buildWithResources rs $ + target context (GhcPkg Clone stage) [pkgName package] [conf] where stdOutToPkgIds :: String -> [String] diff --git a/src/Settings/Builders/GhcPkg.hs b/src/Settings/Builders/GhcPkg.hs index 4056d84..535b00d 100644 --- a/src/Settings/Builders/GhcPkg.hs +++ b/src/Settings/Builders/GhcPkg.hs @@ -14,6 +14,16 @@ ghcPkgBuilderArgs = mconcat , arg "register" , verbosity < Chatty ? arg "-v0" ] + , builder (GhcPkg Unregister) ? do + verbosity <- expr getVerbosity + stage <- getStage + pkgDb <- expr $ packageDbPath stage + mconcat [ arg "--global-package-db" + , arg pkgDb + , arg "unregister" + , arg "--force" + , verbosity < Chatty ? arg "-v0" + ] , builder (GhcPkg Update) ? do verbosity <- expr getVerbosity context <- getContext From git at git.haskell.org Tue Oct 23 20:15:17 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:15:17 +0000 (UTC) Subject: [commit: ghc] master: Preliminary bindist rule (#555) (1579730) Message-ID: <20181023201517.9CBF43ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/15797302751614fba8da15f59de588be7841dd27/ghc >--------------------------------------------------------------- commit 15797302751614fba8da15f59de588be7841dd27 Author: Alp Mestanogullari Date: Tue Apr 3 18:22:55 2018 +0200 Preliminary bindist rule (#555) * Preliminary bindist rule For now, we only ship `/{bin, lib}` and the few make build system related files that are needed to support a simple ``` ./configure [--prefix=PATH] && make install ``` workflow. The current binary distributions of GHC support a wider range of parameters, but I figured it would be a good thing to start with this and enhance it as we all see fit and perhaps using feedback from GHC HQ (@bgamari in particular) and bindist users. * document binary distribution rule in README * sdist-ghc -> source-dist, Rules.Bindist -> Rules.BinaryDist >--------------------------------------------------------------- 15797302751614fba8da15f59de588be7841dd27 README.md | 13 ++++++++++++- cfg/system.config.in | 1 + hadrian.cabal | 1 + src/Builder.hs | 4 ++++ src/Builder.hs-boot | 1 + src/Rules.hs | 6 ++++-- src/Rules/SourceDist.hs | 2 +- 7 files changed, 24 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 620d405..2509dae 100644 --- a/README.md +++ b/README.md @@ -125,7 +125,18 @@ are currently not supported. #### Source distribution -To build a GHC source distribution tarball, run `build sdist-ghc`. +To build a GHC source distribution tarball, run `build source-dist`. + +#### Binary distribution + +To build a GHC binary distribution, run `build binary-dist`. The resulting +tarball contains just enough to support the + +``` sh +$ ./configure [--prefix=PATH] && make install +``` + +workflow, for now. #### Testing diff --git a/cfg/system.config.in b/cfg/system.config.in index c983ae4..72bef12 100644 --- a/cfg/system.config.in +++ b/cfg/system.config.in @@ -7,6 +7,7 @@ alex = @AlexCmd@ ar = @ArCmd@ +autoreconf = autoreconf cc = @CC@ happy = @HappyCmd@ hs-cpp = @HaskellCPPCmd@ diff --git a/hadrian.cabal b/hadrian.cabal index 486148f..ca339fb 100644 --- a/hadrian.cabal +++ b/hadrian.cabal @@ -51,6 +51,7 @@ executable hadrian , Oracles.Setting , Oracles.ModuleFiles , Rules + , Rules.BinaryDist , Rules.Clean , Rules.Compile , Rules.Configure diff --git a/src/Builder.hs b/src/Builder.hs index 5ca6c20..0fb8be5 100644 --- a/src/Builder.hs +++ b/src/Builder.hs @@ -89,6 +89,7 @@ instance NFData HaddockMode -- @GhcPkg Stage1@ is the one built in Stage0. data Builder = Alex | Ar ArMode Stage + | Autoreconf FilePath | DeriveConstants | Cc CcMode Stage | Configure FilePath @@ -174,6 +175,7 @@ instance H.Builder Builder where runtimeDependencies :: Builder -> Action [FilePath] runtimeDependencies = \case + Autoreconf dir -> return [dir -/- "configure.ac"] Configure dir -> return [dir -/- "configure"] Ghc _ Stage0 -> return [] @@ -232,6 +234,7 @@ instance H.Builder Builder where Ar Unpack _ -> cmd echo [Cwd output] [path] buildArgs + Autoreconf dir -> cmd echo [Cwd dir] [path] buildArgs Configure dir -> do -- Inject /bin/bash into `libtool`, instead of /bin/sh, -- otherwise Windows breaks. TODO: Figure out why. @@ -287,6 +290,7 @@ systemBuilderPath builder = case builder of Alex -> fromKey "alex" Ar _ Stage0 -> fromKey "system-ar" Ar _ _ -> fromKey "ar" + Autoreconf _ -> fromKey "autoreconf" Cc _ Stage0 -> fromKey "system-cc" Cc _ _ -> fromKey "cc" -- We can't ask configure for the path to configure! diff --git a/src/Builder.hs-boot b/src/Builder.hs-boot index bd38891..1d10434 100644 --- a/src/Builder.hs-boot +++ b/src/Builder.hs-boot @@ -13,6 +13,7 @@ data HaddockMode = BuildPackage | BuildIndex data Builder = Alex | Ar ArMode Stage + | Autoreconf FilePath | DeriveConstants | Cc CcMode Stage | Configure FilePath diff --git a/src/Rules.hs b/src/Rules.hs index 982d249..100720f 100644 --- a/src/Rules.hs +++ b/src/Rules.hs @@ -8,15 +8,16 @@ import qualified Hadrian.Oracles.TextFile import Expression import GHC import qualified Oracles.ModuleFiles +import qualified Rules.BinaryDist import qualified Rules.Compile -import qualified Rules.PackageData +import qualified Rules.Configure import qualified Rules.Dependencies import qualified Rules.Documentation import qualified Rules.Generate -import qualified Rules.Configure import qualified Rules.Gmp import qualified Rules.Libffi import qualified Rules.Library +import qualified Rules.PackageData import qualified Rules.Program import qualified Rules.Register import Settings @@ -122,6 +123,7 @@ packageRules = do buildRules :: Rules () buildRules = do + Rules.BinaryDist.bindistRules Rules.Configure.configureRules Rules.Generate.copyRules Rules.Generate.generateRules diff --git a/src/Rules/SourceDist.hs b/src/Rules/SourceDist.hs index 6ef7929..8bec3f3 100644 --- a/src/Rules/SourceDist.hs +++ b/src/Rules/SourceDist.hs @@ -9,7 +9,7 @@ import Rules.Clean sourceDistRules :: Rules () sourceDistRules = do - "sdist-ghc" ~> do + "source-dist" ~> do -- We clean the source tree first. -- See https://github.com/snowleopard/hadrian/issues/384. -- TODO: Do we still need to clean the tree? From git at git.haskell.org Tue Oct 23 20:15:21 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:15:21 +0000 (UTC) Subject: [commit: ghc] master: Revert "Preliminary bindist rule (#555)" (#557) (8c2817a) Message-ID: <20181023201521.75A203ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/8c2817a37ec2fdc347a6ee90957f0119a8faa105/ghc >--------------------------------------------------------------- commit 8c2817a37ec2fdc347a6ee90957f0119a8faa105 Author: Andrey Mokhov Date: Tue Apr 3 17:53:28 2018 +0100 Revert "Preliminary bindist rule (#555)" (#557) This reverts commit 15797302751614fba8da15f59de588be7841dd27. >--------------------------------------------------------------- 8c2817a37ec2fdc347a6ee90957f0119a8faa105 README.md | 13 +------------ cfg/system.config.in | 1 - hadrian.cabal | 1 - src/Builder.hs | 4 ---- src/Builder.hs-boot | 1 - src/Rules.hs | 6 ++---- src/Rules/SourceDist.hs | 2 +- 7 files changed, 4 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index 2509dae..620d405 100644 --- a/README.md +++ b/README.md @@ -125,18 +125,7 @@ are currently not supported. #### Source distribution -To build a GHC source distribution tarball, run `build source-dist`. - -#### Binary distribution - -To build a GHC binary distribution, run `build binary-dist`. The resulting -tarball contains just enough to support the - -``` sh -$ ./configure [--prefix=PATH] && make install -``` - -workflow, for now. +To build a GHC source distribution tarball, run `build sdist-ghc`. #### Testing diff --git a/cfg/system.config.in b/cfg/system.config.in index 72bef12..c983ae4 100644 --- a/cfg/system.config.in +++ b/cfg/system.config.in @@ -7,7 +7,6 @@ alex = @AlexCmd@ ar = @ArCmd@ -autoreconf = autoreconf cc = @CC@ happy = @HappyCmd@ hs-cpp = @HaskellCPPCmd@ diff --git a/hadrian.cabal b/hadrian.cabal index ca339fb..486148f 100644 --- a/hadrian.cabal +++ b/hadrian.cabal @@ -51,7 +51,6 @@ executable hadrian , Oracles.Setting , Oracles.ModuleFiles , Rules - , Rules.BinaryDist , Rules.Clean , Rules.Compile , Rules.Configure diff --git a/src/Builder.hs b/src/Builder.hs index 0fb8be5..5ca6c20 100644 --- a/src/Builder.hs +++ b/src/Builder.hs @@ -89,7 +89,6 @@ instance NFData HaddockMode -- @GhcPkg Stage1@ is the one built in Stage0. data Builder = Alex | Ar ArMode Stage - | Autoreconf FilePath | DeriveConstants | Cc CcMode Stage | Configure FilePath @@ -175,7 +174,6 @@ instance H.Builder Builder where runtimeDependencies :: Builder -> Action [FilePath] runtimeDependencies = \case - Autoreconf dir -> return [dir -/- "configure.ac"] Configure dir -> return [dir -/- "configure"] Ghc _ Stage0 -> return [] @@ -234,7 +232,6 @@ instance H.Builder Builder where Ar Unpack _ -> cmd echo [Cwd output] [path] buildArgs - Autoreconf dir -> cmd echo [Cwd dir] [path] buildArgs Configure dir -> do -- Inject /bin/bash into `libtool`, instead of /bin/sh, -- otherwise Windows breaks. TODO: Figure out why. @@ -290,7 +287,6 @@ systemBuilderPath builder = case builder of Alex -> fromKey "alex" Ar _ Stage0 -> fromKey "system-ar" Ar _ _ -> fromKey "ar" - Autoreconf _ -> fromKey "autoreconf" Cc _ Stage0 -> fromKey "system-cc" Cc _ _ -> fromKey "cc" -- We can't ask configure for the path to configure! diff --git a/src/Builder.hs-boot b/src/Builder.hs-boot index 1d10434..bd38891 100644 --- a/src/Builder.hs-boot +++ b/src/Builder.hs-boot @@ -13,7 +13,6 @@ data HaddockMode = BuildPackage | BuildIndex data Builder = Alex | Ar ArMode Stage - | Autoreconf FilePath | DeriveConstants | Cc CcMode Stage | Configure FilePath diff --git a/src/Rules.hs b/src/Rules.hs index 100720f..982d249 100644 --- a/src/Rules.hs +++ b/src/Rules.hs @@ -8,16 +8,15 @@ import qualified Hadrian.Oracles.TextFile import Expression import GHC import qualified Oracles.ModuleFiles -import qualified Rules.BinaryDist import qualified Rules.Compile -import qualified Rules.Configure +import qualified Rules.PackageData import qualified Rules.Dependencies import qualified Rules.Documentation import qualified Rules.Generate +import qualified Rules.Configure import qualified Rules.Gmp import qualified Rules.Libffi import qualified Rules.Library -import qualified Rules.PackageData import qualified Rules.Program import qualified Rules.Register import Settings @@ -123,7 +122,6 @@ packageRules = do buildRules :: Rules () buildRules = do - Rules.BinaryDist.bindistRules Rules.Configure.configureRules Rules.Generate.copyRules Rules.Generate.generateRules diff --git a/src/Rules/SourceDist.hs b/src/Rules/SourceDist.hs index 8bec3f3..6ef7929 100644 --- a/src/Rules/SourceDist.hs +++ b/src/Rules/SourceDist.hs @@ -9,7 +9,7 @@ import Rules.Clean sourceDistRules :: Rules () sourceDistRules = do - "source-dist" ~> do + "sdist-ghc" ~> do -- We clean the source tree first. -- See https://github.com/snowleopard/hadrian/issues/384. -- TODO: Do we still need to clean the tree? From git at git.haskell.org Tue Oct 23 20:15:25 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:15:25 +0000 (UTC) Subject: [commit: ghc] master: Preliminary bindist (#558) (8219f6a) Message-ID: <20181023201525.D430F3ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/8219f6a48280b962b2de28b757b45b70b38d0523/ghc >--------------------------------------------------------------- commit 8219f6a48280b962b2de28b757b45b70b38d0523 Author: Alp Mestanogullari Date: Tue Apr 3 21:42:39 2018 +0200 Preliminary bindist (#558) * Preliminary bindist rule For now, we only ship `/{bin, lib}` and the few make build system related files that are needed to support a simple ``` ./configure [--prefix=PATH] && make install ``` workflow. The current binary distributions of GHC support a wider range of parameters, but I figured it would be a good thing to start with this and enhance it as we all see fit and perhaps using feedback from GHC HQ (@bgamari in particular) and bindist users. * document binary distribution rule in README * sdist-ghc -> source-dist, Rules.Bindist -> Rules.BinaryDist * add missing src/Rules/BinaryDist.hs >--------------------------------------------------------------- 8219f6a48280b962b2de28b757b45b70b38d0523 README.md | 13 +++++- cfg/system.config.in | 1 + hadrian.cabal | 1 + src/Builder.hs | 4 ++ src/Builder.hs-boot | 1 + src/Rules.hs | 6 ++- src/Rules/BinaryDist.hs | 121 ++++++++++++++++++++++++++++++++++++++++++++++++ src/Rules/SourceDist.hs | 2 +- 8 files changed, 145 insertions(+), 4 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 8219f6a48280b962b2de28b757b45b70b38d0523 From git at git.haskell.org Tue Oct 23 20:15:29 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:15:29 +0000 (UTC) Subject: [commit: ghc] master: Fix boot and configure on AppVeyor (#561) (3465caf) Message-ID: <20181023201529.C14D33ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/3465caf80a5d852ce43ec7ecde73c887bc3d3562/ghc >--------------------------------------------------------------- commit 3465caf80a5d852ce43ec7ecde73c887bc3d3562 Author: Andrey Mokhov Date: Sun Apr 8 20:53:49 2018 +0100 Fix boot and configure on AppVeyor (#561) * Call the boot script using the right Python interpreter * Install Python3 * Call boot and configure from Stack environment * Stay in Hadrian directory * Fix path to Stack * Fix slashes * Use bash to run configure >--------------------------------------------------------------- 3465caf80a5d852ce43ec7ecde73c887bc3d3562 appveyor.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 9c163f8..3e67707 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -27,12 +27,13 @@ install: # Install all Hadrian and GHC build dependencies - cd ghc\hadrian - stack setup > nul - - appveyor-retry stack exec -- pacman -S autoconf automake-wrapper make patch python tar --noconfirm + - appveyor-retry stack exec -- pacman -S autoconf automake-wrapper make patch python3 tar --noconfirm build_script: # Boot and configure ghc source tree - cd .. - - python boot && configure --enable-tarballs-autodownload + - hadrian\stack exec -- python3 boot + - hadrian\stack exec -- bash configure --enable-tarballs-autodownload - cd hadrian # Build Hadrian and run internal Hadrian tests From git at git.haskell.org Tue Oct 23 20:15:33 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:15:33 +0000 (UTC) Subject: [commit: ghc] master: Fix Windows build (#563) (2683445) Message-ID: <20181023201533.BA47C3ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/2683445c64be4d4079b00af87fa23cd9a9b2c152/ghc >--------------------------------------------------------------- commit 2683445c64be4d4079b00af87fa23cd9a9b2c152 Author: Andrey Mokhov Date: Tue Apr 10 03:22:31 2018 +0100 Fix Windows build (#563) Fix copyFile failure on Windows plus minor revision >--------------------------------------------------------------- 2683445c64be4d4079b00af87fa23cd9a9b2c152 src/Builder.hs-boot | 2 +- src/Hadrian/Haskell/Cabal/Parse.hs | 376 +++++++++++++++++-------------------- src/Rules/Register.hs | 3 +- 3 files changed, 178 insertions(+), 203 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 2683445c64be4d4079b00af87fa23cd9a9b2c152 From git at git.haskell.org Tue Oct 23 20:15:37 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:15:37 +0000 (UTC) Subject: [commit: ghc] master: Fix Windows build, improve error reporting (#565) (b6c77f3) Message-ID: <20181023201537.938593ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/b6c77f39778d739ba5fc4a920e0f8231e693d1e4/ghc >--------------------------------------------------------------- commit b6c77f39778d739ba5fc4a920e0f8231e693d1e4 Author: Andrey Mokhov Date: Wed Apr 11 23:23:50 2018 +0100 Fix Windows build, improve error reporting (#565) * Print diagnostic info in verbose mode * Try enable-distro-toolchain * Improve error handling >--------------------------------------------------------------- b6c77f39778d739ba5fc4a920e0f8231e693d1e4 appveyor.yml | 2 +- src/Hadrian/Haskell/Cabal/Parse.hs | 65 +++++++++++++++++++------------------- src/Hadrian/Oracles/TextFile.hs | 9 +++++- src/Hadrian/Package.hs | 5 +-- 4 files changed, 44 insertions(+), 37 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc b6c77f39778d739ba5fc4a920e0f8231e693d1e4 From git at git.haskell.org Tue Oct 23 20:15:41 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:15:41 +0000 (UTC) Subject: [commit: ghc] master: Fix copying of fs*.h files during RTS registration (#566) (66117c5) Message-ID: <20181023201541.6C2F13ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/66117c5e751dd5dc742a305e131c48a768984166/ghc >--------------------------------------------------------------- commit 66117c5e751dd5dc742a305e131c48a768984166 Author: Andrey Mokhov Date: Thu Apr 12 02:32:31 2018 +0100 Fix copying of fs*.h files during RTS registration (#566) * Fix indentation * Pass the verbosity setting to Cabal * Add a workaround for missing fs.h files >--------------------------------------------------------------- 66117c5e751dd5dc742a305e131c48a768984166 src/Hadrian/Haskell/Cabal/Parse.hs | 12 ++++++-- src/Rules/Generate.hs | 57 +++++++++++++++++++++----------------- src/Rules/Register.hs | 57 +++++++++++++++++++------------------- 3 files changed, 68 insertions(+), 58 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 66117c5e751dd5dc742a305e131c48a768984166 From git at git.haskell.org Tue Oct 23 20:15:45 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:15:45 +0000 (UTC) Subject: [commit: ghc] master: Undo fs*.h workaround (4e4a023) Message-ID: <20181023201545.54D383ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/4e4a023f5f0595f54df8a0872a34506114df2423/ghc >--------------------------------------------------------------- commit 4e4a023f5f0595f54df8a0872a34506114df2423 Author: Andrey Mokhov Date: Fri Apr 13 01:00:54 2018 +0100 Undo fs*.h workaround See #554 >--------------------------------------------------------------- 4e4a023f5f0595f54df8a0872a34506114df2423 src/Rules/Generate.hs | 5 ----- src/Rules/Register.hs | 6 +----- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/src/Rules/Generate.hs b/src/Rules/Generate.hs index b57f547..cc2bf4b 100644 --- a/src/Rules/Generate.hs +++ b/src/Rules/Generate.hs @@ -167,11 +167,6 @@ copyRules = do prefix -/- "platformConstants" <~ (buildRoot <&> (-/- generatedDir)) prefix -/- "settings" <~ return "." prefix -/- "template-hsc.h" <~ return (pkgPath hsc2hs) - - -- TODO: Get rid of this workaround. - -- See https://github.com/snowleopard/hadrian/issues/554 - root -/- buildDir rtsContext -/- "rts/fs.h" <~ return "rts" - root -/- buildDir rtsContext -/- "rts/fs_rts.h" <~ return "rts" where infixl 1 <~ pattern <~ mdir = pattern %> \file -> do diff --git a/src/Rules/Register.hs b/src/Rules/Register.hs index 8c726b5..ed0cb2b 100644 --- a/src/Rules/Register.hs +++ b/src/Rules/Register.hs @@ -65,11 +65,7 @@ buildConf _ context at Context {..} _conf = do , path -/- "ghcautoconf.h" , path -/- "ghcplatform.h" , path -/- "ghcversion.h" - , path -/- "ffi.h" - -- TODO: Get rid of this workaround. - -- See https://github.com/snowleopard/hadrian/issues/554 - , path -/- "rts/fs.h" - , path -/- "rts/fs_rts.h" ] + , path -/- "ffi.h" ] when (package == integerGmp) $ need [path -/- "ghc-gmp.h"] From git at git.haskell.org Tue Oct 23 20:15:49 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:15:49 +0000 (UTC) Subject: [commit: ghc] master: Fix integer-gmp build (#568) (c190ab6) Message-ID: <20181023201549.4AB3B3ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/c190ab6eeda6cfa0782269d4f2d38c64aa65fd17/ghc >--------------------------------------------------------------- commit c190ab6eeda6cfa0782269d4f2d38c64aa65fd17 Author: Andrey Mokhov Date: Mon Apr 16 02:10:17 2018 +0100 Fix integer-gmp build (#568) * Fix path to GMP's config.mk * Minor revision * Relocate GMP's build artefacts >--------------------------------------------------------------- c190ab6eeda6cfa0782269d4f2d38c64aa65fd17 src/Rules/Gmp.hs | 15 +++++++++------ src/Rules/Library.hs | 34 +++++++++++++++------------------- 2 files changed, 24 insertions(+), 25 deletions(-) diff --git a/src/Rules/Gmp.hs b/src/Rules/Gmp.hs index 89a88e4..8852311 100644 --- a/src/Rules/Gmp.hs +++ b/src/Rules/Gmp.hs @@ -22,9 +22,13 @@ gmpLibrary = ".libs/libgmp.a" gmpContext :: Context gmpContext = vanillaContext Stage1 integerGmp +-- TODO: Location of 'gmpBuildPath' is important: it should be outside any +-- package build directory, as otherwise GMP's object files will match build +-- patterns of 'compilePackage' rules. We could make 'compilePackage' rules +-- more precise to avoid such spurious matching. -- | Build directory for in-tree GMP library. gmpBuildPath :: Action FilePath -gmpBuildPath = buildRoot <&> (-/- buildDir gmpContext -/- "gmp") +gmpBuildPath = buildRoot <&> (-/- stageString (stage gmpContext) -/- "gmp") -- | GMP library header, relative to 'gmpBuildPath'. gmpLibraryH :: FilePath @@ -45,7 +49,7 @@ gmpRules = do root <- buildRootRules root gmpLibraryH %> \header -> do windows <- windowsHost - configMk <- readFile' =<< (gmpBuildPath <&> (-/- "config.mk")) + configMk <- readFile' =<< (buildPath gmpContext <&> (-/- "config.mk")) if not windows && -- TODO: We don't use system GMP on Windows. Fix? any (`isInfixOf` configMk) [ "HaveFrameworkGMP = YES", "HaveLibGmp = YES" ] then do @@ -75,14 +79,13 @@ gmpRules = do -- This causes integerGmp package to be configured, hence creating the files root "gmp/config.mk" %> \_ -> do - -- setup-config, triggers `ghc-cabal configure` - -- everything of a package should depend on that - -- in the first place. + -- Calling 'need' on @setup-config@, triggers @ghc-cabal configure@ + -- Building anything in a package transitively depends on its configuration. setupConfig <- contextPath gmpContext <&> (-/- "setup-config") need [setupConfig] - -- Run GMP's configure script -- TODO: Get rid of hard-coded @gmp at . + -- Run GMP's configure script root "gmp/Makefile" %> \mk -> do env <- configureEnvironment gmpPath <- gmpBuildPath diff --git a/src/Rules/Library.hs b/src/Rules/Library.hs index e9f8ff6..000d032 100644 --- a/src/Rules/Library.hs +++ b/src/Rules/Library.hs @@ -23,34 +23,30 @@ import qualified System.Directory as IO archive :: Way -> String -> String archive way pkgId = "libHS" ++ pkgId ++ (waySuffix way <.> "a") --- | Building a library consist of building --- the artifacts, and copying it somewhere --- with cabal, and finally registering it --- with the compiler via cabal in the --- package database. --- --- So we'll assume rules to build all the --- package artifacts, and provide rules for --- the any of the library artifacts. +-- TODO: This comment is rather vague, make it more precise by listing what +-- exactly gets built and moved where, referencing the corresponding rules. +-- | Building a library consist of building the artefacts, copying it somewhere +-- with Cabal, and finally registering it with the compiler via Cabal in the +-- package database. We assume rules to build all the package artefacts, and +-- provide rules for the library artefacts. library :: Context -> Rules () library context at Context{..} = do root <- buildRootRules pkgId <- case pkgCabalFile package of - Just file -> liftIO $ parseCabalPkgId file - Nothing -> return (pkgName package) + Just file -> liftIO $ parseCabalPkgId file + Nothing -> return $ pkgName package - root -/- libDir context -/- pkgId -/- archive way pkgId %> \_ -> do + root -/- libDir context -/- pkgId -/- archive way pkgId %> \_ -> need =<< mapM (\pkgId -> packageDbPath stage <&> (-/- pkgId <.> "conf")) [pkgId] - return () libraryObjects :: Context -> Action [FilePath] libraryObjects context at Context{..} = do - hsObjs <- hsObjects context - noHsObjs <- nonHsObjects context + hsObjs <- hsObjects context + nonHsObjs <- nonHsObjects context -- This will create split objects if required (we don't track them -- explicitly as this would needlessly bloat the Shake database). - need $ noHsObjs ++ hsObjs + need $ nonHsObjs ++ hsObjs split <- interpretInContext context =<< splitObjects <$> flavour let getSplitObjs = concatForM hsObjs $ \obj -> do @@ -58,7 +54,7 @@ libraryObjects context at Context{..} = do contents <- liftIO $ IO.getDirectoryContents dir return . map (dir -/-) $ filter (not . all (== '.')) contents - (noHsObjs ++) <$> if split then getSplitObjs else return hsObjs + (nonHsObjs ++) <$> if split then getSplitObjs else return hsObjs buildDynamicLib :: Context -> Rules () buildDynamicLib context at Context{..} = do @@ -106,8 +102,8 @@ buildPackageGhciLibrary :: Context -> Rules () buildPackageGhciLibrary context at Context {..} = priority 2 $ do root <- buildRootRules pkgId <- case pkgCabalFile package of - Just file -> liftIO $ parseCabalPkgId file - Nothing -> return (pkgName package) + Just file -> liftIO $ parseCabalPkgId file + Nothing -> return $ pkgName package let libPrefix = root -/- buildDir context -/- "HS" ++ pkgId o = libPrefix ++ "*" ++ (waySuffix way <.> "o") From git at git.haskell.org Tue Oct 23 20:15:53 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:15:53 +0000 (UTC) Subject: [commit: ghc] master: Fix the path to touchy (#572) (32e26b0) Message-ID: <20181023201553.3BA9D3ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/32e26b0fa5adec71fa513a8e6e1d4d655fc562b7/ghc >--------------------------------------------------------------- commit 32e26b0fa5adec71fa513a8e6e1d4d655fc562b7 Author: Andrey Mokhov Date: Mon Apr 16 20:01:00 2018 +0100 Fix the path to touchy (#572) * Fix the path to touchy * Allow binaries to live in lib/bin >--------------------------------------------------------------- 32e26b0fa5adec71fa513a8e6e1d4d655fc562b7 src/GHC.hs | 8 ++++++-- src/Rules/Program.hs | 3 ++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/GHC.hs b/src/GHC.hs index 5a7dc31..0262823 100644 --- a/src/GHC.hs +++ b/src/GHC.hs @@ -128,8 +128,12 @@ installStage pkg -- | The 'FilePath' to a program executable in a given 'Context'. programPath :: Context -> Action FilePath programPath context at Context {..} = do - path <- stageBinPath stage - pgm <- programName context + -- The @touchy@ utility lives in the @lib/bin@ directory instead of @bin@, + -- which is likely just a historical accident that will hopefully be fixed. + -- See: https://github.com/snowleopard/hadrian/issues/570 + path <- if package /= touchy then stageBinPath stage + else stageLibPath stage <&> (-/- "bin") + pgm <- programName context return $ path -/- pgm <.> exe -- | Some contexts are special: their packages do not have @.cabal@ metadata or diff --git a/src/Rules/Program.hs b/src/Rules/Program.hs index 32a8eb8..67a310f 100644 --- a/src/Rules/Program.hs +++ b/src/Rules/Program.hs @@ -19,7 +19,8 @@ buildProgram :: [(Resource, Int)] -> Rules () buildProgram rs = do root <- buildRootRules forM_ [Stage0 ..] $ \stage -> - root -/- stageString stage -/- "bin" -/- "*" %> \bin -> do + [ root -/- stageString stage -/- "bin" -/- "*" + , root -/- stageString stage -/- "lib/bin" -/- "*" ] |%> \bin -> do -- quite inefficient. But we can't access the programName from -- Rules, as it's an Action, due to being backed by an Oracle. From git at git.haskell.org Tue Oct 23 20:15:57 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:15:57 +0000 (UTC) Subject: [commit: ghc] master: Fix missing libHSghc-8.5-0.a (#574) (05fbe8b) Message-ID: <20181023201557.5A2763ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/05fbe8b36da146aae24c53455131b5b5618ee849/ghc >--------------------------------------------------------------- commit 05fbe8b36da146aae24c53455131b5b5618ee849 Author: Andrey Mokhov Date: Mon Apr 16 23:29:25 2018 +0100 Fix missing libHSghc-8.5-0.a (#574) * Drop support for lib0 libraries See #573 * Minor refactoring >--------------------------------------------------------------- 05fbe8b36da146aae24c53455131b5b5618ee849 src/Context.hs | 15 +++------------ src/Hadrian/Oracles/TextFile.hs | 11 ++++++----- src/Rules/Library.hs | 20 ++++++++------------ src/Utilities.hs | 11 +---------- 4 files changed, 18 insertions(+), 39 deletions(-) diff --git a/src/Context.hs b/src/Context.hs index 225752d..0694eb1 100644 --- a/src/Context.hs +++ b/src/Context.hs @@ -7,11 +7,9 @@ module Context ( withHsPackage, -- * Paths - contextDir, buildPath, buildDir, - pkgInplaceConfig, pkgSetupConfigFile, - pkgHaddockFile, pkgLibraryFile, pkgLibraryFile0, pkgGhciLibraryFile, - pkgConfFile, objectPath, contextPath, getContextPath, - libDir, libPath + contextDir, buildPath, buildDir, pkgInplaceConfig, pkgSetupConfigFile, + pkgHaddockFile, pkgLibraryFile, pkgGhciLibraryFile, pkgConfFile, objectPath, + contextPath, getContextPath, libDir, libPath ) where import Base @@ -101,13 +99,6 @@ pkgLibraryFile context at Context {..} = do extension <- libsuf way pkgFile context "libHS" extension --- | Path to the auxiliary library file of a given 'Context', e.g.: --- @_build/stage1/compiler/build/libHSghc-8.1-0.a at . -pkgLibraryFile0 :: Context -> Action FilePath -pkgLibraryFile0 context at Context {..} = do - extension <- libsuf way - pkgFile context "libHS" ("-0" ++ extension) - -- | Path to the GHCi library file of a given 'Context', e.g.: -- @_build/stage1/libraries/array/build/HSarray-0.5.1.0.o at . pkgGhciLibraryFile :: Context -> Action FilePath diff --git a/src/Hadrian/Oracles/TextFile.hs b/src/Hadrian/Oracles/TextFile.hs index 98c098a..2f58fab 100644 --- a/src/Hadrian/Oracles/TextFile.hs +++ b/src/Hadrian/Oracles/TextFile.hs @@ -147,10 +147,11 @@ textFileOracle = do confCabal <- newCache $ \(ctx at Context {..}) -> do case pkgCabalFile package of - Just file -> do - need [file] - putLoud $ "| PackageDataFile oracle: reading " ++ quote file ++ " (Stage: " ++ stageString stage ++ ")..." - Just <$> parsePackageData ctx - Nothing -> return Nothing + Just file -> do + need [file] + putLoud $ "| PackageDataFile oracle: reading " ++ quote file + ++ " (Stage: " ++ stageString stage ++ ")..." + Just <$> parsePackageData ctx + Nothing -> return Nothing void $ addOracle $ \(PackageDataFile ctx) -> confCabal ctx diff --git a/src/Rules/Library.hs b/src/Rules/Library.hs index 000d032..6ce0a71 100644 --- a/src/Rules/Library.hs +++ b/src/Rules/Library.hs @@ -12,7 +12,6 @@ import Expression hiding (way, package) import Flavour import GHC.Packages import Oracles.ModuleFiles -import Oracles.Setting import Rules.Gmp import Settings import Target @@ -60,8 +59,8 @@ buildDynamicLib :: Context -> Rules () buildDynamicLib context at Context{..} = do root <- buildRootRules pkgId <- case pkgCabalFile package of - Just file -> liftIO $ parseCabalPkgId file - Nothing -> return (pkgName package) + Just file -> liftIO $ parseCabalPkgId file + Nothing -> return $ pkgName package let libPrefix = root -/- buildDir context -/- "libHS" ++ pkgId -- OS X libPrefix ++ "*.dylib" %> buildDynamicLibUnix @@ -79,20 +78,17 @@ buildPackageLibrary :: Context -> Rules () buildPackageLibrary context at Context {..} = do root <- buildRootRules pkgId <- case pkgCabalFile package of - Just file -> liftIO (parseCabalPkgId file) - Nothing -> return (pkgName package) + Just file -> liftIO $ parseCabalPkgId file + Nothing -> return $ pkgName package let libPrefix = root -/- buildDir context -/- "libHS" ++ pkgId archive = libPrefix ++ (waySuffix way <.> "a") archive %%> \a -> do objs <- libraryObjects context - asuf <- libsuf way - let isLib0 = ("//*-0" ++ asuf) ?== a removeFile a - if isLib0 then build $ target context (Ar Pack stage) [] [a] -- TODO: Scan for dlls - else build $ target context (Ar Pack stage) objs [a] + build $ target context (Ar Pack stage) objs [a] synopsis <- pkgSynopsis context - unless isLib0 . putSuccess $ renderLibrary + putSuccess $ renderLibrary (quote (pkgName package) ++ " (" ++ show stage ++ ", way " ++ show way ++ ").") a synopsis @@ -101,13 +97,13 @@ buildPackageLibrary context at Context {..} = do buildPackageGhciLibrary :: Context -> Rules () buildPackageGhciLibrary context at Context {..} = priority 2 $ do root <- buildRootRules + -- TODO: Get rid of code duplication for 'pkgId'. pkgId <- case pkgCabalFile package of Just file -> liftIO $ parseCabalPkgId file Nothing -> return $ pkgName package let libPrefix = root -/- buildDir context -/- "HS" ++ pkgId - o = libPrefix ++ "*" ++ (waySuffix way <.> "o") - o %> \obj -> do + libPrefix ++ "*" ++ (waySuffix way <.> "o") %> \obj -> do objs <- allObjects context need objs build $ target context (Ld stage) objs [obj] diff --git a/src/Utilities.hs b/src/Utilities.hs index 57faf41..2c73d94 100644 --- a/src/Utilities.hs +++ b/src/Utilities.hs @@ -13,8 +13,6 @@ import Hadrian.Utilities import Context import Expression hiding (stage) -import GHC.Packages -import Oracles.Setting (windowsHost) import Settings import Target @@ -67,18 +65,11 @@ stage1Dependencies = libraryTargets :: Bool -> Context -> Action [FilePath] libraryTargets includeGhciLib context = do libFile <- pkgLibraryFile context - lib0File <- pkgLibraryFile0 context - lib0 <- buildDll0 context ghciLib <- pkgGhciLibraryFile context ghci <- if includeGhciLib then interpretInContext context $ getPackageData PD.buildGhciLib else return False - return $ [ libFile ] ++ [ lib0File | lib0 ] ++ [ ghciLib | ghci ] - - where buildDll0 :: Context -> Action Bool - buildDll0 Context {..} = do - windows <- windowsHost - return $ windows && stage == Stage1 && package == compiler + return $ [ libFile ] ++ [ ghciLib | ghci ] -- | Coarse-grain 'need': make sure all given libraries are fully built. needLibrary :: [Context] -> Action () From git at git.haskell.org Tue Oct 23 20:16:01 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:16:01 +0000 (UTC) Subject: [commit: ghc] master: Fix lint error (#575) (5b8f442) Message-ID: <20181023201601.60FA93ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/5b8f442f1ac886496ac1b7f8c0234171f8f5f199/ghc >--------------------------------------------------------------- commit 5b8f442f1ac886496ac1b7f8c0234171f8f5f199 Author: Andrey Mokhov Date: Tue Apr 17 01:31:33 2018 +0100 Fix lint error (#575) * Minor revision * Use untracked doesFileExist >--------------------------------------------------------------- 5b8f442f1ac886496ac1b7f8c0234171f8f5f199 src/Rules/Register.hs | 44 ++++++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/src/Rules/Register.hs b/src/Rules/Register.hs index ed0cb2b..b66f085 100644 --- a/src/Rules/Register.hs +++ b/src/Rules/Register.hs @@ -10,6 +10,7 @@ import Utilities import Distribution.ParseUtils import qualified Distribution.Compat.ReadP as Parse import Distribution.Version (Version) +import qualified System.Directory as IO import Hadrian.Expression import Hadrian.Haskell.Cabal.Parse as Cabal @@ -22,24 +23,24 @@ parseCabalName = readPToMaybe parse -- by running the @ghc-pkg@ utility. registerPackages :: [(Resource, Int)] -> Context -> Rules () registerPackages rs context at Context {..} = do - root <- buildRootRules - root -/- relativePackageDbPath stage %> - buildStamp rs context - - root -/- relativePackageDbPath stage -/- packageDbStamp %> \stamp -> - writeFileLines stamp [] - - root -/- relativePackageDbPath stage -/- "*.conf" %> \conf -> do - settings <- libPath context <&> (-/- "settings") - platformConstants <- libPath context <&> (-/- "platformConstants") - need [settings, platformConstants] - let Just pkgName | takeBaseName conf == "rts" = Just "rts" - | otherwise = fst <$> parseCabalName (takeBaseName conf) - let Just pkg = findPackageByName pkgName - bootLibs <- filter isLibrary <$> stagePackages Stage0 - case stage of - Stage0 | pkg `notElem` bootLibs -> copyConf rs (context { package = pkg }) conf - _ -> buildConf rs (context { package = pkg }) conf + root <- buildRootRules + root -/- relativePackageDbPath stage %> buildStamp rs context + + root -/- relativePackageDbPath stage -/- packageDbStamp %> \stamp -> + writeFileLines stamp [] + + -- TODO: Add proper error handling for partial functions. + root -/- relativePackageDbPath stage -/- "*.conf" %> \conf -> do + settings <- libPath context <&> (-/- "settings") + platformConstants <- libPath context <&> (-/- "platformConstants") + need [settings, platformConstants] + let Just pkgName | takeBaseName conf == "rts" = Just "rts" + | otherwise = fst <$> parseCabalName (takeBaseName conf) + let Just pkg = findPackageByName pkgName + isBoot <- (pkg `notElem`) <$> stagePackages Stage0 + case stage of + Stage0 | isBoot -> copyConf rs (context { package = pkg }) conf + _ -> buildConf rs (context { package = pkg }) conf buildConf :: [(Resource, Int)] -> Context -> FilePath -> Action () buildConf _ context at Context {..} _conf = do @@ -76,13 +77,16 @@ buildConf _ context at Context {..} _conf = do copyConf :: [(Resource, Int)] -> Context -> FilePath -> Action () copyConf rs context at Context {..} conf = do depPkgIds <- fmap stdOutToPkgIds . askWithResources rs $ - target context (GhcPkg Dependencies stage) [pkgName package] [] + target context (GhcPkg Dependencies stage) [pkgName package] [] need =<< mapM (\pkgId -> packageDbPath stage <&> (-/- pkgId <.> "conf")) depPkgIds -- We should unregister if the file exists since @ghc-pkg@ will complain -- about existing package: https://github.com/snowleopard/hadrian/issues/543. -- Also, we don't always do the unregistration + registration to avoid -- repeated work after a full build. - unlessM (doesFileExist conf) $ do + -- We do not track 'doesFileExist' since we are going to create the file if + -- it is currently missing. TODO: Is this the right thing to do? + -- See https://github.com/snowleopard/hadrian/issues/569. + unlessM (liftIO $ IO.doesFileExist conf) $ do buildWithResources rs $ target context (GhcPkg Unregister stage) [pkgName package] [] buildWithResources rs $ From git at git.haskell.org Tue Oct 23 20:16:05 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:16:05 +0000 (UTC) Subject: [commit: ghc] master: Speed up AppVeyor build (5276bf5) Message-ID: <20181023201605.5BEE23ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/5276bf540756133a8b6506a293131929db801569/ghc >--------------------------------------------------------------- commit 5276bf540756133a8b6506a293131929db801569 Author: Andrey Mokhov Date: Tue Apr 17 01:44:03 2018 +0100 Speed up AppVeyor build >--------------------------------------------------------------- 5276bf540756133a8b6506a293131929db801569 appveyor.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 69e3b90..f8fe198 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -36,11 +36,8 @@ build_script: - hadrian\stack exec -- bash configure --enable-distro-toolchain - cd hadrian - # Build Hadrian and run internal Hadrian tests - - build selftest - # Build GHC - - build -j --flavour=quickest --no-progress --progress-colour=never --profile=- + - build -j --flavour=quickest --integer-simple --no-progress --progress-colour=never --profile=- # Test GHC binary - cd .. From git at git.haskell.org Tue Oct 23 20:16:09 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:16:09 +0000 (UTC) Subject: [commit: ghc] master: Generic library rules (#571) (d021ffc) Message-ID: <20181023201609.74C6D3ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/d021ffc30b7cb0cd616ec44059f122b49e0b3f58/ghc >--------------------------------------------------------------- commit d021ffc30b7cb0cd616ec44059f122b49e0b3f58 Author: Alp Mestanogullari Date: Tue Apr 17 19:03:36 2018 +0200 Generic library rules (#571) * wip * debugging output * Compute ProjectVersion on demand ONLY! * remove debugging output, boot with --hadrian * go back to using -c everywhere in .travis.yml * prioritise libgmp.a rule over catch-all *.a rule, to avoid conflict * add missing import * tentative fix for the appveyor script * use backslashes in appveyor.yml * less 'cd'ing around in appveyor.yml * address most of @snowleopard's feedback * address last bit of feedback >--------------------------------------------------------------- d021ffc30b7cb0cd616ec44059f122b49e0b3f58 .travis.yml | 21 +-- appveyor.yml | 6 +- hadrian.cabal | 1 + src/Rules.hs | 15 +- src/Rules/Configure.hs | 3 +- src/Rules/Gmp.hs | 5 +- src/Rules/Libffi.hs | 4 +- src/Rules/Library.hs | 364 +++++++++++++++++++++++++++++++++++------------ src/Settings/Packages.hs | 6 +- src/Way.hs | 2 +- src/Way/Type.hs | 4 + 11 files changed, 309 insertions(+), 122 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc d021ffc30b7cb0cd616ec44059f122b49e0b3f58 From git at git.haskell.org Tue Oct 23 20:16:13 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:16:13 +0000 (UTC) Subject: [commit: ghc] master: Fix warning (99c262b) Message-ID: <20181023201613.776A73ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/99c262bfe240215c993304dacca611cb5d880557/ghc >--------------------------------------------------------------- commit 99c262bfe240215c993304dacca611cb5d880557 Author: Andrey Mokhov Date: Tue Apr 17 19:47:29 2018 +0100 Fix warning >--------------------------------------------------------------- 99c262bfe240215c993304dacca611cb5d880557 src/Rules/Library.hs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Rules/Library.hs b/src/Rules/Library.hs index 314d124..0f74d9d 100644 --- a/src/Rules/Library.hs +++ b/src/Rules/Library.hs @@ -10,7 +10,6 @@ import Expression hiding (way, package) import Flavour import GHC.Packages import Oracles.ModuleFiles -import Oracles.Setting (libsuf) import Rules.Gmp import Settings import Target From git at git.haskell.org Tue Oct 23 20:16:18 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:16:18 +0000 (UTC) Subject: [commit: ghc] master: Fix CircleCI (66bc48c) Message-ID: <20181023201618.2C9BC3ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/66bc48cada640cd53ee09c9b9832859f153e231d/ghc >--------------------------------------------------------------- commit 66bc48cada640cd53ee09c9b9832859f153e231d Author: Andrey Mokhov Date: Tue Apr 17 19:48:16 2018 +0100 Fix CircleCI >--------------------------------------------------------------- 66bc48cada640cd53ee09c9b9832859f153e231d circle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/circle.yml b/circle.yml index 66d5193..67b287d 100644 --- a/circle.yml +++ b/circle.yml @@ -43,4 +43,4 @@ compile: test: override: # Test GHC binary - - ghc/inplace/bin/ghc-stage2 -e 1+2 + - _build/stage1/bin/ghc -e 1+2 From git at git.haskell.org Tue Oct 23 20:16:22 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:16:22 +0000 (UTC) Subject: [commit: ghc] master: Fix path to GHC (1174b31) Message-ID: <20181023201622.396A23ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/1174b31551fb954cb5568a34170a5ebcc5b9d292/ghc >--------------------------------------------------------------- commit 1174b31551fb954cb5568a34170a5ebcc5b9d292 Author: Andrey Mokhov Date: Tue Apr 17 20:32:56 2018 +0100 Fix path to GHC See #541 >--------------------------------------------------------------- 1174b31551fb954cb5568a34170a5ebcc5b9d292 circle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/circle.yml b/circle.yml index 67b287d..10b9094 100644 --- a/circle.yml +++ b/circle.yml @@ -43,4 +43,4 @@ compile: test: override: # Test GHC binary - - _build/stage1/bin/ghc -e 1+2 + - ghc/_build/stage1/bin/ghc -e 1+2 From git at git.haskell.org Tue Oct 23 20:16:26 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:16:26 +0000 (UTC) Subject: [commit: ghc] master: Fix AppVeyor (#577) (9110813) Message-ID: <20181023201626.6376E3ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/911081374f58514e76520ae755614c5a0000073c/ghc >--------------------------------------------------------------- commit 911081374f58514e76520ae755614c5a0000073c Author: Andrey Mokhov Date: Wed Apr 18 01:34:10 2018 +0100 Fix AppVeyor (#577) * Copy inplace/mingw to the build root * Run Hadrian with -c on AppVeyor >--------------------------------------------------------------- 911081374f58514e76520ae755614c5a0000073c appveyor.yml | 8 ++------ src/Rules/Configure.hs | 8 +++++++- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 85bfee8..1a18abe 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -30,13 +30,9 @@ install: - appveyor-retry stack exec -- pacman -S autoconf automake-wrapper make patch python3 tar --noconfirm build_script: - # Boot and configure ghc source tree - - cd .. - - hadrian\stack exec -- python3 boot - - hadrian\stack exec -- bash configure --enable-distro-toolchain - # Build GHC - - hadrian\build -j --flavour=quickest --integer-simple --no-progress --progress-colour=never --profile=- + - cd .. + - hadrian\build -c -j --flavour=quickest --integer-simple --no-progress --progress-colour=never --profile=- # Test GHC binary - _build\stage1\bin\ghc -e 1+2 diff --git a/src/Rules/Configure.hs b/src/Rules/Configure.hs index 1fd07de..050d7f3 100644 --- a/src/Rules/Configure.hs +++ b/src/Rules/Configure.hs @@ -12,7 +12,7 @@ import Utilities configureRules :: Rules () configureRules = do - -- TODO: consider other files we should track here (rts/rts.cabal etc) + -- TODO: consider other files we should track here, e.g. @rts/rts.cabal at . [configFile, "settings", configH, "compiler/ghc.cabal"] &%> \outs -> do skip <- not <$> cmdConfigure if skip @@ -29,6 +29,12 @@ configureRules = do context = vanillaContext Stage0 compiler need srcs build $ target context (Configure ".") srcs outs + -- We need to copy the directory with unpacked Windows tarball to + -- the build directory, so that the built GHC has access to it. + -- See https://github.com/snowleopard/hadrian/issues/564. + when System.isWindows $ do + root <- buildRoot + copyDirectory "inplace/mingw" (root -/- "mingw") ["configure", configH <.> "in"] &%> \_ -> do skip <- not <$> cmdConfigure From git at git.haskell.org Tue Oct 23 20:16:30 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:16:30 +0000 (UTC) Subject: [commit: ghc] master: Update README.md (#578) (64da39c) Message-ID: <20181023201630.C31553ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/64da39cc9f955d7c1492ab39927a8e0849b23f00/ghc >--------------------------------------------------------------- commit 64da39cc9f955d7c1492ab39927a8e0849b23f00 Author: Alp Mestanogullari Date: Mon Apr 23 14:21:55 2018 +0200 Update README.md (#578) I noticed that one sentence from the README is out of date, so here's a tentative wording that reflects the current state of things. >--------------------------------------------------------------- 64da39cc9f955d7c1492ab39927a8e0849b23f00 README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 2509dae..5da7990 100644 --- a/README.md +++ b/README.md @@ -10,9 +10,10 @@ project and the architecture of the build system you can find more details in this [Haskell Symposium 2016 paper](https://dl.acm.org/authorize?N41275) and this [Haskell eXchange 2016 talk][talk]. -The new build system can work side-by-side with the existing build system. Note, there is -some interaction between them: they put (some) build results in the same directories, -e.g. the resulting GHC is `inplace/bin/ghc-stage2`. +The new build system can work side-by-side with the existing build system, since it +places all build artefacts under a dedicated directory. The only thing they both share +is the need to run the `./boot` and `./configure` scripts, even though Hadrian can do it +for you (see the documentation for the `-c` flag below). Your first build ---------------- From git at git.haskell.org Tue Oct 23 20:16:35 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:16:35 +0000 (UTC) Subject: [commit: ghc] master: Link to Quick Start guide (7c3c45f) Message-ID: <20181023201635.22B593ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/7c3c45f4539af8e75764a1c100dfbb35a86f4be3/ghc >--------------------------------------------------------------- commit 7c3c45f4539af8e75764a1c100dfbb35a86f4be3 Author: Andrey Mokhov Date: Tue Apr 24 11:27:09 2018 +0100 Link to Quick Start guide >--------------------------------------------------------------- 7c3c45f4539af8e75764a1c100dfbb35a86f4be3 README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 5da7990..6221353 100644 --- a/README.md +++ b/README.md @@ -11,9 +11,9 @@ this [Haskell Symposium 2016 paper](https://dl.acm.org/authorize?N41275) and thi [Haskell eXchange 2016 talk][talk]. The new build system can work side-by-side with the existing build system, since it -places all build artefacts under a dedicated directory. The only thing they both share -is the need to run the `./boot` and `./configure` scripts, even though Hadrian can do it -for you (see the documentation for the `-c` flag below). +places all build artefacts in a dedicated directory (called `_build` by default). +See [this guide](https://ghc.haskell.org/trac/ghc/wiki/Building/Hadrian/QuickStart) +if you'd like to start using Hadrian for building GHC. Your first build ---------------- From git at git.haskell.org Tue Oct 23 20:16:39 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:16:39 +0000 (UTC) Subject: [commit: ghc] master: Fix missing symbols when cross-compiling (#583) (fcc62d1) Message-ID: <20181023201639.90CF23ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/fcc62d1efad0f216b5469f418f57b81a238804ea/ghc >--------------------------------------------------------------- commit fcc62d1efad0f216b5469f418f57b81a238804ea Author: Zhen Zhang Date: Fri Apr 27 18:57:59 2018 +0800 Fix missing symbols when cross-compiling (#583) >--------------------------------------------------------------- fcc62d1efad0f216b5469f418f57b81a238804ea src/Settings/Builders/Common.hs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Settings/Builders/Common.hs b/src/Settings/Builders/Common.hs index 36be143..3b8a413 100644 --- a/src/Settings/Builders/Common.hs +++ b/src/Settings/Builders/Common.hs @@ -29,9 +29,7 @@ cIncludeArgs = do gmpIncludeDir <- getSetting GmpIncludeDir ffiIncludeDir <- getSetting FfiIncludeDir - cross <- expr crossCompiling - compilerOrGhc <- package compiler ||^ package ghc - mconcat [ not (cross && compilerOrGhc) ? arg "-Iincludes" + mconcat [ arg "-Iincludes" , arg $ "-I" ++ root -/- generatedDir , arg $ "-I" ++ path , pure . map ("-I"++) . filter (/= "") $ [iconvIncludeDir, gmpIncludeDir] From git at git.haskell.org Tue Oct 23 20:16:43 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:16:43 +0000 (UTC) Subject: [commit: ghc] master: Update cross-compiling doc (#586) (7c04521) Message-ID: <20181023201643.7FEA03ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/7c045215719b151a154f14e9eb6f8416419203af/ghc >--------------------------------------------------------------- commit 7c045215719b151a154f14e9eb6f8416419203af Author: Zhen Zhang Date: Fri Apr 27 18:59:47 2018 +0800 Update cross-compiling doc (#586) >--------------------------------------------------------------- 7c045215719b151a154f14e9eb6f8416419203af doc/cross-compile.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/cross-compile.md b/doc/cross-compile.md index 5611d2a..724d0e1 100644 --- a/doc/cross-compile.md +++ b/doc/cross-compile.md @@ -16,11 +16,13 @@ After all the dependencies are in place: - `git submodule update --init` - `./configure --target=arm-linux-gnueabihf` - `cd hadrian` -- Modify `src/UserSettings.hs`, set `stage1Only` and `crossCompiling` to `True`. +- Modify `src/UserSettings.hs`, set `stage1Only` to `True`. - Build the compiler by e.g. `./build.sh --flavour=quickest --integer-simple -V -j` After that, you should have built `inplace/bin/ghc-stage1` cross compiler. We will go to the next section to validate this. +**NOTE**: Use of `-c` to configure the target is currently not supported. Please manually run `./configure` like above. + ## Test run Write a simple hello world haskell program: From git at git.haskell.org Tue Oct 23 20:16:47 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:16:47 +0000 (UTC) Subject: [commit: ghc] master: Add all the default-on extensions to build.global-db.bat (#587) (d8190ba) Message-ID: <20181023201647.9E9B23ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/d8190ba0a22ba6d0efbacf64e0186511fdb0fd34/ghc >--------------------------------------------------------------- commit d8190ba0a22ba6d0efbacf64e0186511fdb0fd34 Author: Neil Mitchell Date: Fri Apr 27 22:52:49 2018 +0100 Add all the default-on extensions to build.global-db.bat (#587) >--------------------------------------------------------------- d8190ba0a22ba6d0efbacf64e0186511fdb0fd34 build.global-db.bat | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/build.global-db.bat b/build.global-db.bat index 0d6a696..1022beb 100644 --- a/build.global-db.bat +++ b/build.global-db.bat @@ -3,19 +3,25 @@ setlocal cd %~dp0 mkdir bin 2> nul -set ghcArgs=--make ^ - -Wall ^ - -fno-warn-name-shadowing ^ - -XRecordWildCards ^ - src\Main.hs ^ - -threaded ^ - -isrc ^ - -i..\libraries\Cabal\Cabal ^ - -rtsopts ^ - -with-rtsopts=-I0 ^ - -outputdir=bin ^ - -j ^ - -O ^ +set ghcArgs=--make ^ + -Wall ^ + -fno-warn-name-shadowing ^ + -XDeriveGeneric ^ + -XFlexibleInstances ^ + -XGeneralizedNewtypeDeriving ^ + -XLambdaCase ^ + -XRecordWildCards ^ + -XScopedTypeVariables ^ + -XTupleSections ^ + src\Main.hs ^ + -threaded ^ + -isrc ^ + -i..\libraries\Cabal\Cabal ^ + -rtsopts ^ + -with-rtsopts=-I0 ^ + -outputdir=bin ^ + -j ^ + -O ^ -o bin\hadrian set hadrianArgs=--lint ^ From git at git.haskell.org Tue Oct 23 20:16:52 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:16:52 +0000 (UTC) Subject: [commit: ghc] master: Fix unlit by placing it under lib/bin/ instead of bin/ (#591) (a161b8e) Message-ID: <20181023201652.18F6B3ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/a161b8eee6d0465a605a9fb21a5be41078e9b42f/ghc >--------------------------------------------------------------- commit a161b8eee6d0465a605a9fb21a5be41078e9b42f Author: Alp Mestanogullari Date: Fri May 11 00:29:34 2018 +0200 Fix unlit by placing it under lib/bin/ instead of bin/ (#591) A nicer fix would involve patching GHC to not just look under $libexec/ but also under the directory where the GHC binary itself lives (bin/ for hadrian), so that we can leave all binaries under bin/. Addresses Trac #15132. >--------------------------------------------------------------- a161b8eee6d0465a605a9fb21a5be41078e9b42f src/GHC.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/GHC.hs b/src/GHC.hs index 0262823..5c690dd 100644 --- a/src/GHC.hs +++ b/src/GHC.hs @@ -131,8 +131,10 @@ programPath context at Context {..} = do -- The @touchy@ utility lives in the @lib/bin@ directory instead of @bin@, -- which is likely just a historical accident that will hopefully be fixed. -- See: https://github.com/snowleopard/hadrian/issues/570 - path <- if package /= touchy then stageBinPath stage - else stageLibPath stage <&> (-/- "bin") + -- Likewise for 'unlit'. + path <- if package `elem` [touchy, unlit] + then stageLibPath stage <&> (-/- "bin") + else stageBinPath stage pgm <- programName context return $ path -/- pgm <.> exe From git at git.haskell.org Tue Oct 23 20:16:55 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:16:55 +0000 (UTC) Subject: [commit: ghc] master: Fix redundant import, minor revision (1ee62bf) Message-ID: <20181023201655.E7FA23ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/1ee62bf5ed6aa82cf57b8a5a8160e30d66f4a170/ghc >--------------------------------------------------------------- commit 1ee62bf5ed6aa82cf57b8a5a8160e30d66f4a170 Author: Andrey Mokhov Date: Fri May 11 22:33:17 2018 +0200 Fix redundant import, minor revision >--------------------------------------------------------------- 1ee62bf5ed6aa82cf57b8a5a8160e30d66f4a170 src/Settings/Builders/Common.hs | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/src/Settings/Builders/Common.hs b/src/Settings/Builders/Common.hs index 3b8a413..1995c66 100644 --- a/src/Settings/Builders/Common.hs +++ b/src/Settings/Builders/Common.hs @@ -11,8 +11,7 @@ module Settings.Builders.Common ( import Base import Expression -import GHC.Packages -import Hadrian.Haskell.Cabal.PackageData as PD +import Hadrian.Haskell.Cabal.PackageData import Oracles.Flag import Oracles.Setting import Settings @@ -23,22 +22,21 @@ cIncludeArgs = do pkg <- getPackage root <- getBuildRoot path <- getBuildPath - incDirs <- getPackageData PD.includeDirs - depDirs <- getPackageData PD.depIncludeDirs + incDirs <- getPackageData includeDirs + depDirs <- getPackageData depIncludeDirs iconvIncludeDir <- getSetting IconvIncludeDir gmpIncludeDir <- getSetting GmpIncludeDir ffiIncludeDir <- getSetting FfiIncludeDir - mconcat [ arg "-Iincludes" , arg $ "-I" ++ root -/- generatedDir , arg $ "-I" ++ path , pure . map ("-I"++) . filter (/= "") $ [iconvIncludeDir, gmpIncludeDir] , flag UseSystemFfi ? arg ("-I" ++ ffiIncludeDir) - -- add the build path with include dirs in case we generated - -- some files with autoconf, which will end up in the build directory. + -- Add @incDirs@ in the build directory, since some files generated + -- with @autoconf@ may end up in the build directory. , pure [ "-I" ++ path -/- dir | dir <- incDirs ] - -- add the package directory with include dirs, for includes - -- shipped with the package + -- Add @incDirs@ in the package directory for include files shipped + -- with the package. , pure [ "-I" ++ pkgPath pkg -/- dir | dir <- incDirs ] , pure [ "-I" ++ unifyPath dir | dir <- depDirs ] ] @@ -58,12 +56,12 @@ cWarnings = mconcat packageDatabaseArgs :: Args packageDatabaseArgs = do - stage <- getStage - dbPath <- expr (packageDbPath stage) - expr (need [dbPath -/- packageDbStamp]) - root <- getBuildRoot - prefix <- ifM (builder Ghc) (return "-package-db ") (return "--package-db=") - arg $ prefix ++ root -/- relativePackageDbPath stage + stage <- getStage + dbPath <- expr (packageDbPath stage) + expr (need [dbPath -/- packageDbStamp]) + root <- getBuildRoot + prefix <- ifM (builder Ghc) (return "-package-db ") (return "--package-db=") + arg $ prefix ++ root -/- relativePackageDbPath stage bootPackageDatabaseArgs :: Args bootPackageDatabaseArgs = do From git at git.haskell.org Tue Oct 23 20:17:00 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:17:00 +0000 (UTC) Subject: [commit: ghc] master: Add checkPpr package and infrastructure for testsuite packages (#596) (44368b6) Message-ID: <20181023201700.3332E3ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/44368b61d78b4ccf4e5aa6312cd64f4b2466efc4/ghc >--------------------------------------------------------------- commit 44368b61d78b4ccf4e5aa6312cd64f4b2466efc4 Author: Andrey Mokhov Date: Sat May 12 00:28:56 2018 +0200 Add checkPpr package and infrastructure for testsuite packages (#596) See #593 >--------------------------------------------------------------- 44368b61d78b4ccf4e5aa6312cd64f4b2466efc4 src/GHC.hs | 16 ++++++++----- src/GHC/Packages.hs | 13 +++++----- src/Rules.hs | 44 ++++++++++++++++------------------ src/Rules/Program.hs | 68 ++++++++++++++++++++++++++-------------------------- src/Rules/Test.hs | 14 +++++------ 5 files changed, 77 insertions(+), 78 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 44368b61d78b4ccf4e5aa6312cd64f4b2466efc4 From git at git.haskell.org Tue Oct 23 20:17:04 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:17:04 +0000 (UTC) Subject: [commit: ghc] master: Add dependency on the new "llvm-passes" file. (#604) (85f2506) Message-ID: <20181023201704.0FBC03ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/85f2506f87c890ba985825c74dea92c10e80152e/ghc >--------------------------------------------------------------- commit 85f2506f87c890ba985825c74dea92c10e80152e Author: Kavon Farvardin Date: Wed May 16 18:28:04 2018 -0500 Add dependency on the new "llvm-passes" file. (#604) For details, see https://phabricator.haskell.org/D4695 >--------------------------------------------------------------- 85f2506f87c890ba985825c74dea92c10e80152e src/Base.hs | 1 + src/Rules/Generate.hs | 1 + src/Rules/Program.hs | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Base.hs b/src/Base.hs index fea33a9..430078d 100644 --- a/src/Base.hs +++ b/src/Base.hs @@ -111,6 +111,7 @@ ghcDeps stage = mapM (\f -> stageLibPath stage <&> (-/- f)) [ "ghc-usage.txt" , "ghci-usage.txt" , "llvm-targets" + , "llvm-passes" , "platformConstants" , "settings" ] diff --git a/src/Rules/Generate.hs b/src/Rules/Generate.hs index cc2bf4b..8355ccc 100644 --- a/src/Rules/Generate.hs +++ b/src/Rules/Generate.hs @@ -164,6 +164,7 @@ copyRules = do prefix -/- "ghc-usage.txt" <~ return "driver" prefix -/- "ghci-usage.txt" <~ return "driver" prefix -/- "llvm-targets" <~ return "." + prefix -/- "llvm-passes" <~ return "." prefix -/- "platformConstants" <~ (buildRoot <&> (-/- generatedDir)) prefix -/- "settings" <~ return "." prefix -/- "template-hsc.h" <~ return (pkgPath hsc2hs) diff --git a/src/Rules/Program.hs b/src/Rules/Program.hs index aebaaab..083f3cd 100644 --- a/src/Rules/Program.hs +++ b/src/Rules/Program.hs @@ -45,7 +45,8 @@ buildProgram rs = do need [template] when (package == ghc) $ do -- GHC depends on @settings@, @platformConstants@, - -- @llvm-targets@, @ghc-usage.txt@, @ghci-usage.txt at . + -- @llvm-targets@, @ghc-usage.txt@, @ghci-usage.txt@, + -- @llvm-passes at . need =<< ghcDeps stage cross <- crossCompiling From git at git.haskell.org Tue Oct 23 20:17:08 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:17:08 +0000 (UTC) Subject: [commit: ghc] master: Preliminary nofib rule (#599) (d6c4e04) Message-ID: <20181023201708.057AA3ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/d6c4e0423c3c41f01daf6a3e0403e8cf6ca82d95/ghc >--------------------------------------------------------------- commit d6c4e0423c3c41f01daf6a3e0403e8cf6ca82d95 Author: Alp Mestanogullari Date: Thu May 17 15:19:06 2018 +0200 Preliminary nofib rule (#599) * first draft of a nofib rule * address some of Andrey's feedback * refactor nofib into a proper Builder, now runs but one of the programs fails * more subtle error handling, docs * get rid of RunNofib builder, invoke commands directly >--------------------------------------------------------------- d6c4e0423c3c41f01daf6a3e0403e8cf6ca82d95 hadrian.cabal | 1 + src/Main.hs | 2 ++ src/Rules/Nofib.hs | 58 +++++++++++++++++++++++++++++++++++++++++++ src/Settings/Builders/Make.hs | 11 +++++++- 4 files changed, 71 insertions(+), 1 deletion(-) diff --git a/hadrian.cabal b/hadrian.cabal index 96d5891..0bcbf1f 100644 --- a/hadrian.cabal +++ b/hadrian.cabal @@ -62,6 +62,7 @@ executable hadrian , Rules.Gmp , Rules.Libffi , Rules.Library + , Rules.Nofib , Rules.Program , Rules.Register , Rules.Selftest diff --git a/src/Main.hs b/src/Main.hs index c90b052..083e683 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -10,6 +10,7 @@ import qualified Environment import qualified Rules import qualified Rules.Clean import qualified Rules.Documentation +import qualified Rules.Nofib import qualified Rules.SourceDist import qualified Rules.Selftest import qualified Rules.Test @@ -43,6 +44,7 @@ main = do Rules.buildRules Rules.Documentation.documentationRules Rules.Clean.cleanRules + Rules.Nofib.nofibRules Rules.oracleRules Rules.Selftest.selftestRules Rules.SourceDist.sourceDistRules diff --git a/src/Rules/Nofib.hs b/src/Rules/Nofib.hs new file mode 100644 index 0000000..e0ef5ea --- /dev/null +++ b/src/Rules/Nofib.hs @@ -0,0 +1,58 @@ +module Rules.Nofib where + +import Base +import Expression +import GHC +import Oracles.Setting +import Target + +import System.Environment +import System.Exit + +nofibRules :: Rules () +nofibRules = do + root <- buildRootRules + + -- a phony "nofib" rule that just triggers + -- the rule below. + "nofib" ~> need [root -/- nofibLogFile] + + -- a rule to produce /nofig-log + -- by running the nofib suite and capturing + -- the relevant output. + root -/- nofibLogFile %> \fp -> do + needNofibDeps + + makePath <- builderPath (Make "nofib") + top <- topDirectory + ghcPath <- builderPath (Ghc CompileHs Stage2) + perlPath <- builderPath Perl + + -- some makefiles in nofib rely on a $MAKE + -- env var being defined + liftIO (setEnv "MAKE" makePath) + + -- this runs make commands in the nofib + -- subdirectory, passing the path to + -- the GHC to benchmark and perl to + -- nofib's makefiles. + let nofibArgs = ["WithNofibHc=" ++ (top -/- ghcPath), "PERL=" ++ perlPath] + unit $ cmd (Cwd "nofib") [makePath] ["clean"] + unit $ cmd (Cwd "nofib") [makePath] (nofibArgs ++ ["boot"]) + (Exit e, Stdouterr log) <- cmd (Cwd "nofib") [makePath] nofibArgs + writeFile' fp log + if e == ExitSuccess + then putLoud $ "nofib log available at " ++ fp + else error $ "nofib failed, full log available at " ++ fp + +nofibLogFile :: FilePath +nofibLogFile = "nofib-log" + + +-- the dependencies that nofib seems to require. +needNofibDeps :: Action () +needNofibDeps = do + unlitPath <- programPath (Context Stage1 unlit vanilla) + mtlPath <- pkgConfFile (Context Stage1 mtl vanilla) + need [ unlitPath, mtlPath ] + needBuilder (Ghc CompileHs Stage2) diff --git a/src/Settings/Builders/Make.hs b/src/Settings/Builders/Make.hs index cc350df..79d73cc 100644 --- a/src/Settings/Builders/Make.hs +++ b/src/Settings/Builders/Make.hs @@ -1,5 +1,6 @@ module Settings.Builders.Make (makeBuilderArgs) where +import Builder import Rules.Gmp import Rules.Libffi import Settings.Builders.Common @@ -9,8 +10,16 @@ makeBuilderArgs = do threads <- shakeThreads <$> expr getShakeOptions gmpPath <- expr gmpBuildPath libffiPath <- expr libffiBuildPath + ghcPath <- expr $ + (-/-) <$> topDirectory <*> builderPath (Ghc CompileHs Stage2) + perlPath <- expr $ builderPath Perl let t = show $ max 4 (threads - 2) -- Don't use all Shake's threads mconcat [ builder (Make gmpPath ) ? pure ["MAKEFLAGS=-j" ++ t] , builder (Make libffiPath ) ? pure ["MAKEFLAGS=-j" ++ t, "install"] - , builder (Make "testsuite/tests") ? pure ["THREADS=" ++ t, "fast"] ] + , builder (Make "testsuite/tests") ? pure ["THREADS=" ++ t, "fast"] + , builder (Make "nofib" ) ? pure + [ "WithNofibHc=" ++ ghcPath + , "PERL=" ++ perlPath + ] + ] From git at git.haskell.org Tue Oct 23 20:17:11 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:17:11 +0000 (UTC) Subject: [commit: ghc] master: remove (unnecessary) recursive dependency involving ghcPath (#606) (3837187) Message-ID: <20181023201711.E94873ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/3837187e57bfcc9c00a717eb70cb3e9271525047/ghc >--------------------------------------------------------------- commit 3837187e57bfcc9c00a717eb70cb3e9271525047 Author: Alp Mestanogullari Date: Fri May 18 11:58:12 2018 +0200 remove (unnecessary) recursive dependency involving ghcPath (#606) >--------------------------------------------------------------- 3837187e57bfcc9c00a717eb70cb3e9271525047 src/Settings/Builders/Make.hs | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/Settings/Builders/Make.hs b/src/Settings/Builders/Make.hs index 79d73cc..d231fd7 100644 --- a/src/Settings/Builders/Make.hs +++ b/src/Settings/Builders/Make.hs @@ -1,6 +1,5 @@ module Settings.Builders.Make (makeBuilderArgs) where -import Builder import Rules.Gmp import Rules.Libffi import Settings.Builders.Common @@ -10,16 +9,9 @@ makeBuilderArgs = do threads <- shakeThreads <$> expr getShakeOptions gmpPath <- expr gmpBuildPath libffiPath <- expr libffiBuildPath - ghcPath <- expr $ - (-/-) <$> topDirectory <*> builderPath (Ghc CompileHs Stage2) - perlPath <- expr $ builderPath Perl let t = show $ max 4 (threads - 2) -- Don't use all Shake's threads mconcat [ builder (Make gmpPath ) ? pure ["MAKEFLAGS=-j" ++ t] , builder (Make libffiPath ) ? pure ["MAKEFLAGS=-j" ++ t, "install"] , builder (Make "testsuite/tests") ? pure ["THREADS=" ++ t, "fast"] - , builder (Make "nofib" ) ? pure - [ "WithNofibHc=" ++ ghcPath - , "PERL=" ++ perlPath - ] ] From git at git.haskell.org Tue Oct 23 20:17:16 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:17:16 +0000 (UTC) Subject: [commit: ghc] master: Add ghc-heap (c0292ff) Message-ID: <20181023201716.468A23ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/c0292ffcaee940cfd3a81a878a680e0e273c10bc/ghc >--------------------------------------------------------------- commit c0292ffcaee940cfd3a81a878a680e0e273c10bc Author: Andrey Mokhov Date: Sat May 26 00:17:48 2018 +0200 Add ghc-heap >--------------------------------------------------------------- c0292ffcaee940cfd3a81a878a680e0e273c10bc src/GHC.hs | 13 +++++++------ src/GHC/Packages.hs | 5 +++-- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/GHC.hs b/src/GHC.hs index 61bfb7f..bdb211b 100644 --- a/src/GHC.hs +++ b/src/GHC.hs @@ -3,12 +3,12 @@ module GHC ( -- * GHC packages array, base, binary, bytestring, cabal, checkPpr, compareSizes, compiler, containers, deepseq, deriveConstants, directory, filepath, genapply, - genprimopcode, ghc, ghcBoot, ghcBootTh, ghcCabal, ghcCompact, ghci, ghcPkg, - ghcPrim, ghcTags, ghcSplit, haddock, haskeline, hsc2hs, hp2ps, hpc, hpcBin, - integerGmp, integerSimple, iservBin, libffi, mtl, parsec, parallel, pretty, - primitive, process, rts, runGhc, stm, templateHaskell, terminfo, text, time, - touchy, transformers, unlit, unix, win32, xhtml, ghcPackages, isGhcPackage, - defaultPackages, testsuitePackages, + genprimopcode, ghc, ghcBoot, ghcBootTh, ghcCabal, ghcCompact, ghcHeap, ghci, + ghcPkg, ghcPrim, ghcTags, ghcSplit, haddock, haskeline, hsc2hs, hp2ps, hpc, + hpcBin, integerGmp, integerSimple, iservBin, libffi, mtl, parsec, parallel, + pretty, primitive, process, rts, runGhc, stm, templateHaskell, terminfo, + text, time, touchy, transformers, unlit, unix, win32, xhtml, ghcPackages, + isGhcPackage, defaultPackages, testsuitePackages, -- * Package information programName, nonCabalContext, nonHsMainPackage, autogenPath, installStage, @@ -46,6 +46,7 @@ stage0Packages = do , ghc , ghcBoot , ghcBootTh + , ghcHeap , ghci , ghcPkg , ghcTags diff --git a/src/GHC/Packages.hs b/src/GHC/Packages.hs index 79830dc..e7ede7f 100644 --- a/src/GHC/Packages.hs +++ b/src/GHC/Packages.hs @@ -13,8 +13,8 @@ ghcPackages :: [Package] ghcPackages = [ array, base, binary, bytestring, cabal, checkPpr, compareSizes, compiler , containers, deepseq, deriveConstants, directory, filepath, genapply - , genprimopcode, ghc, ghcBoot, ghcBootTh, ghcCompact, ghci, ghcPkg, ghcPrim - , ghcTags, haddock, haskeline, hsc2hs, hp2ps, hpc, hpcBin, integerGmp + , genprimopcode, ghc, ghcBoot, ghcBootTh, ghcCompact, ghcHeap, ghci, ghcPkg + , ghcPrim, ghcTags, haddock, haskeline, hsc2hs, hp2ps, hpc, hpcBin, integerGmp , integerSimple, iservBin, libffi, mtl, parsec, parallel, pretty, primitive , process, rts, runGhc, stm, templateHaskell, terminfo, text, time, touchy , transformers, unlit, unix, win32, xhtml ] @@ -44,6 +44,7 @@ ghcBoot = hsLib "ghc-boot" ghcBootTh = hsLib "ghc-boot-th" ghcCabal = hsUtil "ghc-cabal" ghcCompact = hsLib "ghc-compact" +ghcHeap = hsLib "ghc-heap" ghci = hsLib "ghci" ghcPkg = hsUtil "ghc-pkg" ghcPrim = hsLib "ghc-prim" From git at git.haskell.org Tue Oct 23 20:17:20 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:17:20 +0000 (UTC) Subject: [commit: ghc] master: Do not always add -Iincludes to C arguments (#610) (ec5e9d3) Message-ID: <20181023201720.6C7223ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/ec5e9d3acdf9ca5ae0e5808ad6f510e9167f2552/ghc >--------------------------------------------------------------- commit ec5e9d3acdf9ca5ae0e5808ad6f510e9167f2552 Author: Alp Mestanogullari Date: Wed Jun 6 22:26:13 2018 +0200 Do not always add -Iincludes to C arguments (#610) >--------------------------------------------------------------- ec5e9d3acdf9ca5ae0e5808ad6f510e9167f2552 src/Settings/Builders/Common.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Settings/Builders/Common.hs b/src/Settings/Builders/Common.hs index 1995c66..ae660db 100644 --- a/src/Settings/Builders/Common.hs +++ b/src/Settings/Builders/Common.hs @@ -11,6 +11,7 @@ module Settings.Builders.Common ( import Base import Expression +import GHC.Packages import Hadrian.Haskell.Cabal.PackageData import Oracles.Flag import Oracles.Setting @@ -27,7 +28,7 @@ cIncludeArgs = do iconvIncludeDir <- getSetting IconvIncludeDir gmpIncludeDir <- getSetting GmpIncludeDir ffiIncludeDir <- getSetting FfiIncludeDir - mconcat [ arg "-Iincludes" + mconcat [ notStage0 ||^ package compiler ? arg "-Iincludes" , arg $ "-I" ++ root -/- generatedDir , arg $ "-I" ++ path , pure . map ("-I"++) . filter (/= "") $ [iconvIncludeDir, gmpIncludeDir] From git at git.haskell.org Tue Oct 23 20:17:24 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:17:24 +0000 (UTC) Subject: [commit: ghc] master: Add libiserv, rename iserv-bin to iserv, drop primitive (#612) (8dba674) Message-ID: <20181023201724.8C42A3ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/8dba6748e84c632c3c0302620c3e62c9fcc3e948/ghc >--------------------------------------------------------------- commit 8dba6748e84c632c3c0302620c3e62c9fcc3e948 Author: Andrey Mokhov Date: Sun Jun 10 02:09:51 2018 +0100 Add libiserv, rename iserv-bin to iserv, drop primitive (#612) See https://phabricator.haskell.org/D4436 >--------------------------------------------------------------- 8dba6748e84c632c3c0302620c3e62c9fcc3e948 src/GHC.hs | 28 ++++++++++++++-------------- src/GHC/Packages.hs | 5 +++-- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/src/GHC.hs b/src/GHC.hs index bdb211b..037ecf6 100644 --- a/src/GHC.hs +++ b/src/GHC.hs @@ -5,8 +5,8 @@ module GHC ( containers, deepseq, deriveConstants, directory, filepath, genapply, genprimopcode, ghc, ghcBoot, ghcBootTh, ghcCabal, ghcCompact, ghcHeap, ghci, ghcPkg, ghcPrim, ghcTags, ghcSplit, haddock, haskeline, hsc2hs, hp2ps, hpc, - hpcBin, integerGmp, integerSimple, iservBin, libffi, mtl, parsec, parallel, - pretty, primitive, process, rts, runGhc, stm, templateHaskell, terminfo, + hpcBin, integerGmp, integerSimple, iserv, libffi, libiserv, mtl, parsec, + parallel, pretty, process, rts, runGhc, stm, templateHaskell, terminfo, text, time, touchy, transformers, unlit, unix, win32, xhtml, ghcPackages, isGhcPackage, defaultPackages, testsuitePackages, @@ -93,7 +93,8 @@ stage1Packages = do ++ [ haddock | not cross ] ++ [ runGhc | not cross ] ++ [ hpcBin | not cross ] - ++ [ iservBin | not win, not cross ] + ++ [ iserv | not win, not cross ] + ++ [ libiserv | not win, not cross ] ++ [ unix | not win ] ++ [ win32 | win ] @@ -114,11 +115,11 @@ programName Context {..} = do targetPlatform <- setting TargetPlatformFull let prefix = if cross then targetPlatform ++ "-" else "" in return $ prefix ++ case package of - p | p == ghc -> "ghc" - | p == hpcBin -> "hpc" - | p == runGhc -> "runhaskell" - | p == iservBin -> "ghc-iserv" - _ -> pkgName package + p | p == ghc -> "ghc" + | p == hpcBin -> "hpc" + | p == runGhc -> "runhaskell" + | p == iserv -> "ghc-iserv" + _ -> pkgName package -- | The build stage whose results are used when installing a package, or -- @Nothing@ if the package is not installed, e.g. because it is a user package. @@ -154,16 +155,15 @@ nonCabalContext Context {..} = (package `elem` [ hp2ps -- | Some program packages should not be linked with Haskell main function. nonHsMainPackage :: Package -> Bool -nonHsMainPackage = (`elem` [ghc, hp2ps, iservBin, touchy, unlit]) +nonHsMainPackage = (`elem` [ghc, hp2ps, iserv, touchy, unlit]) -- | Path to the autogen directory generated by @ghc-cabal@ of a given 'Context'. autogenPath :: Context -> Action FilePath autogenPath context at Context {..} - | isLibrary package = autogen "build" - | package == ghc = autogen "build/ghc" - | package == hpcBin = autogen "build/hpc" - | package == iservBin = autogen "build/iserv" - | otherwise = autogen $ "build" -/- pkgName package + | isLibrary package = autogen "build" + | package == ghc = autogen "build/ghc" + | package == hpcBin = autogen "build/hpc" + | otherwise = autogen $ "build" -/- pkgName package where autogen dir = contextPath context <&> (-/- dir -/- "autogen") diff --git a/src/GHC/Packages.hs b/src/GHC/Packages.hs index e7ede7f..5902396 100644 --- a/src/GHC/Packages.hs +++ b/src/GHC/Packages.hs @@ -15,7 +15,7 @@ ghcPackages = , containers, deepseq, deriveConstants, directory, filepath, genapply , genprimopcode, ghc, ghcBoot, ghcBootTh, ghcCompact, ghcHeap, ghci, ghcPkg , ghcPrim, ghcTags, haddock, haskeline, hsc2hs, hp2ps, hpc, hpcBin, integerGmp - , integerSimple, iservBin, libffi, mtl, parsec, parallel, pretty, primitive + , integerSimple, iserv, libffi, libiserv, mtl, parsec, parallel, pretty , process, rts, runGhc, stm, templateHaskell, terminfo, text, time, touchy , transformers, unlit, unix, win32, xhtml ] @@ -58,8 +58,9 @@ hpc = hsLib "hpc" hpcBin = hsUtil "hpc-bin" `setPath` "utils/hpc" integerGmp = hsLib "integer-gmp" integerSimple = hsLib "integer-simple" -iservBin = hsUtil "iserv-bin" `setPath` "iserv" +iserv = hsUtil "iserv" libffi = cTop "libffi" +libiserv = hsLib "libiserv" mtl = hsLib "mtl" parsec = hsLib "parsec" parallel = hsLib "parallel" From git at git.haskell.org Tue Oct 23 20:17:28 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:17:28 +0000 (UTC) Subject: [commit: ghc] master: Update RTS flags (#613) (a63ad32) Message-ID: <20181023201728.BAFDE3ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/a63ad3294b5d51eec50d454810a314c0b2a696c7/ghc >--------------------------------------------------------------- commit a63ad3294b5d51eec50d454810a314c0b2a696c7 Author: Andrey Mokhov Date: Tue Jun 12 11:19:52 2018 +0100 Update RTS flags (#613) * Update RTS flags See #611 * More tweaks >--------------------------------------------------------------- a63ad3294b5d51eec50d454810a314c0b2a696c7 src/Settings/Packages/Rts.hs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/Settings/Packages/Rts.hs b/src/Settings/Packages/Rts.hs index a4ba3dd..67ea3e7 100644 --- a/src/Settings/Packages/Rts.hs +++ b/src/Settings/Packages/Rts.hs @@ -115,6 +115,7 @@ rtsPackageArgs = package rts ? do , arg $ "-DRtsWay=\"rts_" ++ show way ++ "\"" -- Set the namespace for the rts fs functions , arg $ "-DFS_NAMESPACE=rts" + , arg $ "-DCOMPILING_RTS" -- RTS *must* be compiled with optimisations. The INLINE_HEADER macro -- requires that functions are inlined to work as expected. Inlining -- only happens for optimised builds. Otherwise we can assume that @@ -122,8 +123,13 @@ rtsPackageArgs = package rts ? do -- provide non-inlined alternatives and hence needs the function to -- be inlined. See https://github.com/snowleopard/hadrian/issues/90. , arg "-O2" + , arg "-fomit-frame-pointer" + , arg "-g" - , Debug `wayUnit` way ? arg "-DDEBUG" + , Debug `wayUnit` way ? pure [ "-DDEBUG" + , "-fno-omit-frame-pointer" + , "-g" + , "-O0" ] , way `elem` [debug, debugDynamic] ? arg "-DTICKY_TICKY" , Profiling `wayUnit` way ? arg "-DPROFILING" , Threaded `wayUnit` way ? arg "-DTHREADED_RTS" @@ -153,8 +159,7 @@ rtsPackageArgs = package rts ? do , input "//xxhash.c" ? pure [ "-O3" , "-ffast-math" - , "-ftree-vectorize" - ] + , "-ftree-vectorize" ] , inputs ["//Evac.c", "//Evac_thr.c"] ? arg "-funroll-loops" @@ -175,7 +180,6 @@ rtsPackageArgs = package rts ? do -- emits warnings about call-clobbered registers on x86_64 , inputs [ "//RetainerProfile.c", "//StgCRun.c" , "//win32/ConsoleHandler.c", "//win32/ThrIOManager.c"] ? arg "-w" - , inputs ["//RetainerSet.c"] ? arg "-Wno-format" -- The above warning suppression flags are a temporary kludge. -- While working on this module you are encouraged to remove it and fix -- any warnings in the module. See: @@ -184,7 +188,6 @@ rtsPackageArgs = package rts ? do , (not <$> flag GccIsClang) ? inputs ["//Compact.c"] ? arg "-finline-limit=2500" - , input "//StgCRun.c" ? windowsHost ? arg "-Wno-return-local-addr" , input "//RetainerProfile.c" ? flag GccIsClang ? arg "-Wno-incompatible-pointer-types" , windowsHost ? arg ("-DWINVER=" ++ windowsVersion) From git at git.haskell.org Tue Oct 23 20:17:32 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:17:32 +0000 (UTC) Subject: [commit: ghc] master: Added support for testsuite (#602) (ef4137d) Message-ID: <20181023201732.E83E53ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/ef4137d7e4a8f8f703278042e25f1ab0990ab4df/ghc >--------------------------------------------------------------- commit ef4137d7e4a8f8f703278042e25f1ab0990ab4df Author: Chitrak Raj Gupta Date: Wed Jun 13 15:58:25 2018 +0530 Added support for testsuite (#602) * Rule for testsuite dependencies * Separated validate builder arguments * Added RunTest config options * added support to set test speed with runtest * Fixed minor bug with testConfigs Removed indentation error * Added support for more testing features * Rectified Merge Errors * Removed need rule for Hp2ps * using all available threads * Minor Revision * Removed TestThread argument * Update Utilities.hs >--------------------------------------------------------------- ef4137d7e4a8f8f703278042e25f1ab0990ab4df src/CommandLine.hs | 85 ++++++++++++++++++++++++++++++---------- src/GHC.hs | 21 +++++----- src/GHC/Packages.hs | 15 +++---- src/Rules/Test.hs | 13 +++++- src/Settings/Builders/Make.hs | 23 ++++++++++- src/Settings/Builders/RunTest.hs | 35 +++++++++++++++-- src/Settings/Default.hs | 1 + 7 files changed, 150 insertions(+), 43 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc ef4137d7e4a8f8f703278042e25f1ab0990ab4df From git at git.haskell.org Tue Oct 23 20:17:36 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:17:36 +0000 (UTC) Subject: [commit: ghc] master: Bump Shake version to 0.16.1. (#618) (ccf6453) Message-ID: <20181023201736.D0A603ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/ccf6453f33ef02213b1cc2f680698228e8485a7d/ghc >--------------------------------------------------------------- commit ccf6453f33ef02213b1cc2f680698228e8485a7d Author: Tao He Date: Wed Jun 13 18:31:26 2018 +0800 Bump Shake version to 0.16.1. (#618) The shake-0.16 can't be built with ghc-8.4.3, due to the Semigroup-Monoid-Proposal changes. shake-0.16.1 fixed that. >--------------------------------------------------------------- ccf6453f33ef02213b1cc2f680698228e8485a7d hadrian.cabal | 2 +- stack.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hadrian.cabal b/hadrian.cabal index 0bcbf1f..ef90c74 100644 --- a/hadrian.cabal +++ b/hadrian.cabal @@ -121,7 +121,7 @@ executable hadrian , mtl == 2.2.* , parsec >= 3.1 && < 3.2 , QuickCheck >= 2.6 && < 2.11 - , shake == 0.16.* + , shake >= 0.16.1 , transformers >= 0.4 && < 0.6 , unordered-containers >= 0.2.1 && < 0.3 build-tools: alex >= 3.1 diff --git a/stack.yaml b/stack.yaml index 663389f..61767bd 100644 --- a/stack.yaml +++ b/stack.yaml @@ -10,7 +10,7 @@ packages: - '../libraries/text' extra-deps: -- shake-0.16 +- shake-0.16.1 nix: enable: false From git at git.haskell.org Tue Oct 23 20:17:40 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:17:40 +0000 (UTC) Subject: [commit: ghc] master: Add `gmp` and `ncurses` as nix dependencies (#616) (c51b92b) Message-ID: <20181023201740.C86733ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/c51b92b59d638f0692b7649d1aad226c5b500a56/ghc >--------------------------------------------------------------- commit c51b92b59d638f0692b7649d1aad226c5b500a56 Author: Sean Gillespie Date: Wed Jun 13 07:04:57 2018 -0400 Add `gmp` and `ncurses` as nix dependencies (#616) See #615 >--------------------------------------------------------------- c51b92b59d638f0692b7649d1aad226c5b500a56 shell.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/shell.nix b/shell.nix index f193000..041bf09 100644 --- a/shell.nix +++ b/shell.nix @@ -76,6 +76,8 @@ in [ hadrianPackages.hadrian nixpkgs.arcanist nixpkgs.git + nixpkgs.gmp.dev nixpkgs.gmp.out + nixpkgs.ncurses.dev nixpkgs.ncurses.out nixpkgs.python3Packages.sphinx nixpkgs.texlive.combined.scheme-basic (nixpkgs.haskell.packages.ghc822.ghcWithPackages From git at git.haskell.org Tue Oct 23 20:17:44 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:17:44 +0000 (UTC) Subject: [commit: ghc] master: Minor revision (#619) (c866660) Message-ID: <20181023201744.EDA4C3ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/c866660513a23723209a81f07b1b859265fe33bf/ghc >--------------------------------------------------------------- commit c866660513a23723209a81f07b1b859265fe33bf Author: Andrey Mokhov Date: Thu Jun 14 01:43:31 2018 +0100 Minor revision (#619) See #540 >--------------------------------------------------------------- c866660513a23723209a81f07b1b859265fe33bf src/GHC.hs | 6 +- src/Hadrian/Haskell/Cabal/PackageData.hs | 69 ++++---- src/Hadrian/Haskell/Cabal/Parse.hs | 125 +++++++-------- src/Oracles/Flag.hs | 10 +- src/Rules/Generate.hs | 6 +- src/Rules/Program.hs | 4 +- src/Settings/Builders/GhcCabal.hs | 5 +- src/Settings/Builders/Hsc2Hs.hs | 4 +- src/Settings/Builders/RunTest.hs | 2 +- src/Settings/Packages.hs | 263 ++++++++++++++++++------------- src/Settings/Packages/Compiler.hs | 2 +- 11 files changed, 268 insertions(+), 228 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc c866660513a23723209a81f07b1b859265fe33bf From git at git.haskell.org Tue Oct 23 20:17:49 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:17:49 +0000 (UTC) Subject: [commit: ghc] master: Add test compiler option to test (#621) (0b35e12) Message-ID: <20181023201749.0B4C63ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/0b35e12f4d90227e62ac9a5c700b95ce40f70a3a/ghc >--------------------------------------------------------------- commit 0b35e12f4d90227e62ac9a5c700b95ce40f70a3a Author: Chitrak Raj Gupta Date: Fri Jun 15 03:23:24 2018 +0530 Add test compiler option to test (#621) * Rule for testsuite dependencies * Added RunTest config options * added support to set test speed with runtest * Added support for more testing features * Rectified Merge Errors * using all available threads * Minor Revision * Removed TestThread argument * Update Utilities.hs * Added support to choose test compiler * Minor Revision * Added comments * Update RunTest.hs * Update CommandLine.hs * Update RunTest.hs >--------------------------------------------------------------- 0b35e12f4d90227e62ac9a5c700b95ce40f70a3a src/CommandLine.hs | 17 +++++-- src/Oracles/Setting.hs | 2 + src/Rules/Test.hs | 1 - src/Settings/Builders/RunTest.hs | 105 ++++++++++++++++++++++++--------------- 4 files changed, 79 insertions(+), 46 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 0b35e12f4d90227e62ac9a5c700b95ce40f70a3a From git at git.haskell.org Tue Oct 23 20:17:53 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:17:53 +0000 (UTC) Subject: [commit: ghc] master: Refactor package-specific settings (#622) (2358090) Message-ID: <20181023201753.1CB193ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/235809092b65d1631735b70e9ce9dd2e9ebab47d/ghc >--------------------------------------------------------------- commit 235809092b65d1631735b70e9ce9dd2e9ebab47d Author: Andrey Mokhov Date: Fri Jun 15 01:15:47 2018 +0100 Refactor package-specific settings (#622) * Minor clean up * Track rts.cabal * Move all package-specific settings to Settings.Packages, plus another revision, see #540 * Drop Rules.PackageData >--------------------------------------------------------------- 235809092b65d1631735b70e9ce9dd2e9ebab47d hadrian.cabal | 4 +- src/Base.hs | 7 +- src/Context.hs | 3 +- src/Context/{Paths.hs => Path.hs} | 14 ++- src/GHC.hs | 28 ++++- src/Rules.hs | 15 ++- src/Rules/Configure.hs | 9 +- src/Rules/Generate.hs | 3 +- src/Rules/Gmp.hs | 2 +- src/Rules/Libffi.hs | 21 ++-- src/Rules/PackageData.hs | 33 ----- src/Rules/Program.hs | 1 - src/Rules/Register.hs | 51 ++++---- src/Settings/Builders/Configure.hs | 2 +- src/Settings/Builders/Make.hs | 1 - src/Settings/Default.hs | 6 +- src/Settings/Packages.hs | 222 +++++++++++++++++++++++++++++++-- src/Settings/Packages/Base.hs | 12 -- src/Settings/Packages/Cabal.hs | 10 -- src/Settings/Packages/Compiler.hs | 45 ------- src/Settings/Packages/Ghc.hs | 13 -- src/Settings/Packages/GhcCabal.hs | 32 ----- src/Settings/Packages/GhcPkg.hs | 7 -- src/Settings/Packages/GhcPrim.hs | 12 -- src/Settings/Packages/Ghci.hs | 6 - src/Settings/Packages/Haddock.hs | 7 -- src/Settings/Packages/IntegerGmp.hs | 24 ---- src/Settings/Packages/Rts.hs | 236 ------------------------------------ src/Settings/Packages/RunGhc.hs | 9 -- 29 files changed, 307 insertions(+), 528 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 235809092b65d1631735b70e9ce9dd2e9ebab47d From git at git.haskell.org Tue Oct 23 20:17:56 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:17:56 +0000 (UTC) Subject: [commit: ghc] master: Set more test arguments correctly (#625) (1906828) Message-ID: <20181023201756.ED78E3ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/190682875096bb9eaa4205a05a6b53f73194b7f3/ghc >--------------------------------------------------------------- commit 190682875096bb9eaa4205a05a6b53f73194b7f3 Author: Alp Mestanogullari Date: Fri Jun 15 15:09:57 2018 +0200 Set more test arguments correctly (#625) * attempt at setting some more test arguments correctly * use vanillaContext >--------------------------------------------------------------- 190682875096bb9eaa4205a05a6b53f73194b7f3 src/GHC.hs | 2 ++ src/Rules/Test.hs | 7 ++++++- src/Settings/Builders/RunTest.hs | 33 +++++++++++++++++++++------------ 3 files changed, 29 insertions(+), 13 deletions(-) diff --git a/src/GHC.hs b/src/GHC.hs index 9a160ce..5ee56fc 100644 --- a/src/GHC.hs +++ b/src/GHC.hs @@ -107,6 +107,8 @@ stage2Packages = return [haddock] testsuitePackages :: Action [Package] testsuitePackages = return [ checkApiAnnotations , checkPpr + , ghcPkg + , parallel , hp2ps ] -- | Given a 'Context', compute the name of the program that is built in it diff --git a/src/Rules/Test.hs b/src/Rules/Test.hs index c74cf58..faa79cb 100644 --- a/src/Rules/Test.hs +++ b/src/Rules/Test.hs @@ -71,7 +71,12 @@ needTestsuiteBuilders = do need targets where needfile :: Stage -> Package -> Action FilePath - needfile stage pkg = programPath =<< programContext stage pkg + needfile stage pkg + -- TODO (Alp): we might sometimes need more than vanilla! + -- This should therefore depend on what test ways + -- we are going to use, I suppose? + | isLibrary pkg = pkgConfFile (vanillaContext stage pkg) + | otherwise = programPath =<< programContext stage pkg needTestBuilders :: Action () needTestBuilders = do diff --git a/src/Settings/Builders/RunTest.hs b/src/Settings/Builders/RunTest.hs index 53cf4ef..1feef05 100644 --- a/src/Settings/Builders/RunTest.hs +++ b/src/Settings/Builders/RunTest.hs @@ -8,7 +8,13 @@ import Oracles.Setting (setting) import Rules.Test import Settings.Builders.Common +oneZero :: String -> Bool -> String +oneZero lbl False = lbl ++ "=0" +oneZero lbl True = lbl ++ "=1" + -- Arguments to send to the runtest.py script. +-- +-- A lot of this mirrors what's achieved at testsuite/mk/test.mk. runTestBuilderArgs :: Args runTestBuilderArgs = builder RunTest ? do pkgs <- expr $ stagePackages Stage1 @@ -16,7 +22,12 @@ runTestBuilderArgs = builder RunTest ? do [ [ pkgPath pkg -/- "tests", pkgPath pkg -/- "tests-ghc" ] | pkg <- pkgs, isLibrary pkg, pkg /= rts, pkg /= libffi ] - debugged <- ghcDebugged <$> expr flavour + flav <- expr flavour + rtsways <- rtsWays flav + libways <- libraryWays flav + let hasRtsWay w = elem w rtsways + hasLibWay w = elem w libways + debugged = ghcDebugged flav withNativeCodeGen <- expr ghcWithNativeCodeGen withInterpreter <- expr ghcWithInterpreter @@ -33,6 +44,8 @@ runTestBuilderArgs = builder RunTest ? do ghcFlags <- expr runTestGhcFlags timeoutProg <- expr buildRoot <&> (-/- timeoutProgPath) + -- TODO: set CABAL_MINIMAL_BUILD/CABAL_PLUGIN_BUILD + mconcat [ arg $ "testsuite/driver/runtests.py" , arg $ "--rootdir=" ++ ("testsuite" -/- "tests") , pure ["--rootdir=" ++ test | test <- libTests] @@ -43,24 +56,20 @@ runTestBuilderArgs = builder RunTest ? do , arg "-e", arg $ "config.cleanup=False" -- Don't clean up. , arg "-e", arg $ "config.compiler_debugged=" ++ quote (yesNo debugged) , arg "-e", arg $ "ghc_debugged=" ++ quote (yesNo debugged) - , arg "-e", arg $ "ghc_with_native_codegen=" ++ zeroOne withNativeCodeGen + , arg "-e", arg $ oneZero "ghc_with_native_codegen" withNativeCodeGen , arg "-e", arg $ "config.have_interp=" ++ show withInterpreter , arg "-e", arg $ "config.unregisterised=" ++ show unregisterised , arg "-e", arg $ "ghc_compiler_always_flags=" ++ quote ghcFlags - , arg "-e", arg $ "ghc_with_vanilla=1" -- TODO: do we always build vanilla? - , arg "-e", arg $ "ghc_with_dynamic=0" -- TODO: support dynamic - , arg "-e", arg $ "ghc_with_profiling=0" -- TODO: support profiling - - , arg "-e", arg $ "config.have_vanilla=1" -- TODO: support other build context - , arg "-e", arg $ "config.have_dynamic=0" -- TODO: support dynamic - , arg "-e", arg $ "config.have_profiling=0" -- TODO: support profiling - , arg "-e", arg $ "ghc_with_smp=" ++ zeroOne withSMP + , arg "-e", arg $ oneZero "ghc_with_dynamic_rts" (hasRtsWay dynamic) + , arg "-e", arg $ oneZero "ghc_with_threaded_rts" (hasRtsWay threaded) + , arg "-e", arg $ oneZero "config.have_vanilla" (hasLibWay vanilla) + , arg "-e", arg $ oneZero "config.have_dynamic" (hasLibWay dynamic) + , arg "-e", arg $ oneZero "config.have_profiling" (hasLibWay profiling) + , arg "-e", arg $ oneZero "ghc_with_smp" withSMP , arg "-e", arg $ "ghc_with_llvm=0" -- TODO: support LLVM - , arg "-e", arg $ "ghc_with_threaded_rts=0" -- TODO: support threaded - , arg "-e", arg $ "ghc_with_dynamic_rts=0" -- TODO: support dynamic , arg "-e", arg $ "config.ghc_dynamic_by_default=False" -- TODO: support dynamic , arg "-e", arg $ "config.ghc_dynamic=False" -- TODO: support dynamic From git at git.haskell.org Tue Oct 23 20:18:00 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:18:00 +0000 (UTC) Subject: [commit: ghc] master: Add config file and test speed options to testsuite (#624) (831e1ce) Message-ID: <20181023201800.CB1E03ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/831e1ce04983f640a1234f7706fa4ba975ae6a92/ghc >--------------------------------------------------------------- commit 831e1ce04983f640a1234f7706fa4ba975ae6a92 Author: Chitrak Raj Gupta Date: Fri Jun 15 20:11:40 2018 +0530 Add config file and test speed options to testsuite (#624) * Added option to specify config file * Added speed setting for validation * Revision >--------------------------------------------------------------- 831e1ce04983f640a1234f7706fa4ba975ae6a92 src/CommandLine.hs | 50 ++++++++++++++++++++++++---------------- src/Settings/Builders/Make.hs | 9 +++++++- src/Settings/Builders/RunTest.hs | 6 ++--- 3 files changed, 41 insertions(+), 24 deletions(-) diff --git a/src/CommandLine.hs b/src/CommandLine.hs index 18ddbbc..76e2357 100644 --- a/src/CommandLine.hs +++ b/src/CommandLine.hs @@ -45,31 +45,33 @@ defaultCommandLineArgs = CommandLineArgs -- | These arguments are used by the `test` target. data TestArgs = TestArgs - { testCompiler :: String - , testConfigs :: [String] - , testJUnit :: Maybe FilePath - , testOnly :: Maybe String - , testOnlyPerf :: Bool - , testSkipPerf :: Bool - , testSpeed :: TestSpeed - , testSummary :: Maybe FilePath - , testVerbosity:: Maybe String - , testWays :: [String] } + { testCompiler :: String + , testConfigFile :: String + , testConfigs :: [String] + , testJUnit :: Maybe FilePath + , testOnly :: Maybe String + , testOnlyPerf :: Bool + , testSkipPerf :: Bool + , testSpeed :: TestSpeed + , testSummary :: Maybe FilePath + , testVerbosity :: Maybe String + , testWays :: [String] } deriving (Eq, Show) -- | Default value for `TestArgs`. defaultTestArgs :: TestArgs defaultTestArgs = TestArgs - { testCompiler = "stage2" - , testConfigs = [] - , testJUnit = Nothing - , testOnly = Nothing - , testOnlyPerf = False - , testSkipPerf = False - , testSpeed = Average - , testSummary = Nothing - , testVerbosity= Nothing - , testWays = [] } + { testCompiler = "stage2" + , testConfigFile = "testsuite/config/ghc" + , testConfigs = [] + , testJUnit = Nothing + , testOnly = Nothing + , testOnlyPerf = False + , testSkipPerf = False + , testSpeed = Fast + , testSummary = Nothing + , testVerbosity = Nothing + , testWays = [] } readConfigure :: Either String (CommandLineArgs -> CommandLineArgs) readConfigure = Right $ \flags -> flags { configure = True } @@ -136,6 +138,12 @@ readTestConfig config = let configs = conf : testConfigs (testArgs flags) in flags { testArgs = (testArgs flags) { testConfigs = configs } } +readTestConfigFile :: Maybe String -> Either String (CommandLineArgs -> CommandLineArgs) +readTestConfigFile filepath = + maybe (Left "Cannot parse test-speed") (Right . set) filepath + where + set filepath flags = flags { testArgs = (testArgs flags) { testConfigFile = filepath } } + readTestJUnit :: Maybe String -> Either String (CommandLineArgs -> CommandLineArgs) readTestJUnit filepath = Right $ \flags -> flags { testArgs = (testArgs flags) { testJUnit = filepath } } @@ -197,6 +205,8 @@ optDescrs = "Generate split objects (requires a full clean rebuild)." , Option [] ["test-compiler"] (OptArg readTestCompiler "TEST_COMPILER") "Use given compiler [Default=stage2]." + , Option [] ["test-config-file"] (OptArg readTestConfigFile "CONFIG_FILE") + "congiguration file for testsuite. Default=testsuite/config/ghc" , Option [] ["config"] (OptArg readTestConfig "EXTRA_TEST_CONFIG") "Configurations to run test, in key=value format." , Option [] ["summary-junit"] (OptArg readTestJUnit "TEST_SUMMARY_JUNIT") diff --git a/src/Settings/Builders/Make.hs b/src/Settings/Builders/Make.hs index f366b83..a27e4b4 100644 --- a/src/Settings/Builders/Make.hs +++ b/src/Settings/Builders/Make.hs @@ -4,6 +4,7 @@ import GHC import Oracles.Setting import Rules.Gmp import Settings.Builders.Common +import CommandLine makeBuilderArgs :: Args makeBuilderArgs = do @@ -23,7 +24,8 @@ validateBuilderArgs = builder (Make "testsuite/tests") ? do compiler <- expr $ fullpath ghc checkPpr <- expr $ fullpath checkPpr checkApiAnnotations <- expr $ fullpath checkApiAnnotations - return [ "fast" + args <- expr $ userSetting defaultTestArgs + return [ setTestSpeed $ testSpeed args , "THREADS=" ++ show threads , "TEST_HC=" ++ (top -/- compiler) , "CHECK_PPR=" ++ (top -/- checkPpr) @@ -33,3 +35,8 @@ validateBuilderArgs = builder (Make "testsuite/tests") ? do fullpath :: Package -> Action FilePath fullpath pkg = programPath =<< programContext Stage1 pkg +-- | Support for speed of validation +setTestSpeed :: TestSpeed -> String +setTestSpeed Fast = "fasttest" +setTestSpeed Average = "test" +setTestSpeed Slow = "slowtest" diff --git a/src/Settings/Builders/RunTest.hs b/src/Settings/Builders/RunTest.hs index 1feef05..41da284 100644 --- a/src/Settings/Builders/RunTest.hs +++ b/src/Settings/Builders/RunTest.hs @@ -80,7 +80,6 @@ runTestBuilderArgs = builder RunTest ? do , arg "-e", arg $ "config.arch=" ++ show arch , arg "-e", arg $ "config.platform=" ++ show platform - , arg "--config-file=testsuite/config/ghc" , arg "--config", arg $ "gs=gs" -- Use the default value as in test.mk , arg "--config", arg $ "timeout_prog=" ++ show (top -/- timeoutProg) , arg $ "--threads=" ++ show threads @@ -94,7 +93,8 @@ getTestArgs = do bindir <- expr $ setBinaryDirectory (testCompiler args) compiler <- expr $ setCompiler (testCompiler args) globalVerbosity <- shakeVerbosity <$> expr getShakeOptions - let testOnlyArg = case testOnly args of + let configFileArg= ["--config-file=" ++ (testConfigFile args)] + testOnlyArg = case testOnly args of Just cases -> map ("--only=" ++) (words cases) Nothing -> [] onlyPerfArg = if testOnlyPerf args @@ -120,7 +120,7 @@ getTestArgs = do haddockArg = ["--config", "haddock=" ++ show (bindir -/- "haddock")] hp2psArg = ["--config", "hp2ps=" ++ show (bindir -/- "hp2ps")] hpcArg = ["--config", "hpc=" ++ show (bindir -/- "hpc")] - pure $ testOnlyArg ++ speedArg + pure $ configFileArg ++ testOnlyArg ++ speedArg ++ catMaybes [ onlyPerfArg, skipPerfArg, summaryArg , junitArg, verbosityArg ] ++ configArgs ++ wayArgs ++ compilerArg ++ ghcPkgArg From git at git.haskell.org Tue Oct 23 20:18:04 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:18:04 +0000 (UTC) Subject: [commit: ghc] master: Read the `main-is` field from the cabal file for executables (#627) (f319243) Message-ID: <20181023201804.C27053ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/f3192439950ba3a3af58410c331d2492322dd4ab/ghc >--------------------------------------------------------------- commit f3192439950ba3a3af58410c331d2492322dd4ab Author: Tao He Date: Mon Jun 18 22:53:38 2018 +0800 Read the `main-is` field from the cabal file for executables (#627) * For executables, we should read the `main-is` field from the cabal file. Previously, we simply treat file name for `Main` module as `Main.hs` to build executable. That doesn't work for the `timeout` program. This patch fixes the problem. * Add comments about the processing of `main-is` field from .cabal file. >--------------------------------------------------------------- f3192439950ba3a3af58410c331d2492322dd4ab src/Hadrian/Haskell/Cabal/PackageData.hs | 1 + src/Hadrian/Haskell/Cabal/Parse.hs | 19 ++++++++++++------- src/Oracles/ModuleFiles.hs | 26 ++++++++++++++++++++++++-- 3 files changed, 37 insertions(+), 9 deletions(-) diff --git a/src/Hadrian/Haskell/Cabal/PackageData.hs b/src/Hadrian/Haskell/Cabal/PackageData.hs index d4cd41a..d54809e 100644 --- a/src/Hadrian/Haskell/Cabal/PackageData.hs +++ b/src/Hadrian/Haskell/Cabal/PackageData.hs @@ -10,6 +10,7 @@ data PackageData = PackageData , name :: PackageName , version :: String , componentId :: String + , mainIs :: Maybe (String, FilePath) -- ("Main", filepath) , modules :: [String] , otherModules :: [String] , synopsis :: String diff --git a/src/Hadrian/Haskell/Cabal/Parse.hs b/src/Hadrian/Haskell/Cabal/Parse.hs index 9e6b875..1f54035 100644 --- a/src/Hadrian/Haskell/Cabal/Parse.hs +++ b/src/Hadrian/Haskell/Cabal/Parse.hs @@ -54,13 +54,13 @@ import Settings parseCabalPkgId :: FilePath -> IO String parseCabalPkgId file = C.display . C.package . C.packageDescription <$> C.readGenericPackageDescription C.silent file -biModules :: C.PackageDescription -> (C.BuildInfo, [C.ModuleName]) -biModules pd = go [ comp | comp@(bi,_) <- +biModules :: C.PackageDescription -> (C.BuildInfo, [C.ModuleName], Maybe (C.ModuleName, String)) +biModules pd = go [ comp | comp@(bi,_,_) <- (map libBiModules . maybeToList $ C.library pd) ++ (map exeBiModules $ C.executables pd) , C.buildable bi ] where - libBiModules lib = (C.libBuildInfo lib, C.explicitLibModules lib) + libBiModules lib = (C.libBuildInfo lib, C.explicitLibModules lib, Nothing) exeBiModules exe = (C.buildInfo exe, -- If "main-is: ..." is not a .hs or .lhs file, do not -- inject "Main" into the modules. This does not respect @@ -68,7 +68,9 @@ biModules pd = go [ comp | comp@(bi,_) <- -- Distribution.Simple.GHC for the glory details. if takeExtension (C.modulePath exe) `elem` [".hs", ".lhs"] then C.main : C.exeModules exe - else C.exeModules exe) + -- The module `Main` still need to be kept in `modules` of PD. + else C.exeModules exe, + Just (C.main, C.modulePath exe)) go [] = error "No buildable component found." go [x] = x go _ = error "Cannot handle more than one buildinfo yet." @@ -243,15 +245,18 @@ parsePackageData context at Context {..} = do -- there. So we filter out gcc-lib from the RTS's library-dirs here. _ -> error "No (or multiple) GHC rts package is registered!" - buildInfo = fst (biModules pd') + (buildInfo, modules, mainIs) = biModules pd' in return $ PackageData { dependencies = deps , name = C.unPackageName . C.pkgName . C.package $ pd' , version = C.display . C.pkgVersion . C.package $ pd' , componentId = C.localCompatPackageKey lbi' - , modules = map C.display . snd . biModules $ pd' - , otherModules = map C.display . C.otherModules $ buildInfo + , mainIs = case mainIs of + Just (mod, filepath) -> Just (C.display mod, filepath) + Nothing -> Nothing + , modules = map C.display $ modules + , otherModules = map C.display . C.otherModules $ buildInfo , synopsis = C.synopsis pd' , description = C.description pd' , srcDirs = C.hsSourceDirs buildInfo diff --git a/src/Oracles/ModuleFiles.hs b/src/Oracles/ModuleFiles.hs index fc3d72e..f167de0 100644 --- a/src/Oracles/ModuleFiles.hs +++ b/src/Oracles/ModuleFiles.hs @@ -124,10 +124,15 @@ moduleFilesOracle = void $ do void . addOracle $ \(ModuleFiles (stage, package)) -> do let context = vanillaContext stage package srcDirs <- interpretInContext context (getPackageData PD.srcDirs) + mainIs <- interpretInContext context (getPackageData PD.mainIs) + let removeMain = case mainIs of + Just (mod, _) -> delete mod + Nothing -> id modules <- fmap sort $ interpretInContext context (getPackageData PD.modules) autogen <- autogenPath context let dirs = autogen : map (pkgPath package -/-) srcDirs - modDirFiles = groupSort $ map decodeModule modules + -- Don't resolve the file path for module `Main` twice. + modDirFiles = groupSort $ map decodeModule $ removeMain modules result <- concatForM dirs $ \dir -> do todo <- filterM (doesDirectoryExist . (dir -/-) . fst) modDirFiles forM todo $ \(mDir, mFiles) -> do @@ -136,7 +141,24 @@ moduleFilesOracle = void $ do let cmp f = compare (dropExtension f) found = intersectOrd cmp files mFiles return (map (fullDir -/-) found, mDir) - let pairs = sort [ (encodeModule d f, f) | (fs, d) <- result, f <- fs ] + + -- For a BuildInfo, it may be a library, which deosn't have the `Main` + -- module, or an executable, which must have the `Main` module and the + -- file path of `Main` module is indicated by the `main-is` field in it's + -- .cabal file. + -- + -- For `Main` module, the file name may not be `Main.hs`, unlike other + -- exposed modules. We could get the file path by the module name for + -- other exposed modules, but for `Main`, we must resolve the file path + -- via the `main-is` field in the .cabal file. + mainpairs <- case mainIs of + Just (mod, filepath) -> + concatForM dirs $ \dir -> do + found <- doesFileExist (dir -/- filepath) + return [(mod, unifyPath $ dir -/- filepath) | found] + Nothing -> return [] + + let pairs = sort $ mainpairs ++ [ (encodeModule d f, f) | (fs, d) <- result, f <- fs ] multi = [ (m, f1, f2) | (m, f1):(n, f2):_ <- tails pairs, m == n ] unless (null multi) $ do let (m, f1, f2) = head multi From git at git.haskell.org Tue Oct 23 20:18:08 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:18:08 +0000 (UTC) Subject: [commit: ghc] master: Implement build rules for testsuite/timeout (#499) (48b81a3) Message-ID: <20181023201808.BD37E3ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/48b81a3a523468416d07874fdaacbe597c895247/ghc >--------------------------------------------------------------- commit 48b81a3a523468416d07874fdaacbe597c895247 Author: Tao He Date: Tue Jun 19 00:07:11 2018 +0800 Implement build rules for testsuite/timeout (#499) >--------------------------------------------------------------- 48b81a3a523468416d07874fdaacbe597c895247 src/GHC.hs | 3 ++- src/GHC/Packages.hs | 4 +++- src/Rules/Test.hs | 51 +++++++++++++++++++++++++-------------------------- 3 files changed, 30 insertions(+), 28 deletions(-) diff --git a/src/GHC.hs b/src/GHC.hs index 5ee56fc..f115829 100644 --- a/src/GHC.hs +++ b/src/GHC.hs @@ -109,7 +109,8 @@ testsuitePackages = return [ checkApiAnnotations , checkPpr , ghcPkg , parallel - , hp2ps ] + , hp2ps + , timeout ] -- | Given a 'Context', compute the name of the program that is built in it -- assuming that the corresponding package's type is 'Program'. For example, GHC diff --git a/src/GHC/Packages.hs b/src/GHC/Packages.hs index c9c6f2b..cb005ce 100644 --- a/src/GHC/Packages.hs +++ b/src/GHC/Packages.hs @@ -17,7 +17,8 @@ ghcPackages = , ghcHeap, ghci, ghcPkg, ghcPrim, ghcTags, haddock, haskeline, hsc2hs, hp2ps , hpc, hpcBin, integerGmp, integerSimple, iserv, libffi, libiserv, mtl , parsec, parallel, pretty, process, rts, runGhc, stm, templateHaskell - , terminfo, text, time, touchy, transformers, unlit, unix, win32, xhtml ] + , terminfo, text, time, touchy, transformers, unlit, unix, win32, xhtml + , timeout ] -- TODO: Optimise by switching to sets of packages. isGhcPackage :: Package -> Bool @@ -81,6 +82,7 @@ unlit = hsUtil "unlit" unix = hsLib "unix" win32 = hsLib "Win32" xhtml = hsLib "xhtml" +timeout = hsUtil "timeout" `setPath` "testsuite/timeout" -- | Construct a Haskell library package, e.g. @array at . hsLib :: PackageName -> Package diff --git a/src/Rules/Test.hs b/src/Rules/Test.hs index faa79cb..4b408c0 100644 --- a/src/Rules/Test.hs +++ b/src/Rules/Test.hs @@ -3,6 +3,7 @@ module Rules.Test (testRules, runTestGhcFlags, timeoutProgPath) where import Base import Expression import GHC +import GHC.Packages (timeout) import Oracles.Flag import Oracles.Setting import Settings @@ -14,25 +15,6 @@ import System.Environment -- TODO: clean up after testing testRules :: Rules () testRules = do - root <- buildRootRules - - root -/- timeoutPyPath ~> do - copyFile "testsuite/timeout/timeout.py" (root -/- timeoutPyPath) - - -- TODO windows is still not supported. - -- - -- See: https://github.com/ghc/ghc/blob/master/testsuite/timeout/Makefile#L23 - root -/- timeoutProgPath ~> do - python <- builderPath Python - need [root -/- timeoutPyPath] - let script = unlines - [ "#!/usr/bin/env sh" - , "exec " ++ python ++ " $0.py \"$@\"" - ] - liftIO $ do - writeFile (root -/- timeoutProgPath) script - makeExecutable (root -/- timeoutProgPath) - "validate" ~> do needTestBuilders build $ target (vanillaContext Stage2 compiler) (Make "testsuite/tests") [] [] @@ -40,9 +22,6 @@ testRules = do "test" ~> do needTestBuilders - -- Prepare the timeout program. - need [ root -/- timeoutProgPath ] - -- TODO This approach doesn't work. -- Set environment variables for test's Makefile. env <- sequence @@ -78,6 +57,28 @@ needTestsuiteBuilders = do | isLibrary pkg = pkgConfFile (vanillaContext stage pkg) | otherwise = programPath =<< programContext stage pkg +-- | Build the timeout program. +-- See: https://github.com/ghc/ghc/blob/master/testsuite/timeout/Makefile#L23 +timeoutProgBuilder :: Action () +timeoutProgBuilder = do + root <- buildRoot + windows <- windowsHost + if windows + then do + prog <- programPath =<< programContext Stage1 timeout + need [ prog ] + copyFile prog (root -/- timeoutProgPath) + else do + python <- builderPath Python + copyFile "testsuite/timeout/timeout.py" (root -/- "test/bin/timeout.py") + let script = unlines + [ "#!/usr/bin/env sh" + , "exec " ++ python ++ " $0.py \"$@\"" + ] + liftIO $ do + writeFile (root -/- timeoutProgPath) script + makeExecutable (root -/- timeoutProgPath) + needTestBuilders :: Action () needTestBuilders = do needBuilder $ Ghc CompileHs Stage2 @@ -85,6 +86,7 @@ needTestBuilders = do needBuilder Hpc needBuilder (Hsc2Hs Stage1) needTestsuiteBuilders + timeoutProgBuilder -- | Extra flags to send to the Haskell compiler to run tests. runTestGhcFlags :: Action String @@ -116,8 +118,5 @@ runTestGhcFlags = do , pure "-dno-debug-output" ] -timeoutPyPath :: FilePath -timeoutPyPath = "test/bin/timeout.py" - timeoutProgPath :: FilePath -timeoutProgPath = "test/bin/timeout" <.> exe +timeoutProgPath = "testsuite/timeout/install-inplace/bin/timeout" <.> exe From git at git.haskell.org Tue Oct 23 20:18:12 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:18:12 +0000 (UTC) Subject: [commit: ghc] master: Add new featues to binary distribution (#623) (233a638) Message-ID: <20181023201812.D364A3ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/233a638978832b795aff24d8a75ab37fa17bd0c2/ghc >--------------------------------------------------------------- commit 233a638978832b795aff24d8a75ab37fa17bd0c2 Author: Chitrak Raj Gupta Date: Mon Jun 18 22:53:47 2018 +0530 Add new featues to binary distribution (#623) * Added featues to binary distribution * Minor revision * Using takeFileName instead of basename * Update BinaryDist.hs >--------------------------------------------------------------- 233a638978832b795aff24d8a75ab37fa17bd0c2 src/Rules/BinaryDist.hs | 173 ++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 167 insertions(+), 6 deletions(-) diff --git a/src/Rules/BinaryDist.hs b/src/Rules/BinaryDist.hs index db73622..e922bfe 100644 --- a/src/Rules/BinaryDist.hs +++ b/src/Rules/BinaryDist.hs @@ -37,6 +37,9 @@ bindistRules = do -- other machine. need $ map (bindistFilesDir -/-) (["configure", "Makefile"] ++ bindistInstallFiles) + need $ map ((bindistFilesDir -/- "wrappers") -/-) ["check-api-annotations" + , "check-ppr", "ghc", "ghc-iserv", "ghc-pkg", "ghc-split" + , "ghci", "haddock", "hpc", "hp2ps", "hsc2hs", "runhaskell"] -- finally, we create the archive, at -- /bindist/ghc-X.Y.Z-platform.tar.xz @@ -62,6 +65,9 @@ bindistRules = do root -/- "bindist" -/- "ghc-*" -/- "Makefile" %> \makefilePath -> writeFile' makefilePath bindistMakefile + root -/- "bindist" -/- "ghc-*" -/- "wrappers/*" %> \wrapperPath -> + writeFile' wrapperPath $ wrapper (takeFileName wrapperPath) + -- copy over the various configure-related files needed for a working -- './configure [...] && make install' workflow -- (see the list of files needed in the 'binary-dist' rule above, before @@ -83,7 +89,7 @@ bindistInstallFiles :: [FilePath] bindistInstallFiles = [ "config.sub", "config.guess", "install-sh" , "mk" -/- "config.mk.in", "mk" -/- "install.mk.in" - , "settings.in", "README", "INSTALL" + , "mk" -/- "project.mk.in", "settings.in", "README", "INSTALL" ] -- | Auxiliary function that gives us a 'Filepath' we can 'need' for @@ -106,16 +112,171 @@ bindistMakefile = unlines , ".SUFFIXES:" , "" , "include mk/install.mk" + , "include mk/config.mk" , "" , ".PHONY: default" , "default:" , "\t at echo 'Run \"make install\" to install'" , "\t at false" , "" + , "#------------------------------------------------------------------------------" + , "# INSTALL RULES" + , "" + , "# Hacky function to check equality of two strings" + , "# TODO : find if a better function exists" + , "eq=$(and $(findstring $(1),$(2)),$(findstring $(2),$(1)))" + , "" + , "define installscript" + , "# $1 = package name" + , "# $2 = wrapper path" + , "# $3 = bindir" + , "# $4 = ghcbindir" + , "# $5 = Executable binary path" + , "# $6 = Library Directory" + , "# $7 = Docs Directory" + , "# $8 = Includes Directory" + , "# We are installing wrappers to programs by searching corresponding wrappers." + , "# If wrapper is not found, we are attaching the common wrapper to it " + , "# This implementation is a bit hacky and depends on consistency of program" + , "# names. For hadrian build this will work as programs have a consistent " + , "# naming procefure. This file is tested on Linux(Ubuntu)" + , "# TODO : Check implementation in other distributions" + , "\trm -f $2" + , "\t$(CREATE_SCRIPT) $2" + , "\t at echo \"#!$(SHELL)\" >> $2" + , "\t at echo \"exedir=\\\"$4\\\"\" >> $2" + , "\t at echo \"exeprog=\\\"$1\\\"\" >> $2" + , "\t at echo \"executablename=\\\"$5\\\"\" >> $2" + , "\t at echo \"bindir=\\\"$3\\\"\" >> $2" + , "\t at echo \"libdir=\\\"$6\\\"\" >> $2" + , "\t at echo \"docdir=\\\"$7\\\"\" >> $2" + , "\t at echo \"includedir=\\\"$8\\\"\" >> $2" + , "\t at echo \"\" >> $2 " + , "\tcat wrappers/$1 >> $2" + , "\t$(EXECUTABLE_FILE) $2 ;" + , "endef" + , "" + , "# QUESTION : should we use shell commands?" + , "" + , "# Due to the fact that package database is configured relatively" + , "# We do not change the relative paths of executables and libraries" + , "# But instead use wrapper scripts whenever necessary" + , "LIBPARENT = $(shell dirname $(libdir))" + , "GHCBINDIR = \"$(LIBPARENT)/bin\"" + , "" , ".PHONY: install" - , "install:" - , "\tmkdir -p $(prefix)" - , "\tcp settings lib/settings" - , "\tcp -R bin $(prefix)/" - , "\tcp -R lib $(prefix)/" + , "install: install_bin install_lib" + , "" + , "# Check if we need to install docs" + , "ifeq \"DOCS\" \"YES\"" + , "install: install_docs" + , "endif" + , "" + , "# If the relative path of binaries and libraries are altered, we will need to" + , "# install additional wrapper scripts at bindir." + , "ifneq \"$(LIBPARENT)/bin\" \"$(bindir)\"" + , "install: install_wrappers" + , "endif" + , "" + , "# We need to install binaries relative to libraries." + , "BINARIES = $(wildcard ./bin/*)" + , "install_bin:" + , "\t at echo \"Copying Binaries to $(GHCBINDIR)\"" + , "\t$(INSTALL_DIR) \"$(GHCBINDIR)\"" + , "\tfor i in $(BINARIES); do \\" + , "\t\tcp -R $$i \"$(GHCBINDIR)\"; \\" + , "\tdone" + , "" + , "LIBRARIES = $(wildcard ./lib/*)" + , "install_lib:" + , "\t at echo \"Copying libraries to $(libdir)\"" + , "\t$(INSTALL_DIR) \"$(libdir)\"" + , "\tfor i in $(LIBRARIES); do \\" + , "\t\tcp -R $$i \"$(libdir)/\"; \\" + , "\tdone" + , "" + , "DOCS = $(wildcard ./docs/*)" + , "install_docs:" + , "\t at echo \"Copying libraries to $(docdir)\"" + , "\t$(INSTALL_DIR) \"$(docdir)\"" + , "\tfor i in $(DOCS); do \\" + , "\t\tcp -R $$i \"$(docdir)/\"; \\" + , "\tdone" + , "" + , "BINARY_NAMES=$(shell ls ./bin/)" + , "install_wrappers:" + , "\t at echo \"Installing Wrapper scripts\"" + , "\t$(INSTALL_DIR) \"$(bindir)\"" + , "\t$(foreach p, $(BINARY_NAMES),\\" + , "\t\t$(call installscript,$p,$(bindir)/$p,$(bindir),$(GHCBINDIR),$(GHCBINDIR)/$p,$(libdir),$(docdir),$(includedir)))" + , "" + , "# END INSTALL" + , "# -----------------------------------------------------------------------------" ] + +wrapper :: FilePath -> String +wrapper "ghc" = ghcWrapper +wrapper "ghc-pkg" = ghcPkgWrapper +wrapper "ghci" = ghciWrapper +wrapper "haddock" = haddockWrapper +wrapper "hsc2hs" = hsc2hsWrapper +wrapper "runhaskell" = runhaskellWrapper +wrapper _ = commonWrapper + +-- | Wrapper scripts for different programs. Common is default wrapper. + +ghcWrapper :: String +ghcWrapper = unlines + [ "exec \"$executablename\" -B\"$libdir\" ${1+\"$@\"}" + ] + +ghcPkgWrapper :: String +ghcPkgWrapper = unlines + [ "PKGCONF=\"$libdir/package.conf.d\"" + , "exec \"$executablename\" --global-package-db \"$PKGCONF\" ${1+\"$@\"}" + ] + +ghciWrapper :: String +ghciWrapper = unlines + ["exec \"$executablename\" --interactive \"$@\"" + ] + +haddockWrapper :: String +haddockWrapper = unlines + ["exec \"$executablename\" -B\"$libdir\" -l\"$libdir\" ${1+\"$@\"}" + ] + +commonWrapper :: String +commonWrapper = unlines + ["exec \"$executablename\" ${1+\"$@\"}" + ] + +hsc2hsWrapper :: String +hsc2hsWrapper = unlines + [ "HSC2HS_EXTRA=\"--cflag=-fno-stack-protector --lflag=-fuse-ld=gold\"" + , "tflag=\"--template=$libdir/template-hsc.h\"" + , "Iflag=\"-I$includedir/\"" + , "for arg do" + , " case \"$arg\" in" + , "# On OS X, we need to specify -m32 or -m64 in order to get gcc to" + , "# build binaries for the right target. We do that by putting it in" + , "# HSC2HS_EXTRA. When cabal runs hsc2hs, it passes a flag saying which" + , "# gcc to use, so if we set HSC2HS_EXTRA= then we don't get binaries" + , "# for the right platform. So for now we just don't set HSC2HS_EXTRA=" + , "# but we probably want to revisit how this works in the future." + , "# -c*) HSC2HS_EXTRA=;;" + , "# --cc=*) HSC2HS_EXTRA=;;" + , " -t*) tflag=;;" + , " --template=*) tflag=;;" + , " --) break;;" + , " esac" + , "done" + , "exec \"$executablename\" ${tflag:+\"$tflag\"} $HSC2HS_EXTRA ${1+\"$@\"} \"$Iflag\"" + ] + +runhaskellWrapper :: String +runhaskellWrapper = unlines + ["exec \"$executablename\" -f \"$exedir/ghc\" ${1+\"$@\"}" + ] + + From git at git.haskell.org Tue Oct 23 20:18:16 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:18:16 +0000 (UTC) Subject: [commit: ghc] master: Remove more validation errors (#628) (d4b9c1f) Message-ID: <20181023201816.E4A3B3ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/d4b9c1fbc3ab2b8e4eb844505724538cfab0d399/ghc >--------------------------------------------------------------- commit d4b9c1fbc3ab2b8e4eb844505724538cfab0d399 Author: Chitrak Raj Gupta Date: Wed Jun 20 17:44:53 2018 +0530 Remove more validation errors (#628) * Improved GhcCabal library arguments * setting enviornment for extra programs * Copied necessary programs * Added support to generate ghcconfig We will need it for properly configuring python command Some revisions * Using ghcconfig file for test parameters * minor changes * minor revision * Update Ghc.hs >--------------------------------------------------------------- d4b9c1fbc3ab2b8e4eb844505724538cfab0d399 hadrian.cabal | 1 + src/GHC.hs | 7 ++-- src/Oracles/TestSettings.hs | 73 +++++++++++++++++++++++++++++++++++++ src/Rules/Test.hs | 75 ++++++++++++++++++++++++++++++--------- src/Settings/Builders/GhcCabal.hs | 10 ++++-- src/Settings/Builders/RunTest.hs | 41 +++++++++++++-------- 6 files changed, 170 insertions(+), 37 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc d4b9c1fbc3ab2b8e4eb844505724538cfab0d399 From git at git.haskell.org Tue Oct 23 20:18:21 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:18:21 +0000 (UTC) Subject: [commit: ghc] master: Add includes to bindist (#632) (36c9781) Message-ID: <20181023201821.2CEE03ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/36c9781b8251610dadf79a5e2c6b948e5abaabce/ghc >--------------------------------------------------------------- commit 36c9781b8251610dadf79a5e2c6b948e5abaabce Author: Chitrak Raj Gupta Date: Wed Jun 20 18:39:20 2018 +0530 Add includes to bindist (#632) * adding include directories * Adding includes * Shipping ghci >--------------------------------------------------------------- 36c9781b8251610dadf79a5e2c6b948e5abaabce src/Context.hs | 2 +- src/Rules/BinaryDist.hs | 55 ++++++++++++++++++++++++++++++++++++++----------- 2 files changed, 44 insertions(+), 13 deletions(-) diff --git a/src/Context.hs b/src/Context.hs index 9142125..eaca3bb 100644 --- a/src/Context.hs +++ b/src/Context.hs @@ -7,7 +7,7 @@ module Context ( withHsPackage, -- * Paths - contextDir, buildPath, buildDir, pkgInplaceConfig, pkgSetupConfigFile, + contextDir, buildPath, buildDir, pkgId, pkgInplaceConfig, pkgSetupConfigFile, pkgHaddockFile, pkgLibraryFile, pkgGhciLibraryFile, pkgConfFile, objectPath, contextPath, getContextPath, libDir, libPath ) where diff --git a/src/Rules/BinaryDist.hs b/src/Rules/BinaryDist.hs index e922bfe..c9273ec 100644 --- a/src/Rules/BinaryDist.hs +++ b/src/Rules/BinaryDist.hs @@ -1,5 +1,6 @@ module Rules.BinaryDist where +import Context import Expression import GHC import Oracles.Setting @@ -14,19 +15,25 @@ bindistRules = do -- We 'need' all binaries and libraries targets <- mapM pkgTarget =<< stagePackages Stage1 need targets - - version <- setting ProjectVersion + version <- setting ProjectVersion targetPlatform <- setting TargetPlatformFull + hostOs <- setting BuildOs + hostArch <- setting BuildArch + rtsDir <- pkgId $ vanillaContext Stage1 rts let ghcBuildDir = root -/- stageString Stage1 bindistFilesDir = root -/- "bindist" -/- ghcVersionPretty ghcVersionPretty = "ghc-" ++ version ++ "-" ++ targetPlatform + distDir = hostArch ++ "-" ++ hostOs ++ "-ghc-" ++ version + rtsIncludeDir = ghcBuildDir -/- "lib" -/- distDir -/- rtsDir + -/- "include" -- we create the bindist directory at /bindist/ghc-X.Y.Z-platform/ -- and populate it with a stage2 build createDirectory bindistFilesDir copyDirectory (ghcBuildDir -/- "bin") bindistFilesDir copyDirectory (ghcBuildDir -/- "lib") bindistFilesDir + copyDirectory (rtsIncludeDir) bindistFilesDir {- SHOULD WE SHIP DOCS? need ["docs"] copyDirectory (root -/- "docs") bindistFilesDir @@ -39,7 +46,8 @@ bindistRules = do (["configure", "Makefile"] ++ bindistInstallFiles) need $ map ((bindistFilesDir -/- "wrappers") -/-) ["check-api-annotations" , "check-ppr", "ghc", "ghc-iserv", "ghc-pkg", "ghc-split" - , "ghci", "haddock", "hpc", "hp2ps", "hsc2hs", "runhaskell"] + , "ghci-script", "ghci", "haddock", "hpc", "hp2ps", "hsc2hs" + , "runhaskell"] -- finally, we create the archive, at -- /bindist/ghc-X.Y.Z-platform.tar.xz @@ -89,7 +97,7 @@ bindistInstallFiles :: [FilePath] bindistInstallFiles = [ "config.sub", "config.guess", "install-sh" , "mk" -/- "config.mk.in", "mk" -/- "install.mk.in" - , "mk" -/- "project.mk.in", "settings.in", "README", "INSTALL" + , "mk" -/- "project.mk", "settings.in", "README", "INSTALL" ] -- | Auxiliary function that gives us a 'Filepath' we can 'need' for @@ -165,7 +173,7 @@ bindistMakefile = unlines , "GHCBINDIR = \"$(LIBPARENT)/bin\"" , "" , ".PHONY: install" - , "install: install_bin install_lib" + , "install: install_bin install_lib install_includes" , "" , "# Check if we need to install docs" , "ifeq \"DOCS\" \"YES\"" @@ -186,6 +194,12 @@ bindistMakefile = unlines , "\tfor i in $(BINARIES); do \\" , "\t\tcp -R $$i \"$(GHCBINDIR)\"; \\" , "\tdone" + , "\t at echo \"Copying and installing ghci\"" + , "\trm -f $(GHCBINDIR)/dir" + , "\t$(CREATE_SCRIPT) $(GHCBINDIR)/ghci" + , "\t at echo \"#!$(SHELL)\" >> $(GHCBINDIR)/ghci" + , "\tcat wrappers/ghci-script >> $(GHCBINDIR)/ghci" + , "\t$(EXECUTABLE_FILE) $(GHCBINDIR)/ghci" , "" , "LIBRARIES = $(wildcard ./lib/*)" , "install_lib:" @@ -195,6 +209,14 @@ bindistMakefile = unlines , "\t\tcp -R $$i \"$(libdir)/\"; \\" , "\tdone" , "" + , "INCLUDES = $(wildcard ./include/*)" + , "install_includes:" + , "\t at echo \"Copying libraries to $(includedir)\"" + , "\t$(INSTALL_DIR) \"$(includedir)\"" + , "\tfor i in $(INCLUDES); do \\" + , "\t\tcp -R $$i \"$(includedir)/\"; \\" + , "\tdone" + , "" , "DOCS = $(wildcard ./docs/*)" , "install_docs:" , "\t at echo \"Copying libraries to $(docdir)\"" @@ -215,13 +237,14 @@ bindistMakefile = unlines ] wrapper :: FilePath -> String -wrapper "ghc" = ghcWrapper -wrapper "ghc-pkg" = ghcPkgWrapper -wrapper "ghci" = ghciWrapper -wrapper "haddock" = haddockWrapper -wrapper "hsc2hs" = hsc2hsWrapper -wrapper "runhaskell" = runhaskellWrapper -wrapper _ = commonWrapper +wrapper "ghc" = ghcWrapper +wrapper "ghc-pkg" = ghcPkgWrapper +wrapper "ghci" = ghciWrapper +wrapper "ghci-script" = ghciScriptWrapper +wrapper "haddock" = haddockWrapper +wrapper "hsc2hs" = hsc2hsWrapper +wrapper "runhaskell" = runhaskellWrapper +wrapper _ = commonWrapper -- | Wrapper scripts for different programs. Common is default wrapper. @@ -279,4 +302,12 @@ runhaskellWrapper = unlines ["exec \"$executablename\" -f \"$exedir/ghc\" ${1+\"$@\"}" ] +-- | We need to ship ghci executable, which basically just calls ghc with +-- | --interactive flag. +ghciScriptWrapper :: String +ghciScriptWrapper = unlines + [ "DIR=`dirname \"$0\"`" + , "executable=\"$DIR/ghc\"" + , "exec $executable --interactive \"$@\"" + ] From git at git.haskell.org Tue Oct 23 20:18:25 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:18:25 +0000 (UTC) Subject: [commit: ghc] master: Make Cabal install unconditional in build.cabal.sh (#633) (bbdd69b) Message-ID: <20181023201825.6E9B13ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/bbdd69bdaa48df99b90ffb95d1725abc72eae66b/ghc >--------------------------------------------------------------- commit bbdd69bdaa48df99b90ffb95d1725abc72eae66b Author: Chitrak Raj Gupta Date: Sat Jun 23 03:06:58 2018 +0530 Make Cabal install unconditional in build.cabal.sh (#633) * adding include directories * Adding includes * Stable cabal sandbox build >--------------------------------------------------------------- bbdd69bdaa48df99b90ffb95d1725abc72eae66b build.cabal.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/build.cabal.sh b/build.cabal.sh index d2bdb85..fe390af 100755 --- a/build.cabal.sh +++ b/build.cabal.sh @@ -61,12 +61,13 @@ else if ! ( "$CABAL" sandbox hc-pkg list > /dev/null 2>&1); then "$CABAL" sandbox init "$CABAL" sandbox add-source ../libraries/Cabal/Cabal - "$CABAL" install \ - --dependencies-only \ - --disable-library-profiling \ - --disable-shared fi + "$CABAL" install \ + --dependencies-only \ + --disable-library-profiling \ + --disable-shared + "$CABAL" run hadrian -- \ --lint \ --directory "$absoluteRoot/.." \ From git at git.haskell.org Tue Oct 23 20:18:29 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:18:29 +0000 (UTC) Subject: [commit: ghc] master: Fix timeout building rule for Linux (#638) (843790e) Message-ID: <20181023201829.A582E3ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/843790ea9b3f33494a4dfbfc19efac68b6b3a7ea/ghc >--------------------------------------------------------------- commit 843790ea9b3f33494a4dfbfc19efac68b6b3a7ea Author: Alp Mestanogullari Date: Wed Jun 27 17:31:52 2018 +0200 Fix timeout building rule for Linux (#638) >--------------------------------------------------------------- 843790ea9b3f33494a4dfbfc19efac68b6b3a7ea src/GHC.hs | 21 ++++++++++++--------- src/Rules/Test.hs | 11 +++++------ src/Settings/Builders/RunTest.hs | 1 - 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/src/GHC.hs b/src/GHC.hs index 9b453e5..f84d3d6 100644 --- a/src/GHC.hs +++ b/src/GHC.hs @@ -105,15 +105,18 @@ stage2Packages = return [haddock] -- | Packages that are built only for the testsuite. testsuitePackages :: Action [Package] -testsuitePackages = return [ checkApiAnnotations - , checkPpr - , ghci - , ghcPkg - , hp2ps - , iserv - , parallel - , runGhc - , timeout ] +testsuitePackages = do + win <- windowsHost + return $ + [ checkApiAnnotations + , checkPpr + , ghci + , ghcPkg + , hp2ps + , iserv + , parallel + , runGhc ] ++ + [ timeout | win ] -- | Given a 'Context', compute the name of the program that is built in it -- assuming that the corresponding package's type is 'Program'. For example, GHC diff --git a/src/Rules/Test.hs b/src/Rules/Test.hs index d8d644e..6a04c1e 100644 --- a/src/Rules/Test.hs +++ b/src/Rules/Test.hs @@ -29,6 +29,8 @@ testRules = do cmd [FileStdout $ root -/- ghcConfigPath] (root -/- ghcConfigProgPath) [ ghcPath ] + root -/- timeoutProgPath ~> timeoutProgBuilder + "validate" ~> do needTestBuilders build $ target (vanillaContext Stage2 compiler) (Make "testsuite/tests") [] [] @@ -38,7 +40,7 @@ testRules = do -- TODO : Should we remove the previosly generated config file? -- Prepare Ghc configuration file for input compiler. - need [ root -/- ghcConfigPath ] + need [ root -/- ghcConfigPath, root -/- timeoutProgPath ] -- TODO This approach doesn't work. -- Set environment variables for test's Makefile. @@ -93,13 +95,12 @@ timeoutProgBuilder = do copyFile prog (root -/- timeoutProgPath) else do python <- builderPath Python - copyFile "testsuite/timeout/timeout.py" (root -/- "test/bin/timeout.py") + copyFile "testsuite/timeout/timeout.py" (root -/- timeoutProgPath <.> "py") let script = unlines [ "#!/usr/bin/env sh" , "exec " ++ python ++ " $0.py \"$@\"" ] - liftIO $ do - writeFile (root -/- timeoutProgPath) script + writeFile' (root -/- timeoutProgPath) script makeExecutable (root -/- timeoutProgPath) needTestBuilders :: Action () @@ -108,7 +109,6 @@ needTestBuilders = do needBuilder $ GhcPkg Update Stage1 needBuilder Hpc needBuilder (Hsc2Hs Stage1) - timeoutProgBuilder needTestsuitePackages -- | Extra flags to send to the Haskell compiler to run tests. @@ -160,4 +160,3 @@ needfile stage pkg -- we are going to use, I suppose? | isLibrary pkg = pkgConfFile (Context stage pkg profilingDynamic) | otherwise = programPath =<< programContext stage pkg - diff --git a/src/Settings/Builders/RunTest.hs b/src/Settings/Builders/RunTest.hs index 9f30848..6c0c52f 100644 --- a/src/Settings/Builders/RunTest.hs +++ b/src/Settings/Builders/RunTest.hs @@ -173,4 +173,3 @@ parentPath path = let upPath = init $ splitOn "/" path -- | TODO: move to hadrian utilities. fullpath :: Stage -> Package -> Action FilePath fullpath stage pkg = programPath =<< programContext stage pkg - From git at git.haskell.org Tue Oct 23 20:18:33 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:18:33 +0000 (UTC) Subject: [commit: ghc] master: Switch to the fixed Cabal branch in CI and add a fix for Natural (#640) (e5773fa) Message-ID: <20181023201833.CE6FB3ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/e5773fa623331233385020b23eef3a5788e7e227/ghc >--------------------------------------------------------------- commit e5773fa623331233385020b23eef3a5788e7e227 Author: Alp Mestanogullari Date: Wed Jun 27 21:59:54 2018 +0200 Switch to the fixed Cabal branch in CI and add a fix for Natural (#640) * use @quasicomputational's Cabal branch in CI for the time being * workaround can't-use-Natural-in-base >--------------------------------------------------------------- e5773fa623331233385020b23eef3a5788e7e227 .travis.yml | 7 +++++++ appveyor.yml | 7 +++++++ circle.yml | 4 ++++ src/Settings/Packages.hs | 9 ++++++++- 4 files changed, 26 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index f80bca6..8416e00 100644 --- a/.travis.yml +++ b/.travis.yml @@ -104,6 +104,13 @@ install: - mv .git ghc/hadrian - cd ghc/hadrian && git reset --hard HEAD && cd .. + # We checkout a patched Cabal. + # See: https://github.com/snowleopard/hadrian/issues/634 + - cd libraries/Cabal/ + - git remote add quasicomputational https://github.com/quasicomputational/cabal.git + - git fetch quasicomputational && git checkout cwd-independent-check + - cd ../../ + cache: directories: - $HOME/.cabal diff --git a/appveyor.yml b/appveyor.yml index 1a18abe..a1ac6c4 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -20,6 +20,13 @@ install: # Copy new Hadrian into ./ghc/hadrian - cp -r new-hadrian ghc\hadrian + # We checkout a patched Cabal. + # See: https://github.com/snowleopard/hadrian/issues/634 + - cd ghc/libraries/Cabal/ + - git remote add quasicomputational https://github.com/quasicomputational/cabal.git + - git fetch quasicomputational && git checkout cwd-independent-check + - cd ../../../ + # Install Alex and Happy - set PATH=C:\Users\appveyor\AppData\Roaming\local\bin;%PATH% - ghc\hadrian\stack install --install-ghc alex happy > nul diff --git a/circle.yml b/circle.yml index 10b9094..998e46d 100644 --- a/circle.yml +++ b/circle.yml @@ -31,6 +31,10 @@ compile: # in CircleCI is a separate process, thus you can't "cd" for the other lines - cd ghc/hadrian; git reset --hard HEAD + # We checkout a patched Cabal. + # See: https://github.com/snowleopard/hadrian/issues/634 + - cd ghc/libraries/Cabal/ && git remote add quasicomputational https://github.com/quasicomputational/cabal.git && git fetch quasicomputational && git checkout cwd-independent-check + - cd ghc; ./boot && PATH=~/.cabal/bin:$PATH ./configure # XXX: export PATH doesn't work well either, so we use inline env diff --git a/src/Settings/Packages.hs b/src/Settings/Packages.hs index 6a23bb7..f1f0e61 100644 --- a/src/Settings/Packages.hs +++ b/src/Settings/Packages.hs @@ -27,8 +27,15 @@ packageArgs = do -- This fixes the 'unknown symbol stat' issue. -- See: https://github.com/snowleopard/hadrian/issues/259. - , builder (Ghc CompileCWithGhc) ? arg "-optc-O2" ] + , builder (Ghc CompileCWithGhc) ? arg "-optc-O2" + -- See https://ghc.haskell.org/trac/ghc/ticket/15286 and + -- https://phabricator.haskell.org/D4880 + , builder (Ghc CompileHs) ? mconcat + [ input "//Natural.hs" ? pure ["-O0", "-fno-omit-interface-pragmas"] + , input "//Num.hs" ? pure ["-O0", "-fno-ignore-interface-pragmas"] + ] + ] ------------------------------ bytestring ------------------------------ , package bytestring ? builder CabalFlags ? intLib == integerSimple ? arg "integer-simple" From git at git.haskell.org Tue Oct 23 20:18:37 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:18:37 +0000 (UTC) Subject: [commit: ghc] master: Fixes building with stack within recent versions of ghc repo (#646) (23dc432) Message-ID: <20181023201837.B41CB3ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/23dc432a3f6cafc20499ad98882ed33f25a8f271/ghc >--------------------------------------------------------------- commit 23dc432a3f6cafc20499ad98882ed33f25a8f271 Author: Michael Sloan Date: Thu Jul 19 06:30:52 2018 -0700 Fixes building with stack within recent versions of ghc repo (#646) >--------------------------------------------------------------- 23dc432a3f6cafc20499ad98882ed33f25a8f271 stack.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/stack.yaml b/stack.yaml index 61767bd..d506426 100644 --- a/stack.yaml +++ b/stack.yaml @@ -12,6 +12,16 @@ packages: extra-deps: - shake-0.16.1 +# This is necessary to build until happy's version bounds are updated to work +# with the new Cabal version. Stack's error message explains the issue: +# +# In the dependencies for happy-1.19.9: +# Cabal-2.3.0.0 from stack configuration does not match <2.2 (latest matching version is 2.0.1.1) +# needed due to hadrian-0.1.0.0 -> happy-1.19.9 +# +# TODO: Remove this once it's no longer necessary +allow-newer: true + nix: enable: false packages: From git at git.haskell.org Tue Oct 23 20:18:41 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:18:41 +0000 (UTC) Subject: [commit: ghc] master: Implement the equivalent of D4955 (#648) (165f03e) Message-ID: <20181023201841.8F70C3ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/165f03e90f5090ecbeeee1ef00c3a7338bfa306b/ghc >--------------------------------------------------------------- commit 165f03e90f5090ecbeeee1ef00c3a7338bfa306b Author: Alp Mestanogullari Date: Fri Jul 20 15:08:53 2018 +0200 Implement the equivalent of D4955 (#648) * implement the equivalent of D4991 for hadrian * use stage2 instead of stage == Stage2 >--------------------------------------------------------------- 165f03e90f5090ecbeeee1ef00c3a7338bfa306b src/Settings/Packages.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Settings/Packages.hs b/src/Settings/Packages.hs index f1f0e61..360de3e 100644 --- a/src/Settings/Packages.hs +++ b/src/Settings/Packages.hs @@ -75,10 +75,11 @@ packageArgs = do , ghcProfiled <$> flavour ? notStage0 ? arg "--ghc-pkg-option=--force" ] - , builder CabalFlags ? mconcat + , builder CabalFlags ? mconcat [ ghcWithNativeCodeGen ? arg "ncg" , ghcWithInterpreter ? notStage0 ? arg "ghci" - , flag CrossCompiling ? arg "-terminfo" ] + , flag CrossCompiling ? arg "-terminfo" + , stage2 ? arg "integer-simple" ] , builder (Haddock BuildPackage) ? arg ("--optghc=-I" ++ path) ] From git at git.haskell.org Tue Oct 23 20:18:45 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:18:45 +0000 (UTC) Subject: [commit: ghc] master: Remove the hack to use a patched Cabal submodule in CI (#650) (148006a) Message-ID: <20181023201845.6DC663ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/148006a03eae0e91a17d4fd08b541a12fe5ece1b/ghc >--------------------------------------------------------------- commit 148006a03eae0e91a17d4fd08b541a12fe5ece1b Author: quasicomputational Date: Tue Jul 31 22:45:31 2018 +0100 Remove the hack to use a patched Cabal submodule in CI (#650) The fix has landed in GHC HEAD. Closes #634. >--------------------------------------------------------------- 148006a03eae0e91a17d4fd08b541a12fe5ece1b .travis.yml | 7 ------- appveyor.yml | 7 ------- circle.yml | 4 ---- 3 files changed, 18 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8416e00..f80bca6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -104,13 +104,6 @@ install: - mv .git ghc/hadrian - cd ghc/hadrian && git reset --hard HEAD && cd .. - # We checkout a patched Cabal. - # See: https://github.com/snowleopard/hadrian/issues/634 - - cd libraries/Cabal/ - - git remote add quasicomputational https://github.com/quasicomputational/cabal.git - - git fetch quasicomputational && git checkout cwd-independent-check - - cd ../../ - cache: directories: - $HOME/.cabal diff --git a/appveyor.yml b/appveyor.yml index a1ac6c4..1a18abe 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -20,13 +20,6 @@ install: # Copy new Hadrian into ./ghc/hadrian - cp -r new-hadrian ghc\hadrian - # We checkout a patched Cabal. - # See: https://github.com/snowleopard/hadrian/issues/634 - - cd ghc/libraries/Cabal/ - - git remote add quasicomputational https://github.com/quasicomputational/cabal.git - - git fetch quasicomputational && git checkout cwd-independent-check - - cd ../../../ - # Install Alex and Happy - set PATH=C:\Users\appveyor\AppData\Roaming\local\bin;%PATH% - ghc\hadrian\stack install --install-ghc alex happy > nul diff --git a/circle.yml b/circle.yml index 998e46d..10b9094 100644 --- a/circle.yml +++ b/circle.yml @@ -31,10 +31,6 @@ compile: # in CircleCI is a separate process, thus you can't "cd" for the other lines - cd ghc/hadrian; git reset --hard HEAD - # We checkout a patched Cabal. - # See: https://github.com/snowleopard/hadrian/issues/634 - - cd ghc/libraries/Cabal/ && git remote add quasicomputational https://github.com/quasicomputational/cabal.git && git fetch quasicomputational && git checkout cwd-independent-check - - cd ghc; ./boot && PATH=~/.cabal/bin:$PATH ./configure # XXX: export PATH doesn't work well either, so we use inline env From git at git.haskell.org Tue Oct 23 20:18:49 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:18:49 +0000 (UTC) Subject: [commit: ghc] master: Bump Cabal upper bound (#651) (4265e3a) Message-ID: <20181023201849.6329A3ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/4265e3aab7df92722b81148cf8bf3954ebfc2d21/ghc >--------------------------------------------------------------- commit 4265e3aab7df92722b81148cf8bf3954ebfc2d21 Author: Ben Gamari Date: Sat Aug 4 20:22:24 2018 -0400 Bump Cabal upper bound (#651) >--------------------------------------------------------------- 4265e3aab7df92722b81148cf8bf3954ebfc2d21 hadrian.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hadrian.cabal b/hadrian.cabal index 469bc67..b0ea033 100644 --- a/hadrian.cabal +++ b/hadrian.cabal @@ -113,7 +113,7 @@ executable hadrian other-extensions: MultiParamTypeClasses , TypeFamilies build-depends: base >= 4.8 && < 5 - , Cabal >= 2.3 && < 2.4 + , Cabal >= 2.4 && < 2.5 , containers == 0.5.* , directory >= 1.2 && < 1.4 , extra >= 1.4.7 From git at git.haskell.org Tue Oct 23 20:18:53 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:18:53 +0000 (UTC) Subject: [commit: ghc] master: Fix warnings, improve comments and error handling, minor refactoring (#656) (2fac053) Message-ID: <20181023201853.479373ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/2fac053131d4f297450e092e24524734afffc220/ghc >--------------------------------------------------------------- commit 2fac053131d4f297450e092e24524734afffc220 Author: Andrey Mokhov Date: Thu Aug 23 00:49:33 2018 +0100 Fix warnings, improve comments and error handling, minor refactoring (#656) >--------------------------------------------------------------- 2fac053131d4f297450e092e24524734afffc220 src/Hadrian/Utilities.hs | 15 +++-- src/Oracles/TestSettings.hs | 14 ++--- src/Settings/Builders/RunTest.hs | 115 +++++++++++++++++++-------------------- 3 files changed, 73 insertions(+), 71 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 2fac053131d4f297450e092e24524734afffc220 From git at git.haskell.org Tue Oct 23 20:18:57 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:18:57 +0000 (UTC) Subject: [commit: ghc] master: Fix package dependencies (#657) (a804d57) Message-ID: <20181023201857.3FFCD3ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/a804d57a6b29df8ba51f064ca42dd7f0500eea27/ghc >--------------------------------------------------------------- commit a804d57a6b29df8ba51f064ca42dd7f0500eea27 Author: Andrey Mokhov Date: Fri Aug 24 11:25:39 2018 +0100 Fix package dependencies (#657) This fixes #654. There are only two important changes. 1) The first one fixes missing dependencies: ```diff -pkgDependencies = fmap (fmap PD.dependencies) . readPackageDataFile +pkgDependencies = fmap (fmap (map pkgName . packageDependencies)) . readCabalFile ``` Here `PD.dependencies` returned versioned package names, e.g. `ghc-8.7`, which then failed to match with non-versioned package names such as `ghc` in `contextDependencies`. Switching from `PD.dependencies` to `packageDependencies` fixes this. 2) I clearly remember that we didn't have this bug before, so I added some tests for our package dependency infrastructure to prevent such regressions in future: ```haskell testDependencies :: Action () testDependencies = do putBuild "==== pkgDependencies" depLists <- mapM (pkgDependencies . vanillaContext Stage1) ghcPackages test $ and [ deps == sort deps | Just deps <- depLists ] putBuild "==== Dependencies of the 'ghc-bin' binary" ghcDeps <- pkgDependencies (vanillaContext Stage1 ghc) test $ isJust ghcDeps test $ pkgName compiler `elem` fromJust ghcDeps stage0Deps <- contextDependencies (vanillaContext Stage0 ghc) stage1Deps <- contextDependencies (vanillaContext Stage1 ghc) stage2Deps <- contextDependencies (vanillaContext Stage2 ghc) test $ vanillaContext Stage0 compiler `notElem` stage1Deps test $ vanillaContext Stage1 compiler `elem` stage1Deps test $ vanillaContext Stage2 compiler `notElem` stage1Deps test $ stage1Deps /= stage0Deps test $ stage1Deps == stage2Deps ``` Everything else are cosmetic changes, fixing minor issues in comments, and adding TODOs. To figure out the failure in #654 I had to read some code I didn't write and my hands were automatically fixing some style inconsistencies with the rest of the Hadrian code base. (I'd like to emphasise that I make no judgement about which style is better, it's merely an attempt to make the code base look more homogeneous, which I think is useful.) >--------------------------------------------------------------- a804d57a6b29df8ba51f064ca42dd7f0500eea27 src/Expression.hs | 7 +- src/Hadrian/Haskell/Cabal.hs | 15 +- src/Hadrian/Oracles/TextFile.hs | 17 +-- src/Rules/Library.hs | 322 +++++++++++++++++++--------------------- src/Rules/Selftest.hs | 23 ++- src/Utilities.hs | 11 +- 6 files changed, 199 insertions(+), 196 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc a804d57a6b29df8ba51f064ca42dd7f0500eea27 From git at git.haskell.org Tue Oct 23 20:19:01 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:19:01 +0000 (UTC) Subject: [commit: ghc] master: Clean up remaining bits related to ghc-cabal (#658) (8dc4f73) Message-ID: <20181023201901.734EE3ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/8dc4f73f169a6f7c2efb849df8d3493844ef413c/ghc >--------------------------------------------------------------- commit 8dc4f73f169a6f7c2efb849df8d3493844ef413c Author: Andrey Mokhov Date: Sun Aug 26 14:46:42 2018 +0100 Clean up remaining bits related to ghc-cabal (#658) * Drop ghcCabal package * Merge GhcCabal and CabalFlags builders * Use more consistent naming * Resolve import cycle * Rename parseCabal to parseCabalFile * Remove outdated references to ghc-cabal from comments >--------------------------------------------------------------- 8dc4f73f169a6f7c2efb849df8d3493844ef413c build.global-db.bat | 2 +- hadrian.cabal | 6 +- src/Builder.hs | 89 +++++++++++----------- src/Builder.hs-boot | 7 +- src/Environment.hs | 2 +- src/Expression.hs | 8 +- src/GHC.hs | 25 +++---- src/GHC/Packages.hs | 1 - src/Hadrian/Haskell/Cabal.hs | 10 +-- src/Hadrian/Haskell/Cabal/CabalData.hs | 24 ++++++ src/Hadrian/Haskell/Cabal/PackageData.hs | 2 +- src/Hadrian/Haskell/Cabal/Parse.hs | 43 +++++------ src/Hadrian/Haskell/Cabal/Parse.hs-boot | 9 --- src/Hadrian/Haskell/Cabal/Type.hs | 23 ------ src/Hadrian/Oracles/TextFile.hs | 99 +++++-------------------- src/Hadrian/Oracles/TextFile/Rules.hs | 67 +++++++++++++++++ src/Hadrian/Oracles/TextFile/Type.hs | 41 ++++++++++ src/Rules.hs | 10 +-- src/Rules/Configure.hs | 2 + src/Rules/Documentation.hs | 33 ++++----- src/Rules/Gmp.hs | 4 +- src/Rules/Program.hs | 19 ++--- src/Rules/Register.hs | 2 +- src/Settings/Builders/{GhcCabal.hs => Cabal.hs} | 28 +++---- src/Settings/Builders/GhcPkg.hs | 2 +- src/Settings/Default.hs | 4 +- src/Settings/Packages.hs | 30 ++++---- 27 files changed, 306 insertions(+), 286 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 8dc4f73f169a6f7c2efb849df8d3493844ef413c From git at git.haskell.org Tue Oct 23 20:19:05 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:19:05 +0000 (UTC) Subject: [commit: ghc] master: Drop nonCabalContext, since all GHC packages now come with Cabal files (e174dca) Message-ID: <20181023201905.6192F3ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/e174dca4d5c682369c1e33b4849e949b329fdae0/ghc >--------------------------------------------------------------- commit e174dca4d5c682369c1e33b4849e949b329fdae0 Author: Andrey Mokhov Date: Sun Aug 26 15:12:06 2018 +0100 Drop nonCabalContext, since all GHC packages now come with Cabal files >--------------------------------------------------------------- e174dca4d5c682369c1e33b4849e949b329fdae0 src/GHC.hs | 8 +------- src/Rules.hs | 10 +++++----- src/Settings/Builders/Ghc.hs | 3 +-- 3 files changed, 7 insertions(+), 14 deletions(-) diff --git a/src/GHC.hs b/src/GHC.hs index b3002b8..c5fd1a3 100644 --- a/src/GHC.hs +++ b/src/GHC.hs @@ -12,7 +12,7 @@ module GHC ( testsuitePackages, -- * Package information - programName, nonCabalContext, nonHsMainPackage, autogenPath, installStage, + programName, nonHsMainPackage, autogenPath, installStage, -- * Miscellaneous programPath, buildDll0, rtsContext, rtsBuildPath, libffiContext, @@ -157,12 +157,6 @@ programPath context at Context {..} = do pgm <- programName context return $ path -/- pgm <.> exe --- TODO: This is no longer true -- both @hp2ps@ and @touchy@ appear to have been --- Cabal-ised, so we need to drop these special cases. --- | Some contexts are special: their packages do not have @.cabal@ metadata. -nonCabalContext :: Context -> Bool -nonCabalContext Context {..} = (package `elem` [hp2ps, touchy]) - -- | Some program packages should not be linked with Haskell main function. nonHsMainPackage :: Package -> Bool nonHsMainPackage = (`elem` [ghc, hp2ps, iserv, touchy, unlit]) diff --git a/src/Rules.hs b/src/Rules.hs index 3786d99..93b8592 100644 --- a/src/Rules.hs +++ b/src/Rules.hs @@ -72,11 +72,11 @@ packageTargets includeGhciLib stage pkg = do else if isLibrary pkg then do -- Collect all targets of a library package. let pkgWays = if pkg == rts then getRtsWays else getLibraryWays - ways <- interpretInContext context pkgWays - libs <- mapM (pkgLibraryFile . Context stage pkg) ways - more <- libraryTargets includeGhciLib context - setup <- pkgSetupConfigFile context - return $ [ setup | not (nonCabalContext context) ] ++ libs ++ more + ways <- interpretInContext context pkgWays + libs <- mapM (pkgLibraryFile . Context stage pkg) ways + more <- libraryTargets includeGhciLib context + setup <- pkgSetupConfigFile context + return $ [setup] ++ libs ++ more else do -- The only target of a program package is the executable. prgContext <- programContext stage pkg prgPath <- programPath prgContext diff --git a/src/Settings/Builders/Ghc.hs b/src/Settings/Builders/Ghc.hs index a018360..49bfbd6 100644 --- a/src/Settings/Builders/Ghc.hs +++ b/src/Settings/Builders/Ghc.hs @@ -133,5 +133,4 @@ includeGhcArgs = do , cIncludeArgs , arg $ "-I" ++ root -/- generatedDir , arg $ "-optc-I" ++ root -/- generatedDir - , (not $ nonCabalContext context) ? - pure [ "-optP-include", "-optP" ++ autogen -/- "cabal_macros.h" ] ] + , pure [ "-optP-include", "-optP" ++ autogen -/- "cabal_macros.h" ] ] From git at git.haskell.org Tue Oct 23 20:19:09 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:19:09 +0000 (UTC) Subject: [commit: ghc] master: Fix defaut top level targets (#659) (8ec50a5) Message-ID: <20181023201909.4EAAF3ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/8ec50a585ac62cf7eaa1d4be16a26a2e2990226f/ghc >--------------------------------------------------------------- commit 8ec50a585ac62cf7eaa1d4be16a26a2e2990226f Author: Andrey Mokhov Date: Mon Aug 27 01:31:22 2018 +0100 Fix defaut top level targets (#659) * Keep only Stage0 and Stage1 package databases * Fix default top-level targets >--------------------------------------------------------------- 8ec50a585ac62cf7eaa1d4be16a26a2e2990226f src/Base.hs | 6 +++--- src/GHC.hs | 32 ++++++++++++++++---------------- src/Rules.hs | 35 ++++++++++++++++++----------------- src/Rules/Register.hs | 6 +++--- src/UserSettings.hs | 11 ++++------- 5 files changed, 44 insertions(+), 46 deletions(-) diff --git a/src/Base.hs b/src/Base.hs index 32fb979..68862ed 100644 --- a/src/Base.hs +++ b/src/Base.hs @@ -82,10 +82,10 @@ generatedDir = "generated" generatedPath :: Action FilePath generatedPath = buildRoot <&> (-/- generatedDir) --- | Path to the package database for the given stage of GHC, --- relative to the build root. +-- | Path to the package database for a given build stage, relative to the build +-- root. Note that @StageN@, where @N > 1@, uses the 'Stage1' package database. relativePackageDbPath :: Stage -> FilePath -relativePackageDbPath stage = stageString stage -/- "lib" -/- "package.conf.d" +relativePackageDbPath stage = stageString (min stage Stage1) -/- "lib/package.conf.d" -- | Path to the package database used in a given 'Stage', including -- the build root. diff --git a/src/GHC.hs b/src/GHC.hs index c5fd1a3..a849294 100644 --- a/src/GHC.hs +++ b/src/GHC.hs @@ -51,9 +51,7 @@ stage0Packages = do , ghcHeap , ghci , ghcPkg - , ghcTags , hsc2hs - , hp2ps , hpc , mtl , parsec @@ -92,31 +90,33 @@ stage1Packages = do , time , unlit , xhtml ] - ++ [ haddock | not cross ] - ++ [ runGhc | not cross ] ++ [ hpcBin | not cross ] ++ [ iserv | not win, not cross ] ++ [ libiserv | not win, not cross ] + ++ [ runGhc | not cross ] + ++ [ touchy | win ] ++ [ unix | not win ] ++ [ win32 | win ] stage2Packages :: Action [Package] -stage2Packages = return [haddock] +stage2Packages = do + cross <- flag CrossCompiling + return $ [ ghcTags ] + ++ [ haddock | not cross ] -- | Packages that are built only for the testsuite. testsuitePackages :: Action [Package] testsuitePackages = do - win <- windowsHost - return $ - [ checkApiAnnotations - , checkPpr - , ghci - , ghcPkg - , hp2ps - , iserv - , parallel - , runGhc ] ++ - [ timeout | win ] + win <- windowsHost + return $ [ checkApiAnnotations + , checkPpr + , ghci + , ghcPkg + , hp2ps + , iserv + , parallel + , runGhc ] ++ + [ timeout | win ] -- | Given a 'Context', compute the name of the program that is built in it -- assuming that the corresponding package's type is 'Program'. For example, GHC diff --git a/src/Rules.hs b/src/Rules.hs index 93b8592..85eb001 100644 --- a/src/Rules.hs +++ b/src/Rules.hs @@ -21,39 +21,40 @@ import qualified Rules.Program import qualified Rules.Register import Settings import Target +import UserSettings import Utilities allStages :: [Stage] allStages = [minBound .. maxBound] --- | This rule calls 'need' on all top-level build targets, respecting the --- 'Stage1Only' flag. +-- | This rule calls 'need' on all top-level build targets that Hadrian builds +-- by default, respecting the 'stage1Only' flag. topLevelTargets :: Rules () topLevelTargets = action $ do - (programs, libraries) <- partition isProgram <$> stagePackages Stage1 - pgmNames <- mapM (g Stage1) programs - libNames <- mapM (g Stage1) libraries - verbosity <- getVerbosity when (verbosity >= Loud) $ do - putNormal "Building stage2" + (libraries, programs) <- partition isLibrary <$> stagePackages Stage1 + libNames <- mapM (name Stage1) libraries + pgmNames <- mapM (name Stage1) programs putNormal . unlines $ - [ "| Building Programs : " ++ intercalate ", " pgmNames - , "| Building Libraries: " ++ intercalate ", " libNames ] - - targets <- mapM (f Stage1) =<< stagePackages Stage1 + [ "| Building Stage1 libraries: " ++ intercalate ", " libNames + , "| Building Stage1 programs : " ++ intercalate ", " pgmNames ] + let buildStages = [Stage0, Stage1] ++ [Stage2 | not stage1Only] + targets <- concatForM buildStages $ \stage -> do + packages <- stagePackages stage + mapM (path stage) packages need targets where -- either the package database config file for libraries or -- the programPath for programs. However this still does -- not support multiple targets, where a cabal package has -- a library /and/ a program. - f :: Stage -> Package -> Action FilePath - f stage pkg | isLibrary pkg = pkgConfFile (Context stage pkg (read "v")) - | otherwise = programPath =<< programContext stage pkg - g :: Stage -> Package -> Action String - g stage pkg | isLibrary pkg = return $ pkgName pkg - | otherwise = programName (Context stage pkg (read "v")) + path :: Stage -> Package -> Action FilePath + path stage pkg | isLibrary pkg = pkgConfFile (vanillaContext stage pkg) + | otherwise = programPath =<< programContext stage pkg + name :: Stage -> Package -> Action String + name stage pkg | isLibrary pkg = return (pkgName pkg) + | otherwise = programName (vanillaContext stage pkg) -- TODO: Get rid of the @includeGhciLib@ hack. -- | Return the list of targets associated with a given 'Stage' and 'Package'. diff --git a/src/Rules/Register.hs b/src/Rules/Register.hs index 7aa1ca4..909b1b3 100644 --- a/src/Rules/Register.hs +++ b/src/Rules/Register.hs @@ -28,10 +28,10 @@ configurePackage context at Context {..} = do root -/- contextDir context -/- "setup-config" %> \_ -> Cabal.configurePackage context --- | Registering a package and initialise the corresponding package database if --- need be. +-- | Register a package and initialise the corresponding package database if +-- need be. Note that we only register packages in 'Stage0' and 'Stage1'. registerPackage :: [(Resource, Int)] -> Context -> Rules () -registerPackage rs context at Context {..} = do +registerPackage rs context at Context {..} = when (stage < Stage2) $ do root <- buildRootRules -- Initialise the package database. diff --git a/src/UserSettings.hs b/src/UserSettings.hs index e52ed68..9246806 100644 --- a/src/UserSettings.hs +++ b/src/UserSettings.hs @@ -3,8 +3,8 @@ -- If you don't copy the file your changes will be tracked by git and you can -- accidentally commit them. module UserSettings ( - userFlavours, userPackages, verboseCommand, - buildProgressColour, successColour, stage1Only + userFlavours, userPackages, verboseCommand, buildProgressColour, + successColour, stage1Only ) where import Flavour @@ -46,11 +46,8 @@ successColour :: SuccessColour successColour = mkSuccessColour (Dull Green) -- TODO: Set this flag from the command line. --- | Set this flag to 'True' to disable building Stage2 GHC (i.e. the @ghc-stage2@ --- executable) and Stage2 utilities (such as @haddock@). Note that all Stage0 --- and Stage1 libraries (including 'compiler') will still be built. Enabling --- this flag during installation leads to installing @ghc-stage1@ instead of --- @ghc-stage2@, and @ghc-pkg@ that was build with the Stage0 compiler. +-- | Set this flag to 'True' to disable building Stage2 GHC and Stage2 utilities +-- such as @haddock at . All Stage0 and Stage1 libraries will still be built. -- Also see Note [No stage2 packages when CrossCompiling or Stage1Only] in the -- top-level @ghc.mk at . stage1Only :: Bool From git at git.haskell.org Tue Oct 23 20:19:13 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:19:13 +0000 (UTC) Subject: [commit: ghc] master: Clean up remaining bits of the install rule (#660) (0059b9f) Message-ID: <20181023201913.671253ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/0059b9f205d0e184e7f676917bf6d300a63c98a9/ghc >--------------------------------------------------------------- commit 0059b9f205d0e184e7f676917bf6d300a63c98a9 Author: Andrey Mokhov Date: Mon Aug 27 12:26:30 2018 +0100 Clean up remaining bits of the install rule (#660) #531 removed install rules (`src/Rules/Install.hs`), but left a lot of supporting code that is now unused. Hopefully, this clean up completes the removal of install rules. If they are ever coming back to Hadrian in any shape, some useful code can be recovered here. See #540. >--------------------------------------------------------------- 0059b9f205d0e184e7f676917bf6d300a63c98a9 cfg/system.config.in | 15 -------- doc/user-settings.md | 8 ++-- src/Builder.hs | 49 +----------------------- src/CommandLine.hs | 13 +------ src/GHC.hs | 12 +----- src/Oracles/Setting.hs | 83 ++++++++-------------------------------- src/Settings.hs | 8 +--- src/Settings/Builders/Make.hs | 5 +-- src/Settings/Builders/RunTest.hs | 2 +- src/Settings/Packages.hs | 9 ----- 10 files changed, 29 insertions(+), 175 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 0059b9f205d0e184e7f676917bf6d300a63c98a9 From git at git.haskell.org Tue Oct 23 20:19:17 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:19:17 +0000 (UTC) Subject: [commit: ghc] master: Reorganise GHC packages, get rid of Builder import cycle (#662) (0106f20) Message-ID: <20181023201917.719D03ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/0106f203927187d76ce9e92e69ed9864d01091dc/ghc >--------------------------------------------------------------- commit 0106f203927187d76ce9e92e69ed9864d01091dc Author: Andrey Mokhov Date: Mon Aug 27 21:45:17 2018 +0100 Reorganise GHC packages, get rid of Builder import cycle (#662) * Reorganise GHC and GHC.Packages modules to get rid of import cycles * Move "GHC.Packages" to "Packages", merge "GHC" into "Settings.Default" >--------------------------------------------------------------- 0106f203927187d76ce9e92e69ed9864d01091dc hadrian.cabal | 3 +- src/Builder.hs | 2 +- src/Builder.hs-boot | 46 -------- src/Expression.hs | 2 +- src/Expression/Type.hs | 2 +- src/GHC.hs | 192 --------------------------------- src/GHC/Packages.hs | 108 ------------------- src/Hadrian/Haskell/Cabal/Parse.hs | 12 +-- src/Oracles/ModuleFiles.hs | 5 +- src/Packages.hs | 210 +++++++++++++++++++++++++++++++++++++ src/Rules.hs | 2 +- src/Rules/BinaryDist.hs | 2 +- src/Rules/Configure.hs | 6 +- src/Rules/Documentation.hs | 2 +- src/Rules/Generate.hs | 2 +- src/Rules/Gmp.hs | 2 +- src/Rules/Libffi.hs | 3 +- src/Rules/Library.hs | 9 +- src/Rules/Nofib.hs | 87 ++++++++------- src/Rules/Program.hs | 3 +- src/Rules/Register.hs | 12 +-- src/Rules/Selftest.hs | 4 +- src/Rules/Test.hs | 105 +++++++------------ src/Settings.hs | 2 +- src/Settings/Builders/Cabal.hs | 8 +- src/Settings/Builders/Common.hs | 5 +- src/Settings/Builders/Configure.hs | 2 +- src/Settings/Builders/Ghc.hs | 8 +- src/Settings/Builders/HsCpp.hs | 2 +- src/Settings/Builders/Hsc2Hs.hs | 6 +- src/Settings/Builders/Make.hs | 2 +- src/Settings/Builders/RunTest.hs | 43 ++++++-- src/Settings/Default.hs | 163 ++++++++++++++++++++++------ src/Settings/Packages.hs | 2 +- src/Settings/Warnings.hs | 2 +- 35 files changed, 514 insertions(+), 552 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 0106f203927187d76ce9e92e69ed9864d01091dc From git at git.haskell.org Tue Oct 23 20:19:21 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:19:21 +0000 (UTC) Subject: [commit: ghc] master: Remove dead code (ae35b2b) Message-ID: <20181023201921.5BAF43ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/ae35b2b2b89ffe750f3a8dc32908c11f22227f85/ghc >--------------------------------------------------------------- commit ae35b2b2b89ffe750f3a8dc32908c11f22227f85 Author: Andrey Mokhov Date: Mon Aug 27 21:49:00 2018 +0100 Remove dead code >--------------------------------------------------------------- ae35b2b2b89ffe750f3a8dc32908c11f22227f85 src/Packages.hs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/Packages.hs b/src/Packages.hs index 8a0d150..c4645d4 100644 --- a/src/Packages.hs +++ b/src/Packages.hs @@ -12,8 +12,7 @@ module Packages ( -- * Package information programName, nonHsMainPackage, autogenPath, programPath, timeoutPath, - buildDll0, rtsContext, rtsBuildPath, libffiContext, libffiBuildPath, - libffiLibraryName + rtsContext, rtsBuildPath, libffiContext, libffiBuildPath, libffiLibraryName ) where import Hadrian.Package @@ -178,11 +177,6 @@ autogenPath context at Context {..} where autogen dir = contextPath context <&> (-/- dir -/- "autogen") -buildDll0 :: Context -> Action Bool -buildDll0 Context {..} = do - windows <- windowsHost - return $ windows && stage == Stage1 && package == compiler - -- | RTS is considered a Stage1 package. rtsContext :: Context rtsContext = vanillaContext Stage1 rts From git at git.haskell.org Tue Oct 23 20:19:25 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:19:25 +0000 (UTC) Subject: [commit: ghc] master: Minor revision (a820566) Message-ID: <20181023201925.3B0243ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/a820566c16e1945b02632e68bd54cc351f562ebc/ghc >--------------------------------------------------------------- commit a820566c16e1945b02632e68bd54cc351f562ebc Author: Andrey Mokhov Date: Tue Aug 28 00:33:13 2018 +0100 Minor revision >--------------------------------------------------------------- a820566c16e1945b02632e68bd54cc351f562ebc src/Oracles/ModuleFiles.hs | 45 ++++++++++++++++++++-------------------- src/Settings/Builders/Cabal.hs | 11 +++++----- src/Settings/Builders/Ghc.hs | 25 ++++++++++------------ src/Settings/Builders/Haddock.hs | 15 +++++++------- src/Settings/Packages.hs | 15 +++++++------- 5 files changed, 54 insertions(+), 57 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc a820566c16e1945b02632e68bd54cc351f562ebc From git at git.haskell.org Tue Oct 23 20:19:29 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:19:29 +0000 (UTC) Subject: [commit: ghc] master: Simplify Package data type (#663) (798a716) Message-ID: <20181023201929.2B3113ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/798a716b16370e359f5892f327f0bd625c08a4a0/ghc >--------------------------------------------------------------- commit 798a716b16370e359f5892f327f0bd625c08a4a0 Author: Andrey Mokhov Date: Wed Aug 29 02:33:21 2018 +0100 Simplify Package data type (#663) I noticed that all packages we build have Cabal files now, which means we no longer need to distinguish between C and Haskell packages. This leads to a lot of simplifications and removal of unsafe functions. >--------------------------------------------------------------- 798a716b16370e359f5892f327f0bd625c08a4a0 hadrian.cabal | 1 - src/Context.hs | 24 +---- src/Context/Type.hs | 8 +- src/Expression.hs | 4 +- src/Hadrian/Haskell/Cabal.hs | 19 ++-- src/Hadrian/Haskell/Cabal/CabalData.hs | 2 +- src/Hadrian/Haskell/Cabal/PackageData.hs | 2 +- src/Hadrian/Haskell/Cabal/Parse.hs | 12 +-- src/Hadrian/Oracles/TextFile.hs | 13 +-- src/Hadrian/Oracles/TextFile/Rules.hs | 28 +++--- src/Hadrian/Oracles/TextFile/Type.hs | 4 +- src/Hadrian/Package.hs | 93 +++++++++---------- src/Hadrian/Package/Type.hs | 45 ---------- src/Hadrian/Utilities.hs | 13 ++- src/Packages.hs | 150 +++++++++++++++---------------- src/Rules/BinaryDist.hs | 4 +- src/Rules/Documentation.hs | 10 +-- src/Rules/Library.hs | 7 +- src/Rules/Selftest.hs | 8 +- src/Settings/Builders/Cabal.hs | 11 ++- src/Settings/Builders/Ghc.hs | 5 +- src/Settings/Builders/Haddock.hs | 26 +++--- src/Utilities.hs | 9 +- 23 files changed, 206 insertions(+), 292 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 798a716b16370e359f5892f327f0bd625c08a4a0 From git at git.haskell.org Tue Oct 23 20:19:33 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:19:33 +0000 (UTC) Subject: [commit: ghc] master: Tweak the build root section (e5f13b3) Message-ID: <20181023201933.6576D3ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/e5f13b3a7586873d190208e9dbac6abc560fab23/ghc >--------------------------------------------------------------- commit e5f13b3a7586873d190208e9dbac6abc560fab23 Author: Andrey Mokhov Date: Wed Aug 29 18:50:51 2018 +0100 Tweak the build root section >--------------------------------------------------------------- e5f13b3a7586873d190208e9dbac6abc560fab23 README.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 6221353..b88d08d 100644 --- a/README.md +++ b/README.md @@ -59,12 +59,11 @@ In addition to standard Shake flags (try `--help`), the build system currently supports several others: * `--build-root=PATH` or `-oPATH`: specify the directory in which you want to store all -the build artifacts. If none is specified by the user, hadrian will store everything -under `_build/` at the top of ghc's source tree. Unlike GHC's make build system, -hadrian doesn't have any "inplace" logic left anymore. This option is therefore -useful for GHC developers who want to build GHC in different ways or at different -commits, from the same directory, and have the build products sit in different, -isolated folders. +build products. By default Hadrian builds everything in the `_build/` subdirectory of +the GHC source tree. Unlike the Make build system, Hadrian doesn't have any "inplace" +logic left anymore. This option is therefore useful for GHC developers who want to build +GHC in different ways or at different commits, from the same source directory, and have +the build products sit in different, isolated folders. * `--configure` or `-c`: use this flag to run the `boot` and `configure` scripts automatically, so that you don't have to remember to run them manually as you normally From git at git.haskell.org Tue Oct 23 20:19:37 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:19:37 +0000 (UTC) Subject: [commit: ghc] master: Fix documentation rules (#665) (90d07d7) Message-ID: <20181023201937.585E53ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/90d07d7bf42bc6f04af10b6bb38953e99a86c514/ghc >--------------------------------------------------------------- commit 90d07d7bf42bc6f04af10b6bb38953e99a86c514 Author: Andrey Mokhov Date: Thu Aug 30 00:36:58 2018 +0100 Fix documentation rules (#665) * Make sure we need haddockHtmlLib before creating anything in the directory * Fix Haddock builder provenance * Do not clean up the HTML docs directory * Fix the target directory * Add more missing dependencies on haddockHtmlLib * Replace docPackage with docContext * Minor revision >--------------------------------------------------------------- 90d07d7bf42bc6f04af10b6bb38953e99a86c514 src/Builder.hs | 2 +- src/Rules/Documentation.hs | 162 +++++++++++++++++++++------------------------ 2 files changed, 78 insertions(+), 86 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 90d07d7bf42bc6f04af10b6bb38953e99a86c514 From git at git.haskell.org Tue Oct 23 20:19:41 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:19:41 +0000 (UTC) Subject: [commit: ghc] master: Fix build scripts (#668) (12e6635) Message-ID: <20181023201941.433893ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/12e6635a583a48cee81d7ac007687a5038519244/ghc >--------------------------------------------------------------- commit 12e6635a583a48cee81d7ac007687a5038519244 Author: Andrey Mokhov Date: Sat Sep 1 19:50:38 2018 +0100 Fix build scripts (#668) * Delete scripts relying on global package database * Simplify Cabal build script * Simplify the default build script * Fix path * Invoke the build script from GHC root * Switch to newer Cabal * Don't disable Cabal output * Add build.cabal.bat >--------------------------------------------------------------- 12e6635a583a48cee81d7ac007687a5038519244 .travis.yml | 8 +++--- build.cabal.bat | 41 ++++++++++++++++++++++++++++++ build.cabal.sh | 73 ++++++++++++----------------------------------------- build.global-db.bat | 38 ---------------------------- build.global-db.sh | 52 -------------------------------------- build.sh | 32 +---------------------- circle.yml | 4 +-- 7 files changed, 64 insertions(+), 184 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 12e6635a583a48cee81d7ac007687a5038519244 From git at git.haskell.org Tue Oct 23 20:19:45 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:19:45 +0000 (UTC) Subject: [commit: ghc] master: Build runghc instead of runhaskell (#670) (abf9cbe) Message-ID: <20181023201945.314E93ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/abf9cbee2651a555b8fe9b7d1d2382432f2f2bb1/ghc >--------------------------------------------------------------- commit abf9cbee2651a555b8fe9b7d1d2382432f2f2bb1 Author: Andrey Mokhov Date: Sun Sep 2 13:40:05 2018 +0100 Build runghc instead of runhaskell (#670) * Build runghc instead of runhaskell * Minor revision (formatting, comments) >--------------------------------------------------------------- abf9cbee2651a555b8fe9b7d1d2382432f2f2bb1 src/Builder.hs | 4 +- src/Packages.hs | 2 - src/Rules/BinaryDist.hs | 461 +++++++++++++++++++++++------------------------- src/Rules/Test.hs | 12 +- 4 files changed, 226 insertions(+), 253 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc abf9cbee2651a555b8fe9b7d1d2382432f2f2bb1 From git at git.haskell.org Tue Oct 23 20:19:49 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:19:49 +0000 (UTC) Subject: [commit: ghc] master: Address some issues with the testsuite rules (#672) (4819617) Message-ID: <20181023201949.233A03ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/481961760e6aa7cded1d52a698fe94867d405f97/ghc >--------------------------------------------------------------- commit 481961760e6aa7cded1d52a698fe94867d405f97 Author: Alp Mestanogullari Date: Mon Sep 3 19:26:06 2018 +0200 Address some issues with the testsuite rules (#672) The driver was invoked with invalid syntax for some arguments, we were not making sure hsc2hs is built before we run the tests (it's needed by many), etc. >--------------------------------------------------------------- 481961760e6aa7cded1d52a698fe94867d405f97 src/Rules/Test.hs | 1 + src/Settings/Builders/RunTest.hs | 14 +++++++------- src/Settings/Default.hs | 1 + 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/Rules/Test.hs b/src/Rules/Test.hs index 64ff52f..f5d6990 100644 --- a/src/Rules/Test.hs +++ b/src/Rules/Test.hs @@ -29,6 +29,7 @@ testRules = do -- | Using program shipped with testsuite to generate ghcconfig file. root -/- ghcConfigProgPath ~> do ghc <- builderPath $ Ghc CompileHs Stage0 + createDirectory $ takeDirectory (root -/- ghcConfigProgPath) cmd ghc [ghcConfigHsPath, "-o" , root -/- ghcConfigProgPath] -- | TODO : Use input test compiler and not just stage2 compiler. diff --git a/src/Settings/Builders/RunTest.hs b/src/Settings/Builders/RunTest.hs index c2e6bfd..734fecd 100644 --- a/src/Settings/Builders/RunTest.hs +++ b/src/Settings/Builders/RunTest.hs @@ -94,18 +94,18 @@ runTestBuilderArgs = builder RunTest ? do , arg "-e", arg $ "config.cleanup=False" -- Don't clean up. , arg "-e", arg $ "config.compiler_debugged=" ++ quote (yesNo debugged) , arg "-e", arg $ "ghc_debugged=" ++ quote (yesNo debugged) - , arg "-e", arg $ asZeroOne "ghc_with_native_codegen" withNativeCodeGen + , arg "-e", arg $ asZeroOne "ghc_with_native_codegen=" withNativeCodeGen , arg "-e", arg $ "config.have_interp=" ++ show withInterpreter , arg "-e", arg $ "config.unregisterised=" ++ show unregisterised , arg "-e", arg $ "ghc_compiler_always_flags=" ++ quote ghcFlags - , arg "-e", arg $ asZeroOne "ghc_with_dynamic_rts" (hasRtsWay "dyn") - , arg "-e", arg $ asZeroOne "ghc_with_threaded_rts" (hasRtsWay "thr") - , arg "-e", arg $ asZeroOne "config.have_vanilla" (hasLibWay vanilla) - , arg "-e", arg $ asZeroOne "config.have_dynamic" (hasLibWay dynamic) - , arg "-e", arg $ asZeroOne "config.have_profiling" (hasLibWay profiling) - , arg "-e", arg $ asZeroOne "ghc_with_smp" withSMP + , arg "-e", arg $ asZeroOne "ghc_with_dynamic_rts=" (hasRtsWay "dyn") + , arg "-e", arg $ asZeroOne "ghc_with_threaded_rts=" (hasRtsWay "thr") + , arg "-e", arg $ asZeroOne "config.have_vanilla=" (hasLibWay vanilla) + , arg "-e", arg $ asZeroOne "config.have_dynamic=" (hasLibWay dynamic) + , arg "-e", arg $ asZeroOne "config.have_profiling=" (hasLibWay profiling) + , arg "-e", arg $ asZeroOne "ghc_with_smp=" withSMP , arg "-e", arg $ "ghc_with_llvm=0" -- TODO: support LLVM , arg "-e", arg $ "config.ghc_dynamic_by_default=" ++ show hasDynamicByDefault diff --git a/src/Settings/Default.hs b/src/Settings/Default.hs index 689a49e..839c033 100644 --- a/src/Settings/Default.hs +++ b/src/Settings/Default.hs @@ -133,6 +133,7 @@ testsuitePackages = do , ghci , ghcPkg , hp2ps + , hsc2hs , iserv , parallel , runGhc ] ++ From git at git.haskell.org Tue Oct 23 20:19:53 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:19:53 +0000 (UTC) Subject: [commit: ghc] master: Fix typos (3217903) Message-ID: <20181023201953.326933ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/3217903fc83afab09f0686e16c382e3468a82e76/ghc >--------------------------------------------------------------- commit 3217903fc83afab09f0686e16c382e3468a82e76 Author: Andrey Mokhov Date: Tue Sep 4 18:34:01 2018 +0100 Fix typos >--------------------------------------------------------------- 3217903fc83afab09f0686e16c382e3468a82e76 doc/user-settings.md | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/doc/user-settings.md b/doc/user-settings.md index 0865c5b..e8e980f 100644 --- a/doc/user-settings.md +++ b/doc/user-settings.md @@ -139,21 +139,20 @@ Note that `rtsWays` is computed from `libraryWays` by default, therefore the abo change will lead to the removal of `threadedProfiling` way from `rtsWays`. To change this behaviour, you can override the default `rtsWays` setting. -Similarly, if we want to completely turn off dynamic linking, -we can define a custom `Flavour` to this effect: +Similarly, if we want to completely turn off dynamic linking, we can define a custom +`Flavour` to this effect: ``` haskell noDynamicFlavour :: Flavour noDynamicFlavour = defaultFlavour - { name = "no-dynamic" - , libraryWays = remove [dynamic] defaultLibraryWays - } + { name = "no-dynamic" + , libraryWays = remove [dynamic] defaultLibraryWays } ``` ## Verbose command lines By default Hadrian does not print full command lines during the build process and instead prints short human readable digests for each executed command. You -can suppress this behaviour completely or partially using `verboseCommands` setting: +can suppress this behaviour completely or partially using `verboseCommand` setting: ```haskell -- | Set to 'True' to print full command lines during the build process. Note: -- this is a 'Predicate', hence you can enable verbose output only for certain @@ -166,22 +165,22 @@ verboseCommand = do For example, to print the full command lines used to compile GHC executables, set `verboseCommands` to: ```haskell -verboseCommands :: Predicate -verboseCommands = input "ghc/Main.hs" +verboseCommand :: Predicate +verboseCommand = input "ghc/Main.hs" ``` Below are a few other examples: ```haskell -- Print command lines for all Ghc Link invocations: -verboseCommands = builder (Ghc Link) +verboseCommand = builder (Ghc Link) -- Print command lines when compiling files in package compiler using Gcc: -verboseCommands = builder (Gcc Compile) &&^ package compiler +verboseCommand = builder (Gcc Compile) &&^ package compiler -- Use patterns when matching files: -verboseCommands = output "//rts/sm/*" &&^ way threaded +verboseCommand = output "//rts/sm/*" &&^ way threaded -- Print all commands: -verboseCommands = return True +verboseCommand = return True ``` ## Miscellaneous From git at git.haskell.org Tue Oct 23 20:19:57 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:19:57 +0000 (UTC) Subject: [commit: ghc] master: Remove unwanted '-O0's in Settings.Packages (#674) (921dbbd) Message-ID: <20181023201957.943E83ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/921dbbdc771212ad408a11d841707c01254fdb39/ghc >--------------------------------------------------------------- commit 921dbbdc771212ad408a11d841707c01254fdb39 Author: Alp Mestanogullari Date: Wed Sep 5 01:23:26 2018 +0200 Remove unwanted '-O0's in Settings.Packages (#674) >--------------------------------------------------------------- 921dbbdc771212ad408a11d841707c01254fdb39 src/Settings/Packages.hs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Settings/Packages.hs b/src/Settings/Packages.hs index 5249c5a..2dbb826 100644 --- a/src/Settings/Packages.hs +++ b/src/Settings/Packages.hs @@ -31,8 +31,8 @@ packageArgs = do -- See https://ghc.haskell.org/trac/ghc/ticket/15286 and -- https://phabricator.haskell.org/D4880 , builder (Ghc CompileHs) ? mconcat - [ input "//Natural.hs" ? pure ["-O0", "-fno-omit-interface-pragmas"] - , input "//Num.hs" ? pure ["-O0", "-fno-ignore-interface-pragmas"] + [ input "//Natural.hs" ? pure ["-fno-omit-interface-pragmas"] + , input "//Num.hs" ? pure ["-fno-ignore-interface-pragmas"] ] ] ------------------------------ bytestring ------------------------------ @@ -53,7 +53,7 @@ packageArgs = do , builder (Ghc CompileHs) ? mconcat [ inputs ["//GHC.hs", "//GhcMake.hs"] ? arg "-fprof-auto" , input "//Parser.hs" ? - pure ["-O0", "-fno-ignore-interface-pragmas", "-fcmm-sink" ] ] + pure ["-fno-ignore-interface-pragmas", "-fcmm-sink" ] ] , builder (Cabal Setup) ? mconcat [ arg $ "--ghc-option=-DSTAGE=" ++ show (fromEnum stage + 1) @@ -213,8 +213,7 @@ rtsPackageArgs = package rts ? do , Debug `wayUnit` way ? pure [ "-DDEBUG" , "-fno-omit-frame-pointer" - , "-g" - , "-O0" ] + , "-g" ] , way `elem` [debug, debugDynamic] ? arg "-DTICKY_TICKY" , Profiling `wayUnit` way ? arg "-DPROFILING" , Threaded `wayUnit` way ? arg "-DTHREADED_RTS" From git at git.haskell.org Tue Oct 23 20:20:01 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:20:01 +0000 (UTC) Subject: [commit: ghc] master: Work around the "can't use Natural in base" problem on a per-flavour basis (#676) (1bbc4b3) Message-ID: <20181023202001.D731C3ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/1bbc4b3b620562c673ee0871254e3cae3e3cb232/ghc >--------------------------------------------------------------- commit 1bbc4b3b620562c673ee0871254e3cae3e3cb232 Author: Alp Mestanogullari Date: Wed Sep 5 19:41:45 2018 +0200 Work around the "can't use Natural in base" problem on a per-flavour basis (#676) * Work around the "can't use natural in base" problem on a per-flavour basis The only flavours that need the workaround are the ones that build GHC/{Natural, Num}.hs with -O0, namely 'quick', 'quickest' and 'prof'. This patches defines the necessary arguments in one place and uses them in all the aforementionned flavour definitions. This will allow us to have both quick/quickest/prof builds that come through as well as an efficient compiler when we want it (with e.g perf), which wasn't the case before my series of patches for this problem. * address @snowleopard's feedback >--------------------------------------------------------------- 1bbc4b3b620562c673ee0871254e3cae3e3cb232 hadrian.cabal | 1 + src/Settings/Flavours/Common.hs | 11 +++++++++++ src/Settings/Flavours/Profiled.hs | 6 +++++- src/Settings/Flavours/Quick.hs | 6 +++++- src/Settings/Flavours/QuickCross.hs | 6 +++++- src/Settings/Flavours/Quickest.hs | 6 +++++- 6 files changed, 32 insertions(+), 4 deletions(-) diff --git a/hadrian.cabal b/hadrian.cabal index 6bb0d73..2fd2c8c 100644 --- a/hadrian.cabal +++ b/hadrian.cabal @@ -87,6 +87,7 @@ executable hadrian , Settings.Builders.RunTest , Settings.Builders.Xelatex , Settings.Default + , Settings.Flavours.Common , Settings.Flavours.Development , Settings.Flavours.Performance , Settings.Flavours.Profiled diff --git a/src/Settings/Flavours/Common.hs b/src/Settings/Flavours/Common.hs new file mode 100644 index 0000000..a1eb2fb --- /dev/null +++ b/src/Settings/Flavours/Common.hs @@ -0,0 +1,11 @@ +module Settings.Flavours.Common where + +import Expression + +-- See https://ghc.haskell.org/trac/ghc/ticket/15286 and +-- https://phabricator.haskell.org/D4880 +naturalInBaseFixArgs :: Args +naturalInBaseFixArgs = mconcat + [ input "//Natural.hs" ? pure ["-fno-omit-interface-pragmas"] + , input "//Num.hs" ? pure ["-fno-ignore-interface-pragmas"] + ] diff --git a/src/Settings/Flavours/Profiled.hs b/src/Settings/Flavours/Profiled.hs index d56cc10..91b7f3b 100644 --- a/src/Settings/Flavours/Profiled.hs +++ b/src/Settings/Flavours/Profiled.hs @@ -3,6 +3,7 @@ module Settings.Flavours.Profiled (profiledFlavour) where import Expression import Flavour import {-# SOURCE #-} Settings.Default +import Settings.Flavours.Common (naturalInBaseFixArgs) -- Please update doc/flavours.md when changing this file. profiledFlavour :: Flavour @@ -13,7 +14,10 @@ profiledFlavour = defaultFlavour profiledArgs :: Args profiledArgs = sourceArgs SourceArgs - { hsDefault = pure ["-O0", "-H64m"] + { hsDefault = mconcat + [ pure ["-O0", "-H64m"] + , naturalInBaseFixArgs + ] , hsLibrary = notStage0 ? arg "-O" , hsCompiler = arg "-O" , hsGhc = arg "-O" } diff --git a/src/Settings/Flavours/Quick.hs b/src/Settings/Flavours/Quick.hs index 99dade9..3da1dcf 100644 --- a/src/Settings/Flavours/Quick.hs +++ b/src/Settings/Flavours/Quick.hs @@ -4,6 +4,7 @@ import Expression import Flavour import Oracles.Flag import {-# SOURCE #-} Settings.Default +import Settings.Flavours.Common (naturalInBaseFixArgs) -- Please update doc/flavours.md when changing this file. quickFlavour :: Flavour @@ -16,7 +17,10 @@ quickFlavour = defaultFlavour quickArgs :: Args quickArgs = sourceArgs SourceArgs - { hsDefault = pure ["-O0", "-H64m"] + { hsDefault = mconcat $ + [ pure ["-O0", "-H64m"] + , naturalInBaseFixArgs + ] , hsLibrary = notStage0 ? arg "-O" , hsCompiler = stage0 ? arg "-O" , hsGhc = stage0 ? arg "-O" } diff --git a/src/Settings/Flavours/QuickCross.hs b/src/Settings/Flavours/QuickCross.hs index 3d0c410..cfc3586 100644 --- a/src/Settings/Flavours/QuickCross.hs +++ b/src/Settings/Flavours/QuickCross.hs @@ -4,6 +4,7 @@ import Expression import Flavour import Oracles.Flag import {-# SOURCE #-} Settings.Default +import Settings.Flavours.Common -- Please update doc/flavours.md when changing this file. quickCrossFlavour :: Flavour @@ -16,7 +17,10 @@ quickCrossFlavour = defaultFlavour quickCrossArgs :: Args quickCrossArgs = sourceArgs SourceArgs - { hsDefault = pure ["-O0", "-H64m"] + { hsDefault = mconcat $ + [ pure ["-O0", "-H64m"] + , naturalInBaseFixArgs + ] , hsLibrary = notStage0 ? mconcat [ arg "-O", arg "-fllvm" ] , hsCompiler = stage0 ? arg "-O" , hsGhc = mconcat diff --git a/src/Settings/Flavours/Quickest.hs b/src/Settings/Flavours/Quickest.hs index 836b935..2bcfac4 100644 --- a/src/Settings/Flavours/Quickest.hs +++ b/src/Settings/Flavours/Quickest.hs @@ -3,6 +3,7 @@ module Settings.Flavours.Quickest (quickestFlavour) where import Expression import Flavour import {-# SOURCE #-} Settings.Default +import Settings.Flavours.Common (naturalInBaseFixArgs) -- Please update doc/flavours.md when changing this file. quickestFlavour :: Flavour @@ -14,7 +15,10 @@ quickestFlavour = defaultFlavour quickestArgs :: Args quickestArgs = sourceArgs SourceArgs - { hsDefault = pure ["-O0", "-H64m"] + { hsDefault = mconcat $ + [ pure ["-O0", "-H64m"] + , naturalInBaseFixArgs + ] , hsLibrary = mempty , hsCompiler = stage0 ? arg "-O" , hsGhc = stage0 ? arg "-O" } From git at git.haskell.org Tue Oct 23 20:20:05 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:20:05 +0000 (UTC) Subject: [commit: ghc] master: Make the test rule depend on ghc-compact, to make this library's tests pass (#677) (f8d3f9b) Message-ID: <20181023202005.D1CBF3ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/f8d3f9b09ec1596b7cf7349e3ec8508352d6e3e4/ghc >--------------------------------------------------------------- commit f8d3f9b09ec1596b7cf7349e3ec8508352d6e3e4 Author: Alp Mestanogullari Date: Thu Sep 6 15:31:34 2018 +0200 Make the test rule depend on ghc-compact, to make this library's tests pass (#677) This fixes all the failing ghc-compact tests (quite likely all of them, since they presumably all need the library), and also removes some leftover from the previous PR #676. >--------------------------------------------------------------- f8d3f9b09ec1596b7cf7349e3ec8508352d6e3e4 src/Settings/Default.hs | 1 + src/Settings/Packages.hs | 9 +-------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/Settings/Default.hs b/src/Settings/Default.hs index 839c033..b3828fa 100644 --- a/src/Settings/Default.hs +++ b/src/Settings/Default.hs @@ -131,6 +131,7 @@ testsuitePackages = do return $ [ checkApiAnnotations , checkPpr , ghci + , ghcCompact , ghcPkg , hp2ps , hsc2hs diff --git a/src/Settings/Packages.hs b/src/Settings/Packages.hs index 2dbb826..97e272b 100644 --- a/src/Settings/Packages.hs +++ b/src/Settings/Packages.hs @@ -26,15 +26,8 @@ packageArgs = do -- This fixes the 'unknown symbol stat' issue. -- See: https://github.com/snowleopard/hadrian/issues/259. - , builder (Ghc CompileCWithGhc) ? arg "-optc-O2" + , builder (Ghc CompileCWithGhc) ? arg "-optc-O2" ] - -- See https://ghc.haskell.org/trac/ghc/ticket/15286 and - -- https://phabricator.haskell.org/D4880 - , builder (Ghc CompileHs) ? mconcat - [ input "//Natural.hs" ? pure ["-fno-omit-interface-pragmas"] - , input "//Num.hs" ? pure ["-fno-ignore-interface-pragmas"] - ] - ] ------------------------------ bytestring ------------------------------ , package bytestring ? builder (Cabal Flags) ? intLib == integerSimple ? arg "integer-simple" From git at git.haskell.org Tue Oct 23 20:20:09 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:20:09 +0000 (UTC) Subject: [commit: ghc] master: Update OS X scripts to test a GHC patch for #614 (#678) (06f3206) Message-ID: <20181023202009.C87B63ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/06f3206e1f81a1dcf7b7a4181238d21538f84e24/ghc >--------------------------------------------------------------- commit 06f3206e1f81a1dcf7b7a4181238d21538f84e24 Author: Alp Mestanogullari Date: Fri Sep 7 20:19:39 2018 +0200 Update OS X scripts to test a GHC patch for #614 (#678) * .travis.yml: update OS X script to test a GHC patch for #614 * circle.yml: update script to test GHC patch for #614 >--------------------------------------------------------------- 06f3206e1f81a1dcf7b7a4181238d21538f84e24 .travis.yml | 3 +++ circle.yml | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index dd83ae0..b59cfd6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -70,6 +70,9 @@ matrix: - brew upgrade python script: + - git remote add alp https://github.com/alpmestan/ghc.git + - git fetch alp + - git checkout alp/osx-findPtr # Due to timeout limit of OS X build on Travis CI, # we will ignore selftest and build only stage1 - hadrian/build.sh -j -c $MODE --no-progress --progress-colour=never --profile=- diff --git a/circle.yml b/circle.yml index cfdca70..7c9684f 100644 --- a/circle.yml +++ b/circle.yml @@ -30,7 +30,8 @@ compile: # NOTE: we must write them in the same line because each line # in CircleCI is a separate process, thus you can't "cd" for the other lines - cd ghc/hadrian; git reset --hard HEAD - + - cd ghc; git remote add alp https://github.com/alpmestan/ghc.git + - cd ghc; git fetch alp; git checkout alp/osx-findPtr - cd ghc; ./boot && PATH=~/.cabal/bin:$PATH ./configure # XXX: export PATH doesn't work well either, so we use inline env From git at git.haskell.org Tue Oct 23 20:20:13 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:20:13 +0000 (UTC) Subject: [commit: ghc] master: Fix clean so it works on Windows (#679) (9a6f41c) Message-ID: <20181023202013.D7A423ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/9a6f41ced3c9db625f1485029c3256dc7d9c93d8/ghc >--------------------------------------------------------------- commit 9a6f41ced3c9db625f1485029c3256dc7d9c93d8 Author: Neil Mitchell Date: Fri Sep 7 20:41:48 2018 +0100 Fix clean so it works on Windows (#679) >--------------------------------------------------------------- 9a6f41ced3c9db625f1485029c3256dc7d9c93d8 src/Rules/Clean.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Rules/Clean.hs b/src/Rules/Clean.hs index 629d9a1..abf6933 100644 --- a/src/Rules/Clean.hs +++ b/src/Rules/Clean.hs @@ -1,5 +1,6 @@ module Rules.Clean (clean, cleanSourceTree, cleanRules) where +import qualified System.Directory as IO import Base clean :: Action () @@ -7,7 +8,8 @@ clean = do putBuild "| Removing Hadrian files..." cleanSourceTree path <- buildRoot - removeDirectory path + putBuild $ "| Remove directory " ++ path ++ " (after build completes)" + runAfter $ IO.removeDirectoryRecursive path -- since we can't delete the Shake database while Shake is running putSuccess "| Done. " cleanSourceTree :: Action () From git at git.haskell.org Tue Oct 23 20:20:17 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:20:17 +0000 (UTC) Subject: [commit: ghc] master: Move to GHC 8.4.3 by upgrading the Stackage snapshot (#680) (df96f25) Message-ID: <20181023202017.D149E3ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/df96f251080498c56daa6462ae085158c6d66aa2/ghc >--------------------------------------------------------------- commit df96f251080498c56daa6462ae085158c6d66aa2 Author: Neil Mitchell Date: Fri Sep 7 23:44:08 2018 +0100 Move to GHC 8.4.3 by upgrading the Stackage snapshot (#680) >--------------------------------------------------------------- df96f251080498c56daa6462ae085158c6d66aa2 stack.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stack.yaml b/stack.yaml index d506426..6a529e7 100644 --- a/stack.yaml +++ b/stack.yaml @@ -1,7 +1,7 @@ # For more information, see: http://docs.haskellstack.org/en/stable/yaml_configuration.html # Specifies the GHC version and set of packages available (e.g., lts-3.5, nightly-2015-09-21, ghc-7.10.2) -resolver: lts-10.8 +resolver: lts-12.9 # Local packages, usually specified by relative directory name packages: From git at git.haskell.org Tue Oct 23 20:20:21 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:20:21 +0000 (UTC) Subject: [commit: ghc] master: Build more profiling ways by default (#682) (9bf046f) Message-ID: <20181023202021.C8D683ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/9bf046f153911f3e5aedf081a394af9ae33bf1c6/ghc >--------------------------------------------------------------- commit 9bf046f153911f3e5aedf081a394af9ae33bf1c6 Author: Alp Mestanogullari Date: Mon Sep 10 17:40:44 2018 +0200 Build more profiling ways by default (#682) See #681 >--------------------------------------------------------------- 9bf046f153911f3e5aedf081a394af9ae33bf1c6 src/Settings/Default.hs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Settings/Default.hs b/src/Settings/Default.hs index b3828fa..e9d4f68 100644 --- a/src/Settings/Default.hs +++ b/src/Settings/Default.hs @@ -157,7 +157,12 @@ defaultRtsWays = do ways <- getLibraryWays mconcat [ pure [ logging, debug, threaded, threadedDebug, threadedLogging ] - , (profiling `elem` ways) ? pure [threadedProfiling] + , (profiling `elem` ways) ? + pure [ profiling, threadedProfiling, debugProfiling + , threadedDebugProfiling ] + -- we don't add the 'logging' variants of those for now, but we might + -- in the future? + {- , (dynamic `elem` ways) ? pure [ dynamic, debugDynamic, threadedDynamic, threadedDebugDynamic , loggingDynamic, threadedLoggingDynamic ] -} From git at git.haskell.org Tue Oct 23 20:20:25 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:20:25 +0000 (UTC) Subject: [commit: ghc] master: Set integer-gmp flag when appropriate (#684) (97f9345) Message-ID: <20181023202025.BB8B03ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/97f93453e46eb52c64d661ba73c0bb03bfa81585/ghc >--------------------------------------------------------------- commit 97f93453e46eb52c64d661ba73c0bb03bfa81585 Author: Alp Mestanogullari Date: Wed Sep 12 19:18:18 2018 +0200 Set integer-gmp flag when appropriate (#684) * set integer-gmp flag when appropriate, when building the compiler lib * address Andrey's feedback >--------------------------------------------------------------- 97f93453e46eb52c64d661ba73c0bb03bfa81585 src/Settings/Packages.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Settings/Packages.hs b/src/Settings/Packages.hs index 97e272b..ab9e8df 100644 --- a/src/Settings/Packages.hs +++ b/src/Settings/Packages.hs @@ -22,7 +22,7 @@ packageArgs = do mconcat --------------------------------- base --------------------------------- [ package base ? mconcat - [ builder (Cabal Flags) ? arg ('+' : pkgName intLib) + [ builder (Cabal Flags) ? notStage0 ? arg (pkgName intLib) -- This fixes the 'unknown symbol stat' issue. -- See: https://github.com/snowleopard/hadrian/issues/259. @@ -71,7 +71,8 @@ packageArgs = do [ ghcWithNativeCodeGen ? arg "ncg" , ghcWithInterpreter ? notStage0 ? arg "ghci" , flag CrossCompiling ? arg "-terminfo" - , stage2 ? arg "integer-simple" ] + , notStage0 ? intLib == integerGmp ? + arg "integer-gmp" ] , builder (Haddock BuildPackage) ? arg ("--optghc=-I" ++ path) ] From git at git.haskell.org Tue Oct 23 20:20:29 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:20:29 +0000 (UTC) Subject: [commit: ghc] master: Fix a logic error that kept us from building/linking object files for many ways (#687) (9609113) Message-ID: <20181023202029.96EF13ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/9609113f1d54e043c29f0fb6f1172509e7a66a84/ghc >--------------------------------------------------------------- commit 9609113f1d54e043c29f0fb6f1172509e7a66a84 Author: Alp Mestanogullari Date: Wed Sep 12 23:13:50 2018 +0200 Fix a logic error that kept us from building/linking object files for many ways (#687) >--------------------------------------------------------------- 9609113f1d54e043c29f0fb6f1172509e7a66a84 src/Rules/Library.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Rules/Library.hs b/src/Rules/Library.hs index 49a7d22..13f2ea3 100644 --- a/src/Rules/Library.hs +++ b/src/Rules/Library.hs @@ -92,7 +92,7 @@ cObjects :: Context -> Action [FilePath] cObjects context = do srcs <- interpretInContext context (getPackageData PD.cSrcs) objs <- mapM (objectPath context) srcs - return $ if way context == threaded + return $ if Threaded `wayUnit` way context then objs else filter ((`notElem` ["Evac_thr", "Scav_thr"]) . takeBaseName) objs From git at git.haskell.org Tue Oct 23 20:20:33 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:20:33 +0000 (UTC) Subject: [commit: ghc] master: Add unlit to testsuitePackages (#688) (407190e) Message-ID: <20181023202033.766C73ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/407190e6e8d0ce29960317495a6f6dcf5e31aa4a/ghc >--------------------------------------------------------------- commit 407190e6e8d0ce29960317495a6f6dcf5e31aa4a Author: Alp Mestanogullari Date: Thu Sep 13 00:21:07 2018 +0200 Add unlit to testsuitePackages (#688) >--------------------------------------------------------------- 407190e6e8d0ce29960317495a6f6dcf5e31aa4a src/Settings/Default.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Settings/Default.hs b/src/Settings/Default.hs index e9d4f68..82bfc9a 100644 --- a/src/Settings/Default.hs +++ b/src/Settings/Default.hs @@ -137,7 +137,8 @@ testsuitePackages = do , hsc2hs , iserv , parallel - , runGhc ] ++ + , runGhc + , unlit ] ++ [ timeout | win ] -- | Default build ways for library packages: From git at git.haskell.org Tue Oct 23 20:20:37 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:20:37 +0000 (UTC) Subject: [commit: ghc] master: OS X CI scripts: don't use my GHC branch anymore, D5138 has been merged (#690) (6eb9c0c) Message-ID: <20181023202037.714AD3ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/6eb9c0c9bf918586f3f5b1c350eb99d541e43e06/ghc >--------------------------------------------------------------- commit 6eb9c0c9bf918586f3f5b1c350eb99d541e43e06 Author: Alp Mestanogullari Date: Thu Sep 13 10:51:21 2018 +0200 OS X CI scripts: don't use my GHC branch anymore, D5138 has been merged (#690) >--------------------------------------------------------------- 6eb9c0c9bf918586f3f5b1c350eb99d541e43e06 .travis.yml | 5 +---- circle.yml | 2 -- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index b59cfd6..3620e5f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -70,11 +70,8 @@ matrix: - brew upgrade python script: - - git remote add alp https://github.com/alpmestan/ghc.git - - git fetch alp - - git checkout alp/osx-findPtr # Due to timeout limit of OS X build on Travis CI, - # we will ignore selftest and build only stage1 + # we will ignore selftest - hadrian/build.sh -j -c $MODE --no-progress --progress-colour=never --profile=- # Test GHC binary diff --git a/circle.yml b/circle.yml index 7c9684f..4d0d973 100644 --- a/circle.yml +++ b/circle.yml @@ -30,8 +30,6 @@ compile: # NOTE: we must write them in the same line because each line # in CircleCI is a separate process, thus you can't "cd" for the other lines - cd ghc/hadrian; git reset --hard HEAD - - cd ghc; git remote add alp https://github.com/alpmestan/ghc.git - - cd ghc; git fetch alp; git checkout alp/osx-findPtr - cd ghc; ./boot && PATH=~/.cabal/bin:$PATH ./configure # XXX: export PATH doesn't work well either, so we use inline env From git at git.haskell.org Tue Oct 23 20:20:41 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:20:41 +0000 (UTC) Subject: [commit: ghc] master: Build touchy and unlit only in Stage0, copy binaries for later stages (#693) (835f276) Message-ID: <20181023202041.653793ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/835f2766eda708c7f8bc21c25528ce60dc7e8319/ghc >--------------------------------------------------------------- commit 835f2766eda708c7f8bc21c25528ce60dc7e8319 Author: Alp Mestanogullari Date: Fri Sep 21 22:24:41 2018 +0200 Build touchy and unlit only in Stage0, copy binaries for later stages (#693) * unlit: build only in stage0, copy that binary for later stages (fixes #595) * add missing condition We only want this "optimisation" for unlit. * compare 'Package's instead of strings * same optimisation for touchy >--------------------------------------------------------------- 835f2766eda708c7f8bc21c25528ce60dc7e8319 src/Rules/Program.hs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Rules/Program.hs b/src/Rules/Program.hs index 9c0f459..76390e3 100644 --- a/src/Rules/Program.hs +++ b/src/Rules/Program.hs @@ -55,6 +55,9 @@ buildProgram rs = do (True, s) | s > Stage0 -> do srcDir <- buildRoot <&> (-/- (stageString Stage0 -/- "bin")) copyFile (srcDir -/- takeFileName bin) bin + (False, s) | s > Stage0 && (package `elem` [touchy, unlit]) -> do + srcDir <- stageLibPath Stage0 <&> (-/- "bin") + copyFile (srcDir -/- takeFileName bin) bin _ -> buildBinary rs bin =<< programContext stage package buildBinary :: [(Resource, Int)] -> FilePath -> Context -> Action () From git at git.haskell.org Tue Oct 23 20:20:45 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:20:45 +0000 (UTC) Subject: [commit: ghc] master: Rework parsing of Cabal metadata (#692) (7169ac5) Message-ID: <20181023202045.468C33ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/7169ac5d7b03f1ed5fbb05514352c0fdeb16429b/ghc >--------------------------------------------------------------- commit 7169ac5d7b03f1ed5fbb05514352c0fdeb16429b Author: Andrey Mokhov Date: Sat Sep 29 11:43:17 2018 +0100 Rework parsing of Cabal metadata (#692) The current implementation of parsing Cabal data is a big mess, which affects performance as described in #671 and #550. In this PR we simplify the implementation and avoid unnecessary reparsing. As a result, the zero build time is reduced from 30 seconds to 5 seconds on my machine. The full build time seems to have been improved as well, since now all CI bots complete within the time limit. On the other hand, the speed up of the full build with `-j` on my machine does not appear to be significant. >--------------------------------------------------------------- 7169ac5d7b03f1ed5fbb05514352c0fdeb16429b hadrian.cabal | 10 +- src/Context.hs | 6 +- src/Expression.hs | 14 +-- src/Hadrian/Expression.hs | 2 +- src/Hadrian/Haskell/Cabal.hs | 41 ++++--- src/Hadrian/Haskell/Cabal/CabalData.hs | 24 ----- src/Hadrian/Haskell/Cabal/PackageData.hs | 46 -------- src/Hadrian/Haskell/Cabal/Parse.hs | 180 +++++++++++++++---------------- src/Hadrian/Haskell/Cabal/Type.hs | 75 +++++++++++++ src/Hadrian/Oracles/Cabal.hs | 41 +++++++ src/Hadrian/Oracles/Cabal/Rules.hs | 63 +++++++++++ src/Hadrian/Oracles/Cabal/Type.hs | 62 +++++++++++ src/Hadrian/Oracles/Path.hs | 4 +- src/Hadrian/Oracles/TextFile.hs | 70 ++++++++---- src/Hadrian/Oracles/TextFile/Rules.hs | 63 ----------- src/Hadrian/Oracles/TextFile/Type.hs | 41 ------- src/Oracles/ModuleFiles.hs | 16 +-- src/Rules.hs | 6 +- src/Rules/BinaryDist.hs | 2 +- src/Rules/Documentation.hs | 11 +- src/Rules/Library.hs | 8 +- src/Rules/Program.hs | 6 +- src/Rules/Selftest.hs | 4 +- src/Settings/Builders/Cabal.hs | 3 +- src/Settings/Builders/Cc.hs | 4 +- src/Settings/Builders/Common.hs | 6 +- src/Settings/Builders/Ghc.hs | 16 +-- src/Settings/Builders/Haddock.hs | 12 +-- src/Settings/Builders/Hsc2Hs.hs | 12 +-- src/Settings/Default.hs | 4 +- src/Utilities.hs | 16 +-- stack.yaml | 5 +- 32 files changed, 484 insertions(+), 389 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 7169ac5d7b03f1ed5fbb05514352c0fdeb16429b From git at git.haskell.org Tue Oct 23 20:20:49 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:20:49 +0000 (UTC) Subject: [commit: ghc] master: Simplify oracles (#694) (021e753) Message-ID: <20181023202049.1EB9E3ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/021e753b499d87fd2a6d34eb502ed3abac5b3791/ghc >--------------------------------------------------------------- commit 021e753b499d87fd2a6d34eb502ed3abac5b3791 Author: Andrey Mokhov Date: Sun Sep 30 12:46:37 2018 +0100 Simplify oracles (#694) As discussed in #550, we can remove some unnecessary occurrences of `newCache`. >--------------------------------------------------------------- 021e753b499d87fd2a6d34eb502ed3abac5b3791 src/Hadrian/Oracles/Cabal/Rules.hs | 9 +++------ src/Hadrian/Oracles/TextFile.hs | 10 ---------- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/src/Hadrian/Oracles/Cabal/Rules.hs b/src/Hadrian/Oracles/Cabal/Rules.hs index a069c73..dcda370 100644 --- a/src/Hadrian/Oracles/Cabal/Rules.hs +++ b/src/Hadrian/Oracles/Cabal/Rules.hs @@ -36,21 +36,19 @@ import Hadrian.Utilities -- 3) 'Hadrian.Oracles.Cabal.configurePackageGHC' that configures a package. cabalOracle :: Rules () cabalOracle = do - packageData <- newCache $ \package -> do + void $ addOracleCache $ \(PackageDataKey package) -> do let file = pkgCabalFile package need [file] putLoud $ "| PackageData oracle: parsing " ++ quote file ++ "..." parsePackageData package - void $ addOracleCache $ \(PackageDataKey package) -> packageData package - contextData <- newCache $ \(context at Context {..}) -> do + void $ addOracleCache $ \(ContextDataKey context at Context {..}) -> do putLoud $ "| ContextData oracle: resolving data for " ++ quote (pkgName package) ++ " (" ++ show stage ++ ", " ++ show way ++ ")..." resolveContextData context - void $ addOracleCache $ \(ContextDataKey context) -> contextData context - conf <- newCache $ \(pkg, stage) -> do + void $ addOracleCache $ \(PackageConfigurationKey (pkg, stage)) -> do putLoud $ "| PackageConfiguration oracle: configuring " ++ quote (pkgName pkg) ++ " (" ++ show stage ++ ")..." -- Configure the package with the GHC corresponding to the given stage @@ -60,4 +58,3 @@ cabalOracle = do let platform = fromMaybe (error msg) maybePlatform msg = "PackageConfiguration oracle: cannot detect platform" return $ PackageConfiguration (compiler, platform) - void $ addOracleCache $ \(PackageConfigurationKey pkgStage) -> conf pkgStage diff --git a/src/Hadrian/Oracles/TextFile.hs b/src/Hadrian/Oracles/TextFile.hs index 08670c0..aef553f 100644 --- a/src/Hadrian/Oracles/TextFile.hs +++ b/src/Hadrian/Oracles/TextFile.hs @@ -66,10 +66,6 @@ lookupDependencies depFile file = do Just [] -> error $ "No source file found for file " ++ quote file Just (source : files) -> return (source, files) -newtype TextFile = TextFile FilePath - deriving (Binary, Eq, Hashable, NFData, Show, Typeable) -type instance RuleResult TextFile = String - newtype KeyValue = KeyValue (FilePath, String) deriving (Binary, Eq, Hashable, NFData, Show, Typeable) type instance RuleResult KeyValue = Maybe String @@ -90,12 +86,6 @@ type instance RuleResult KeyValues = Maybe [String] -- see 'lookupDependencies'. textFileOracle :: Rules () textFileOracle = do - text <- newCache $ \file -> do - need [file] - putLoud $ "| TextFile oracle: reading " ++ quote file ++ "..." - liftIO $ readFile file - void $ addOracleCache $ \(TextFile file) -> text file - kv <- newCache $ \file -> do need [file] putLoud $ "| KeyValue oracle: reading " ++ quote file ++ "..." From git at git.haskell.org Tue Oct 23 20:20:52 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:20:52 +0000 (UTC) Subject: [commit: ghc] master: Pass 'threaded' flag to the GHC executable (#689) (996afc7) Message-ID: <20181023202052.F069D3ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/996afc7daaea8de48bec92de3b30c632ccc8dfad/ghc >--------------------------------------------------------------- commit 996afc7daaea8de48bec92de3b30c632ccc8dfad Author: Alp Mestanogullari Date: Mon Oct 1 18:36:09 2018 +0200 Pass 'threaded' flag to the GHC executable (#689) >--------------------------------------------------------------- 996afc7daaea8de48bec92de3b30c632ccc8dfad src/Settings/Packages.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Settings/Packages.hs b/src/Settings/Packages.hs index ab9e8df..8ee2436 100644 --- a/src/Settings/Packages.hs +++ b/src/Settings/Packages.hs @@ -82,7 +82,11 @@ packageArgs = do , builder (Cabal Flags) ? mconcat [ ghcWithInterpreter ? notStage0 ? arg "ghci" - , flag CrossCompiling ? arg "-terminfo" ] ] + , flag CrossCompiling ? arg "-terminfo" + -- the 'threaded' flag is True by default, but + -- let's record explicitly that we link all ghc + -- executables with the threaded runtime. + , arg "threaded" ] ] -------------------------------- ghcPkg -------------------------------- , package ghcPkg ? From git at git.haskell.org Tue Oct 23 20:20:56 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:20:56 +0000 (UTC) Subject: [commit: ghc] master: Honour the flavours advertised by the flavours.md document (#691) (5e432d4) Message-ID: <20181023202056.D50FA3ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/5e432d4aa47fc4311276c4442e4542ba2febec5e/ghc >--------------------------------------------------------------- commit 5e432d4aa47fc4311276c4442e4542ba2febec5e Author: Alp Mestanogullari Date: Tue Oct 2 19:01:45 2018 +0200 Honour the flavours advertised by the flavours.md document (#691) * honour the flavours advertised by our flavours.md document In particular, this patches focuses on enabling back the dynamic-enabled ways for the runtime system, which required to fix a bug in libsuf. * address some feedback * make dynamicGhcPrograms :: Action Bool to implement the default logic faithfully * remove redundant windows check >--------------------------------------------------------------- 5e432d4aa47fc4311276c4442e4542ba2febec5e doc/user-settings.md | 2 +- src/Flavour.hs | 2 +- src/Oracles/Setting.hs | 16 +++++++-------- src/Rules/Documentation.hs | 2 +- src/Settings/Builders/Cabal.hs | 2 +- src/Settings/Default.hs | 41 ++++++++++++++++++++++--------------- src/Settings/Default.hs-boot | 3 ++- src/Settings/Flavours/Quick.hs | 12 +++++++++-- src/Settings/Flavours/QuickCross.hs | 11 +++++++++- src/Settings/Flavours/Quickest.hs | 12 ++--------- src/Settings/Packages.hs | 6 +++++- 11 files changed, 66 insertions(+), 43 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 5e432d4aa47fc4311276c4442e4542ba2febec5e From git at git.haskell.org Tue Oct 23 20:21:00 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:21:00 +0000 (UTC) Subject: [commit: ghc] master: update GHC versions used on travis (051564b) Message-ID: <20181023202100.AA0B83ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/051564be1f98351dc7f2cdbd2390c9f0508f21bc/ghc >--------------------------------------------------------------- commit 051564be1f98351dc7f2cdbd2390c9f0508f21bc Author: Alp Mestanogullari Date: Tue Oct 9 13:17:15 2018 +0200 update GHC versions used on travis I saw that (nightly) travis builds are failing because we now only support 8.4 or higher to boot a GHC HEAD build. I don't know how to achieve this for the OS X section though. >--------------------------------------------------------------- 051564be1f98351dc7f2cdbd2390c9f0508f21bc .travis.yml | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3620e5f..f670784 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,18 +3,18 @@ matrix: include: - os: linux env: MODE="selftest" - compiler: "GHC 8.2.2" + compiler: "GHC 8.4.3" addons: apt: packages: - - ghc-8.2.2 - - cabal-install-2.2 + - ghc-8.4.3 + - cabal-install-2.4 - zlib1g-dev sources: hvr-ghc before_install: - - PATH="/opt/ghc/8.2.2/bin:$PATH" - - PATH="/opt/cabal/2.2/bin:$PATH" + - PATH="/opt/ghc/8.4.3/bin:$PATH" + - PATH="/opt/cabal/2.4/bin:$PATH" script: # Run internal Hadrian tests, after boot and configure. @@ -22,18 +22,18 @@ matrix: - os: linux env: MODE="--flavour=quickest" - compiler: "GHC 8.2.2" + compiler: "GHC 8.4.3" addons: apt: packages: - - ghc-8.2.2 - - cabal-install-2.2 + - ghc-8.4.3 + - cabal-install-2.4 - zlib1g-dev sources: hvr-ghc before_install: - - PATH="/opt/ghc/8.2.2/bin:$PATH" - - PATH="/opt/cabal/2.2/bin:$PATH" + - PATH="/opt/ghc/8.4.3/bin:$PATH" + - PATH="/opt/cabal/2.4/bin:$PATH" script: # Build GHC, letting hadrian boot & configure the ghc source tree @@ -41,18 +41,18 @@ matrix: - os: linux env: MODE="--flavour=quickest --integer-simple" - compiler: "GHC 8.4.1" + compiler: "GHC 8.6.1" addons: apt: packages: - - ghc-8.4.1 - - cabal-install-2.2 + - ghc-8.6.1 + - cabal-install-2.4 - zlib1g-dev sources: hvr-ghc before_install: - - PATH="/opt/ghc/8.4.1/bin:$PATH" - - PATH="/opt/cabal/2.2/bin:$PATH" + - PATH="/opt/ghc/8.6.1/bin:$PATH" + - PATH="/opt/cabal/2.4/bin:$PATH" script: # boot, configure and build GHC From git at git.haskell.org Tue Oct 23 20:21:04 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:21:04 +0000 (UTC) Subject: [commit: ghc] master: Merge pull request #700 from snowleopard/alp/ghc-versions-ci (db3dbb6) Message-ID: <20181023202104.8B1643ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/db3dbb61452591fcbc91738f6754e419b594ab8c/ghc >--------------------------------------------------------------- commit db3dbb61452591fcbc91738f6754e419b594ab8c Merge: 5e432d4 051564b Author: Alp Mestanogullari Date: Tue Oct 9 16:33:22 2018 +0200 Merge pull request #700 from snowleopard/alp/ghc-versions-ci update GHC versions used on travis >--------------------------------------------------------------- db3dbb61452591fcbc91738f6754e419b594ab8c .travis.yml | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) From git at git.haskell.org Tue Oct 23 20:21:08 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:21:08 +0000 (UTC) Subject: [commit: ghc] master: Bump QuickCheck bound (c8bab28) Message-ID: <20181023202108.747203ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/c8bab2837b1f1655bb99399aa74baaaf581dea9b/ghc >--------------------------------------------------------------- commit c8bab2837b1f1655bb99399aa74baaaf581dea9b Author: Andrey Mokhov Date: Sat Oct 20 18:42:41 2018 +0100 Bump QuickCheck bound >--------------------------------------------------------------- c8bab2837b1f1655bb99399aa74baaaf581dea9b hadrian.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hadrian.cabal b/hadrian.cabal index 9d83c0b..fec927a 100644 --- a/hadrian.cabal +++ b/hadrian.cabal @@ -120,7 +120,7 @@ executable hadrian , extra >= 1.4.7 , mtl == 2.2.* , parsec >= 3.1 && < 3.2 - , QuickCheck >= 2.6 && < 2.11 + , QuickCheck >= 2.6 && < 2.12 , shake >= 0.16.4 , transformers >= 0.4 && < 0.6 , unordered-containers >= 0.2.1 && < 0.3 From git at git.haskell.org Tue Oct 23 20:21:12 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:21:12 +0000 (UTC) Subject: [commit: ghc] master: Fix warnings, improve documentation (45f3bff) Message-ID: <20181023202112.709283ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/45f3bff7016a2a0cd9a5455a882ced984655e90b/ghc >--------------------------------------------------------------- commit 45f3bff7016a2a0cd9a5455a882ced984655e90b Author: Andrey Mokhov Date: Sat Oct 20 19:41:27 2018 +0100 Fix warnings, improve documentation >--------------------------------------------------------------- 45f3bff7016a2a0cd9a5455a882ced984655e90b src/Hadrian/Expression.hs | 3 +- src/Oracles/Setting.hs | 82 ++++++++++++++++++++++++++++++++--------------- 2 files changed, 58 insertions(+), 27 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 45f3bff7016a2a0cd9a5455a882ced984655e90b From git at git.haskell.org Tue Oct 23 20:21:15 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:21:15 +0000 (UTC) Subject: [commit: ghc] master: testsuite: Mark T15349 as broken in the ghci way (2146994) Message-ID: <20181023202115.4351D3ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/214699477a641bab7d3b9e063682a6b71a1f8b35/ghc >--------------------------------------------------------------- commit 214699477a641bab7d3b9e063682a6b71a1f8b35 Author: Ben Gamari Date: Thu Oct 18 20:48:06 2018 -0400 testsuite: Mark T15349 as broken in the ghci way See #15349. >--------------------------------------------------------------- 214699477a641bab7d3b9e063682a6b71a1f8b35 libraries/base/tests/all.T | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/base/tests/all.T b/libraries/base/tests/all.T index 7cb5c4f..90af902 100644 --- a/libraries/base/tests/all.T +++ b/libraries/base/tests/all.T @@ -241,4 +241,4 @@ test('T14425', normal, compile_and_run, ['']) test('T10412', normal, compile_and_run, ['']) test('T13896', normal, compile_and_run, ['']) test('T13167', normal, compile_and_run, ['']) -test('T15349', [exit_code(1)], compile_and_run, ['']) +test('T15349', [exit_code(1), expect_broken_for(15349, 'ghci')], compile_and_run, ['']) From git at git.haskell.org Tue Oct 23 20:21:18 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:21:18 +0000 (UTC) Subject: [commit: ghc] master: Remove Hadrian submodule (575b35f) Message-ID: <20181023202118.167533ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/575b35f4cdc18045bccd42d341d6f25d95c0696c/ghc >--------------------------------------------------------------- commit 575b35f4cdc18045bccd42d341d6f25d95c0696c Author: Ben Gamari Date: Tue Oct 23 14:20:07 2018 -0400 Remove Hadrian submodule >--------------------------------------------------------------- 575b35f4cdc18045bccd42d341d6f25d95c0696c .gitmodules | 3 --- hadrian | 1 - 2 files changed, 4 deletions(-) diff --git a/.gitmodules b/.gitmodules index 830b5c4..42ed8bf9 100644 --- a/.gitmodules +++ b/.gitmodules @@ -113,6 +113,3 @@ [submodule ".arc-linters/arcanist-external-json-linter"] path = .arc-linters/arcanist-external-json-linter url = ../arcanist-external-json-linter.git -[submodule "hadrian"] - path = hadrian - url = ../hadrian.git diff --git a/hadrian b/hadrian deleted file mode 160000 index 4265e3a..0000000 --- a/hadrian +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 4265e3aab7df92722b81148cf8bf3954ebfc2d21 From git at git.haskell.org Tue Oct 23 20:21:21 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:21:21 +0000 (UTC) Subject: [commit: ghc] master: Add 'hadrian/' from commit '45f3bff7016a2a0cd9a5455a882ced984655e90b' (9475620) Message-ID: <20181023202121.69BB73ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/94756201349685a34c4495addd3484fdfcc8b498/ghc >--------------------------------------------------------------- commit 94756201349685a34c4495addd3484fdfcc8b498 Merge: 575b35f 45f3bff Author: Ben Gamari Date: Tue Oct 23 14:20:13 2018 -0400 Add 'hadrian/' from commit '45f3bff7016a2a0cd9a5455a882ced984655e90b' git-subtree-dir: hadrian git-subtree-mainline: 575b35f4cdc18045bccd42d341d6f25d95c0696c git-subtree-split: 45f3bff7016a2a0cd9a5455a882ced984655e90b >--------------------------------------------------------------- Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 94756201349685a34c4495addd3484fdfcc8b498 From git at git.haskell.org Tue Oct 23 20:21:24 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:21:24 +0000 (UTC) Subject: [commit: ghc] master: Bump hsc2hs submodule (d65cbd6) Message-ID: <20181023202124.6409E3ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/d65cbd6da27f89e04e87effb36bc7ffe3b50bd5e/ghc >--------------------------------------------------------------- commit d65cbd6da27f89e04e87effb36bc7ffe3b50bd5e Author: Ben Gamari Date: Tue Oct 23 15:20:37 2018 -0400 Bump hsc2hs submodule >--------------------------------------------------------------- d65cbd6da27f89e04e87effb36bc7ffe3b50bd5e utils/hsc2hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/hsc2hs b/utils/hsc2hs index 8807b4c..a816333 160000 --- a/utils/hsc2hs +++ b/utils/hsc2hs @@ -1 +1 @@ -Subproject commit 8807b4cd9b9efc719828b52cd9aecb9892d3d80b +Subproject commit a816333ae67c54b98cce4ed22621242714967b3e From git at git.haskell.org Tue Oct 23 20:21:34 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 23 Oct 2018 20:21:34 +0000 (UTC) Subject: [commit: ghc] master's head updated: Bump hsc2hs submodule (d65cbd6) Message-ID: <20181023202134.ABE183ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc Branch 'master' now includes: 013cf0c Initial commit bd90cd8 Add a brief intro to the project. c5c557a Add .gitignore. cf7b65b Add shake launcher. 4139a9c Add top-level build script. 4e03b1c Add Base.hs (basic datatypes and imports for the build system). 9566d56 Add Config.hs (autoconf and configure rules). cb701bb Add Oracles.hs (configuration infrastructure). c8212ad Add Packages.hs (package build rules). 9a33083 Add Ways.hs (build ways and helper functions). c816893 Add docs (mostly progress comments so far). 3c08e17 Comment on where this goes in the GHC source tree. 9089a36 Add configuration files and dummy builders (autoconf, configure) for debugging. 8433156 Add mk-miner submodule. 2a82120 Improve mk-miner submodule. 6a7c214 Moved source files to src subdirectory. 23c7701 Fix paths to source files. 8b10b13 Remove the generated 'configure' script from the repository. dfd6b21 Stop tracking the generated 'configure' script. 232891d Remove fake autoconf. 42304f9 Remove fake configure.ac. e4d24e1 Remove generated default.config. e89924f Move config files to cfg subdirectory. 3dac5a5 Remove generated file. 7d90047 Add support for autoconf/configure chain. 371842e Add generated default.config to .gitignore. ced1860 Add a comment to user.config explaining its purpose. fe2655b Remove redundant imports, add TODO's. 428e148 Remove redundant imports, drop Stage1Only. 4d2b4bc Make C:/msys64/ a silent command. a58a713 Update to the latest GHC source tree. 8a93116 Update build-package-data.docx to match Package.hs 618d90d Minor revisions (add comments, move Condition to Oracles.hs). 7eb2d38 Add -fwarn-tabs and -fwarn-unused-imports. 3bbb9fb Add build/autogen/Paths_library.hs to ghc-cabal results. 1fa4aa5 Add replaceChar helper function. 4198a65 Bring && back. 2d4a29c Track progress. a253255 Add support for parsing package-data.mk files. 9d1a489 Add buildPackageDeps rule. 4e5f1b7 Move generic helper functions to Util.hs. e20c4bc Refactor Oracles.hs. d2f3a74 Fix formatting, add TODOs. c4cc0dc Factor out postProcessPackageData to Util.hs. 4dd9560 Add splitArgs function to Base.hs. 5adb8aa Add src-hc-opts to configuration files. 980d486 Export wayHcOpts. 9007c90 Add support for src-hc-opts configuration option. bf9edba Fix postProcessPackageData. 96dec4a Add supports-package-key to configuration files. 21bfb81 Implement more arguments for ghc -M. 212e91f Replace isSlash with standard isPathSeparator. d043ef5 Add replaceSeparators to Util.hs. 34696c1 Fix replaceSeparators in Util.hs. d869302 Complete first working version of buildPackageDeps rule. a2c0e5d Split Oracles.hs module into logical parts. c5f7958 Refactor imports. 8228615 Move most code into src/Oracles/ submodules. 9d8e3a3 Change computed configuration flags into Conditions. a7cc473 Remove redundant GHC extensions. 4166bc7 Move Condition to Base.hs. 64b16d7 Add ShowAction typeclass. 37de3d5 Replace path with instance ShowAction Builder. 1495a2d Replace option with instance ShowAction Option. 6084342 Add args -- a variadic version of arg. c6870b2 Implement joinArgs and joinArgsWithSpaces as variadic functions. a4f318f Refactor using variadic args. 640b38f Minor changes and comments. 04cbcbc Decompose Package.hs into logically separate modules. 5a4b172 Track build rule source files initiating incremental rebuilds when code changes. eeea3ed Add directions to Package submodules. 500ab74 Minor changes. e384039 Remove redundant extension. 9133934 Remove splitArgs. b9c1da8 Support multiword options. 1a7b657 Handle multiword options in build rules. 9a24f38 Ensure that intercalateArgs _ mempty = mempty. 86b63df Remove argConfWith which became redundant. 7792b9a Add instance ShowAction PackageData. f79678a Clean up code. 2f9338d Simplify PackageData. 1ef6a04 Generalise and export suffix :: Way -> String. 2549740 Handle multiple way suffices. 06fd336 Refactor src/Base.hs. 0da6908 Rename ShowAction to ShowArgs. 7661c31 Clean up build rules. 45208c5 Set precedence level for <+>. d08651a Clean up. b70f3d8 Refactor buildPackageDependencies into separate functions. 4c715ac Add prefixArgs function. 3579324 Clean up. 7ad9848 Reexport module Data.Function from Base.hs. 94501e5 Remove way descriptions, add detectWay function. ccb5848 Move functions ghcOpts, packageArgs, includeArgs, srcArgs. c826054 Add buildPackageCompile rule. e315d33 Add src/Package/Compile.hs. 89c8f79 Clean up. 9fbf3c8 Refactor duplicated code into pathArgs, outputArgs and includeArgs functions. f913c35 Add an infix version of when (). 018f850 Add productArgs and concatArgs helper functions. 128c5ac Refactor, limit lines at 80 characters. 56689f0 Simplify: Package -> TodoItem -> Rules () is a monoid! d264db1 Fit lines into 80 characters. 21e48fc Refactor oracle rules. 481caa8 Remove postProcessPackageData from Util. d956739 Fit lines into 80 characters. d0095df Add instance Show Stage. 817ed05 Fit lines into 80 characters. e77d98b Add support for SolarisBrokenShld flag. a5de5a5 Add support for SolarisBrokenShld flag. 238efc2 Remove redundant GHC extentions. 2e29ea9 Clean up. f956bdc Fit lines into 80 characters, add exists Builder function. 7c9dfba Rename exists Builder to specified Builder, add comments. b5beba9 Add options SplitObjectsBroken, GhcUnregisterised, DynamicExtension, ProjectVersion. 2840dab Record new progress. 91ecc02 Work on way suffixes. a325521 Add buildPackageLibrary. 750a43f Implement search for *.hs and *.o files for a given package. 30138cb Implement terseRun and arArgs functions. efb5972 Use terseRun and new configuration options. 2143dce Implement new build rule: buildPackageLibrary. 5aa3add Remove old library files before calling Ar. 4fcb471 Improve terseRun. 7c45e18 Optimise buildPackageDependencies rule. 1e5c095 Optimise buildPackageDependencies rule. 0ad3af2 Print more diagnostic info. 7b1964e Add link rule. 4863449 Clean up. d4aabcd Add array package. fae8451 Add hiRule. 821776b Split Ar arguments into chunks of length 100 at most. 5d2cf2c Add toStandard to varios places. 9f89177 Add a cool screenshot. 90c4840 Remove a (useless?) output from the buildPackageData rule. cd02d00 Add bin-package-db package. 316ff4c Add CppOpts. 02297c2 Add binary package. 92352f7 Fix missing options and pkgDepObjects. d1ade7d Fix dropDynamic. fd28d9a Add toStandard. 5c01b64 Generate targets from package list. 7ad0b09 Clean up. 6ce7cd3 Use multiple output rules for *.o and *.hi files. 1a3f43b Add package data key HsOpts. 8bdefdd Add Cabal/Cabal to list of packages. f124e23 Fix file names for package names with slashes (e.g. Cabal/Cabal). f80948c Clean up. 797df55 Add chunksOfSize helper function. d52b4c9 Add packages: containers, filepath, hoopl, hpc, parallel, pretty, stm, template-haskell, transformers. cff887e Add argSizeLimit function (mainly for Ar builder). 5596b04 Generalise run and terseRun. b75a548 Pass HsOpts to ghc -M. 6269a42 Pass arguments as simple lists. ad6da32 Add bin-package-db (stage 0) to packages. e86a741 Add arg folder. 440aeff Add generated arg/*.txt files to .gitignore. 11ad707 Add generated arg/*/*.txt files to .gitignore. 63d4481 Add putColoured. 1b0bfa6 Fix splitObjects function. 50b8c2f Add dependencies on argument lists. 3cbaccc Rename opts to args. 7412fe3 Add ShowArg for single string options, clean up code. 229d5cb Add Version and DepNames keys to PackageData. 7ffb294 Add Targets.hs for specifying targets, clean up code. 5a9b0a7 Refactor package-data oracles. 5c1a7e4 Make single and multiple string options type safe. eac54ff Add GhcSourcePath option. 2990db6 Add bootPackageDb function. a5a2fed Clean up colourisation code. a644c32 Add DependencyList oracle. 316d98e Add CcArgs and CSrcs keys to PackageData. debca7a Add support for c source files. 734994c Rename includeHcArgs to includeGhcArgs. d6744a7 Add stage parameter to Gcc builder. Clean up. 7d42fda Clean up rules related to dependency lists. 9e247b0 Rename (run, terseRun) to (verboseRun, run). 3344cea Split compile rules for {hi, o}, clean up code. 4399476 Add more targets. a93823b Add Util/unifyPath function and make sure it is used. a1819f6 Refactor rules, clean up code. 8290198 Fix recursive rules error. 20ed2d1 Clean up. 91a8bab Add DepIncludeDirs package data option. 79bc4c9 Add comments, do minor refactoring. 2c7003a Fix include paths for Gcc. 8a860e6 Add remaining library packages to Targets.hs. 2d24ed4 Add base and integer-gmp2 to the list of targets. e809d1c Clean up. 7c2279b Add comments. 9c218ad Restrict ShowArgs and args to accept only lists. 98cfed5 Fix bootPkgConstraints. eafd5e0 Implement customise :: Package -> Package function. 9d35421 Keep Haskell-land settings in Settings.hs. ba209b9 Fix cabalName in libraryPackage. 77766e8 Fix comments. 14a236b Clean up. 8f52904 Experiment with parameterised graphs. a5a8d53 Implement basic infrastructure for parameterised expressions. 27bc02e Add Eq instances. 71be3a8 Implement predicates and evaluators. 93e218e Refactor argument expressions. 35cab30 Rename src/Expression.hs -> src/Expression/Base.hs. d7cd023 Begin translating the code using expressions. 8cf38ba Finish translation of Data.hs argument lists. 08136dd Clean up. 21b789e Remove old file src/Expression/Args.hs. cb2003c Continue major refactoring for expression-based build system. 79ad8ee Finish Args datatype, propagate changes to related modules. 0fe624f Add Simplify instances for PG and Predicate. 489e385 Add a draft implementation for resolution of Config variables. 8bdc64c Work on the top-level build structure. 4ad4d41 Implement buildPackageData rule. 51028b8 Clean up Expression package. 353b02b Make PG and BuildPredicate abstract. a827aa5 New refactoring started: switching to a shallow embedding. f60980a Add topLevel function to construct top-level packages like compiler. f033f1f Remove TargetDir from Base.hs. a2de9b0 Add documentation drafts. 2be9217 Add buildPackageDependencies rule. cf54d1a Continue refactoring. fdb6117 Drop parameterisation by monad in Expression. 031179a Finish buildPackageData with the Reader approach. 622d3c1 Simplify build rule interfaces. b5bf68d Add example UserSettings.hs. 5b1c215 Switch to difference lists. 5d6c2d7 Add userPackages for overriding default targetPackages. f500bd1 Add userPackages for overriding default list of target packages. a1dd39f Add userWays and make sure all user-specific settings are used. 95b6614 Fix ordering of appends. 3461e46 Remove redundant argument to build rules. 2f70955 Refactor folder structure. 062952c Split Targets.hs and Settings.hs into multiple logically separate files. 2bd0715 Move derived predicates around. b67db18 Fix argument ordering issues in DiffExpr. 463094d Refactor settings predicates. ac4dab0 Implement appendCcArgs abstraction for passing arguments both to Gcc and GhcCabal. af8520c Drop unused predicates notBuilder and builders. 7e62041 Add comments, move derived predicates to Switches.hs. 8f6fe55 Add an agenda for the meeting on 16 June 2015. acde0ea Add comments. Minor refactoring. 2f373e4 Add getFile and getWay to Environment. 56cf235 Rename appendCcArgs to ccArgs. 7d53e6b Finalise meeting agenda. b2b7c5c Add comments. 418a1cd Make targetDirectory and knownPackages configurable, rename Environment to Target. 238398a Add comments, rename interpretDiff to interpret. cbda822 Add argWith. f62f166 Clean up. 35d9a07 Add targetPath. 196430d Add argsHashOracle for tracking changes in the build system. 5db0017 Factor out build :: Target -> Action () into Rules/Util.hs. 92ef777 Refactoring: Target is now defined in Target.hs, old Targets.hs is dropped. da64dca Rename Settings to Args. Rename old Args defined in Base.hs to ArgList (to be dropped later). 9737176 Remove unused code from Base and Oracles. c319fbb Distringuish partial Targets using type synonyms. 772ea96 Refactor Oracles/Builder.hs. 9bde7d8 Clean up Base. 3726211 Rename Ways.hs => Way.hs and refactor it. c41e156 Add support to multiple files in Target, implement registerPackage predicate. d9b03d3 Rename Settings.hs to Settings/Args.hs. 5a4a443 Implement argPath that unifies the path argument. a8cfbde Remove user.config file, rename default.config to system.config. 272f100 Refactor and rename Oracles/Option.hs. 03f90e7 Remove Base.hs, move Stage definition to Stage.hs. 49419bc Refactor oracles, add comments. 7dc414c Simplify Rules.Config. 6e8416e Fix import of IntSet. b253397 Migrate all user-configurable settings from system.default to Settings/User.hs. 580d397 Improve performance by caching windows root lookup. 4512f27 Drop stringly-typed configuration keys. 9b560ce Drop old src/Package/Data.hs. d2dfdfa Add GhcM builder. 505302b Add apply function for transforming expressions. 86b0a17 Clean up. fcb25e6 Implement expression for GhcM builder. 179d1cd Add -/- for combining paths with unification of the result. d9d1dd9e Rename ask* to get* to avoid mixing up oracles with expressions. ff86f40 Refactoring for consistent interface (getters) for expressions. 65b298b Implement buildPackageDependencies rule. 4bd8812 Add a draft description of demo. 28a8078 Clean up. 4f2fbbb Add dependencies to Target. 096b595 Add custom settings for compiler and other packages. 9463852 Parallelise build by collecting targets and then needing them. 6547fc7 Add support for resources. Limit parallelism of ghc-pkg. 3090409 Fix custom settings of the compiler package. 140376a Add to demo.txt. 3122d3a Improve performance of getHsSources. 4364462 Clean up. 0be1b62 Refactor findModuleFiles and add comments. 7a936b6 Clean up and optimise performance. 4e96a03 Limit parallelism of ghc-cabal. 4aabd6f Use fine-grain dependencies in buildPackageDependencies. f1249da Switch to using Distribution package for parsing cabal files. 44ce571 Add Base.hs with Shake imports and build paths. 8e9fe8d Cache computation of boot package constraints in a file. 49c3bb1 Configure packages in dependency order, refactor resources. 61a085c Allow more parallelism in buildPackageData. c677b04 Simplify Package. 5f8abc4 Clean up rules. 327b06e Avoid using interpretDiff, use simpler interpret instead. 9a6f684 Rename redError(_) to putError(_). 12cecf1 Add knownWays and knownRtsWays to Settings.Ways. 098d9c1 Implement compilePackage build rule. 4fd1732 Get rid of redError_. 7ebd24f Make detectWay safe, add comments. be568c0 Drop knownWays and knownRtsWays. c204ca9 Optimise rules by removing a loop over all possible ways. 1711977 Move matchBuildResult to Way.hs. ef14064 Add cmdLineLengthLimit for detecting command line size limits. 6c89bd0 Remove unused code. c02e070 Add support for multiple invokations of Ar when argument list is too long. c1b296a Move decodeModule to Util.hs. 1ac1688 Create Settings/Builders/ directory for keeping builder-related settings. 3f3134c Add buildPackageLibrary build rule. 83cd6c5 Handle dyamic libraries in detectWay. fafec42 Fix detectWay and way parsing. a6623ab Add putSuccess helper function. e3e3c1d Add library targets. 85808dd Add support for BUILD_GHCI_LIB field of package-data.mk. 020d528 Implement build rule for GHCI libraries. 9afd164 Remove error from putSuccess :-) b397bb3 Reverse the target list passed to need (otherwise the targets are build in reverse order). 5bb1d7e Drop need from build. Add appropriate needs to build rules. 036328f Clean up. c48554d Add hibootsuf and an unsafe version of safeDetectWay. 6344510 Add support for hs-boot files. d2910ba Improve zero build performance. 4914709 Switch to using one dependency file for all objects. d41d5a7 Clean up code, do renaming. 810b1e2 Rename getHsSources to getPackageSources. 486a3e5 Optimise ArgsHash oracle improving zero build time. 18a779b Fix performance drop due to improper use of removeFiles. 096f602 Add comments. 6b0b4ab Add removeFile to Util.hs. 2b2008d Add trackBuildSystem switch (perhaps, temporarily). f72d396 Clarify comment. 4e5ab6b Add haddock path to cfg/system.config.in. 30687f3 Add Haddock builder. 3d65807 Add HiddenModules key to PackageData.hs. d811225 Add haddock build targets. 0aedb12 Add pkgHaddockPath for finding haddock files. 2520d7f Build haddock only in Stage1. b16ec20 Collect all arguments for haddock. b51e6d9 Add findKnownPackage for finding packages by name. b38d769 Implement buildPackageDocumentation build rule. 885369f Drop mk-miner submodule. d56995a Remove traces of mk-miner submodule. d4f6e48 Drop custom cfg/configure.ac and instead add an appropriate AC_CONFIG_FILES command directly to the existing configure.ac. 7baa070 Move needBuilder to src/Builder.hs. 4d70a1e Move basic predicates to src/Switches.hs. 95d2949 Move Monoid (ReaderT Target Action a) instance to src/Target.hs. bc4a11c Clean up. efe9d6f Drop integerGmp2 and clean up. 4238fb7 Clean up, fix -Wall warnings. 49574e6 Drop DepKeys, add DepId, clean up code. 228da6f Remove parallel, stm, random, primitive, vector and dph from Stage1 packages, drop integerGmp2 support. aabc5a6 Add PartialTarget, handle GHC.Prim module in a special way. 47764c0 Rename Switches.hs to Predicates.hs. 1d27a44 Fix infinite loop bug in chunksOfSize. c6b59ef Implement interestingInfo for Haddock. bf86f0e Fix Haddock arguments. 14c35b5 Add runghcid.bat. 134cac9 Use -Wall when compiling the build system. c125896 Refactor imports. d4a438f Refactor Oracles. f68d70f Move Settings/Default.hs to GHC.hs, add Settings.hs. 190f3fd Merge Base.hs and Util.hs. c928f2c Add comments. a4c1eba Add comments, order Builder alphabetically. 88fa774 Remove notP and (??) Predicate functions. aff7b3c Replace GccLt46 with gccGe46 as the former was always used negated. 5603275 Refactor imports, add comments. b04c769 Clean up code, add comments. 3039df4 Fix Ghc/GhcM arguments. cdf208c Generate only one rule for Haddock (Stage1). a9adcf3 Clean up. fdbc3fb Add generatePackageCode rule, alexArgs, happyArgs and Hsc2Hs builder. f225aed Collect arguments for Hsc2Hs builder. b2928a3 Add more configuration flags. e68f4ed Add a note on dead/duplicated code. 8b1feb5 Add support for empty YES/NO flags (treat empty as NO). 1e13a6e Add support for Alex, Happy and Hsc2Hs builders. 330dcdb Add hsc2HsArgs to global settings. 00de798 Unify paths of sources and files in a target. 738bac8 Clean up. 44f7b51 Track generated sources. 13708d7 Add support for new keys in package-data files. 8e74ca7 Add support for new configuration flags. f7ee775 Finish Generate rule. 7ae3a52 Add new configuration flags for generating Config.hs. 702ce42 Add GenPrimopCode builder. 17087d7 Handle GenPrimopCode builder in a special way. b8d04a6 Add new configuration flags for generating Config.hs. f406d36 Add genPrimopCodeArgs to defaultArgs. 395f3ce Add next meeting discusion agenda. ed20ac4 Draft GenPrimopCode argument list. 7e4f903 Implement generation of PrimopWrappers.hs. Work on generating Config.hs. 47c7ab1 Add GhcSplit and Unlit builders. aecfdda Fix ghcEnableTablesNextToCode, refactor code. c7f9f7c Fix GhcPrim path in getPackageSources. 28e3a26 Clean up code. cc3113d Add getLibWays to capture context-less ways. 1a17fee Implement all modes of GenPrimopCode builder. 9b9f7d2 Fix untracked .hs-incl dependencies. 90301e1 Implement new generate rules. 45d41a5 Add new builder HsCpp. 14e4942 Add more thoughts. f164cdc Add ArSupportsAtFile, BuildPlatform, HostPlatform, TargetPlatform flags. 093c1a9 Add ArSupportsAtFile flag. 2ed0b04 Add new setting keys. 6cde985 Add new mode for Ar builder: useAtFile (big performance increase). 555265c Fix HsCpp argument list. 9253049 Improve Generate rule: clean up code, more accurate dependencies. 6a0c30f Add ghc-bin package. 9f99e24 Put when trackBuildSystem conditional more precisely. 55fd868 Clean up, add comments. 07dbd29 Finalise meeting agenda. c488f65 Add support for non-library packages. 5e0734b Add comments/todos. 5a162b2 Rename Target fields: sources -> inputs, files -> outputs. d7b3d34 Add support for compiling programs with Ghc builder. 3cd6a3b Remove duplicates from library archives. 3ceca89 Add buildProgram rule. 1c09363 Pass dll0 modules to ghc-cabal for the compiler package. 49dfde7 Add GhcLink builder. 3e82d46 Add basic support for -0 libraries. 159903e Work on command lines for compiling stage 2 GHC. 9439336 Add extra objects into integerGmp library. 2f1eda7 Add support for utility packages. b0424dc Fix a poor pattern for detecting -0 library files. 098c9ec Pass __GLASGOW_HASKELL__ to gcc when compiling directory.c 3021dbe Add generator for ghc-pkg//Version.hs. bbc6e4a Add support for building ghc-pkg. a0e932a Build ghc-pkg and ghc-cabal in stage 0. f659a18 Build ghc-pwd. f3199c1 Build all utils that use cabal files. 6b14363 Build haddock. bbdaa7e Build deriveConstants utility. e99bd28 Build genapply utility. 6f2b78b Build genprimopcode utility. 1057ef3 Build hp2ps utility. 0678e10 Clean up. 5e7de75 No need to modify configure.ac any more. See https://phabricator.haskell.org/D1638 8ef67ed Don't build system.config by default. 850863e Update README.md bf75f42 Add NFData instances 525f966 Add build.sh for building on Posix platforms 73b4605 GHC: bin-package-db is now ghc-boot 4758a21 LIB_NAME, PACKAGE_KEY are now COMPONENT_ID c0f3b67 deriveConstants now has a Cabal file 96d66f0 Add configuration for libdw c525470 genapply now has a Cabal build 5ff0907 genprimopcode also has a Cabal file 1c8539d Dependencies: Use msum instead of explicit pattern matching 0afdf64 Add remote GHCi libraries bd2a394 The new build system will live in `shake-build`. c937606 Merge pull request #2 from bgamari/master 6961517 Move to shake-build subdirectory. 1203444 Set shakeFilesPath to shake-build/.db ddfe5bc Move Shake database to shake-build/.db, rename _shake to .shake for consistency. 5975b50 Clean up. f4fb52d Disable profiling and dynamic ways temporarily. a66be35 Clean up. 341f711 Add matchPackageNames to match packages and package names. 3ee9ae2 Fix boot package constraints. 361c3c2 Fix broken parallel build: track dependencies due to -package-id flags. 30d3d63 Fix absolute paths starting with /c/ on Windows. 304b099 Add pkgDataFile to look up the path to package-data.mk of a particular stage/package combination. f48da18 Add verboseCommands predicate to show executed commands in full when needed. 5211197 README: Add basic instructions for Linux 8e8cc53 Documentation: Move HsColour invocation to after `need` 9d2868b Actions: Factor out box drawing 86ed4e3 Fix detection of libraries 821d9e9 Merge pull request #8 from bgamari/master 139d90d GHC: Set PackageType of iservBin c84445f Rules: Refactor generateTargets 5c42b58 Merge pull request #11 from bgamari/master ecd1e7d Base: Use proper Haddock syntax aad2247 Hide `parallel` from shake 26e64ed Move `renderBox` to `Base` cbd6aef Program: Use renderBox c7a0c19 Library: Use renderBox 0c9d7d8 Add an explicit dependency on pkgDataFile to make sure GhcCabal hscolour is run after GhcCabal configure. e801ee0 Merge pull request #13 from bgamari/master f5d4e7b Clean up, make naming consistent: setPkgType -> setType. 663ad01 Build program executables directly in inplace/bin. c98eebc Bootstrap ghc-cabal. 5980218 Move isLibrary to src/Package.hs, add isProgram. 6b358c3 Fix parallel build, clean up code. c720083 Build haddock and ghcTags in stage1 temporarily until stage2 is fixed. f2d3eb5 Add Windows instructions 552f617 Add a section on how to contribute 31d8890 Fix Show instances. 3d90d06 Add support for turnWarningsIntoErrors in Settings/User.hs. 52ecf6c Improve naming convention for build directories: always use stageN. eda28da Clean up. 363b227 Fix tracking of *.hs-incl files. 4e2f6c5 Copy *.hs-boot files of generated sources. bfe72a5 Remove a duplicate success message when building Lib0. ba41ded Implement encodeModule -- the inverse for decodeModule. ecdeae7 Clean up. cf825fe Implement ModuleFiles oracle for caching the search of module files of a package. a5a12ec Update README.md 0153864 Merge pull request #25 from angerman/patch-1 d12e733 Create LICENSE 02dfa6d Rename "shaking-up-ghc" to "Shaking up GHC" 7e65227 Make PackageName into a proper newtype 828bc3a Avoid common shell scripting pitfalls 0e19611 Show simple shake progress and timings bfd3d32 Parallelize+optimize compilation of build system (-j -O) 3783b0d Merge pull request #17 from bgamari/types f354291 Merge pull request #29 from quchen/script-refactoring 1c8a0e7 Fix haddockArgs, clean up code. 95d594c Clean up. 920b393 Remove runghcid.bat. 5bb30bc Split the batch file into multiple lines, add missing flags (-j -O). 013fa90 Simplify src/Oracles/ModuleFiles.hs, improve performance. 5da933f Add Cabal support for sandboxed build system building 263fc63 Expression: Add Haddocks 20b4c08 Merge pull request #34 from bgamari/master b053270 Merge pull request #28 from quchen/cabalify c1802dc Remove `make inplace/bin/ghc-cabal` (see #23) 3f55a9e Add the author's email. b56b886 Move OverloadedStrings to other-extensions. 8fe9fa6 Move parseMakefile from dependenciesOracle to Rules.Dependencies (for better performance) 86ee9f6 Add a section on resetting the build (#32) bdb88c6 Use `-B` flag to reset the build 8c3022d Move generators to a dedicated directory, and track their changes. 641eb2d Rename GhcPkgVersionHs.hs to VersionHs.hs, refactor src/Rules/Generate.hs. 27d45f1 Add CcClangBackend and CcLlvmBackend settings. 6b7b9cc Generate includes/ghcautoconf.h, refactor Rules/Generate.hs. 47529e5 Add config.h.in to shake-build/cfg. This file is needed for Rules.Generators.GhcAutoconfH. 8c32f2c Generate includes/ghcplatform.h efbe44f Add "--template" and "-I" arguments to hsc2HsArgs 1046838 Adds OS X Section to Readme 9d1952f Merge pull request #46 from angerman/feature/fix-hsc2hs eb02aa4 Merge pull request #49 from angerman/feature/readme-osx 8ed92e9 Clean up Windows script bf060f8 Add IRC to README.md ec44701 Merge pull request #51 from snowleopard/angerman-patch-1 e4e72d8 Update LICENSE b6f3045 Merge pull request #52 from snowleopard/angerman-patch-2 44d81b0 Fix path to Config.hs (#47). 382ecb4 Merge branch 'master' of github.com:snowleopard/shaking-up-ghc 7f8db60 Drop doc directory (no useful docs there anyway), fix #54. 6d4720c Don't need . 6863e5e Implement build rule for template-hsc.h, fix #44. f80dd4c Use existing target input instead of made up 'src' 20037b1 Initialise bootstrapping.conf (fix #42). 2d221a4 Use ||^ for OR-ing Predicates. 6001acb Add builders: DeriveConstants, Nm, Objdump. c6cfb36 Generate files with DeriveConstants (#39). 1fcb025 Add explicit dependencies on includes/ generated files (fix #48). 43b6cc3 Add install targets, install inplace/lib/platformConstants. 66f18be Generate includes/ghcversion.h 456d2bd Adds ghcautoconf and ghcplatform as dependencies to hp2ps. b45902d Merge pull request #58 from angerman/feature/ghcversion 3b1b4df Merge pull request #59 from angerman/feature/hp2ps-deps b27b177 Clean up. 7274771 Fix paths to generated Haskell files. e7f3ae8 Use orderOnly dependencies for generated headers, see #48 58d7fcc Add a TODO note for unlit and driver/ghc-split utils. ef0386c Base: Hide `parallel` a9aa2ac Base: Don't reexport Data.Char ac5040d Expression: Don't re-export Base 74fb3f9 Eliminate re-exports from `Predicates` f05d78d Base: Don't reexport `System.Console.ANSI` 6472042 Base: Reexport `MonadTrans` instead of `Reader` 1405953 Base: Don't reexport Development.Shake.Config 062e6b2 Base: Don't reexport Development.Shake.Util 0be2c4b GhcCabal: Simplify imports 30484e2 Builder: Add haddocks 84af166 Merge pull request #36 from bgamari/reexport 024b562 Re-export Data.Monoid from Expression. 804a5e2 Use orderOnly dependencies for ordering ghc-cabal invocations (avoids unnecessary rebuilds). 3e2cdc9 First step towards #60. f415ad1 Use Target fields for printing out relevant build information. 0c9571a Add Settings/Builders/Common.hs for storing common Args, refactor code. bf70983 Decompose src/Settings/Builders/Gcc.hs, factor out cIncludeArgs into src/Settings/Builders/Common.hs. 73d198b Add new source files. 9e2ddcb Add Stage.stageString, rename runghc -> runGhc. 9140548 Add Expressions.removePair function to remove pairs of arguments. 7ca8be7 Add custom predicate builderGhc for Ghc/GhcM builders. 8ba5827 Decompose Settings/Builders/Ghc.hs (see #60). 0ceae64 Add a build rule for inplace/lib/settings. a1eab18 Add support for wrappers. 109a6f8 Add missing sources. 7cf7210 Decompose Settings/Builders/GhcCabal.hs (see #60). 49521c0 Track wrapped binary. d9d00b8 Fixes the -B path for the ghcWrapper. 4ade862 Decompose Settings/Builders/Haddock.hs (see #60). 75ebcfb Merge pull request #65 from angerman/fix-B 02b0d75 Fix compilerPackageArgs (Haddock builder). aee3088 ghcPkg Wrapper c720603 Merge pull request #68 from angerman/wrapper/ghc-pkg 84704cf Initialise inplace/lib/package.conf.d, fix #66. e2fb954 Don't re-initialise packageConfiguration in Stage2, see #66. 79ceb45 Update README.md e97d689 Merge pull request #72 from snowleopard/angerman-patch-4 6c80bd8 Match generator sources exactly, see #69 and #70. 26cd11f Fix extention, see #69 and #70. 56705eb Rename builder arguments, fix #60. 6dbe055 Update GhcPkg.hs 77655b7 Merge pull request #74 from snowleopard/angerman-patch-5 4b70d6e Add GenApply builder, #22. 3872f96 Rename installRules into copyRules and add copy rules for ffi*.h files, #22. 34488df Add basic support for rts package, #22. d06dabc Add Ranlib and Tar builders. d3eef6d Add COMPONENT_ID field to rts package-data.mk (#22). 3b8aa92 Build libffi library, fix #75. 9be3f7e Register rts package, see #22 and #67. 122a01d Add ghcautoconf, ghcplatform as rtsConf dependencies 25b2408 Adds ghcversion and derivedconstants to rts 94f5e79 Adds Rules for IntegerGmp a4893ad Merge pull request #78 from angerman/feature/dependencies ee639c7 Merge pull request #79 from angerman/feature/integer-gmp 8cea200 Adds integer gmp path to the Gcc builder. 80d3477 Merge pull request #80 from angerman/feature/integerGmpIncludePath d3d5b11 Split libgmp.a d271649 Merge pull request #85 from angerman/feature/fix-integer-gmp fd3a1f8 Add support for both *.gz and *.bz2 archives, see #79. 498939a Factor our common build actions into src/Rules/Actions.hs 4ce3206 Respect trackBuildSystem user setting 1c3c9f3 Clean up build rules for custom packages. 563307b Fix #87. c4c7a7f Build rts in stage1 instead of dist 6d36942 Copy libffi into place d40050f Adds integerGmpLibraryH to Rules.IntegerGmp a228d2b Adds Integer Gmp Library to IntegerGmp 72ed36f Drop SUPPORTS_COMPONENT_ID which is no longer provided by configure. bee905c Merge pull request #91 from angerman/feature/div 8235f15 Make output boxes prettier by closing them on the right a2e9fb9 Merge pull request #92 from quchen/closed-box e12516f Rename runGhc => runghc c4cbb3a Fix path to src/Rules/IntegerGmp.hs. 87568c1 Improve handling of generated dependencies, clean up code. 64da998 Add Travis support 45c731c Merge pull request #93 from quchen/travis-ci 64f9350 Continue refactoring of generated dependencies. 19310e7 Fix libCffi name on Windows (fix #89). 5bc7a0a Add topDirectory function instead of less reliable GhcSourcePath. 9050f37 Drop ghcPwd package, we no longer build it. e651350 Fix a loop in generated dependencies. ba41ec6 Another tweak of generated dependencies. 2565fc3 Adds derivedConstantsDependencies for rts 6fd807b Adds gmp.h to the integerGmp dependencies. 8e3e9bc Compile rts with -O2 04fc52c Wrap ghc-stage2 ccf4030 Merge pull request #95 from angerman/feature/fix-rts-deps 9e1ef6a Merge pull request #97 from angerman/feature/ghc-stage2-wrapper b978e17 Fix travis script: configure after shake-build is in place. d4e44fb Add comments. b18f0e3 Allow splitObjects to be controlled in Settings/User.hs, see #84. d0ffc1f Rework Travis CI script 0d43a40 Merge pull request #101 from quchen/master 2d1efa2 Temporarily disable haddock, see #98. 0b0e1d6 Fix readlink for os x. 8718da8 Adds -no-hs-main to iservBin f4ef847 Merge pull request #107 from angerman/feature/iserv a1f3c8d Adds quotes. 2c635d5 Add rl function to the cabal build file as well. e17f0e6 -Augenkrebs 5517cb0 Merge pull request #106 from angerman/feature/broken-osx-readlink 83c73a2 Make ghc-cabal build parallel [skip ci]. ff676fc Separate build messages with a newline. 709026d Refactor libffi rules. ae6f58d Attempt to fix integer-gmp problem on Travis, see #103. a33ab01 Force integerGmp package to be configured before reading config.mk file, see #103. 50dbdd4 Avoid cyclic dependencies, see #103. 412009d Don't separate build commands with an empty line.\n\nThis allows to fit more commands on screen. 9e731d6 Try to invoke libtool via bash. 375d41e Another attempt to invoke libtool via bash, see #103. da61b39 Minor revision d716ae5 Add a rule for libraries/integer-gmp/gmp/gmp.h, see #103. f466624 Adds osx to the list of operatin systems in the travis.yml d705676 Do we need tabs? a7610e0 env for all, apt only for linux fb5ed14 collapse env, addons wihout linux 35d0909 Drop commas 3ea7037 Can we install ghc and cabal through homebrew on os x? 019b513 This should work, I guess. 59c09b8 Use install. 17306dc Install alex, happy; adjust path only on ghc/cabal path only on linux. 9ff8773 Reorder os and env e18abef run cabal update a5aa58f Can we put addons and before_install into the include? 12c433c before_install steps don't merge cb74ce8 Set CONFIG_SHELL, such that libtool obtains the bash header. f8d9ddc Remove -Wall and -fwarn-tabs, fix #116. 7b5c5bf Adds "MAKEFLAGS=" back in. 2f52d19 Merge pull request #115 from angerman/feature/libtool 6095058 Merge pull request #112 from angerman/feature/osx-ci ce8ffdb Simplify extraObjects in src/Rules/Library.hs, see #117. 41ecfdc Refactor generated dependencies 2e4f060 Add IRC notifications 9784dfb Cache $HOME/.ghc as well 31fdc6b Merge pull request #120 from quchen/irc-notifications 7d55b36 Let's try the stupid --with-gcc fix for os x. 0fee526 Merge pull request #121 from angerman/feature/fix-osx-ci 4478851 Lookup builder in PATH if they are given without path. f3a1eb7 Updates travis and README to reflect fixing #26 290e990 Add a test appveyor script, see #110. 8bf936f Fix test script, see #110. 584fd8a Install prerequisites for Windows build. 1731a15 Create /usr/local/bin, silence curl. 907af3f Drop heavy python dependency, change project folder. dfc34f1 Fix path to clone folder. da29ac9 Rename cabal, add build script. 5afac8a Install project dependencies, pass -j --no-progress to build.bat e008f71 Fix cabal rename error. a4447be Change cabal config path and cache it. 3e42d47 Fix cabal path, create directory for cabal if it does not exist. 3008453 Move cabal folder inside /home/ghc. d913235 Keep experimenting with cabal folder. f419f64 Run cabal outside bash. accce20 Run cabal in -v3 mode to reveal the problem. 351c39f Run cabal in -v3 mode in bash. 05b4a6e Try to use an older cabal version. d314d4f Try to use stack instead of cabal. ccf97ae Install ghc-7.10.3 before using stack. 280b6fa Switch to stack/windows-x86_64. 78fee43 Drop extra flags to stack install. 3ecd105 Create /home/ghc/tmp, add stack install dir to PATH. 152f4da Add appveyor badge a599895 Fix paths. f514cc4 Install shake, mtl and ansi-terminal. a7da5e0 Take 2 e4ed614 Show the candidates. 0fa71d1 :( b47bd51 :+1: 909ed08 Fix the old-time issue. 2ad773b Restore install argument to stack. 360a4c3 Improve needBuilder, see #124. 39c3486 Prepend to configure. aff54c8 Adds Oracle 9024712 Escape echo quotes. b54121d Call bash with single quotes. f187ca8 Fix missing generated dependencies for rts, see #123. 2d333d5 Bring bash quoting back. 1d3de4c Moves wordsWhen into Base, and adjusts names and types to be more descriptive. 6f88557 Renames absoluteCommand to lookupInPath 5ccd03c Makes wordsWhen more generic. fee02d9 Build touchy, fix #125. 79a0bf3 Download ghc-tarballs manually. 4c75d3f Merge pull request #123 from angerman/feature/fix-clang bcb7894 Build touchy only on Windows, see #125. 53784f5 Update README.md fff8d58 Update README.md 6df7616 Merge pull request #129 from snowleopard/angerman-patch-2 b67f727 Build only stage1 base library to fit into Travis 50 min limit for OSX. 45eefc0 Create ghc-tarballs folder. f7cd3ae Rename replaceIf -> replaceWhen to match wordsWhen, clean up. 03b3379 Move copyRules to Rules/Generate.hs, add missing generated dependencies. 921dcce Make value sources more explicit de634da Add Haddock comments in Predicates.hs 20381e5 Split up definitions in Rules.hs db5e646 Add Haddock build to CI bee9cee Explain stages 1b013b0 Add Haddocks to Target.hs 997ce25 Haddocks for Way.hs ffc151c Fix type error 5f4a8f6 Add cabal configure to CI 302c1df Fix bad imports 9dd9ae0 Add Haddocks to GHC.hs 5a82579 Add Haddocks to Base.hs 6cf7902 Add missing Haddock header 2ba641b Make imports fully qualified c573af0 Document the provenance of the Main functions in the code rather than in comments 619f31e Revert "Document the provenance of the Main functions in the code rather than in comments" 1690e0f Merge pull request #122 from quchen/housekeeping 39e1756 Add missing package Settings.Packages.Touchy. cedbb79 Minor revision (comments, whitespace). bf18da2 Make build badges more informative ee94a7c Try fetching ghc-tarballs via stack exec. b6bb19c Add build rules for *.S sources, add rts/*.S files. 9ad20c9 Specify path to stack. 23ef499 Add init script, fix path to stak. 782e998 Add APPVEYOR_BUILD_FOLDER to PATH, show versions of key binaries. 2fd5c6e Clone ghc into ghc/tmp. cd567f7 Drop init script. 8c9544a Run boot & configure via stack exec. efeb163 Don't reinstall perl. c6d3c5e Fix path to configure. 01b7eed Try bash within stack to run configure. 29ce56c Bring bash configure back. 75063f0 Use mingw64_shell.bat for running scripts. 4a625f8 Try to use get-win32-tarballs.sh. b3382b9 Create ghc-tarballs/mingw-w64/x86_64/ directory. 988dabb Fix unnecessary import hiding 4116dbd Merge pull request #136 from quchen/redundant-hiding eab9a54 Create ghc-tarballs/perl folder. 192fd13 Fix shake script path. 8d1c201 Run shake script from shake-build. a5763fa Run shake script outside bash. f4ece5b Run shake script via stack. ffc5d73 Run shake script via stack from shake-build folder. a64efa9 Fix terminal issue, build stage1 ghc only. cce8759 Adds Unlit utility bd5bc65 Adds knowledge about Perl 7470e5d Adds ghc-split generator, generateScripts and re-enables SplitObjects 693a66c Use Extra library 8c2a30d Merge pull request #140 from snowleopard/feature/use-extra c43d07d Shallow clone GHC from Github instead of Haskell.org b214918 Drop "ghs-split" builder 423c5dd Include PR Comments e3d96ff Adjust cmdLineLengthLimit for OS X 883d929 Merge pull request #138 from snowleopard/feature/UtilUnlit e7fc568 Add iosHost function. f8660c8 Fix iosHost condition. a012ac6 Merge pull request #142 from quchen/clone-from-github 6200ac8 Unset GHC_PACKAGE_PATH before building. 5e3f91f Move chunksOfSize to Settings/Builders/Ar.hs, add comments. 901105e Reset GHC_PACKAGE_PATH varialbe (2nd try). 9580d01 Depend on ghc-split only when building with split objects. de13770 Reset GHC_PACKAGE_PATH varialbe (3rd try). b183504 Reset GHC_PACKAGE_PATH varialbe (4th try). 9ba5daa Reset GHC_PACKAGE_PATH varialbe (5th try). 3dff957 Refactor generators, add makeExecutable action. 4745578 Build stage1 GHC only on appveyor to fit into the time limit. 1ad387d Add missing source Settings.Builders.Common db5dce0 Build stage1 GHC only to fit into OS X time limit on Travis. ef6ddf9 Drop exe extension. 8efb43d Don't conflict with parallel in the latest Shake, provides a warning free way to be forward and backward compatible with Shake (albeit not pretty) 4444fa4 Add a .ghci file, useful for experimenting and using ghcid dbe8c1e Refactor getSingleton to avoid using list, otherwise an import of Data.Extra.List causes shadowing issues 02ec50d Rewrite digest, avoid using list (to avoid a shadow warning), and avoid using head (partial function) eda5882 Avoid using Traversable to get at forM b9c6d43 Export Data.List.Extra from Base, rather than importing Extra in each module (seems to fit with the general style) 9ae96f4 Use splitOn to parse the Way 9dbd805 Build ghc-cabal only, add cache. f168dc4 Switch to a more ambitious build target. 1b36ea9 Quote cache path. c217881 Attempt to build stage1 GHC. eda85ff Move build artefacts to .build/ directory. 1d18a74 Fix include paths. f84ee22 Postprocess inplace-pkg-config files. c96b1e9 Merge branch 'master' of https://github.com/snowleopard/shaking-up-ghc 6c81e9a Hide parallel when importing from Development.Shake aaf934d Remove qualification on parallel identifiers 02c75e7 Comment as to why we disable a warning f89a75f #143, turn of name shadowing warning 6e1511f Remove an unnecessary hiding after disabling name shadow warning 4be2130 Make build.bat work regardless of your current directory, so you can invoke it from the root directory a850455 Move gmp build results to buildRootPath. ef27c7c Merge pull request #144 from ndmitchell/master 697cba53 Revert changes in Way.hs from #144. 016a71f Fix formatting. 91622d3 Add -fno-warn-name-shadowing to cabal file. 24e6c28 Move bootstrapping.conf to .build. 55b0d41 Update Setting.hs 754ed41 Merge pull request #150 from snowleopard/angerman-patch-1 28c706d #146, add a Test module with selftest 70b40d9 #146, run the tests on Appveyor 763a518 Rewrite chunksOfSize so it doesn't go pear shaped on long inputs 077bf47 #146, add a test helper d001140 #146, add tests for chunksOfSize 916d5a9 Update the docs for chunksOfSize c5cb061 #151, add a call to selftest 5f80d4f Merge pull request #151 from ndmitchell/master 0c3a659 Use shallow git clone. 9178de2 Fix parallel invocations of DeriveConstants builder. 462f78f Report success on IRC only if the build was fixed 27f303f Merge pull request #152 from snowleopard/report-on-fix 1b226d9 Switch off -split-objs by default, fix #153. 5d4e182 Preliminary working state 8dfe2b9 Merge branch 'master' into angerman/feature/build-info-flags e519681 Fix Merge. 5dd8bbb Adds Pony f794e73 Replace Oracle with IO Ref 85799a5 Add dependencies, fix #155. a482625 Minor revision 43d5847 Allow users to choose which 'make' to use. 31dbe92 Create .build/stage0 for libffi to be moved to. 86f3052 Don't move from a temporary directory. db11fb0 Add removeDirectory to Rules/Actions, seems to fit 07d94c9 Simplify fixLibffiMakefile, no need to chop into lines first ccc16b2 Use removeDirectory where appropriate 3a88dc5 #156, ensure the entire piece is under a removeFiles so we always clean up the garbage 57c6497 Merge pull request #154 from snowleopard/angerman/feature/build-info-flags 2dd57cc In the removeDirectory operation, use removeIfExists 8f995f6 #156, remove the directory if it already exists f5f6c41 Merge pull request #161 from ndmitchell/master a60cdcd #155, fix the name of the QuickCheck package (it doesn't follow the convention all the others do) 6934485 Merge pull request #162 from ndmitchell/master 80eac86 fix handling of --with-gmp-* configure arguments b784a22 merge GMP library and framework GMP checks together 86a3fe5 simplify configureIntGmpArguments based on idea provided by Gabor Greif a24a85f Drops 'none' 46bf4bc Proper support for `dot` 231a5ce Complete Advanced Render Box 59a30fe Refinements. dc90c3c Merge pull request #168 from kgardas/fix_gmp_args 34c999b Use doesDirectoryExist to workaround a getDirectoryContents bug. ff0194b Don't use system GMP on Windows. 14e5009 Fix formatting in renderAction. e094834 Print out system.config when running CI. f792789 Fix comments. 79cf2e3 Detect the right patch command and use it when building gmp. 2024396 Determine system GMP library name and pass it via -optl. da96a23 Drops dot, adds none; renames pony to unicorn c2f1abd Space leak. ade3088 adds putBuildInfo ee95b14 Merge remote-tracking branch 'snowleopard/master' into angerman/feature/advanced-render-box c7c45fc Move rendering to Actions. 8a0380a Merge pull request #171 from snowleopard/angerman/feature/advanced-render-box b4f0b5c Make error message more helpful. d684612 Don't track integer-gmp.buildinfo. ba5f163 Add Make builder. 266461a Drop makeCommand, use make detected by configure. ba74f58 Don't need make (fails on Windows). f33acd3 Undo irrelevant changes in previous commit. 16c89e4 Don't rerun configure for integerGmp package. 6b532ba Add support for separate interface file compilation. c9ec473 Switch compileInterfaceFilesSeparately off by default. f63e9db Fix lint error on doesFileExist 'config.mk'. e9013dc Make the build badges follow the master branch only 4a90b33 Refactor paths to auxiliary build files. 1c877aa Merge branch 'master' of github.com:snowleopard/shaking-up-ghc f5dff68 Minor revision. 3ff1fc1 Refactor ways, revise comments. 1300254 Further work on #174. 6abfdfa fix handling of FFI library configure params afc4d05 use flag instead of setting for use system ffi value 51c24a8 Build unlit. b5d0778 Copy ghc-usage.txt and ghci-usage.txt. 40b7920 Refactor Builder.hs. a3afd03 change from using "dirs" to "dir" for FFI library configuration 680766b Merge branch 'master' into fix_ffi_args 39f0e7a pass ffi include/library directories to HsCpp efc92c5 fix tracking of changes to Libffi rules file 9a4bdc7 Merge pull request #182 from kgardas/fix_ffi_args 6e00b02 Create package database directories using oracles. 36b7f4d fix "dirs" to "dir" for gmp and iconv libraries 875d9ca Merge pull request #183 from kgardas/fix_dirs_to_dir 8f68b8b Fix CI regression, minor revision. bbbf03c Drop redundant case. 11f78b1 Minor revision. dc8dbcc do not pass --with-intree-gmp to configure when system gmp is used 88af41c remove redundant Settings.Builders.Common import 06fb099 simplify code and fix naming conventions based on Andrey's comments 30883f8 Merge pull request #185 from kgardas/fix_gmp_cabal_args c50e0dc Refactor CmdLineFlag.hs. e7377d1 Minor revision. 87c6fae Add support for --split-object command line flag. e874fed Add initial support for --configure command line flag. 4460146 Add full support for --configure command line flag. c9b2b76 Switch on ChangeModtimeAndDigest by default. 6bdb902 Major rewrite before the first release 82a7fa5 Minor revision 3d335e1 Add and link to important issues. e2b0201 Minor revision 1b08589 Add a link to milestones. a730d9b Implement clean target. 497f750 Add a note on clean target a8ea524 Use removeFiles instead of removeFilesAfter. 30a3d91 Merge branch 'master' of github.com:snowleopard/shaking-up-ghc 0bde9c1 Remove Shake database on clean. 93605e1 Add build.stack.sh 4aa3bb6 fix typos in build.*.sh ce71b6d Merge pull request #190 from joehillen/stack cf5d338 Add a note on build.stack.sh. 3f74e8b Move GMP build to Stage1. 48d0ee0 Move libffi build to Stage1. e01bf2f Force AppVeyor CI to succeed and store the cache. f6cd23d Add Environment module for setting up environment variables. 73d8de1 Clean up, build stage 1 GHC on AppVeyor. f9e5109 Make .cabal meta-data more accurate 6432f0c Add `cabal new-build` based wrapper script 21eef1e Temporarily disable ChangeModtimeAndDigest (test AppVeyor speed up). 45e208e Merge pull request #192 from hvr/pr/fix-cabal-metadata e2271ac Merge pull request #193 from hvr/pr/cabal-nix dfabde8 Bring ChangeModtimeAndDigest back. 8738dd2 Add build flavours, implement a simple quick flavour. 5ed8f3a Use quick flavour on Travis. 5286213 Add a new command line flag: build flavour. 3787444 Don't change extension of files found in PATH. f6355ec Improve the clean and rebuild section. 92a3ffb Add a note about interaction of the new and existing build systems. b06bae8 Rename Test to Selftest. e9abc61 Add basic validation support (GHC tests). eee29dc Add testing section c760627 Use libHS*_thr.a instead of libHS*.thr_a naming convention for libraries. 3b0fdab Add a rule to build gmpLibraryInTreeH. 8f9dd7e Add a target for threaded rts library. 0c06eac Build hpc-bin. a9f9876 Add validate target. 304840f Depend on Stage2 GHC, ghc-pkg and hpc in validate target. 4cc0abb Add a note on validate target fce6921 #189, clear PWD so we can be sure it has the Unix-style path even on Windows 0cf18c9 Merge pull request #199 from ndmitchell/master 1329a94 Add includesDependencies to primops.txt rule. acd13b4 Add configFile to Base, track building ./settings e5e7221 Don't print progress info too early. d1fb3de Sort list items. 1441846 Build top-level targets in parallel. af2d086 Track mk/config.h adfff77 Track mk/config.h.in be9a21c Do a full build on both Travis instances. fc040db Need touchy when calling ghc-stageN, N > 0, on Windows. f8bd699 Build GhcPkg Stage1 on OS X Travis. c3fc983 Drop exe extension. 8424eb5 Drop registerPackage predicate. c1364e5 Refactor Settings.Paths, add pkgConfFile. 9129e8b Decouple buildPackageData and registerPackage rules. 13d735f Drop ghc-cabal resource. 82b665e Update stack.yaml to lts-5.1 793587b Merge pull request #202 from joehillen/patch-1 2bde60d Don't print empty arguments. 1562315 Pass --enable-tarballs-autodownload to configure by default on Windows. 2825f93 Don't use --configure by default, add --enable-tarballs-autodownload flag on Windows. b9af374 Refer to the build script simple as 'build'. 83c1e5e Depend on package configuration when compiling package sources with GHC. 116bf85 Don't run GHC concurrently with ghc-pkg. 44fd16d Don't run GHC -M concurrently with ghc-pkg. 63bbebf Add copyDirectory to Rules.Actions. 7f2c6a1 Add --haddock command line flag. 90c59d1 Copy generated files to old build directories. 7122295 Copy haddock-prologue.txt to new build directory. e1b6c56 Fix Haddock documentation. 52b915f Add --haddock flag. 8b24f9f Drop duplication of ghc_boot_platform.h 7be13bf Merge branch 'master' of github.com:snowleopard/shaking-up-ghc 7e8bfbb Minor revision. 7d7802d Add -fno-warn-name-shadowing. d5e2d92 Rename Rules.Config to Rules.Setup. 0678acb Run mk/get-win32-tarballs.sh on Windows. 507f48d Minor revision. 4cef7ec Rename the --configure flag to --setup. 2fe68f0 Rename --configure to --setup. f5299c8 Implement path lookup on Windows. 68cf604 Fix executable lookup. bd405c1 Use qualified imports. 3178d82 Drop top-level Oracles.hs 05e7242 Report an error if an executable is not found, unify paths. 56d3256 Unify paths. b3e25ee Drop alwaysRerun from setup rules. 0b0996b Drop support for old configure.ac. d17c1f5 Don't fail if configuration file is out-of-date. 0123303 Fix formatting, drop old comments. 27317cf Make fixFile more robust. d4b6ee5 Get rid of gmpLibNameCache. d07b5b2 Add TODO. e9106e8 Depend on integerGmp configure in gmpRules. cc10288 Drop configureIntGmpArguments. aafa9ad Extract gmpLibs from integer-gmp.buildinfo directly. 2c21908 Track gmpBuildInfoPath explicitly. e8b62f7 Factor out Context from Target. 6482e6a Add comments. 9497fbe Move mkUserGuidePart to Stage2. d1ec507 Install mkUserGuidePart binary to inplace/bin. 9207f25 Fix incorrect context when reading BuildGhciLib flag. e7f8710 Factor out build rules into Rules.buildRules. d81e041 Move Selftest and Test rules into Rules directory. a10669a Move Rules/Package.hs into Rules.hs. 010fb8c Drop unused Resources parameter. b820539 Use do notation to combine Rules. 6a9772a Minor revision. 2fc7bd3 Drop Rules.Resources, move packageDb resource to buildRules. de8ca62 Drop GranSim way unit. 49a7cb2 Drop Parallel way unit. cfb1331 Do not hide Shake.parallel (we no longer have conflicting Way.parallel). 799b809 Fix separation into full and RTS-only ways, add comments. 3c88f16 Move profilingDynamic to full ways. 575d82f Add allWays. 23d501a Pass way to compilePackage via Context. 8478284 Drop workaround for GHC bug #11331. 0ddf3b4 Minor revision. 98b1f8c Pass way to buildPackageLibrary via Context, minor revision. f6a9d2f Finalise generation of build rules from contexts. 1aec72e Drop matchBuildResult and associated functions. 5fcb480 Add matchVersionedFilePath and use for matching library targets. 89c79cd Hide Shake.parallel. Again. c0b1a37 Factor out buildPackageGhciLibrary from buildPackageLibrary and make it more robust. f0f4193 Use matchVersionedFilePath in registerPackage build rule. 0b68ae8 Add tests for matchVersionedFilePath. a849c93 Don't unify paths as it seems prone to surprises. 8ae1c56 Refactor Selftest, add more tests for matchVersionedFilePath. cbbbc63 Use Data.Bifunctor.bimap as it is now available on bootstrapping GHC. e40e2e0 Ensure that if ghc compilation fails then we return a non-zero error code from build.bat f98836e Merge branch 'master' of https://github.com/ndmitchell/shaking-up-ghc d1dacae Merge pull request #208 from ndmitchell/master 6dc581c Add --profile=- to CI build scripts. dfce0db Add missing resource dependency to buildBinary. 548a30b Make RecordWildCards a default extension. 57c623d Drop redundant newCache. e1d05c5 Add comments. 13ad050 Refactor oracles, drop redundant newCache. badd551 Refactor paths using Context. 903ab6c Refactor moduleFilesOracle, work in progress. 5e32c91 Document and test encode/decodeModule. e054479 Add lookupAll and test it. 2ec9f84 Keep duplicates in the intersection. 59d7bf1 Drop duplication of module names in moduleFilesOracle. 9039a4f Add findModuleFiles and export it. 1136a62 Test findModuleFiles. a09185a Drop redundant brackets. 3d9c2fd Simplify and refactor moduleFiles oracle. 41778b0 Add missing dependencies. d396ba3 Minor revision. 79858ef Add findGenerator, refactor Oracles.ModuleFiles. 50663a4 Drop testModuleFilesOracle. 1fd2368 Use Context as key to moduleFilesOracle. 9171856 Minor revision. 31515fa Use conventional whitespacing for @. e2fbf4c Add comments. 39f61a4 Use (Stage, Package) as the key for moduleFilesOracle. 0273e3e Fix outdated comments. d8a249b Add comments. 0d7891b Drop redundant 'build' component in build paths, rename contextPath to buildPath. 2e3ec0c Use default project name on AppVeyor. 13b1491 Add missing arguments for rts package. 7e7497a Fix haddock. 3dcbe7a Add docs for how to compile on Windows, with a list of complete instructions 2d02668 Add a note on how to install Happy/Alex better a5a37b9 Merge pull request #212 from ndmitchell/master 42bce9a Link to Stack-based build instructions for Windows. f1157df Minor revision 8ba5cff Error when a non-optional builder is not specified. d89358f Make Objdump builder optional. c1adff7 Split buildPackageData rule. ad44a95 Hash Target inputs in ArgsHashOracle. c7a4165 Disable library profiling in quick build flavour. 0b327b5 Allow build flavours to control Ways. 56526ff Build profiled libraries by default. 9b68950 Quick flavour now disables library profiling b052ae7 We can now build profiling way acf3623 Update limitations c50799d Experiment with a more efficient version of -/- in Settings.Paths 950ac6b Merge branch 'master' of git://github.com/snowleopard/shaking-up-ghc bf60359 Add -threaded to ghc options. 67e3104 Install alex and happy using cabal to fix Travis failure 0e27bf4 Pass conf-cc-args-stageN to Gcc builder. 5b49f64 Minor tweaks e23dab7 Don't add exe extension to builder paths on Windows. 96dec14 Rename Gcc(M) to Cc(M). 897ba61 Add CompilerMode to Cc and Ghc builders. 1c137b3 Adapt to @WhatIsGcc@ being renamed to @CC@ in GHC HEAD 3bab113 Convert cfg/system.config.in to use unix line-endings 1099f62 Merge pull request #225 from hvr/pr/systemcfg-fixes e34e7e2 Keep up with recent GHC changes, see #215. d1c8ba4 Add a note on cabalDeps list. 61032aa List installed packages in CI e29218a Run ghc-pkg list through stack ee592f4 Don't use Docker on Travis. 219da37 Try full build on Mac OS X. cf5ab9a Switch to shake-0.15.6. 028ef28 Add shake-0.15.6 to stack extra-deps 6826d14 Merge pull request #230 from cocreature/stack-shake-0.15.6 98041b2 Tweak shake constraint. 7bc4867 Add CompilerMode Link. 64ae7fe Drop experimental code for #174. 366b35b Minor revision. e532385 Merge builder, stagedBuilder, builderGhc/Cc into builder. ab5a70f Drop workaround a Shake getDirectoryFiles bug. ed4cdd8 Add comment on unicode build info. 8d0581e Drop laxDependencies. To be replaced by Shake's skip feature. b08a8f6 Rename to Hadrian cf2b1da Rename to Hadrian. 2736806 Rename to Hadrian 0c5fe5b Rename to Hadrian 11759a8 Rename to Hadrian. affe0bd Rename project executable to hadrian. c32b33d Add TODOs. d2051cd Rename shakePath to hadrian. 5f40553 Rename build directory 5779105 Update CI links 1317c88 Build Hadrian in _build. f76a8be Fix Appveyor CI. a37ad75 Fix Travis CI. 666f5c2 Move Hadrian executable to /hadrian. 185af60 Move Shake files into _build/hadrian e6373a0 Use in-tree Cabal library. 72f6ec6 Turn Configure into a Builder. 0b6c0aa Do putInfo even in verbose mode, minor revision. 759dff3 Print version info before running configure de4f7bc Move gmp library instead of copying it. Add moveFile. 2674950 Merge branch 'master' of git://github.com/snowleopard/hadrian d842e0f Run configure via stack exec. b8dda5c Attempt to fix Appveyor failure 70fd668 Add PATH to happy. 0015942 Drop support for shake-0.15.5 7166d12 Run boot and configure by default. 56be38d Use qualified imports in Rules.hs for better readability. dd4f887 Run boot and configure from Hadrian. 7cb590a Drop --setup, add --skip-configure. a228b96 Call GMP's configure in gmpBuildPath. a7adf8c Get rid of partial functions. 3be1a41 Rename to Hadrian. 6a09a6b Don't need patch file by default. fa57784 Get rid of partial functions. ad53022 Drop removeDirectoryIfExists. 658d373 Move Base.removeFileIfExists to Rules.Actions.removeFile. 72cbd44 Show output of boot and configure. 32a2526 Fix get-win32-tarballs command line. 9c45e4d Move decode/encodeModule to Oracles.ModuleFiles. a88253a Move GMP paths to Settings.Paths. f0781a7 Refactor Gmp and Libffi rules. acf2160 Add comments. 2249b40 Make only install target in libffi. 6828f4a Add comments. d04a83f Actions: use `mv` instead of renameDirectory (fixes #236) e61bd40 Merge pull request #237 from michalt/movedirectory-fix/1 13f3e0c Run boot and configure via Hadrian da2ce2e Use --flavour=quick 6864e8b Add a note on automated run of boot and configure 6ef09f4 Echo stdout only if --progress-info={normal, unicorn}. f31a7de Add Make builder. 6da6b45 Add missing Settings.Flavours.Quick module. e19cd9f Fix configureBuilderArgs name. d27501d Add makeBuilderArgs. 6e953f1 Do not unify paths on each -/- invocation. 7239000 Update comments. caf0d6a Add predicate input, rename predicate file to output. bc5b5e1 Add missing path unifications. 82ead73 Add link to MVP issue b56f4eb Add user settings documentation f715a27 Add a link to the user settings doc 4b0dc2f Minor revision be59fae Minor revision 86ae5c7 Add TODOs. 8c6a188 Add miscellaneous, minor revision b91d515 Comments 3ff4183 Unix line endings, match Haddock comments in Settings/User.hs c8725b2 Fix predicate 2ac9e71 Simplify dc0bae1 Drop non-derived Show instance for PackageName 3c5998c Minor revision fda4673 Drop DeriveDataTypeable extension f50439d Minor revision d1780e4 Don't add redundant path separator in -/- e982476 Clean up imports (improve consistency) 12dc4c5 Re-export Expression from Predicates 03f89a6 Rename module Predicates to Predicate 0f7bc96 Check if the output supports colors (fixes #244) a9f43e5 Merge pull request #253 from michalt/colors/1 f910a1c Track only files of known extensions when looking for module files e91daa3 Add ghc-boot-th package 34545e3 Drop dreary package signagures fa77d93 Make build progress info colours customisable, drop putError and putOracle. acc2c7e Move versionToInt to Settings/Builders/Haddock a2b39be Don't celebrate duplication 2c77b71 Add a paragraph on customising progress messages d6a0d7a Replace quote by show c81dc684f7 Add quote function 1080ebf Fix putSuccess aa9c65b Add --progress-colour command line flag 5ca3853 Don't use colours on CI dd3d592 Run CI in verbose mode 13b80f7 Unify include and link paths 7053d0c Minor revision 5b75d12 Link gmp objects to integerGmp library 816b0ac Revise comments ba108c0 Add missing dependency aaead2a Pass GMP objects to Ld explicitly ffcc3d9 Add a note on --progress-colour 1054490 Add a note on --verbose 5d2c1ee Build check-api-annotations 2c74f92 Fix missing dependencies for Stage2 packages b6f224c Refactor dependency oracles 19293d9 Drop orderOnly dependency on GMP objects 3de1a5a Run Make builder with -jN using N = shakeThreads 97d37ea Drop TransitiveDepNames 026466a Rename PackageDb to PackageDatabase 73ad993 Use simpler mapM instead of traverse 8933a3a Simplify using firstJustM 15acc2c Minor revision e7e58aa Set `THREADS` when running validate f24d880 Merge pull request #256 from michalt/validate-threads 00b88a1 Upgrade to extra-1.4.7 ec031af Drop shake-0.15.6 from extra-deps, and add extra-1.4.7 68f8eaf Use LTS-5.17 166e3fb Packages/Rts: add `linker` to RTS directories 45b5f13 Merge pull request #257 from michalt/rts-linker/1 123bdb3 Enable optional UserSettings.hs file 20d7082 Merge pull request #258 from KaiHa/ticket/247 5ad9fad Test the resulting GHC binary 119bda5 Switch to UseLibdw d58dabf Fix path to user settings 157b855 Fix paths to user settings af6a040 Merge build.cabal-new.sh into build.cabal.sh c9e7570 Minor revision 39f0509 Clean up switching from Settings.User to UserSettings 24d6d50 Merge pull request #260 from hvr/pr/unify-cabal-script 49c2df8 Fix formatting 85b4b52 Set dynamicGhcPrograms = False 5422e92 Note on nm on OS X 920e7bb Merge pull request #262 from alexbiehl/patch-1 1ff9ead Change default colours to fit both B-on-W and W-on-B terminals e592fb1 Add actions copyDirectoryContent and runBuilderWith 73970d5 Remove explicit import of 'System.Directory' 787cb4f Remove excessive whitespace d7c80c8 Add Quickest build flavour 3a04d34 Use Quickest flavour on Appveyor 6d6834a Fix Quick flavour 1f1a7b3 Use Quickest flavour on Mac OSX b299acb Attempt to optimise ghc-stage2 in Quick flavour 0955d43 Don't optimise GHC in Quickest flavour 0579308 Minor revision 21f3e05 Add Oracle 'DirectoryContent' 5439f0e Rework copyDirectoryContent 5999957 getDirectoryContent: Implement an AST for matching df3ad6d Merge pull request #266 from KaiHa/copyDirectoryContent fa4ca65 Enable RecordWildCards 3be52c5 Refactor build flavours 88b495c Drop unused folder 54a8e15 Switch from condLibrary to condLibraries in Cabal 5fe4668 Support autogen paths of new Cabal 6369ef0 Point to in-tree Cabal sources 4ad8082 Drop trackBuildSystem setting 38d1f55 Fix autogen path for iserv b05a328 Try full build on AppVeyor 29c2402 Test Stage2 GHC after the build 868ffae Attempt to run Stage2 GHC without Stack abfd4e7 Try default build flavour on Travis Linux 59b07fd Update build flavour related text 0053526 Minor revision e1b6e52 Typo 03ffd8e Merge pull request #270 from ggreif/patch-1 3b0fab4 Drop TODO 118adf2 Revert to quickest build flavour on Travis Linux 116e64d Attempt to fix the 'unknown symbol stat' issue on Travis Linux 1281be4 Change the stack configuration to use the local Cabal lib 3380e0d Merge pull request #271 from michalt/stack-localcabal/1 9e22012 Install only after GHC sources are fetched b2fc154 Fix GHC location before Stack install b3bcd0f Fix inability to find gmp.h when building concurrently 4a7016b Merge pull request #273 from mpickering/master a8abbc9 Split CompilerMode for GHC and CC e89ab5c Merge pull request #275 from michalt/compilermode/1 3c31edc Use nm-classic instead of nm when host is Darwin fc4c968 Use in-tree cabal in build.cabal.sh (works for cabal < 1.24) fd48c37 build.cabal.sh: Use CABAL variable 564b125 Revert raising of the cabal version in the build-dependency 3724023 Use in-tree cabal in build.cabal.sh (for cabal >= 1.24) ea51eaa Use `add-source` instead of linking cabal.sandbox.config eff3e36 Merge pull request #277 from KaiHa/ticket274 234b41b Make generatedDependencies an Expr [FilePath] 14a596a Merge pull request #278 from michalt/generated-dependencies/1 c547d12 Minor revision f1f95d5 Require Cabal 1.25 9467c06 Make dependencies easier to copy 9b474d3 Don't capitalise 'quickcheck' ae1fa1a Don't run cabal on Hadrian a931066 Adapt to Cabal library API changes c2d7e2a Initial version of FindMissingInclude 197ca35 Merge pull request #279 from michalt/gcc-mm-mg/1 0cfd96d Use --flavour=quickest bbd884c Add a Stack build script for Windows 082f17b Drop redundant imports 676ec2e Fix comments e789d21 Bump stack to lts-6.12 and remove extra pkg from extra-deps c7f8ae2 Merge pull request #284 from michalt/stack/lts612extra 4e58441 Add build-tools Alex and Happy. f644b3f Use Stack to download bootstrapping GHC and install MSYS2. f937d80 Exit the build script if Hadrian cannot be built fe19fc3 Try to drop the 'echo' hack. 4b682d2 Run stack setup in silent mode 80e986b Reduce verbosity 7987366 Final tweaks 5905138 Whitespace 3218044 Refactor and simplify cc72f0c Fix path to GHC binary 1fa2cb1 Simplify instructions, add CI badge 633fad1 Link to prerequisites fd7dd6f Tweak instructions 73c72a6 Lowercase flavour names in --help e5b4b0c Merge pull request #286 from cocreature/lowercase-flavour 57d6c69 Add path to generated includes for compiler package 6836711 Refactor GMP build rule d12066d Split the GMP build rule even further c9ae45b Fix missing directory f2cff6f Move generated includes to build directory 456a10b Drop TODOs c6cb106 Fix generated includes 0ff86b4 Fix path to ghcversion.h header 79575b3 Pass configure Cc and Cpp options to GHC 10154e7 Adapt to Cabal library changes 4afc5a4 Drop Text.PrettyPrint dependency e0de028 Drop repeated argument 6adb600 Unify paths when printing progress info c391842 Refactor libffi build rule b096f1e Don't track -jN arguments passed to Make 73b9b7b Support several variants of -jN flag, add tests 8cfa6ef Fix warnings 9233793 Minor revision 703429d Limit Make's thread d3d00b0 Reduce verbosity of ghc-cabal and ghc-pkg 8657341 Eliminate some uses of fromJust a86f2b1 Build mkUserGuidePart with stage-0 b7948dd Merge pull request #290 from bgamari/master 2a20ce5 Add links to Hadrian paper and talk 325db89 Whitespace only a20d473 Remove old issues 2d60196 Minor revision 3e37d73 Simplify package database directory tracking 0d8713a Drop unused extension a0afb98 Minor revision fbe22e6 Simplify getSingleton, add comments b61423d Split compilation of Haskell and non-Haskell files bb43f24 Refactor discovery of generated dependencies ffff1b3 Simplify, drop code duplication, add comments c391fea Attempt to fix Travis MacOSX instance 90e3e97 Use nm-classic when running on Travis 99404de Merge pull request #276 from wereHamster/osx-use-nm-classic 4378fcf Revert to running the configure script from Hadrian 2895999 Fix typo 038dfb4 Move package.conf.inplace to build directory f52e582 Simplify 9d13cd8 Improve code consistency, simplify, fix comments 2f74254 Refactor imports in Settings/Builders e3aedfe Fix GenApply arguments 7303fcf Don't generate files into the source tree b2f49f0 Build runGhc executable 0bec73c Drop GenApply arguments, as it actually needs none. aa6bba1 Move auxiliary build files to _build/hadrian 179f5b1 Build Hadrian in /hadrian/bin 67f433b Compute package dependencies only for packages we build d4d9c03 Add rule 'sdist-ghc' 0bfadf3 Merge pull request #265 from KaiHa/wip/ticket219 0959e45 Add a note on source distribution 6596774 Retry pacman package downloads on AppVeyor to make CI more robust cfecd73 Refactor package-data generation for custom packages 241d59a Turn contextDirectory into stageDirectory fd0cb1f Move rtsContext to Settings.Packages.Rts 058cb92 Simplify builderPath 44f7374 Refactor programPath 28f2675 Build iservBin, fix comments c93cf69 Bring back tmp directory for in-tree build artefacts 8ee46b1 Refactor builder path manipulation e1e2621 Add missing src/Oracles/Path.hs b42f4fd Merge LookupInPath and Path oracles e31cb51 Rename src/Settings/Paths.hs -> src/Settings/Path.hs fb30a88 Rename src/Rules/Actions.hs -> src/Util.hs 75281f2 Simplify defaultPackages definition 223d161 Minor revision e2871fc Add a selftest for Packages f808265 Run selftest in GHC tree 63ba250 Test conditions for building win32 and unix packages 47a1e7d Simplify needTouchy, drop old comments bf83d95 Don't build ghcPkg in Stage1 5d12adf Refactor programPath c5ba8b9 Move programInplacePath to Settings.Path 7b00fa7 Fix buildProgram d9b059b Minor revision 8be3f76 Fix path separators 7041682 Drop redundant createDirectory calls 4fd513a Simplify, remove old hacks 010dd78 Add missing dependencies on generated files eca7b6a Move GHC/Prim.hs outside of autogen directory 95ee1ab Build dependencies for all known packages that exist 6d420eb Minor revision, don't copy Hadrian binaries 94c88da Don't generate in-tree directories by ghc-cabal e93f7a4 Drop redundant clean up after ghc-cabal e3b5f08 Put RTS's package configuration into inplace-pkg-config for consistency 7ebb204 Refactor Data and Register build rules 46ef16f Move RTS path settings to Settings.Path 72a08b0 Move custom contexts to Settings.Path e3be330 Simplify handling of non-Cabal contexts e2761b2 Simplify handling of programs with no Haskell main 4e80495 Simplify ghcCabalPackageArgs 92b5c35 Drop old TODOs 31c6109 Add GhcPkgMode 0412d60 Drop references to #113 1eff9b4 Directory package no longer needs special treatment 6552aff Minor revision e081b08 Fix paths in inplace-pkg-config files 7f62b5a Handle Make correctly in needBuilder, refactor customBuild 6984895 Adapt to Cabal library changes 8e3cb44 Build ghci library in Stage0 552bb90 Build internal ghci support in Stage1 374b10a Build compact library 6508f4b Add perf flavour 9c8d9bf Add missing profiling flags bc44c00 Add prof flavour 3201312 Add missing flags for Parser module 25a6441 Minor revision ab1c922 Move -Wall before custom package settings, drop tab warnings c88fc78 Duplicate libffi library for each build way 8e7685c Fix way-specific flags 76de227 Fix profiled GHC 3ae4e1d Depend on RTS only when building GHC program daa4b7c Remove dependency on rts for programs built in Stage0 cf73599 Drop redundant top-level rts target c27e8cb Make quick and quickest flavours more precise 12aa4ef Minor revision 6b35c2c Move integerLibrary to flavour 4ac02f6 Depend on GMP only when using integerGmp 0c08cc6 Test integerSimple on CI de151a9 Revert to integerGmp 60c8172 Update section on integerLibrary, expand build ways example 1774b40 Drop no longer relevant bits d6e7919 Add development flavours b2ca3dd Refactor build flavours ff9e5b6 Add a doc on build flavours e03bcf6 Link to build flavours doc 3d4e548 Update notes on build ways and flavours 084ce3b Don't modify ways in development flavours 71b2b96 Rename Settings.Optimisation to Settings.SourceArgs a63d835 Reorder source arguments b42cac6 Add --integer-simple command line argument 77840e7 Speed up Travis OSX build by --integer-simple 5ca4af3 Add a note on --integer-simple command line flag f39305c Don't need the GMP library when building with integerSimple b94612d Filter out repeated ways when copying libffi a7b1494 Use -H32m in all build flavours 2ef6390 Use -H32m in all build flavours ebee16a Move checkApiAnnotations, compareSizes and ghcTags to Stage0 e908a4a Fix breakage due to changes in Cabal API 6e73b4d Add -Wno-sync-nand to ghcPrim's cbits/atomic.c 0dc5fdf Switch to new GMP library c3e8242 Use --depth 1 for git clone (#298) cb5035a Add extra to the list of dependencies e561f80 Move -rtsopts to linker options f8bd794 Merge branch 'master' of https://github.com/snowleopard/hadrian e664431 Depend on the exact version of the in-tree Cabal library 30708a4 Rename compact to ghc-compact 198abb4 Rename readPackageDescription to readGenericPackageDescription to fix the warning 7b90c76 Drop repetition in the list of packages, fixing Hadrian's selftest 295c781 Added a note about git line-ending settings (#303) c158014 Add wrapper for Runhaskell, Fix #304 (#305) 5b9f6e9 Allow cmm files in non-custom packages ff322d9 Drop package self-dependencies 4347b0d GHC ticket 13583 has been resolved, so the workaround is no longer needed b3339d4 Use xcode8 image c4e2e45 Rename runHaskell wrapper to runGhc for consistency 3ea149a Disable some warnings (#307) 4952e80 Add Werror to CC and HC (#309) bc32262 Add copyFileUntracked (#313) 1fd9854 Fix CABAL_VERSION argument in building ghc-cabal (#319) 8299d14 Add more utilities including install and symbolic link (#316) 0589a9e Compute cabalDeps in GhcCabal build (#320) 02351ac Fix implicit assumption about inplace installation etc. (#315) 49835af Add binary wrappers for hp2ps, hpc, hsc2hs (#321) ffc905c Drop dependency on hoopl (#328) 3935e97 Add Install Rules (#312) 49b13b8 Build dynamic libs (#325) ae7358b Don't pass gcc warning options to ghc (#329) edd539f Various portability fixes (#331) 6d46b39 Fix setup-config dependency (#334) b245f0e Add Stage1Only rule (#340) 5f0e385 Automate dependency analysis of installed packages (#342) d8e1759 Better tracking of dependence in installation (#353) e93f583d Update README.md (#352) 9dde04c Update flavours doc (#338) 13023bc Fix documentation rules (#324) b7550b2 Use correct ar for host/target (#356) e8abab2 Fix warnings e1aadf3 Don't optimize cabal stage0 build (#357) 31f9640 Fix validate's dependency on generated files (#362) 9a34338 Minor revision 31890f3 Fix paths to install-related commands on Windows. Minor revision. 374d7b1 Use mv command to move files 076e53f Add CircleCI script (#364) 1400b14 Add CircleCI badge 6395cf5 Untrack copied artifacts (#365) 0ca5f3a Fix on Windows install 05b3ebe Add ghc-iserv wrapper (#367) 408ef4e Fix typo in comment (#369) 4bdc4a4 Link to the projects webpage 061dcf1 Minor revision b7fff3b Make OS X build faster and Add GHC 8.0.2 build on Travis CI (#370) 599381f Minor revision 44b279b Add an acknowledgement to Zhen Zhang 2741b3c Drop language in Travis CI config (#372) 58e2120 Comments only 145999c Need all top-level dependencies in one go for better parallelism. Minor revision. d9c97e8 Fix builder dependencies on generated files (#363) 2555a5f Fix validate's executable dependency (#375) fd5cd07 Fix validate's hsc2hs dependency (#375) (#378) 776cf70 Drop redundant imports 345deee Bump Cabal library version, fix AppVeyor build 9c75620 Part 1 of the Great Refactoring of the Expression 227d8d7 Don't echo 57cfa03 Disable parallel garbage collection (#385) e6dcd1b Use GHC to compile C files (#380) 7b4fdfb Fix profiled GHC context b6be67c Bump to lts-9.0 c8b08a2 Fix AppVeyor 3a39f38 Switch to building using GHC 8.0.2 and GHC 8.2.1 on Travis e918ec1 Clean the source tree before building source distribution 6e8b0af cabal-install-2.x can new-build (#386) dd4270a Drop redundant line 81fecb8 Fix warnings 48e8b6f Factor out generic build infrastructure fe857d0 Use Cabal build scripts on CI a432cff Move ArgsHash oracle to the library 5e1d004 Minor revision 7ff841eb Move DirectoryContents oracle to the library df8e5aa Factor out general functionality of path oracles to the library 8e97252 Merge all generators into a single file, factor our common functionality into the library. 2bdb94f Merge Predicate into Expression 65c5d7c Factor out generic predicates into the library e37a5f7 Drop append, simplify 5dd20f0 Minor revision d3ef19d Move the Config oracle to the library acf66a3 Simplify oracles da27a1f Replace Config oracle with generic key-value text file oracle 72bf4b1 Minor revision 78878b7 Fix package registration a395dd7 Move putColoured to the library 4f0b5a1 Re-export basic data type definitions from Base 709ffb7 Merge Rules.Oracles into Rules 1a0a80b Extend KeyValue oracle to handle lists of values 1df5491 Drop Oracles.Dependencies moving code to the library and Utilities (former Util) a56298f Make most extensions default, minor clean up b4977a3 Add default extensions to .ghci 0ef2b1f Clean up imports db56cf4 Provide more useful ToPredicate instances 0530e0d Refactor command line arguments and flavours 58e2d05 Move file system operations to the library 5026b9c Fix compile error on GHC 8.2+ d2ca01b Re-export Dynamic and Typeable bits 0c67f7d Move need of inplaceLibCopyTargets to top-level (#388) 9b70568 Major refactoring of path settings 1ade885 Fix merge conflicts 7792fbb Minor revision 8fc676e Move systemBuilderPath to GHC 4a46d14 Factor out cabal parsing functionality into the library 46a0061 Switch to MIT license b85602d Add docs, minor revision 4fca3ae Factor out file cache functionality into the library e815c5f Fix overlapping build rules and generalise the pattern 67ae38d Build with '--integer-simple' on Linux GHC 8.0.2 CI df4848c .bat file tidy up plus shake-0.16 compatibility (#392) 14aec31 Move Package to the library 39a2b89 Make Package datatype abstract 7c65e09 Simplify Package data type f0fb1be Move RTS-specific paths to Settings.Packages.Rts 7231dd5 Fix Travis timeout e91b0c2 Run ranlib directly 23c8602 Fix Travis d2dddad Add mtl, parsec and text as Stage0 packages 9fa04f0 Minor revision 48ad1e7 Drop double installation of Hadrian dependencies 942ed27 Fix install rules by untracking copy files and use relative path (#396) 4b6707a Improve infrastructure for Cabal file parsing 8586ab8 Merge branch 'master' of https://github.com/snowleopard/hadrian 268155a Minor revision a8cbd16 Fix MonadFail warning 8f244c4 Add ghcid.txt ef47d7b Fix performance bug: do not call ghc-cabal to determine package targets c413722 delete cfg/config.h.in (#390) 176bfd4 Add DESTDIR to command line arguments (#397) acd5c37 Minor revision 4ce8587 Switch to computing package version only through the Cabal library 9105fc6 Compute package synopsis directly from Cabal files 8972c19 Install rule: copy gmp header (#398) b25faf5 Drop defaultDestDir and use Shake's verbosity to control verbose commands (#400) f189ed4 Remove unnecessary use of -DGENERICS flag (#402) 74a6561 Drop mkUserGuidePart 5ef696e Differentiate between C and Haskell package f7c9b8b Do not run CI in verbose mode fc564b8 Simplify package lists 0781e16 Refactor GHC/user packages, move builder-specific functions into Builder cbc2f63 Add cross compilation (#401) 241ceff Minor refactoring: re-export Context and GHC from Expression 9dcd2a6 Minor revision of install stages 090e00a Fix wrapper build 7a5c384 Refactor program build rules 9da5e17 Fix wrapper build rules de975b7 Minor revision 12e7d5f Drop dll-split 8f5ad00 Drop dll-split related arguments to ghc-cabal 29046aa Factor out common builder-related functionality into the library f970bfc Minor revision: move builder-related functionality to Builder modules 655d175 Factor out common Ar functionality into the library 46a37b1 Add ArMode to distinguish packing and unpacking of archives c3f0f40 Mark as temporarily out-of-date 6d14f09 Add support for llvm-targets 95a23a6 Drop support for -this-package-key bece422 Drop cabal_macros_boot.h ae1f7c1 Refine cross-compilation implementation (#410) 17be7a1 Fix performance bug: Stage0 packages do not depend on inplaceLibCopyTargets fdd223e Add missing dependency of hsc2hs on template-hsc.h adc8e35 Need rts at the top-level to allow more parallelism 9a1b659 Optimise stage1 compiler 101d787 Update docs to list -H64m 97fa508 Implement documentation building (#413) f479c5d Avoid running commands with the Shell option, which breaks due to spaces in paths fcdecad Fix Config.hs to import GhcPrelude (#417) 907cad6 Update shake and add stm to stage1 packages (#419) 706d35e Complete RTS compiler args (#418) 07b7d5f Drop redundant import 6abbbd0 Add RTS args related to libffi 0e193c0 Drop outdated RTS arguments, fix Windows build b2d06c6 Clean up RTS arguments 68446ab Move ffiIncludeDir to C arguments 6abcec9 Drop checkApiAnnotations utility 88a7b4e Switch to isWindows c6d7b2a Fix missing dependency on package configuration e1c9afa Build man page (#424) 18539d0 Switch to the python based boot script d6fd6fe Fix libffil build c13806a Install python on CI 81a6d1a Install python3 on CircleCI 6eb3059 Install python3 on Travis OS X c70f765 Update docs c6efd3f Minor revision 830567e Drop redundant code a69c73f Drop the redundant build rule for literate Perl scripts 837675c Implement Stage1 GHC freezing cbee74b Minor revision, drop old TODO 7c507e1 Document the --freeze1 flag dffda59 Don't print boot's diagnostic info by default 03ebefd Register the access to the package database when compiling with GHC e4f9829 Fix usage of -with-rtsopts (#429) 10b8358 Make Brief the default setting of the --progress-info flag 45da08b Rearrange unix build scripts. (#430) 6942b2d build.cabal.sh: Use cabal new-run (#435) 4b42da3 Fix the list of Hadrian arguments 2f88f30 Restore the original build script relying on the global package database 65bcdcb Don't use `new-build` for pre-2.1 Cabal 4df3e2d Rename Rules.Data to Rules.PackageData 0aa31f9 Make build.sh call the default build script (build.cabal.sh) f68d527 Make build.bat call the default build script on Windows (build.stack.bat) 04cdf78 Switch AppVeyor to use the default build.bat script 9e4a9c1 Fix the call to another script 14c2c27 Fix CI by calling default script via bash 4e7d0f9 Drop quotes 4b60862 Fix CI (#441) 7a85ccf Implement install_docs (#442) 987240f Replace shortcuts to issues by GitHub links f4bbf31 Minor clean up, taking hlint suggestions e04d207 Move Tar builder into the library e6e95fc Move Sphinx builder into the library e0bbd9f Update README.md 3a95faf Update cross-compile.md f846945 Add a note on building documentation c41d1ed Make sure build scripts can be run from outside Hadrian directory 882c4a6 Remove the git clone step, preparing for the merge e25bb01 Finalise documentation build rule (#447) f6a491d Threaded is no longer conditional in the quickest flavour a0ccea6 Add a note on doc/flavours.md 3bac585 Update documentation 4fd94c3 Update stage1Only docs 438dc57 Finalise warnings-related arguments (#448) 5ebb69a Drop GccLtXX flags, require GCC > 4.7 and up (#450) 06ec241 Widen bounds on Cabal (#452) a679764 Fix CI scripts (#454) 94dbe9d Fix ghc-cabal build (#455) 5baa8db Fix AppVeyor cache failure (#456) f15e851 Do not run configure by default (#458) fa3771f hadrian: Disable -Wno-undef in files which include ffi.h (#459) fa95caa Unbreak `cabal new-build` (#466) 9aff81d Fix Windows build 6c5f5c9 Minor clean up of Hadrian dependencies 4971843 Bring mtl dependency back 9dd7ad2 Fix dependencies (#477) e5c7a29 Do not depend on the in-tree filepath library (#478) 8fd6818 Add ways to build hadrian using nix (#473) 4499b29 Follow GHC changes (#479) dc8032e Extend ghcHEAD derivation rather than make a new derivation (#486) 86216e2 Drop -Werror (#487) d2e83f2 Add a free ACM download link for the paper 2609bd0 Fix CI (#489) 7d2368d Drop redundant dependencies on in-tree packages (#491) fdc35b1 Fix broken colours with `-j` (#484) 63a5563 [WIP] Support run GHC's test from hadrian. (#495) 8d6945d Fix Haddock (#496) 1232d26 Drop custom logic for Scav_thr and Evac_thr (#497) fd51234 Fix Hadrian after Cabal changes (#498) c01865f Add support for runtime dependencies 63b9d5f Minor revision 81f180a Add unlit to GHC's runtime dependencies 8ffd5bd Merge pull request #500 from snowleopard/runtime-deps 5029444 Relax Cabal constraint 7805b98 Merge pull request #503 from snowleopard/angerman-patch-1 386cd49 Add iserv library (#504) 2e0e8ae Add --quickjump to Haddock (#505) cc8f62c Move a bunch of types into dedicated modules (#502) 7fa577c Fix ghc-cabal: Parsec modules are now found in libraries/parsec/src (#506) 5edcca7 Undo iserv changes (#507) b6d83c4 Add --configure flag to the script da39729 Make shell.nix less broken (#510) c1706f6 Add troubleshooting section 37bd95f Pin nixpkgs and all-cabal-hashes in shell.nix (#511) 7894c96 Change permission bits for build.cabal.sh, fixes #517 (#520) 764be7e Drop the no longer necessary chmod eda173b Fix Hadrian after Cabal changes 9eef6a7 Merge pull request #521 from snowleopard/drop-chmod f4d12c0 Bump Cabal version 3fa914a Merge pull request #528 from snowleopard/bump-cabal 7a5ee60 Add extra include paths when invoking ghc-cabal (#526) 57d0fca Add 'git' to nativeBuildInputs in shell.nix (#530) 47678ea Add clean routines for fs (#533) 2fcfde2 Add user-defined flavour example for turning off dynamic linking (#535) fe5759b fix end 3a68f11 Use Cabal directly in place of ghc-cabal + make build root configurable (#531) 9a46249 Merge pull request #542 from Mistuke/fix-specific-file 659b18d Fix warnings (#547) 591c425 Fix Circle CI (#553) a8ad5af Unregister stage0 package first if it needs to be cloned (#552) 1579730 Preliminary bindist rule (#555) 8c2817a Revert "Preliminary bindist rule (#555)" (#557) 8219f6a Preliminary bindist (#558) 3465caf Fix boot and configure on AppVeyor (#561) 2683445 Fix Windows build (#563) b6c77f3 Fix Windows build, improve error reporting (#565) 66117c5 Fix copying of fs*.h files during RTS registration (#566) 4e4a023 Undo fs*.h workaround c190ab6 Fix integer-gmp build (#568) 32e26b0 Fix the path to touchy (#572) 05fbe8b Fix missing libHSghc-8.5-0.a (#574) 5b8f442 Fix lint error (#575) 5276bf5 Speed up AppVeyor build d021ffc Generic library rules (#571) 99c262b Fix warning 66bc48c Fix CircleCI 1174b31 Fix path to GHC 9110813 Fix AppVeyor (#577) 64da39c Update README.md (#578) 7c3c45f Link to Quick Start guide fcc62d1 Fix missing symbols when cross-compiling (#583) 7c04521 Update cross-compiling doc (#586) d8190ba Add all the default-on extensions to build.global-db.bat (#587) a161b8e Fix unlit by placing it under lib/bin/ instead of bin/ (#591) 1ee62bf Fix redundant import, minor revision 44368b6 Add checkPpr package and infrastructure for testsuite packages (#596) 85f2506 Add dependency on the new "llvm-passes" file. (#604) d6c4e04 Preliminary nofib rule (#599) 3837187 remove (unnecessary) recursive dependency involving ghcPath (#606) c0292ff Add ghc-heap ec5e9d3 Do not always add -Iincludes to C arguments (#610) 8dba674 Add libiserv, rename iserv-bin to iserv, drop primitive (#612) a63ad32 Update RTS flags (#613) ef4137d Added support for testsuite (#602) ccf6453 Bump Shake version to 0.16.1. (#618) c51b92b Add `gmp` and `ncurses` as nix dependencies (#616) c866660 Minor revision (#619) 0b35e12 Add test compiler option to test (#621) 2358090 Refactor package-specific settings (#622) 1906828 Set more test arguments correctly (#625) 831e1ce Add config file and test speed options to testsuite (#624) f319243 Read the `main-is` field from the cabal file for executables (#627) 48b81a3 Implement build rules for testsuite/timeout (#499) 233a638 Add new featues to binary distribution (#623) d4b9c1f Remove more validation errors (#628) 36c9781 Add includes to bindist (#632) bbdd69b Make Cabal install unconditional in build.cabal.sh (#633) 843790e Fix timeout building rule for Linux (#638) e5773fa Switch to the fixed Cabal branch in CI and add a fix for Natural (#640) 23dc432 Fixes building with stack within recent versions of ghc repo (#646) 165f03e Implement the equivalent of D4955 (#648) 148006a Remove the hack to use a patched Cabal submodule in CI (#650) 4265e3a Bump Cabal upper bound (#651) 2fac053 Fix warnings, improve comments and error handling, minor refactoring (#656) a804d57 Fix package dependencies (#657) 8dc4f73 Clean up remaining bits related to ghc-cabal (#658) e174dca Drop nonCabalContext, since all GHC packages now come with Cabal files 8ec50a5 Fix defaut top level targets (#659) 0059b9f Clean up remaining bits of the install rule (#660) 0106f20 Reorganise GHC packages, get rid of Builder import cycle (#662) ae35b2b Remove dead code a820566 Minor revision 798a716 Simplify Package data type (#663) e5f13b3 Tweak the build root section 90d07d7 Fix documentation rules (#665) 12e6635 Fix build scripts (#668) abf9cbe Build runghc instead of runhaskell (#670) 4819617 Address some issues with the testsuite rules (#672) 3217903 Fix typos 921dbbd Remove unwanted '-O0's in Settings.Packages (#674) 1bbc4b3 Work around the "can't use Natural in base" problem on a per-flavour basis (#676) f8d3f9b Make the test rule depend on ghc-compact, to make this library's tests pass (#677) 06f3206 Update OS X scripts to test a GHC patch for #614 (#678) 9a6f41c Fix clean so it works on Windows (#679) df96f25 Move to GHC 8.4.3 by upgrading the Stackage snapshot (#680) 9bf046f Build more profiling ways by default (#682) 97f9345 Set integer-gmp flag when appropriate (#684) 9609113 Fix a logic error that kept us from building/linking object files for many ways (#687) 407190e Add unlit to testsuitePackages (#688) 6eb9c0c OS X CI scripts: don't use my GHC branch anymore, D5138 has been merged (#690) 835f276 Build touchy and unlit only in Stage0, copy binaries for later stages (#693) 7169ac5 Rework parsing of Cabal metadata (#692) 021e753 Simplify oracles (#694) 996afc7 Pass 'threaded' flag to the GHC executable (#689) 5e432d4 Honour the flavours advertised by the flavours.md document (#691) 051564b update GHC versions used on travis db3dbb6 Merge pull request #700 from snowleopard/alp/ghc-versions-ci c8bab28 Bump QuickCheck bound 45f3bff Fix warnings, improve documentation 2146994 testsuite: Mark T15349 as broken in the ghci way 575b35f Remove Hadrian submodule 9475620 Add 'hadrian/' from commit '45f3bff7016a2a0cd9a5455a882ced984655e90b' d65cbd6 Bump hsc2hs submodule From git at git.haskell.org Wed Oct 24 08:47:08 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 24 Oct 2018 08:47:08 +0000 (UTC) Subject: [commit: ghc] wip/t-12758_circleci_push_perf_notes: - (8265eb4) Message-ID: <20181024084708.5B1303ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/t-12758_circleci_push_perf_notes Link : http://ghc.haskell.org/trac/ghc/changeset/8265eb4a104669c9bd6b3d9ef7b7854488e6c241/ghc >--------------------------------------------------------------- commit 8265eb4a104669c9bd6b3d9ef7b7854488e6c241 Author: David Eichmann Date: Mon Oct 22 15:37:29 2018 +0100 - >--------------------------------------------------------------- 8265eb4a104669c9bd6b3d9ef7b7854488e6c241 .circleci/config.yml | 61 +++++++++-------------------------- .circleci/push-test-metrics.sh | 46 ++++++++++++++++++++++++++ testsuite/driver/perf_notes.py | 16 +++++---- testsuite/driver/runtests.py | 10 +++++- testsuite/driver/testglobals.py | 3 ++ testsuite/mk/test.mk | 4 +++ testsuite/tests/perf/should_run/all.T | 5 +-- 7 files changed, 88 insertions(+), 57 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 8265eb4a104669c9bd6b3d9ef7b7854488e6c241 From git at git.haskell.org Wed Oct 24 08:49:13 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 24 Oct 2018 08:49:13 +0000 (UTC) Subject: [commit: ghc] wip/t-12758_circleci_push_perf_notes: - (86651c1) Message-ID: <20181024084913.3717A3ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/t-12758_circleci_push_perf_notes Link : http://ghc.haskell.org/trac/ghc/changeset/86651c18e42c889a3bfaf473261fabfeed8647db/ghc >--------------------------------------------------------------- commit 86651c18e42c889a3bfaf473261fabfeed8647db Author: David Eichmann Date: Mon Oct 22 15:37:29 2018 +0100 - >--------------------------------------------------------------- 86651c18e42c889a3bfaf473261fabfeed8647db .circleci/config.yml | 61 +++++++++-------------------------- .circleci/push-test-metrics.sh | 46 ++++++++++++++++++++++++++ testsuite/driver/perf_notes.py | 16 +++++---- testsuite/driver/runtests.py | 10 +++++- testsuite/driver/testglobals.py | 3 ++ testsuite/mk/test.mk | 4 +++ testsuite/tests/perf/should_run/all.T | 5 +-- 7 files changed, 88 insertions(+), 57 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 86651c18e42c889a3bfaf473261fabfeed8647db From git at git.haskell.org Wed Oct 24 12:19:47 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 24 Oct 2018 12:19:47 +0000 (UTC) Subject: [commit: ghc] master: Trigger multiline mode in GHCi on '\case' (#13087) (eaf1593) Message-ID: <20181024121947.DE9F13ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/eaf159340cfa948c16fa212ff1bf5aec6134a694/ghc >--------------------------------------------------------------- commit eaf159340cfa948c16fa212ff1bf5aec6134a694 Author: Alec Theriault Date: Wed Oct 24 07:02:08 2018 -0400 Trigger multiline mode in GHCi on '\case' (#13087) Summary: In ALR, 'ITlcase' should expect an opening curly. This is probably a forgotten edge case in ALR, since `maybe_layout` (which handles the non-ALR layout) already deals with the 'ITlcase' token properly. Test Plan: make TEST=T10453 && make TEST=T13087 Reviewers: bgamari, RyanGlScott Reviewed By: RyanGlScott Subscribers: RyanGlScott, rwbarton, carter GHC Trac Issues: #10453, #13087 Differential Revision: https://phabricator.haskell.org/D5236 >--------------------------------------------------------------- eaf159340cfa948c16fa212ff1bf5aec6134a694 compiler/parser/Lexer.x | 1 + testsuite/tests/ghci/scripts/T10453.script | 16 ++++++++++++++++ testsuite/tests/ghci/scripts/T10453.stdout | 4 ++++ testsuite/tests/ghci/scripts/all.T | 1 + testsuite/tests/parser/should_compile/T13087.hs | 8 ++++++++ testsuite/tests/parser/should_compile/all.T | 1 + 6 files changed, 31 insertions(+) diff --git a/compiler/parser/Lexer.x b/compiler/parser/Lexer.x index f820007..f99a344 100644 --- a/compiler/parser/Lexer.x +++ b/compiler/parser/Lexer.x @@ -2673,6 +2673,7 @@ lexTokenAlr = do mPending <- popPendingImplicitToken ITwhere -> setAlrExpectingOCurly (Just ALRLayoutWhere) ITlet -> setAlrExpectingOCurly (Just ALRLayoutLet) ITof -> setAlrExpectingOCurly (Just ALRLayoutOf) + ITlcase -> setAlrExpectingOCurly (Just ALRLayoutOf) ITdo -> setAlrExpectingOCurly (Just ALRLayoutDo) ITmdo -> setAlrExpectingOCurly (Just ALRLayoutDo) ITrec -> setAlrExpectingOCurly (Just ALRLayoutDo) diff --git a/testsuite/tests/ghci/scripts/T10453.script b/testsuite/tests/ghci/scripts/T10453.script new file mode 100644 index 0000000..7ab916a --- /dev/null +++ b/testsuite/tests/ghci/scripts/T10453.script @@ -0,0 +1,16 @@ +:set +m +:set -XLambdaCase + +foo1 x = case x of + 1 -> "one" + _ -> "not one" + +foo1 0 +foo1 1 + +foo2 = \case + 1 -> "one" + _ -> "not one" + +foo2 0 +foo2 1 diff --git a/testsuite/tests/ghci/scripts/T10453.stdout b/testsuite/tests/ghci/scripts/T10453.stdout new file mode 100644 index 0000000..55be53d --- /dev/null +++ b/testsuite/tests/ghci/scripts/T10453.stdout @@ -0,0 +1,4 @@ +"not one" +"one" +"not one" +"one" diff --git a/testsuite/tests/ghci/scripts/all.T b/testsuite/tests/ghci/scripts/all.T index 67c4b38..bb3be80 100755 --- a/testsuite/tests/ghci/scripts/all.T +++ b/testsuite/tests/ghci/scripts/all.T @@ -224,6 +224,7 @@ test('T10248', normal, ghci_script, ['T10248.script']) test('T10110', normal, ghci_script, ['T10110.script']) test('T10322', normal, ghci_script, ['T10322.script']) test('T10439', normal, ghci_script, ['T10439.script']) +test('T10453', normal, ghci_script, ['T10453.script']) test('T10466', normal, ghci_script, ['T10466.script']) test('T10501', normal, ghci_script, ['T10501.script']) test('T10508', normal, ghci_script, ['T10508.script']) diff --git a/testsuite/tests/parser/should_compile/T13087.hs b/testsuite/tests/parser/should_compile/T13087.hs new file mode 100644 index 0000000..8e83028 --- /dev/null +++ b/testsuite/tests/parser/should_compile/T13087.hs @@ -0,0 +1,8 @@ +{-# LANGUAGE AlternativeLayoutRule #-} +{-# LANGUAGE LambdaCase #-} + +isOne :: Int -> Bool +isOne = \case 1 -> True + _ -> False + +main = return () diff --git a/testsuite/tests/parser/should_compile/all.T b/testsuite/tests/parser/should_compile/all.T index 842bef0..7b1142c 100644 --- a/testsuite/tests/parser/should_compile/all.T +++ b/testsuite/tests/parser/should_compile/all.T @@ -113,6 +113,7 @@ test('T11622', normal, compile, ['']) test('DumpParsedAst', normal, compile, ['-dsuppress-uniques -ddump-parsed-ast']) test('DumpRenamedAst', normal, compile, ['-dsuppress-uniques -ddump-rn-ast']) test('DumpTypecheckedAst', normal, compile, ['-dsuppress-uniques -ddump-tc-ast']) +test('T13087', normal, compile, ['']) test('T13747', normal, compile, ['']) test('T14189', normal, compile, ['-dsuppress-uniques -ddump-rn-ast']) test('T13986', normal, compile, ['']) From git at git.haskell.org Wed Oct 24 12:19:51 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 24 Oct 2018 12:19:51 +0000 (UTC) Subject: [commit: ghc] master: Fix #15781 by using ktypedocs on type synonym RHSes (79c641d) Message-ID: <20181024121951.5A39E3ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/79c641de60f1d6aa6f724d4fc49137ccbe3ab008/ghc >--------------------------------------------------------------- commit 79c641de60f1d6aa6f724d4fc49137ccbe3ab008 Author: Ryan Scott Date: Wed Oct 24 07:02:30 2018 -0400 Fix #15781 by using ktypedocs on type synonym RHSes Summary: This is a follow-up to D5173, which permitted unparenthesized kind signatures in certain places. One place that appeared to be overlooked was the right-hand sides of type synonyms, which this patch addresses by introducing a `ktypedoc` parser production (which is to `ctypdoc` as `ktype` is to `ctype`) and using it in the right place. Test Plan: make test TEST="KindSigs T15781" Reviewers: harpocrates, bgamari Reviewed By: harpocrates Subscribers: rwbarton, mpickering, carter GHC Trac Issues: #15781 Differential Revision: https://phabricator.haskell.org/D5245 >--------------------------------------------------------------- 79c641de60f1d6aa6f724d4fc49137ccbe3ab008 compiler/parser/Parser.y | 11 ++-- testsuite/tests/parser/should_compile/KindSigs.hs | 3 ++ .../tests/parser/should_compile/KindSigs.stderr | 63 ++++++++++++++++------ testsuite/tests/parser/should_compile/T15781.hs | 6 +++ testsuite/tests/parser/should_compile/all.T | 1 + 5 files changed, 65 insertions(+), 19 deletions(-) diff --git a/compiler/parser/Parser.y b/compiler/parser/Parser.y index d7aef8d..9f43e36 100644 --- a/compiler/parser/Parser.y +++ b/compiler/parser/Parser.y @@ -1059,8 +1059,8 @@ cl_decl :: { LTyClDecl GhcPs } -- ty_decl :: { LTyClDecl GhcPs } -- ordinary type synonyms - : 'type' type '=' ctypedoc - -- Note ctype, not sigtype, on the right of '=' + : 'type' type '=' ktypedoc + -- Note ktypedoc, not sigtype, on the right of '=' -- We allow an explicit for-all but we don't insert one -- in type Foo a = (b,b) -- Instead we just say b is out of scope @@ -1776,12 +1776,17 @@ unpackedness :: { Located ([AddAnn], SourceText, SrcUnpackedness) } : '{-# UNPACK' '#-}' { sLL $1 $> ([mo $1, mc $2], getUNPACK_PRAGs $1, SrcUnpack) } | '{-# NOUNPACK' '#-}' { sLL $1 $> ([mo $1, mc $2], getNOUNPACK_PRAGs $1, SrcNoUnpack) } --- A ktype is a ctype, possibly with a kind annotation +-- A ktype/ktypedoc is a ctype/ctypedoc, possibly with a kind annotation ktype :: { LHsType GhcPs } : ctype { $1 } | ctype '::' kind {% ams (sLL $1 $> $ HsKindSig noExt $1 $3) [mu AnnDcolon $2] } +ktypedoc :: { LHsType GhcPs } + : ctypedoc { $1 } + | ctypedoc '::' kind {% ams (sLL $1 $> $ HsKindSig noExt $1 $3) + [mu AnnDcolon $2] } + -- A ctype is a for-all type ctype :: { LHsType GhcPs } : 'forall' tv_bndrs '.' ctype {% hintExplicitForall (getLoc $1) >> diff --git a/testsuite/tests/parser/should_compile/KindSigs.hs b/testsuite/tests/parser/should_compile/KindSigs.hs index aafe1a1..75213ab 100644 --- a/testsuite/tests/parser/should_compile/KindSigs.hs +++ b/testsuite/tests/parser/should_compile/KindSigs.hs @@ -27,6 +27,9 @@ type Quux = '[ True :: Bool ] type Quux' = [ True :: Bool, False :: Bool ] type Quuux b = '( [Int, Bool] :: [Type], b ) +-- Kind annotation on the RHS of a type synonym +type Sarsaparilla = Int :: Type + -- Note that 'true :: Bool :: Type' won't parse - you need some parens true :: (Bool :: Type) true = True diff --git a/testsuite/tests/parser/should_compile/KindSigs.stderr b/testsuite/tests/parser/should_compile/KindSigs.stderr index 10dbd0d..4aee57d 100644 --- a/testsuite/tests/parser/should_compile/KindSigs.stderr +++ b/testsuite/tests/parser/should_compile/KindSigs.stderr @@ -502,54 +502,83 @@ ({ KindSigs.hs:28:42 } (Unqual {OccName: b}))))]))))) - ,({ KindSigs.hs:31:1-22 } + ,({ KindSigs.hs:31:1-31 } + (TyClD + (NoExt) + (SynDecl + (NoExt) + ({ KindSigs.hs:31:6-17 } + (Unqual + {OccName: Sarsaparilla})) + (HsQTvs + (NoExt) + []) + (Prefix) + ({ KindSigs.hs:31:21-31 } + (HsKindSig + (NoExt) + ({ KindSigs.hs:31:21-23 } + (HsTyVar + (NoExt) + (NotPromoted) + ({ KindSigs.hs:31:21-23 } + (Unqual + {OccName: Int})))) + ({ KindSigs.hs:31:28-31 } + (HsTyVar + (NoExt) + (NotPromoted) + ({ KindSigs.hs:31:28-31 } + (Unqual + {OccName: Type}))))))))) + ,({ KindSigs.hs:34:1-22 } (SigD (NoExt) (TypeSig (NoExt) - [({ KindSigs.hs:31:1-4 } + [({ KindSigs.hs:34:1-4 } (Unqual {OccName: true}))] (HsWC (NoExt) (HsIB (NoExt) - ({ KindSigs.hs:31:9-22 } + ({ KindSigs.hs:34:9-22 } (HsParTy (NoExt) - ({ KindSigs.hs:31:10-21 } + ({ KindSigs.hs:34:10-21 } (HsKindSig (NoExt) - ({ KindSigs.hs:31:10-13 } + ({ KindSigs.hs:34:10-13 } (HsTyVar (NoExt) (NotPromoted) - ({ KindSigs.hs:31:10-13 } + ({ KindSigs.hs:34:10-13 } (Unqual {OccName: Bool})))) - ({ KindSigs.hs:31:18-21 } + ({ KindSigs.hs:34:18-21 } (HsTyVar (NoExt) (NotPromoted) - ({ KindSigs.hs:31:18-21 } + ({ KindSigs.hs:34:18-21 } (Unqual {OccName: Type}))))))))))))) - ,({ KindSigs.hs:32:1-11 } + ,({ KindSigs.hs:35:1-11 } (ValD (NoExt) (FunBind (NoExt) - ({ KindSigs.hs:32:1-4 } + ({ KindSigs.hs:35:1-4 } (Unqual {OccName: true})) (MG (NoExt) - ({ KindSigs.hs:32:1-11 } - [({ KindSigs.hs:32:1-11 } + ({ KindSigs.hs:35:1-11 } + [({ KindSigs.hs:35:1-11 } (Match (NoExt) (FunRhs - ({ KindSigs.hs:32:1-4 } + ({ KindSigs.hs:35:1-4 } (Unqual {OccName: true})) (Prefix) @@ -557,14 +586,14 @@ [] (GRHSs (NoExt) - [({ KindSigs.hs:32:6-11 } + [({ KindSigs.hs:35:6-11 } (GRHS (NoExt) [] - ({ KindSigs.hs:32:8-11 } + ({ KindSigs.hs:35:8-11 } (HsVar (NoExt) - ({ KindSigs.hs:32:8-11 } + ({ KindSigs.hs:35:8-11 } (Unqual {OccName: True}))))))] ({ } @@ -575,3 +604,5 @@ [])))] (Nothing) (Nothing))) + + diff --git a/testsuite/tests/parser/should_compile/T15781.hs b/testsuite/tests/parser/should_compile/T15781.hs new file mode 100644 index 0000000..c20df73 --- /dev/null +++ b/testsuite/tests/parser/should_compile/T15781.hs @@ -0,0 +1,6 @@ +{-# LANGUAGE KindSignatures #-} +module T15781 where + +import Data.Kind + +type F = Int :: Type diff --git a/testsuite/tests/parser/should_compile/all.T b/testsuite/tests/parser/should_compile/all.T index 7b1142c..a85b09c 100644 --- a/testsuite/tests/parser/should_compile/all.T +++ b/testsuite/tests/parser/should_compile/all.T @@ -139,3 +139,4 @@ def only_MG_loc(x): test('T15279', normalise_errmsg_fun(only_MG_loc), compile, ['']) test('T15457', normal, compile, ['']) test('T15675', normal, compile, ['']) +test('T15781', normal, compile, ['']) From git at git.haskell.org Wed Oct 24 12:19:54 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 24 Oct 2018 12:19:54 +0000 (UTC) Subject: [commit: ghc] master: Keep top-level names in typed TH quotes alive (bb835c9) Message-ID: <20181024121954.C93383ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/bb835c96c3d962c2e08d23f6fb900665c89953b4/ghc >--------------------------------------------------------------- commit bb835c96c3d962c2e08d23f6fb900665c89953b4 Author: Ryan Scott Date: Wed Oct 24 07:02:59 2018 -0400 Keep top-level names in typed TH quotes alive Summary: When renaming untyped TH quotes, some care is taken to ensure that uses of top-level names in quotes do not have their bindings discarded during desugaring. The same care was not applied to typed TH quotes, so this patch brings the two into sync. Test Plan: make test TEST=T15783 Reviewers: bgamari, mpickering Reviewed By: mpickering Subscribers: mpickering, rwbarton, carter GHC Trac Issues: #15783 Differential Revision: https://phabricator.haskell.org/D5248 >--------------------------------------------------------------- bb835c96c3d962c2e08d23f6fb900665c89953b4 compiler/typecheck/TcExpr.hs | 21 ++++++++++++++------- testsuite/tests/th/T15783A.hs | 6 ++++++ testsuite/tests/th/T15783B.hs | 6 ++++++ testsuite/tests/th/all.T | 2 ++ 4 files changed, 28 insertions(+), 7 deletions(-) diff --git a/compiler/typecheck/TcExpr.hs b/compiler/typecheck/TcExpr.hs index bb9279e..17678a5 100644 --- a/compiler/typecheck/TcExpr.hs +++ b/compiler/typecheck/TcExpr.hs @@ -1998,14 +1998,13 @@ checkThLocalId id ; case mb_local_use of Just (top_lvl, bind_lvl, use_stage) | thLevel use_stage > bind_lvl - , isNotTopLevel top_lvl - -> checkCrossStageLifting id use_stage + -> checkCrossStageLifting top_lvl id use_stage _ -> return () -- Not a locally-bound thing, or -- no cross-stage link } -------------------------------------- -checkCrossStageLifting :: Id -> ThStage -> TcM () +checkCrossStageLifting :: TopLevelFlag -> Id -> ThStage -> TcM () -- If we are inside typed brackets, and (use_lvl > bind_lvl) -- we must check whether there's a cross-stage lift to do -- Examples \x -> [|| x ||] @@ -2015,7 +2014,12 @@ checkCrossStageLifting :: Id -> ThStage -> TcM () -- This is similar to checkCrossStageLifting in RnSplice, but -- this code is applied to *typed* brackets. -checkCrossStageLifting id (Brack _ (TcPending ps_var lie_var)) +checkCrossStageLifting top_lvl id (Brack _ (TcPending ps_var lie_var)) + | isTopLevel top_lvl + = when (isExternalName id_name) (keepAlive id_name) + -- See Note [Keeping things alive for Template Haskell] in RnSplice + + | otherwise = -- Nested identifiers, such as 'x' in -- E.g. \x -> [|| h x ||] -- We must behave as if the reference to x was @@ -2040,17 +2044,20 @@ checkCrossStageLifting id (Brack _ (TcPending ps_var lie_var)) else setConstraintVar lie_var $ -- Put the 'lift' constraint into the right LIE - newMethodFromName (OccurrenceOf (idName id)) + newMethodFromName (OccurrenceOf id_name) THNames.liftName id_ty -- Update the pending splices ; ps <- readMutVar ps_var - ; let pending_splice = PendingTcSplice (idName id) (nlHsApp (noLoc lift) (nlHsVar id)) + ; let pending_splice = PendingTcSplice id_name + (nlHsApp (noLoc lift) (nlHsVar id)) ; writeMutVar ps_var (pending_splice : ps) ; return () } + where + id_name = idName id -checkCrossStageLifting _ _ = return () +checkCrossStageLifting _ _ _ = return () polySpliceErr :: Id -> SDoc polySpliceErr id diff --git a/testsuite/tests/th/T15783A.hs b/testsuite/tests/th/T15783A.hs new file mode 100644 index 0000000..591a975 --- /dev/null +++ b/testsuite/tests/th/T15783A.hs @@ -0,0 +1,6 @@ +{-# LANGUAGE TemplateHaskell #-} +module T15783A where + +import T15783B + +main = $$f diff --git a/testsuite/tests/th/T15783B.hs b/testsuite/tests/th/T15783B.hs new file mode 100644 index 0000000..818f57d --- /dev/null +++ b/testsuite/tests/th/T15783B.hs @@ -0,0 +1,6 @@ +{-# LANGUAGE TemplateHaskell #-} +module T15783B(f) where + +d = 0 + +f = [|| d ||] diff --git a/testsuite/tests/th/all.T b/testsuite/tests/th/all.T index df114b5..d10523c 100644 --- a/testsuite/tests/th/all.T +++ b/testsuite/tests/th/all.T @@ -439,3 +439,5 @@ test('TH_recursiveDo', normal, compile_and_run, ['-v0 -dsuppress-uniques']) test('T15481', normal, compile, ['-v0 -ddump-splices -dsuppress-uniques']) test('TH_recover_warns', normal, compile, ['-v0 -ddump-splices -dsuppress-uniques']) test('T15738', normal, compile, ['-v0 -ddump-splices -dsuppress-uniques']) +test('T15783', normal, multimod_compile, + ['T15783A', '-v0 ' + config.ghc_th_way_flags]) From git at git.haskell.org Wed Oct 24 12:19:58 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 24 Oct 2018 12:19:58 +0000 (UTC) Subject: [commit: ghc] master: Fix #15792 by not reifying invisible arguments in AppTys (bfd93f9) Message-ID: <20181024121958.AEAF33ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/bfd93f90b6c63edf2790356e95feddf9898ec888/ghc >--------------------------------------------------------------- commit bfd93f90b6c63edf2790356e95feddf9898ec888 Author: Ryan Scott Date: Wed Oct 24 07:03:40 2018 -0400 Fix #15792 by not reifying invisible arguments in AppTys Summary: The `reifyType` function in `TcSplice` is carefully designed to avoid reifying visible arguments to `TyConApp`s. However, the same care was not given towards the `AppTy` case, which lead to #15792. This patch changes to the `AppTy` case of `reifyType` so that it consults the kind of the function type to determine which of the argument types are invisible (and therefore should be dropped) during reification. This required crafting a variant of `tyConArgFlags`, which I dubbed `appTyArgFlags`, that accept an arbitrary function `Type` instead of a `TyCon`. Test Plan: make test TEST=T15792 Reviewers: goldfire, bgamari, simonpj Reviewed By: simonpj Subscribers: simonpj, rwbarton, carter GHC Trac Issues: #15792 Differential Revision: https://phabricator.haskell.org/D5252 >--------------------------------------------------------------- bfd93f90b6c63edf2790356e95feddf9898ec888 compiler/typecheck/TcSplice.hs | 18 +++++++++++++++++- compiler/types/Type.hs | 29 +++++++++++++++++++++++++---- testsuite/tests/th/T15792.hs | 16 ++++++++++++++++ testsuite/tests/th/T15792.stderr | 2 ++ testsuite/tests/th/all.T | 1 + 5 files changed, 61 insertions(+), 5 deletions(-) diff --git a/compiler/typecheck/TcSplice.hs b/compiler/typecheck/TcSplice.hs index 8f05225..c5886d3 100644 --- a/compiler/typecheck/TcSplice.hs +++ b/compiler/typecheck/TcSplice.hs @@ -1743,7 +1743,23 @@ reifyType ty@(ForAllTy {}) = reify_for_all ty reifyType (LitTy t) = do { r <- reifyTyLit t; return (TH.LitT r) } reifyType (TyVarTy tv) = return (TH.VarT (reifyName tv)) reifyType (TyConApp tc tys) = reify_tc_app tc tys -- Do not expand type synonyms here -reifyType (AppTy t1 t2) = do { [r1,r2] <- reifyTypes [t1,t2] ; return (r1 `TH.AppT` r2) } +reifyType ty@(AppTy {}) = do + let (ty_head, ty_args) = splitAppTys ty + ty_head' <- reifyType ty_head + ty_args' <- reifyTypes (filter_out_invisible_args ty_head ty_args) + pure $ mkThAppTs ty_head' ty_args' + where + -- Make sure to filter out any invisible arguments. For instance, if you + -- reify the following: + -- + -- newtype T (f :: forall a. a -> Type) = MkT (f Bool) + -- + -- Then you should receive back `f Bool`, not `f Type Bool`, since the + -- `Type` argument is invisible (#15792). + filter_out_invisible_args :: Type -> [Type] -> [Type] + filter_out_invisible_args ty_head ty_args = + filterByList (map isVisibleArgFlag $ appTyArgFlags ty_head ty_args) + ty_args reifyType ty@(FunTy t1 t2) | isPredTy t1 = reify_for_all ty -- Types like ((?x::Int) => Char -> Char) | otherwise = do { [r1,r2] <- reifyTypes [t1,t2] ; return (TH.ArrowT `TH.AppT` r1 `TH.AppT` r2) } diff --git a/compiler/types/Type.hs b/compiler/types/Type.hs index 9012815..1846525 100644 --- a/compiler/types/Type.hs +++ b/compiler/types/Type.hs @@ -63,7 +63,8 @@ module Type ( stripCoercionTy, splitCoercionType_maybe, splitPiTysInvisible, filterOutInvisibleTypes, filterOutInferredTypes, - partitionInvisibleTypes, partitionInvisibles, tyConArgFlags, + partitionInvisibleTypes, partitionInvisibles, + tyConArgFlags, appTyArgFlags, synTyConResKind, modifyJoinResTy, setJoinResTy, @@ -1573,8 +1574,9 @@ partitionInvisibles = partitionWith pick_invis pick_invis (thing, vis) | isInvisibleArgFlag vis = Left thing | otherwise = Right thing --- | Given a 'TyCon' and a list of argument types, determine each argument's --- visibility ('Inferred', 'Specified', or 'Required'). +-- | Given a 'TyCon' and a list of argument types to which the 'TyCon' is +-- applied, determine each argument's visibility +-- ('Inferred', 'Specified', or 'Required'). -- -- Wrinkle: consider the following scenario: -- @@ -1588,7 +1590,26 @@ partitionInvisibles = partitionWith pick_invis -- Thus, the first argument is invisible, @S@ is visible, @R@ is invisible again, -- and @Q@ is visible. tyConArgFlags :: TyCon -> [Type] -> [ArgFlag] -tyConArgFlags tc = go emptyTCvSubst (tyConKind tc) +tyConArgFlags tc = fun_kind_arg_flags (tyConKind tc) + +-- | Given a 'Type' and a list of argument types to which the 'Type' is +-- applied, determine each argument's visibility +-- ('Inferred', 'Specified', or 'Required'). +-- +-- Most of the time, the arguments will be 'Required', but not always. Consider +-- @f :: forall a. a -> Type at . In @f Type Bool@, the first argument (@Type@) is +-- 'Specified' and the second argument (@Bool@) is 'Required'. It is precisely +-- this sort of higher-rank situation in which 'appTyArgFlags' comes in handy, +-- since @f Type Bool@ would be represented in Core using 'AppTy's. +-- (See also Trac #15792). +appTyArgFlags :: Type -> [Type] -> [ArgFlag] +appTyArgFlags ty = fun_kind_arg_flags (typeKind ty) + +-- | Given a function kind and a list of argument types (where each argument's +-- kind aligns with the corresponding position in the argument kind), determine +-- each argument's visibility ('Inferred', 'Specified', or 'Required'). +fun_kind_arg_flags :: Kind -> [Type] -> [ArgFlag] +fun_kind_arg_flags = go emptyTCvSubst where go _ _ [] = [] go subst (ForAllTy (Bndr tv argf) res_ki) (arg_ty:arg_tys) diff --git a/testsuite/tests/th/T15792.hs b/testsuite/tests/th/T15792.hs new file mode 100644 index 0000000..2567fb5 --- /dev/null +++ b/testsuite/tests/th/T15792.hs @@ -0,0 +1,16 @@ +{-# LANGUAGE PolyKinds #-} +{-# LANGUAGE RankNTypes #-} +{-# LANGUAGE TemplateHaskell #-} +module T15792 where + +import Data.Kind +import Language.Haskell.TH hiding (Type) +import System.IO + +newtype T (f :: forall a. a -> Type) = MkT (f Bool) + +$(pure []) + +$(do info <- reify ''T + runIO $ hPutStrLn stderr $ pprint info + pure []) diff --git a/testsuite/tests/th/T15792.stderr b/testsuite/tests/th/T15792.stderr new file mode 100644 index 0000000..c13f7ba --- /dev/null +++ b/testsuite/tests/th/T15792.stderr @@ -0,0 +1,2 @@ +newtype T15792.T (f_0 :: forall (a_1 :: *) . a_1 -> *) + = T15792.MkT (f_0 GHC.Types.Bool) diff --git a/testsuite/tests/th/all.T b/testsuite/tests/th/all.T index d10523c..75ec5db 100644 --- a/testsuite/tests/th/all.T +++ b/testsuite/tests/th/all.T @@ -441,3 +441,4 @@ test('TH_recover_warns', normal, compile, ['-v0 -ddump-splices -dsuppress-unique test('T15738', normal, compile, ['-v0 -ddump-splices -dsuppress-uniques']) test('T15783', normal, multimod_compile, ['T15783A', '-v0 ' + config.ghc_th_way_flags]) +test('T15792', normal, compile, ['-v0 -dsuppress-uniques']) From git at git.haskell.org Wed Oct 24 15:39:33 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 24 Oct 2018 15:39:33 +0000 (UTC) Subject: [commit: ghc] master: Refactor the treatment of predicate types (0faf7fd) Message-ID: <20181024153933.4D4DB3ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/0faf7fd3e6c652575af9993787f07cad86f452f6/ghc >--------------------------------------------------------------- commit 0faf7fd3e6c652575af9993787f07cad86f452f6 Author: Simon Peyton Jones Date: Tue Oct 16 12:38:16 2018 +0100 Refactor the treatment of predicate types Trac #15648 showed that GHC was a bit confused about the difference between the types for * Predicates * Coercions * Evidence (in the typechecker constraint solver) This patch cleans it up. See especially Type.hs Note [Types for coercions, predicates, and evidence] Particular changes * Coercion types (a ~# b) and (a ~#R b) are not predicate types (so isPredTy reports False for them) and are not implicitly instantiated by the type checker. This is a real change, but it consistently reflects that fact that (~#) and (~R#) really are different from predicates. * isCoercionType is renamed to isCoVarType * During type inference, simplifyInfer, we do /not/ want to infer a constraint (a ~# b), because that is no longer a predicate type. So we 'lift' it to (a ~ b). See TcType Note [Lift equality constaints when quantifying] * During type inference for pattern synonyms, we need to 'lift' provided constraints of type (a ~# b) to (a ~ b). See Note [Equality evidence in pattern synonyms] in PatSyn * But what about (forall a. Eq a => a ~# b)? Is that a predicate type? No -- it does not have kind Constraint. Is it an evidence type? Perhaps, but awkwardly so. In the end I decided NOT to make it an evidence type, and to ensure the the type inference engine never meets it. This made me /simplify/ the code in TcCanonical.makeSuperClasses; see TcCanonical Note [Equality superclasses in quantified constraints] Instead I moved the special treatment for primitive equality to TcInteract.doTopReactOther. See TcInteract Note [Looking up primitive equalities in quantified constraints] Also see Note [Evidence for quantified constraints] in Type. All this means I can have isEvVarType ty = isCoVarType ty || isPredTy ty which is nice. All in all, rather a lot of work for a small refactoring, but I think it's a real improvement. >--------------------------------------------------------------- 0faf7fd3e6c652575af9993787f07cad86f452f6 compiler/basicTypes/Id.hs | 18 ++--- compiler/coreSyn/CoreLint.hs | 4 +- compiler/coreSyn/CoreOpt.hs | 2 +- compiler/coreSyn/CoreUtils.hs | 2 +- compiler/deSugar/DsBinds.hs | 6 +- compiler/typecheck/ClsInst.hs | 7 +- compiler/typecheck/TcCanonical.hs | 56 ++++++-------- compiler/typecheck/TcErrors.hs | 4 +- compiler/typecheck/TcEvidence.hs | 6 +- compiler/typecheck/TcInteract.hs | 44 ++++++++++- compiler/typecheck/TcPatSyn.hs | 60 ++++++++++++++- compiler/typecheck/TcType.hs | 89 +++++++++++++++------- compiler/types/TyCoRep.hs | 13 +--- compiler/types/Type.hs | 79 ++++++++++++++++--- .../partial-sigs/should_compile/T15039c.stderr | 4 +- .../partial-sigs/should_compile/T15039d.stderr | 5 +- .../tests/typecheck/should_fail/T13320.stderr | 3 +- 17 files changed, 282 insertions(+), 120 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 0faf7fd3e6c652575af9993787f07cad86f452f6 From git at git.haskell.org Wed Oct 24 15:39:36 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 24 Oct 2018 15:39:36 +0000 (UTC) Subject: [commit: ghc] master: Wibble report a wanted (ecfe38e) Message-ID: <20181024153936.4CA563ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/ecfe38ef622a73a88caf9857d1752bd2d7541361/ghc >--------------------------------------------------------------- commit ecfe38ef622a73a88caf9857d1752bd2d7541361 Author: Simon Peyton Jones Date: Tue Oct 23 09:10:21 2018 +0100 Wibble report a wanted >--------------------------------------------------------------- ecfe38ef622a73a88caf9857d1752bd2d7541361 compiler/typecheck/TcRnTypes.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/compiler/typecheck/TcRnTypes.hs b/compiler/typecheck/TcRnTypes.hs index 8119be5..131e57b 100644 --- a/compiler/typecheck/TcRnTypes.hs +++ b/compiler/typecheck/TcRnTypes.hs @@ -2412,9 +2412,12 @@ insolubleWC (WC { wc_impl = implics, wc_simple = simples }) insolubleCt :: Ct -> Bool -- Definitely insoluble, in particular /excluding/ type-hole constraints +-- Namely: a) an equality constraint +-- b) that is insoluble +-- c) and does not arise from a Given insolubleCt ct - | not (insolubleEqCt ct) = False | isHoleCt ct = isOutOfScopeCt ct -- See Note [Insoluble holes] + | not (insolubleEqCt ct) = False | arisesFromGivens ct = False -- See Note [Given insolubles] | otherwise = True From git at git.haskell.org Wed Oct 24 15:39:39 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 24 Oct 2018 15:39:39 +0000 (UTC) Subject: [commit: ghc] master: Remove unnecessary free-var-set deletion (9aaa897) Message-ID: <20181024153939.4E0E33ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/9aaa8971de7e8438ec0854d198f22385e1687076/ghc >--------------------------------------------------------------- commit 9aaa8971de7e8438ec0854d198f22385e1687076 Author: Simon Peyton Jones Date: Tue Oct 23 09:10:50 2018 +0100 Remove unnecessary free-var-set deletion In TcSimplify.neededEvVars, in add_implic_seeds we were deleting the 'givens'; but they are already deleted, so this is a no-op. This patch just remove the redundant delete. >--------------------------------------------------------------- 9aaa8971de7e8438ec0854d198f22385e1687076 compiler/typecheck/TcEvidence.hs | 15 +++++++-------- compiler/typecheck/TcSMonad.hs | 4 ++-- compiler/typecheck/TcSimplify.hs | 4 ++-- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/compiler/typecheck/TcEvidence.hs b/compiler/typecheck/TcEvidence.hs index fa19089..1d6098d 100644 --- a/compiler/typecheck/TcEvidence.hs +++ b/compiler/typecheck/TcEvidence.hs @@ -399,19 +399,16 @@ data EvBindsVar -- Some Given, some Wanted ebv_tcvs :: IORef CoVarSet - -- The free coercion vars of the (rhss of) the coercion bindings - -- All of these are Wanted - -- - -- Coercions don't actually have bindings - -- because we plug them in-place (via a mutable - -- variable); but we keep their free variables - -- so that we can report unused given constraints + -- The free Given coercion vars needed by Wanted coercions that + -- are solved by filling in their HoleDest in-place. Since they + -- don't appear in ebv_binds, we keep track of their free + -- variables so that we can report unused given constraints -- See Note [Tracking redundant constraints] in TcSimplify } | CoEvBindsVar { -- See Note [Coercion evidence only] - -- See above for comments on ebv_uniq, evb_tcvs + -- See above for comments on ebv_uniq, ebv_tcvs ebv_uniq :: Unique, ebv_tcvs :: IORef CoVarSet } @@ -834,6 +831,8 @@ evTermCoercion tm = case evTermCoercion_maybe tm of ********************************************************************* -} findNeededEvVars :: EvBindMap -> VarSet -> VarSet +-- Find all the Given evidence needed by seeds, +-- looking transitively through binds findNeededEvVars ev_binds seeds = transCloVarSet also_needs seeds where diff --git a/compiler/typecheck/TcSMonad.hs b/compiler/typecheck/TcSMonad.hs index 3e50569..43e8512 100644 --- a/compiler/typecheck/TcSMonad.hs +++ b/compiler/typecheck/TcSMonad.hs @@ -3340,12 +3340,12 @@ setEvBind ev_bind -- | Mark variables as used filling a coercion hole useVars :: CoVarSet -> TcS () -useVars vars +useVars co_vars = do { ev_binds_var <- getTcEvBindsVar ; let ref = ebv_tcvs ev_binds_var ; wrapTcS $ do { tcvs <- TcM.readTcRef ref - ; let tcvs' = tcvs `unionVarSet` vars + ; let tcvs' = tcvs `unionVarSet` co_vars ; TcM.writeTcRef ref tcvs' } } -- | Equalities only diff --git a/compiler/typecheck/TcSimplify.hs b/compiler/typecheck/TcSimplify.hs index 92da1ac..562340f 100644 --- a/compiler/typecheck/TcSimplify.hs +++ b/compiler/typecheck/TcSimplify.hs @@ -1775,8 +1775,8 @@ neededEvVars implic@(Implic { ic_given = givens ; return (implic { ic_need_inner = need_inner , ic_need_outer = need_outer }) } where - add_implic_seeds (Implic { ic_need_outer = needs, ic_given = givens }) acc - = (needs `delVarSetList` givens) `unionVarSet` acc + add_implic_seeds (Implic { ic_need_outer = needs }) acc + = needs `unionVarSet` acc needed_ev_bind needed (EvBind { eb_lhs = ev_var , eb_is_given = is_given }) From git at git.haskell.org Wed Oct 24 15:39:43 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 24 Oct 2018 15:39:43 +0000 (UTC) Subject: [commit: ghc] master: Solve equalities in a pattern signature (7ea714c) Message-ID: <20181024153943.3B9283ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/7ea714cd8d64dd0a7646d71d45e18c9f6a3527cb/ghc >--------------------------------------------------------------- commit 7ea714cd8d64dd0a7646d71d45e18c9f6a3527cb Author: Simon Peyton Jones Date: Tue Oct 16 14:47:12 2018 +0100 Solve equalities in a pattern signature Trac #15694 showed that we were forgetting to solve the equalities of a pattern signature until too late. Result: WARNINGs and a panic: "Type-correct unfilled coercion hole" >--------------------------------------------------------------- 7ea714cd8d64dd0a7646d71d45e18c9f6a3527cb compiler/typecheck/TcSigs.hs | 25 ++++++++++++++++++++++-- testsuite/tests/patsyn/should_fail/T15694.hs | 25 ++++++++++++++++++++++++ testsuite/tests/patsyn/should_fail/T15694.stderr | 4 ++++ testsuite/tests/patsyn/should_fail/all.T | 1 + 4 files changed, 53 insertions(+), 2 deletions(-) diff --git a/compiler/typecheck/TcSigs.hs b/compiler/typecheck/TcSigs.hs index a371f55..ada9178 100644 --- a/compiler/typecheck/TcSigs.hs +++ b/compiler/typecheck/TcSigs.hs @@ -297,6 +297,24 @@ Once we get to type checking, we decompose it into its parts, in tcPatSynSig. universal and existential vars. * After we kind-check the pieces and convert to Types, we do kind generalisation. + +Note [solveEqualities in tcPatSynSig] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +It's important that we solve /all/ the equalities in a pattern +synonym signature, because we are going to zonk the signature to +a Type (not a TcType), in TcPatSyn.tc_patsyn_finish, and that +fails if there are un-filled-in coercion variables mentioned +in the type (Trac #15694). + +The best thing is simply to use solveEqualities to solve all the +equalites, rather than leaving them in the ambient constraints +to be solved later. Pattern synonyms are top-level, so there's +no problem with completely solving them. + +(NB: this solveEqualities wraps tcImplicitTKBndrs, which itself +does a solveLocalEqualities; so solveEqualities isn't going to +make any further progress; it'll just report any unsolved ones, +and fail, as it should.) -} tcPatSynSig :: Name -> LHsSigType GhcRn -> TcM TcPatSynInfo @@ -307,8 +325,10 @@ tcPatSynSig name sig_ty , hsib_body = hs_ty } <- sig_ty , (univ_hs_tvs, hs_req, hs_ty1) <- splitLHsSigmaTy hs_ty , (ex_hs_tvs, hs_prov, hs_body_ty) <- splitLHsSigmaTy hs_ty1 - = do { (implicit_tvs, (univ_tvs, (ex_tvs, (req, prov, body_ty)))) - <- -- NB: tcImplicitTKBndrs calls solveLocalEqualities + = do { traceTc "tcPatSynSig 1" (ppr sig_ty) + ; (implicit_tvs, (univ_tvs, (ex_tvs, (req, prov, body_ty)))) + <- solveEqualities $ + -- See Note [solveEqualities in tcPatSynSig] tcImplicitTKBndrs skol_info implicit_hs_tvs $ tcExplicitTKBndrs skol_info univ_hs_tvs $ tcExplicitTKBndrs skol_info ex_hs_tvs $ @@ -324,6 +344,7 @@ tcPatSynSig name sig_ty -- Kind generalisation ; kvs <- kindGeneralize ungen_patsyn_ty + ; traceTc "tcPatSynSig" (ppr ungen_patsyn_ty) -- These are /signatures/ so we zonk to squeeze out any kind -- unification variables. Do this after kindGeneralize which may diff --git a/testsuite/tests/patsyn/should_fail/T15694.hs b/testsuite/tests/patsyn/should_fail/T15694.hs new file mode 100644 index 0000000..915ad7e --- /dev/null +++ b/testsuite/tests/patsyn/should_fail/T15694.hs @@ -0,0 +1,25 @@ +{-# Language RankNTypes, PatternSynonyms, TypeOperators, DataKinds, PolyKinds, KindSignatures, GADTs #-} + +module T15694 where + +import Data.Kind +import Data.Type.Equality + +data Ctx :: Type -> Type where + E :: Ctx(Type) + (:&:) :: a -> Ctx(as) -> Ctx(a -> as) + +data ApplyT(kind::Type) :: kind -> Ctx(kind) -> Type where + AO :: a -> ApplyT(Type) a E + AS :: ApplyT(ks) (f a) ctx + -> ApplyT(k -> ks) f (a:&:ctx) + + +pattern ASSO :: () => forall ks k (f :: k -> ks) (a1 :: k) (ctx :: Ctx ks) + (ks1 :: Type) k1 (a2 :: k1) (ctx1 :: Ctx ks1) a3. + (kind ~ (k -> ks), a ~~ f, b ~~ (a1 :&: ctx), + ks ~ (k1 -> ks1), ctx ~~ (a2 :&: E), + ks1 ~ Type, f a1 a2 ~~ a3) + => a3 -> ApplyT kind a b + +pattern ASSO a = AS (AS (AO a)) diff --git a/testsuite/tests/patsyn/should_fail/T15694.stderr b/testsuite/tests/patsyn/should_fail/T15694.stderr new file mode 100644 index 0000000..360fb30 --- /dev/null +++ b/testsuite/tests/patsyn/should_fail/T15694.stderr @@ -0,0 +1,4 @@ + +T15694.hs:22:35: error: + • Expected kind ‘k1 -> k00’, but ‘f a1’ has kind ‘ks’ + • In the first argument of ‘(~~)’, namely ‘f a1 a2’ diff --git a/testsuite/tests/patsyn/should_fail/all.T b/testsuite/tests/patsyn/should_fail/all.T index e726eaa..099e905 100644 --- a/testsuite/tests/patsyn/should_fail/all.T +++ b/testsuite/tests/patsyn/should_fail/all.T @@ -46,3 +46,4 @@ test('T14507', normal, compile_fail, ['-dsuppress-uniques']) test('T15289', normal, compile_fail, ['']) test('T15685', normal, compile_fail, ['']) test('T15692', normal, compile, ['']) # It has -fdefer-type-errors inside +test('T15694', normal, compile_fail, ['']) From git at git.haskell.org Wed Oct 24 15:39:46 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 24 Oct 2018 15:39:46 +0000 (UTC) Subject: [commit: ghc] master: Add HasDebugCallStack to ctEvCoecion (e2ca107) Message-ID: <20181024153946.30F7C3ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/e2ca1072fd5b9d6f3983b7bb8099d728ed66efc0/ghc >--------------------------------------------------------------- commit e2ca1072fd5b9d6f3983b7bb8099d728ed66efc0 Author: Simon Peyton Jones Date: Thu Oct 18 15:49:56 2018 +0100 Add HasDebugCallStack to ctEvCoecion This is a debug-only change >--------------------------------------------------------------- e2ca1072fd5b9d6f3983b7bb8099d728ed66efc0 compiler/typecheck/TcRnTypes.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/typecheck/TcRnTypes.hs b/compiler/typecheck/TcRnTypes.hs index bbd85aa..8119be5 100644 --- a/compiler/typecheck/TcRnTypes.hs +++ b/compiler/typecheck/TcRnTypes.hs @@ -2825,7 +2825,7 @@ ctEvExpr ev@(CtWanted { ctev_dest = HoleDest _ }) = Coercion $ ctEvCoercion ev ctEvExpr ev = evId (ctEvEvId ev) -ctEvCoercion :: CtEvidence -> Coercion +ctEvCoercion :: HasDebugCallStack => CtEvidence -> Coercion ctEvCoercion (CtGiven { ctev_evar = ev_id }) = mkTcCoVarCo ev_id ctEvCoercion (CtWanted { ctev_dest = dest }) From git at git.haskell.org Wed Oct 24 15:39:49 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 24 Oct 2018 15:39:49 +0000 (UTC) Subject: [commit: ghc] master: Don't print out undefined coercions (7d90364) Message-ID: <20181024153949.320663ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/7d9036448a394d7f2eeb158bb71d0fa694f88f56/ghc >--------------------------------------------------------------- commit 7d9036448a394d7f2eeb158bb71d0fa694f88f56 Author: Simon Peyton Jones Date: Thu Oct 18 15:36:37 2018 +0100 Don't print out undefined coercions A debug-print was trying to print the coercion returned by the flattener. But that coercion can be undefined in the case of Derived constraints. Because we might rewrite it with [D] a ~ ty, and there is no evidence for that. Solution: don't attempt to print the coercion. >--------------------------------------------------------------- 7d9036448a394d7f2eeb158bb71d0fa694f88f56 compiler/typecheck/TcCanonical.hs | 3 ++- compiler/typecheck/TcFlatten.hs | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/compiler/typecheck/TcCanonical.hs b/compiler/typecheck/TcCanonical.hs index a0932ac..b576fc3 100644 --- a/compiler/typecheck/TcCanonical.hs +++ b/compiler/typecheck/TcCanonical.hs @@ -1773,6 +1773,7 @@ canCFunEqCan :: CtEvidence canCFunEqCan ev fn tys fsk = do { (tys', cos, kind_co) <- flattenArgsNom ev fn tys -- cos :: tys' ~ tys + ; let lhs_co = mkTcTyConAppCo Nominal fn cos -- :: F tys' ~ F tys new_lhs = mkTyConApp fn tys' @@ -1780,7 +1781,7 @@ canCFunEqCan ev fn tys fsk flav = ctEvFlavour ev ; (ev', fsk') <- if isTcReflexiveCo kind_co -- See Note [canCFunEqCan] - then do { traceTcS "canCFunEqCan: refl" (ppr new_lhs $$ ppr lhs_co) + then do { traceTcS "canCFunEqCan: refl" (ppr new_lhs) ; let fsk_ty = mkTyVarTy fsk ; ev' <- rewriteEqEvidence ev NotSwapped new_lhs fsk_ty lhs_co (mkTcNomReflCo fsk_ty) diff --git a/compiler/typecheck/TcFlatten.hs b/compiler/typecheck/TcFlatten.hs index 5c9bdd9..add0a6f 100644 --- a/compiler/typecheck/TcFlatten.hs +++ b/compiler/typecheck/TcFlatten.hs @@ -772,6 +772,9 @@ flattenArgsNom :: CtEvidence -> TyCon -> [TcType] -> TcS ([Xi], [TcCoercion], Tc -- and we want to flatten all at nominal role -- The kind passed in is the kind of the type family or class, call it T -- The last coercion returned has type (typeKind(T xis) ~N typeKind(T tys)) +-- +-- For Derived constraints the returned coercion may be undefined +-- because flattening may use a Derived equality ([D] a ~ ty) flattenArgsNom ev tc tys = do { traceTcS "flatten_args {" (vcat (map ppr tys)) ; (tys', cos, kind_co) From git at git.haskell.org Wed Oct 24 15:39:52 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 24 Oct 2018 15:39:52 +0000 (UTC) Subject: [commit: ghc] master: Report a Wanted error even if there are Given ones (6b1102e) Message-ID: <20181024153952.ED2F03ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/6b1102e2cfcffb265fd33cf8a99ab5e6b3f14906/ghc >--------------------------------------------------------------- commit 6b1102e2cfcffb265fd33cf8a99ab5e6b3f14906 Author: Simon Peyton Jones Date: Thu Oct 18 15:41:44 2018 +0100 Report a Wanted error even if there are Given ones We suppress some Given errors; see Note [Given errors] in TcErrors. But we must be careful not to suppress Wanted errors because of the presence of these Given errors -- else we might allow compilation to bogusly proceed The rubber hits the road in TcRnTypes.insolubleCt, where we don't want to treat Givens as insoluble, nor (and this is the new bit) Deriveds that arise from Givens. See Note [Given insolubles] in TcRnTypes. This fixes #15767. >--------------------------------------------------------------- 6b1102e2cfcffb265fd33cf8a99ab5e6b3f14906 compiler/typecheck/TcErrors.hs | 2 +- compiler/typecheck/TcRnTypes.hs | 24 ++++++++++++++-------- testsuite/tests/typecheck/should_fail/T15767.hs | 9 ++++++++ .../tests/typecheck/should_fail/T15767.stderr | 9 ++++++++ testsuite/tests/typecheck/should_fail/all.T | 1 + 5 files changed, 35 insertions(+), 10 deletions(-) diff --git a/compiler/typecheck/TcErrors.hs b/compiler/typecheck/TcErrors.hs index 35f31d1..951107b 100644 --- a/compiler/typecheck/TcErrors.hs +++ b/compiler/typecheck/TcErrors.hs @@ -543,7 +543,7 @@ reportWanteds ctxt tc_lvl (WC { wc_simple = simples, wc_impl = implics }) -- report1: ones that should *not* be suppresed by -- an insoluble somewhere else in the tree -- It's crucial that anything that is considered insoluble - -- (see TcRnTypes.insolubleWantedCt) is caught here, otherwise + -- (see TcRnTypes.insolubleCt) is caught here, otherwise -- we might suppress its error message, and proceed on past -- type checking to get a Lint error later report1 = [ ("Out of scope", is_out_of_scope, True, mkHoleReporter tidy_cts) diff --git a/compiler/typecheck/TcRnTypes.hs b/compiler/typecheck/TcRnTypes.hs index 695d2ae..bbd85aa 100644 --- a/compiler/typecheck/TcRnTypes.hs +++ b/compiler/typecheck/TcRnTypes.hs @@ -89,7 +89,7 @@ module TcRnTypes( isSolvedWC, andWC, unionsWC, mkSimpleWC, mkImplicWC, addInsols, insolublesOnly, addSimples, addImplics, tyCoVarsOfWC, dropDerivedWC, dropDerivedSimples, - tyCoVarsOfWCList, insolubleWantedCt, insolubleEqCt, + tyCoVarsOfWCList, insolubleCt, insolubleEqCt, isDroppableCt, insolubleImplic, arisesFromGivens, @@ -2387,7 +2387,7 @@ addInsols wc cts insolublesOnly :: WantedConstraints -> WantedConstraints -- Keep only the definitely-insoluble constraints insolublesOnly (WC { wc_simple = simples, wc_impl = implics }) - = WC { wc_simple = filterBag insolubleWantedCt simples + = WC { wc_simple = filterBag insolubleCt simples , wc_impl = mapBag implic_insols_only implics } where implic_insols_only implic @@ -2407,16 +2407,16 @@ insolubleImplic ic = isInsolubleStatus (ic_status ic) insolubleWC :: WantedConstraints -> Bool insolubleWC (WC { wc_impl = implics, wc_simple = simples }) - = anyBag insolubleWantedCt simples + = anyBag insolubleCt simples || anyBag insolubleImplic implics -insolubleWantedCt :: Ct -> Bool +insolubleCt :: Ct -> Bool -- Definitely insoluble, in particular /excluding/ type-hole constraints -insolubleWantedCt ct - | isGivenCt ct = False -- See Note [Given insolubles] - | isHoleCt ct = isOutOfScopeCt ct -- See Note [Insoluble holes] - | insolubleEqCt ct = True - | otherwise = False +insolubleCt ct + | not (insolubleEqCt ct) = False + | isHoleCt ct = isOutOfScopeCt ct -- See Note [Insoluble holes] + | arisesFromGivens ct = False -- See Note [Given insolubles] + | otherwise = True insolubleEqCt :: Ct -> Bool -- Returns True of /equality/ constraints @@ -2470,6 +2470,12 @@ because that'll suppress reports of [W] C b (f b). But we may not report the insoluble [G] f b ~# b either (see Note [Given errors] in TcErrors), so we may fail to report anything at all! Yikes. +The same applies to Derived constraints that /arise from/ Givens. +E.g. f :: (C Int [a]) => blah +where a fundep means we get + [D] Int ~ [a] +By the same reasoning we must not suppress other errors (Trac #15767) + Bottom line: insolubleWC (called in TcSimplify.setImplicationStatus) should ignore givens even if they are insoluble. diff --git a/testsuite/tests/typecheck/should_fail/T15767.hs b/testsuite/tests/typecheck/should_fail/T15767.hs new file mode 100644 index 0000000..f9f853d --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T15767.hs @@ -0,0 +1,9 @@ +{-# LANGUAGE FunctionalDependencies, FlexibleContexts #-} + +module T15767 where + +class C a b | b -> a where f :: a -> b + +y = x where + x :: (C () b, C Bool b) => b + x = f () diff --git a/testsuite/tests/typecheck/should_fail/T15767.stderr b/testsuite/tests/typecheck/should_fail/T15767.stderr new file mode 100644 index 0000000..2c20dd2 --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T15767.stderr @@ -0,0 +1,9 @@ + +T15767.hs:7:5: error: + • No instance for (C () b) arising from a use of ‘x’ + • In the expression: x + In an equation for ‘y’: + y = x + where + x :: (C () b, C Bool b) => b + x = f () diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T index 501c5e1..35c925e 100644 --- a/testsuite/tests/typecheck/should_fail/all.T +++ b/testsuite/tests/typecheck/should_fail/all.T @@ -484,3 +484,4 @@ test('T15527', normal, compile_fail, ['']) test('T15552', normal, compile, ['']) test('T15552a', normal, compile_fail, ['']) test('T15629', normal, compile_fail, ['']) +test('T15767', normal, compile_fail, ['']) From git at git.haskell.org Wed Oct 24 15:39:56 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 24 Oct 2018 15:39:56 +0000 (UTC) Subject: [commit: ghc] master: Improve output from -ddump-types (321bc1a) Message-ID: <20181024153956.055B63ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/321bc1a644a9e4598a4af30d4aeae315f0ff487a/ghc >--------------------------------------------------------------- commit 321bc1a644a9e4598a4af30d4aeae315f0ff487a Author: Simon Peyton Jones Date: Tue Oct 16 12:03:56 2018 +0100 Improve output from -ddump-types This patch makes a number of improvements to the output generated by -ddump-types * Prints data constructor separately * Omits empty chunks of output I was driven initially by the unhelpful existing output for data constructors, but ended up doing some refactoring. Lots of error message wibbles, but nothing significant. Certainly no change in user behaviour. (NB: It is just possible that I have failed to cleanly separate this patch from the next one, about isPredTy and friends.) >--------------------------------------------------------------- 321bc1a644a9e4598a4af30d4aeae315f0ff487a compiler/typecheck/TcRnDriver.hs | 140 ++++++++++++--------- testsuite/tests/ado/ado004.stderr | 2 - .../tests/determinism/determ021/determ021.stdout | 4 - testsuite/tests/driver/json2.stderr | 2 +- .../indexed-types/should_compile/T3017.stderr | 5 +- .../tests/partial-sigs/should_compile/ADT.stderr | 4 +- .../partial-sigs/should_compile/AddAndOr1.stderr | 2 - .../partial-sigs/should_compile/AddAndOr2.stderr | 2 - .../partial-sigs/should_compile/AddAndOr3.stderr | 2 - .../partial-sigs/should_compile/AddAndOr4.stderr | 2 - .../partial-sigs/should_compile/AddAndOr5.stderr | 2 - .../partial-sigs/should_compile/AddAndOr6.stderr | 2 - .../partial-sigs/should_compile/BoolToBool.stderr | 2 - .../should_compile/DataFamilyInstanceLHS.stderr | 15 +-- .../should_compile/Defaulting1MROn.stderr | 2 - .../should_compile/Defaulting2MROff.stderr | 2 - .../should_compile/Defaulting2MROn.stderr | 2 - .../partial-sigs/should_compile/Either.stderr | 2 - .../should_compile/EqualityConstraint.stderr | 2 - .../tests/partial-sigs/should_compile/Every.stderr | 2 - .../partial-sigs/should_compile/EveryNamed.stderr | 2 - .../should_compile/ExpressionSig.stderr | 2 - .../should_compile/ExpressionSigNamed.stderr | 2 - .../should_compile/ExtraConstraints1.stderr | 2 - .../should_compile/ExtraConstraints2.stderr | 2 - .../should_compile/ExtraConstraints3.stderr | 2 - .../should_compile/ExtraNumAMROff.stderr | 2 - .../should_compile/ExtraNumAMROn.stderr | 2 - .../partial-sigs/should_compile/Forall1.stderr | 2 - .../partial-sigs/should_compile/GenNamed.stderr | 2 - .../partial-sigs/should_compile/HigherRank1.stderr | 2 - .../partial-sigs/should_compile/HigherRank2.stderr | 2 - .../should_compile/LocalDefinitionBug.stderr | 2 - .../partial-sigs/should_compile/Meltdown.stderr | 3 +- .../should_compile/MonoLocalBinds.stderr | 2 - .../partial-sigs/should_compile/NamedTyVar.stderr | 2 - .../NamedWildcardInDataFamilyInstanceLHS.stderr | 16 +-- .../NamedWildcardInTypeFamilyInstanceLHS.stderr | 1 - .../should_compile/ParensAroundContext.stderr | 2 - .../partial-sigs/should_compile/PatBind.stderr | 2 - .../partial-sigs/should_compile/PatBind2.stderr | 2 - .../partial-sigs/should_compile/PatternSig.stderr | 2 - .../partial-sigs/should_compile/Recursive.stderr | 2 - .../should_compile/ScopedNamedWildcards.stderr | 2 - .../should_compile/ScopedNamedWildcardsGood.stderr | 2 - .../partial-sigs/should_compile/ShowNamed.stderr | 2 - .../partial-sigs/should_compile/SimpleGen.stderr | 2 - .../partial-sigs/should_compile/SkipMany.stderr | 5 +- .../should_compile/SomethingShowable.stderr | 2 - .../partial-sigs/should_compile/Uncurry.stderr | 2 - .../should_compile/UncurryNamed.stderr | 2 - .../WarningWildcardInstantiations.stderr | 2 - testsuite/tests/polykinds/T15592.stderr | 8 +- testsuite/tests/roles/should_compile/Roles1.stderr | 17 ++- testsuite/tests/roles/should_compile/Roles2.stderr | 7 +- testsuite/tests/roles/should_compile/T8958.stderr | 6 +- testsuite/tests/th/TH_Roles2.stderr | 2 - .../tests/typecheck/should_compile/T12763.stderr | 2 +- .../tests/typecheck/should_compile/tc231.stderr | 5 +- 59 files changed, 119 insertions(+), 207 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 321bc1a644a9e4598a4af30d4aeae315f0ff487a From git at git.haskell.org Wed Oct 24 15:39:59 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 24 Oct 2018 15:39:59 +0000 (UTC) Subject: [commit: ghc] master: Comments and white space (4111540) Message-ID: <20181024153959.4C4EB3ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/4111540127ae059774b2b7e69d7eddee01a17e81/ghc >--------------------------------------------------------------- commit 4111540127ae059774b2b7e69d7eddee01a17e81 Author: Simon Peyton Jones Date: Tue Oct 16 12:00:32 2018 +0100 Comments and white space >--------------------------------------------------------------- 4111540127ae059774b2b7e69d7eddee01a17e81 compiler/coreSyn/CoreUtils.hs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/compiler/coreSyn/CoreUtils.hs b/compiler/coreSyn/CoreUtils.hs index 55609cf..c498258 100644 --- a/compiler/coreSyn/CoreUtils.hs +++ b/compiler/coreSyn/CoreUtils.hs @@ -1503,7 +1503,6 @@ expr_ok primop_ok (Lam b e) | isTyVar b = expr_ok primop_ok e | otherwise = True - -- Tick annotations that *tick* cannot be speculated, because these -- are meant to identify whether or not (and how often) the particular -- source expression was evaluated at runtime. @@ -1613,7 +1612,7 @@ isDivOp _ = False exprOkForSpeculation accepts very special case expressions. Reason: (a ==# b) is ok-for-speculation, but the litEq rules in PrelRules convert it (a ==# 3#) to - case a of { DEAFULT -> 0#; 3# -> 1# } + case a of { DEFAULT -> 0#; 3# -> 1# } for excellent reasons described in PrelRules Note [The litEq rule: converting equality to case]. So, annoyingly, we want that case expression to be @@ -1685,7 +1684,7 @@ In earlier GHCs, we got this: 0 -> 0 } Before join-points etc we could only get rid of two cases (which are -redundant) by recognising that th e(case <# ds 5 of { ... }) is +redundant) by recognising that the (case <# ds 5 of { ... }) is ok-for-speculation, even though it has /lifted/ type. But now join points do the job nicely. ------- End of historical note ------------ From git at git.haskell.org Wed Oct 24 19:10:04 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 24 Oct 2018 19:10:04 +0000 (UTC) Subject: [commit: ghc] branch 'wip/az-D5036-2' created Message-ID: <20181024191004.9CE823ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/az-D5036-2 Referencing: b6cc28d0bd5f783371a8c0742d2f0c8672ffad7c From git at git.haskell.org Wed Oct 24 19:10:07 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 24 Oct 2018 19:10:07 +0000 (UTC) Subject: [commit: ghc] wip/az-D5036-2: [TTG: Handling Source Locations] Foundation and Pat (5ec29fb) Message-ID: <20181024191007.B51C73ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/az-D5036-2 Link : http://ghc.haskell.org/trac/ghc/changeset/5ec29fbc936b5107357ccb497c3a36534f04096d/ghc >--------------------------------------------------------------- commit 5ec29fbc936b5107357ccb497c3a36534f04096d Author: Shayan-Najd Date: Tue Oct 23 20:30:54 2018 +0200 [TTG: Handling Source Locations] Foundation and Pat Summary: - the class `HasSrcSpan`, and its functions (e.g., `cL` and `dL`), are introduced - some instances of `HasSrcSpan` are introduced - some constructors `L` are replaced with `cL` - some patterns `L` are replaced with `dL` view pattern - `XPat` is renamed to `NewPat` - some type annotation are necessarily updated updated (e.g., `Pat p` --> `Pat (GhcPass p)`) - (there was a bug in an earlier version of this patch related to using functor on `Located` things that is fixed) Test Plan: - GHC and the related code (e.g., Haddock) fully compile on my Linux system - the patch passes the tests and ./Validate Reviewers: bgamari, alanz, simonpj Subscribers: mpickering GHC Trac Issues: #15495 Differential Revision: https://phabricator.haskell.org/D5036 >--------------------------------------------------------------- 5ec29fbc936b5107357ccb497c3a36534f04096d compiler/basicTypes/Name.hs | 8 +- compiler/basicTypes/SrcLoc.hs | 80 ++++++-- compiler/deSugar/Check.hs | 10 +- compiler/deSugar/DsArrows.hs | 5 +- compiler/deSugar/DsExpr.hs | 2 +- compiler/deSugar/DsListComp.hs | 2 +- compiler/deSugar/DsMeta.hs | 3 +- compiler/deSugar/DsUtils.hs | 45 ++--- compiler/deSugar/ExtractDocs.hs | 5 +- compiler/deSugar/Match.hs | 23 +-- compiler/deSugar/MatchCon.hs | 3 +- compiler/hsSyn/Convert.hs | 107 ++++++----- compiler/hsSyn/HsExtension.hs | 4 +- compiler/hsSyn/HsPat.hs | 88 +++++---- compiler/hsSyn/HsPat.hs-boot | 3 +- compiler/hsSyn/HsTypes.hs | 4 +- compiler/hsSyn/HsUtils.hs | 213 +++++++++++---------- compiler/main/DynFlags.hs | 1 + compiler/main/GHC.hs | 4 + compiler/main/HeaderInfo.hs | 74 ++++---- compiler/main/HscStats.hs | 4 +- compiler/main/HscTypes.hs | 3 +- compiler/parser/Lexer.x | 30 +-- compiler/parser/Parser.y | 106 ++++++----- compiler/parser/RdrHsSyn.hs | 369 +++++++++++++++++++------------------ compiler/rename/RnBinds.hs | 10 +- compiler/rename/RnExpr.hs | 7 +- compiler/rename/RnPat.hs | 50 ++--- compiler/rename/RnSplice.hs | 14 +- compiler/rename/RnTypes.hs | 9 +- compiler/typecheck/TcBinds.hs | 3 +- compiler/typecheck/TcErrors.hs | 4 +- compiler/typecheck/TcHsSyn.hs | 3 +- compiler/typecheck/TcHsType.hs | 2 +- compiler/typecheck/TcPat.hs | 5 +- compiler/typecheck/TcPatSyn.hs | 15 +- compiler/typecheck/TcRnDriver.hs | 2 +- compiler/typecheck/TcRnExports.hs | 4 +- compiler/typecheck/TcRnMonad.hs | 33 ++-- compiler/typecheck/TcTyClsDecls.hs | 9 +- compiler/typecheck/TcTyDecls.hs | 19 +- compiler/utils/Binary.hs | 2 +- ghc/GHCi/UI/Info.hs | 7 +- testsuite/tests/ghc-api/T6145.hs | 7 +- utils/ghctags/Main.hs | 3 +- 45 files changed, 797 insertions(+), 607 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 5ec29fbc936b5107357ccb497c3a36534f04096d From git at git.haskell.org Wed Oct 24 19:10:10 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 24 Oct 2018 19:10:10 +0000 (UTC) Subject: [commit: ghc] wip/az-D5036-2: D5036 rebased. (b6cc28d) Message-ID: <20181024191010.89D463ABB9@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/az-D5036-2 Link : http://ghc.haskell.org/trac/ghc/changeset/b6cc28d0bd5f783371a8c0742d2f0c8672ffad7c/ghc >--------------------------------------------------------------- commit b6cc28d0bd5f783371a8c0742d2f0c8672ffad7c Author: Alan Zimmerman Date: Wed Oct 24 21:08:59 2018 +0200 D5036 rebased. Compiles (via ./validate) until haddock, missing the required patch. >--------------------------------------------------------------- b6cc28d0bd5f783371a8c0742d2f0c8672ffad7c compiler/parser/Lexer.x | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/parser/Lexer.x b/compiler/parser/Lexer.x index 8129cce..9472bd4 100644 --- a/compiler/parser/Lexer.x +++ b/compiler/parser/Lexer.x @@ -1161,7 +1161,7 @@ parseNestedPragma input@(AI _ buf) = do setExts (.&. complement (xbit InNestedCommentBit)) postInput@(AI _ postBuf) <- getInput setInput origInput - case unLoc lt of + case unRealSrcSpan lt of ITcomment_line_prag -> do let bytes = byteDiff buf postBuf diff = lexemeToString buf bytes From git at git.haskell.org Wed Oct 24 21:19:45 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 24 Oct 2018 21:19:45 +0000 (UTC) Subject: [commit: ghc] wip/az-D5036-2: Update haddock submodule to include the D5036 changes (1d55da3) Message-ID: <20181024211946.005923ABBA@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/az-D5036-2 Link : http://ghc.haskell.org/trac/ghc/changeset/1d55da3643af7483ecafb1a2a294c0fc565d2437/ghc >--------------------------------------------------------------- commit 1d55da3643af7483ecafb1a2a294c0fc565d2437 Author: Alan Zimmerman Date: Wed Oct 24 23:18:26 2018 +0200 Update haddock submodule to include the D5036 changes >--------------------------------------------------------------- 1d55da3643af7483ecafb1a2a294c0fc565d2437 utils/haddock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/haddock b/utils/haddock index b5372b7..857a3b8 160000 --- a/utils/haddock +++ b/utils/haddock @@ -1 +1 @@ -Subproject commit b5372b7d86e3058b419076641dd3048258c4ddf2 +Subproject commit 857a3b851ac3b56d05cd0b520862e1cb7adfb0d8 From git at git.haskell.org Thu Oct 25 07:20:21 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 25 Oct 2018 07:20:21 +0000 (UTC) Subject: [commit: ghc] master: Fix some broken links (#15733) (49c7a51) Message-ID: <20181025072021.561E23ABBA@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/49c7a51ef614068ba664422c48e97d3ec76178a5/ghc >--------------------------------------------------------------- commit 49c7a51ef614068ba664422c48e97d3ec76178a5 Author: Fangyi Zhou Date: Thu Oct 25 10:16:48 2018 +0300 Fix some broken links (#15733) Change some URLs from hackage.haskell.org/trac to ghc.haskell.org/trac Test Plan: manually verify links work Reviewers: bgamari, simonmar, mpickering Reviewed By: bgamari, mpickering Subscribers: mpickering, rwbarton, carter GHC Trac Issues: #15733 Differential Revision: https://phabricator.haskell.org/D5257 >--------------------------------------------------------------- 49c7a51ef614068ba664422c48e97d3ec76178a5 INSTALL.md | 2 +- compiler/codeGen/StgCmmHeap.hs | 2 +- libraries/ghc-heap/GHC/Exts/Heap/Closures.hs | 2 +- libraries/ghc-heap/GHC/Exts/Heap/InfoTable/Types.hsc | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 42bbc1e..3ab14df 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -44,5 +44,5 @@ References ========== [1] http://www.haskell.org/ghc/ - [2] http://hackage.haskell.org/trac/ghc/wiki/Building/Preparation + [2] http://ghc.haskell.org/trac/ghc/wiki/Building/Preparation [3] http://www.haskell.org/haddock/ diff --git a/compiler/codeGen/StgCmmHeap.hs b/compiler/codeGen/StgCmmHeap.hs index 3be35b3..3b170eb 100644 --- a/compiler/codeGen/StgCmmHeap.hs +++ b/compiler/codeGen/StgCmmHeap.hs @@ -519,7 +519,7 @@ heapCheck checkStack checkYield do_gc code [" Trying to allocate more than "++show mBLOCK_SIZE++" bytes.", "", "This is currently not possible due to a limitation of GHC's code generator.", - "See http://hackage.haskell.org/trac/ghc/ticket/4505 for details.", + "See http://ghc.haskell.org/trac/ghc/ticket/4505 for details.", "Suggestion: read data from a file instead of having large static data", "structures in code."] | hpHw > 0 = Just (mkIntExpr dflags (hpHw * (wORD_SIZE dflags))) diff --git a/libraries/ghc-heap/GHC/Exts/Heap/Closures.hs b/libraries/ghc-heap/GHC/Exts/Heap/Closures.hs index facb801..a3f9b97 100644 --- a/libraries/ghc-heap/GHC/Exts/Heap/Closures.hs +++ b/libraries/ghc-heap/GHC/Exts/Heap/Closures.hs @@ -94,7 +94,7 @@ areBoxesEqual (Box a) (Box b) = case reallyUnsafePtrEqualityUpToTag# a b of type Closure = GenClosure Box -- | This is the representation of a Haskell value on the heap. It reflects --- +-- -- -- The data type is parametrized by the type to store references in. Usually -- this is a 'Box' with the type synonym 'Closure'. diff --git a/libraries/ghc-heap/GHC/Exts/Heap/InfoTable/Types.hsc b/libraries/ghc-heap/GHC/Exts/Heap/InfoTable/Types.hsc index 9a19360..9c7c392 100644 --- a/libraries/ghc-heap/GHC/Exts/Heap/InfoTable/Types.hsc +++ b/libraries/ghc-heap/GHC/Exts/Heap/InfoTable/Types.hsc @@ -28,7 +28,7 @@ type HalfWord = Word16 type EntryFunPtr = FunPtr (Ptr () -> IO (Ptr ())) -- | This is a somewhat faithful representation of an info table. See --- +-- -- for more details on this data structure. data StgInfoTable = StgInfoTable { entry :: Maybe EntryFunPtr, -- Just <=> not ghciTablesNextToCode From git at git.haskell.org Thu Oct 25 08:10:20 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 25 Oct 2018 08:10:20 +0000 (UTC) Subject: [commit: ghc] master: Test Trac #15648 (a3476aa) Message-ID: <20181025081020.ACCC63ABBA@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/a3476aa265a4448df9c8d3333d6829a898108af6/ghc >--------------------------------------------------------------- commit a3476aa265a4448df9c8d3333d6829a898108af6 Author: Simon Peyton Jones Date: Wed Oct 24 16:51:32 2018 +0100 Test Trac #15648 >--------------------------------------------------------------- a3476aa265a4448df9c8d3333d6829a898108af6 testsuite/tests/typecheck/should_fail/T15648.hs | 30 ++++++++++++++++++++++ .../tests/typecheck/should_fail/T15648.stderr | 23 +++++++++++++++++ testsuite/tests/typecheck/should_fail/T15648a.hs | 7 +++++ testsuite/tests/typecheck/should_fail/all.T | 1 + 4 files changed, 61 insertions(+) diff --git a/testsuite/tests/typecheck/should_fail/T15648.hs b/testsuite/tests/typecheck/should_fail/T15648.hs new file mode 100644 index 0000000..a566a1b --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T15648.hs @@ -0,0 +1,30 @@ +{-# LANGUAGE GADTs #-} +{-# LANGUAGE KindSignatures #-} +{-# LANGUAGE ScopedTypeVariables #-} +{-# LANGUAGE TemplateHaskell #-} +{-# LANGUAGE TypeApplications #-} +{-# LANGUAGE TypeOperators #-} +module T15648 where + +import Data.Kind (Type) +import Data.Type.Equality (type (~~)) +import T15648a (ueqT) + +data LegitEquality :: Type -> Type -> Type where + Legit :: LegitEquality a a + +data JankyEquality :: Type -> Type -> Type where + Jank :: $ueqT a b -> JankyEquality a b + +unJank :: JankyEquality a b -> $ueqT a b +unJank (Jank x) = x + +legitToJank :: LegitEquality a b -> JankyEquality a b +legitToJank Legit = Jank + +mkLegit :: a ~~ b => LegitEquality a b +mkLegit = Legit + +ueqSym :: forall (a :: Type) (b :: Type). + $ueqT a b -> $ueqT b a +ueqSym = unJank $ legitToJank $ mkLegit @b @a diff --git a/testsuite/tests/typecheck/should_fail/T15648.stderr b/testsuite/tests/typecheck/should_fail/T15648.stderr new file mode 100644 index 0000000..192d8d1 --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T15648.stderr @@ -0,0 +1,23 @@ + +T15648.hs:23:21: error: + • Couldn't match type ‘(a0 GHC.Prim.~# b0) -> JankyEquality a0 b0’ + with ‘JankyEquality a a’ + Expected type: JankyEquality a b + Actual type: (a0 GHC.Prim.~# b0) -> JankyEquality a0 b0 + • Probable cause: ‘Jank’ is applied to too few arguments + In the expression: Jank + In an equation for ‘legitToJank’: legitToJank Legit = Jank + • Relevant bindings include + legitToJank :: LegitEquality a b -> JankyEquality a b + (bound at T15648.hs:23:1) + +T15648.hs:30:10: error: + • Couldn't match expected type ‘(a GHC.Prim.~# b) + -> b GHC.Prim.~# a’ + with actual type ‘b GHC.Prim.~# a’ + • In the expression: unJank $ legitToJank $ mkLegit @b @a + In an equation for ‘ueqSym’: + ueqSym = unJank $ legitToJank $ mkLegit @b @a + • Relevant bindings include + ueqSym :: (a GHC.Prim.~# b) -> b GHC.Prim.~# a + (bound at T15648.hs:30:1) diff --git a/testsuite/tests/typecheck/should_fail/T15648a.hs b/testsuite/tests/typecheck/should_fail/T15648a.hs new file mode 100644 index 0000000..73a05bb --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T15648a.hs @@ -0,0 +1,7 @@ +module T15648a where + +import Language.Haskell.TH.Lib +import Language.Haskell.TH.Syntax + +ueqT :: Q Type +ueqT = conT $ mkNameG_tc "ghc-prim" "GHC.Prim" "~#" diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T index 35c925e..f80f5cd 100644 --- a/testsuite/tests/typecheck/should_fail/all.T +++ b/testsuite/tests/typecheck/should_fail/all.T @@ -485,3 +485,4 @@ test('T15552', normal, compile, ['']) test('T15552a', normal, compile_fail, ['']) test('T15629', normal, compile_fail, ['']) test('T15767', normal, compile_fail, ['']) +test('T15648', [extra_files(['T15648a.hs'])], multimod_compile_fail, ['T15648', '-v0 -fprint-equality-relations']) From git at git.haskell.org Thu Oct 25 08:10:23 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 25 Oct 2018 08:10:23 +0000 (UTC) Subject: [commit: ghc] master: Add comments for StgCse and Unarise (232b0cb) Message-ID: <20181025081023.A97463ABBA@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/232b0cb35c1f731be66a032a4deee87bc47db3c9/ghc >--------------------------------------------------------------- commit 232b0cb35c1f731be66a032a4deee87bc47db3c9 Author: Simon Peyton Jones Date: Wed Oct 24 17:15:15 2018 +0100 Add comments for StgCse and Unarise This just improves docmentation for the fix to Trac #15300 >--------------------------------------------------------------- 232b0cb35c1f731be66a032a4deee87bc47db3c9 compiler/simplStg/SimplStg.hs | 2 ++ compiler/simplStg/StgCse.hs | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/compiler/simplStg/SimplStg.hs b/compiler/simplStg/SimplStg.hs index 36bf510..830dd19 100644 --- a/compiler/simplStg/SimplStg.hs +++ b/compiler/simplStg/SimplStg.hs @@ -40,6 +40,8 @@ stg2stg dflags binds ; stg_linter False "Pre-unarise" binds ; let un_binds = unarise us binds ; stg_linter True "Unarise" un_binds + -- Important that unarisation comes first + -- See Note [StgCse after unarisation] in StgCse ; dumpIfSet_dyn dflags Opt_D_dump_stg "STG syntax:" (pprStgTopBindings un_binds) diff --git a/compiler/simplStg/StgCse.hs b/compiler/simplStg/StgCse.hs index 1ae1213..2caf006 100644 --- a/compiler/simplStg/StgCse.hs +++ b/compiler/simplStg/StgCse.hs @@ -67,7 +67,23 @@ and nothing stops us from transforming that to foo [e] = case e of b { Left [n] -> … , Right [x] -> b} + +Note [StgCse after unarisation] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Consider two unboxed sum terms: + + (# 1 | #) :: (# Int | Int# #) + (# 1 | #) :: (# Int | Int #) + +These two terms are not equal as they unarise to different unboxed +tuples. However if we run StgCse before Unarise, it'll think the two +terms (# 1 | #) are equal, and replace one of these with a binder to +the other. That's bad -- Trac #15300. + +Solution: do unarise first. + -} + module StgCse (stgCse) where import GhcPrelude From git at git.haskell.org Thu Oct 25 08:10:27 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 25 Oct 2018 08:10:27 +0000 (UTC) Subject: [commit: ghc] master: Remove a zonkTcTyVarToTyVar (29978ef) Message-ID: <20181025081027.4EBCD3ABBA@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/29978ef1f834d77dc31bf7054590d526d068df7e/ghc >--------------------------------------------------------------- commit 29978ef1f834d77dc31bf7054590d526d068df7e Author: Simon Peyton Jones Date: Thu Oct 25 08:50:59 2018 +0100 Remove a zonkTcTyVarToTyVar This patch fixes Trac #15778 by removing a zonkTcTyVarToTyVar from tcHsSigType. Nww that a pattern-bound type variable can refer to a type, it's obvoiusly wrong to expect it to be a TyVar! Moreover, that zonk is entirely unnecessary. I added a new Note [Type variables in the type environment] in TcRnTypes >--------------------------------------------------------------- 29978ef1f834d77dc31bf7054590d526d068df7e compiler/typecheck/TcHsType.hs | 32 ++++++--------- compiler/typecheck/TcRnTypes.hs | 47 ++++++++++++++++++++-- testsuite/tests/typecheck/should_compile/T15778.hs | 6 +++ testsuite/tests/typecheck/should_compile/all.T | 1 + 4 files changed, 62 insertions(+), 24 deletions(-) diff --git a/compiler/typecheck/TcHsType.hs b/compiler/typecheck/TcHsType.hs index 4b755e4..24299dd 100644 --- a/compiler/typecheck/TcHsType.hs +++ b/compiler/typecheck/TcHsType.hs @@ -2475,7 +2475,7 @@ tcHsPatSigType ctxt sig_ty ; sig_ty <- zonkPromoteType sig_ty ; checkValidType ctxt sig_ty - ; tv_pairs <- mapM mk_tv_pair sig_tkvs + ; let tv_pairs = mkTyVarNamePairs sig_tkvs ; traceTc "tcHsPatSigType" (ppr sig_vars) ; return (wcs, tv_pairs, sig_ty) } @@ -2488,14 +2488,9 @@ tcHsPatSigType ctxt sig_ty _ -> newTauTyVar -- See Note [Pattern signature binders] - mk_tv_pair tv = do { tv' <- zonkTcTyVarToTyVar tv - ; return (tyVarName tv, tv') } - -- The Name is one of sig_vars, the lexically scoped name - -- But if it's a TyVarTv, it might have been unified - -- with an existing in-scope skolem, so we must zonk - -- here. See Note [Pattern signature binders] + tcHsPatSigType _ (HsWC _ (XHsImplicitBndrs _)) = panic "tcHsPatSigType" -tcHsPatSigType _ (XHsWildCardBndrs _) = panic "tcHsPatSigType" +tcHsPatSigType _ (XHsWildCardBndrs _) = panic "tcHsPatSigType" tcPatSig :: Bool -- True <=> pattern binding -> LHsSigWcType GhcRn @@ -2532,8 +2527,8 @@ tcPatSig in_pat_bind sig res_ty -- f :: Int -> Int -- f (x :: T a) = ... -- Here 'a' doesn't get a binding. Sigh - ; let bad_tvs = [ tv | (_,tv) <- sig_tvs - , not (tv `elemVarSet` exactTyCoVarsOfType sig_ty) ] + ; let bad_tvs = filterOut (`elemVarSet` exactTyCoVarsOfType sig_ty) + (tyCoVarsOfTypeList sig_ty) ; checkTc (null bad_tvs) (badPatTyVarTvs sig_ty bad_tvs) -- Now do a subsumption check of the pattern signature against res_ty @@ -2562,13 +2557,14 @@ patBindSigErr sig_tvs {- Note [Pattern signature binders] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +See also Note [Type variables in the type environment] in TcRnTypes. Consider data T where MkT :: forall a. a -> (a -> Int) -> T f :: T -> ... - f (MkT x (f :: b -> c)) = ... + f (MkT x (f :: b -> c)) = Here * The pattern (MkT p1 p2) creates a *skolem* type variable 'a_sk', @@ -2581,13 +2577,10 @@ Here * Then unification makes beta := a_sk, gamma := Int That's why we must make beta and gamma a MetaTv, - not a SkolemTv, so that it can unify to a_sk rsp. Int. - Note that gamma unifies with a type, not just a type variable - (see https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0029-scoped-type-variables-types.rst) + not a SkolemTv, so that it can unify to a_sk (or Int, respectively). - * Finally, in 'blah' we must have the envt "b" :-> a_sk, "c" :-> Int. - The pairs ("b" :-> a_sk, "c" :-> Int) are returned by tcHsPatSigType, - constructed by mk_tv_pair in that function. + * Finally, in '' we have the envt "b" :-> beta, "c" :-> gamma, + so we return the pairs ("b" :-> beta, "c" :-> gamma) from tcHsPatSigType, Another example (Trac #13881): fl :: forall (l :: [a]). Sing l -> Sing l @@ -2600,14 +2593,13 @@ We make up a fresh meta-TauTv, y_sig, for 'y', and kind-check the pattern signature Sing (l :: [y]) That unifies y_sig := a_sk. We return from tcHsPatSigType with -the pair ("y" :-> a_sk). +the pair ("y" :-> y_sig). For RULE binders, though, things are a bit different (yuk). RULE "foo" forall (x::a) (y::[a]). f x y = ... Here this really is the binding site of the type variable so we'd like to use a skolem, so that we get a complaint if we unify two of them -together. - +together. Hence the new_tv function in tcHsPatSigType. ************************************************************************ diff --git a/compiler/typecheck/TcRnTypes.hs b/compiler/typecheck/TcRnTypes.hs index 131e57b..a411975 100644 --- a/compiler/typecheck/TcRnTypes.hs +++ b/compiler/typecheck/TcRnTypes.hs @@ -1081,10 +1081,7 @@ data TcTyThing , tct_info :: IdBindingInfo -- See Note [Meaning of IdBindingInfo] } - | ATyVar Name TcTyVar -- The type variable to which the lexically scoped type - -- variable is bound. We only need the Name - -- for error-message purposes; it is the corresponding - -- Name in the domain of the envt + | ATyVar Name TcTyVar -- See Note [Type variables in the type environment] | ATcTyCon TyCon -- Used temporarily, during kind checking, for the -- tycons and clases in this recursive group @@ -1251,6 +1248,48 @@ variables have ClosedTypeId=True (or imported). This is an extension compared to the JFP paper on OutsideIn, which used "top-level" as a proxy for "closed". (It's not a good proxy anyway -- the MR can make a top-level binding with a free type variable.) + +Note [Type variables in the type environment] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +The type environment has a binding for each lexically-scoped +type variable that is in scope. For example + + f :: forall a. a -> a + f x = (x :: a) + + g1 :: [a] -> a + g1 (ys :: [b]) = head ys :: b + + g2 :: [Int] -> Int + g2 (ys :: [c]) = head ys :: c + +* The forall'd variable 'a' in the signature scopes over f's RHS. + +* The pattern-bound type variable 'b' in 'g1' scopes over g1's + RHS; note that it is bound to a skolem 'a' which is not itself + lexically in scope. + +* The pattern-bound type variable 'c' in 'g2' is bound to + Int; that is, pattern-bound type variables can stand for + arbitrary types. (see + GHC proposal #128 "Allow ScopedTypeVariables to refer to types" + https://github.com/ghc-proposals/ghc-proposals/pull/128, + and the paper + "Type variables in patterns", Haskell Symposium 2018. + + +This is implemented by the constructor + ATyVar Name TcTyVar +in the type environment. + +* The Name is the name of the original, lexically scoped type + variable + +* The TcTyVar is sometimes a skolem (like in 'f'), and sometimes + a unification variable (like in 'g1', 'g2'). We never zonk the + type environment so in the latter case it always stays as a + unification variable, although that variable may be later + unified with a type (such as Int in 'g2'). -} instance Outputable IdBindingInfo where diff --git a/testsuite/tests/typecheck/should_compile/T15778.hs b/testsuite/tests/typecheck/should_compile/T15778.hs new file mode 100644 index 0000000..4c95d37 --- /dev/null +++ b/testsuite/tests/typecheck/should_compile/T15778.hs @@ -0,0 +1,6 @@ +{-# LANGUAGE ScopedTypeVariables #-} +{-# LANGUAGE TypeInType #-} + +module T15778 where + +f (x :: (Int :: a)) = True :: (Bool :: a) diff --git a/testsuite/tests/typecheck/should_compile/all.T b/testsuite/tests/typecheck/should_compile/all.T index b9cb68e..36cc4b4 100644 --- a/testsuite/tests/typecheck/should_compile/all.T +++ b/testsuite/tests/typecheck/should_compile/all.T @@ -651,3 +651,4 @@ test('T15473', normal, compile_fail, ['']) test('T15499', normal, compile, ['']) test('T15586', normal, compile, ['']) test('T15368', normal, compile, ['-fdefer-type-errors']) +test('T15778', normal, compile, ['']) From git at git.haskell.org Thu Oct 25 08:48:31 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 25 Oct 2018 08:48:31 +0000 (UTC) Subject: [commit: ghc] master: Improve documentation about overlapping instances (09481a7) Message-ID: <20181025084831.EB7B83ABBA@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/09481a708caad699b65712dedd321cbbc19851a7/ghc >--------------------------------------------------------------- commit 09481a708caad699b65712dedd321cbbc19851a7 Author: Simon Peyton Jones Date: Thu Oct 25 09:47:32 2018 +0100 Improve documentation about overlapping instances An attempt to help with Trac #15800 >--------------------------------------------------------------- 09481a708caad699b65712dedd321cbbc19851a7 docs/users_guide/glasgow_exts.rst | 50 ++++++++++++++++++++++++++++----------- 1 file changed, 36 insertions(+), 14 deletions(-) diff --git a/docs/users_guide/glasgow_exts.rst b/docs/users_guide/glasgow_exts.rst index 4a77f3b..366dd98 100644 --- a/docs/users_guide/glasgow_exts.rst +++ b/docs/users_guide/glasgow_exts.rst @@ -6792,9 +6792,12 @@ like this: target constraint is a substitution instance of :math:`I`. These instance declarations are the *candidates*. -- Eliminate any candidate :math:`IX` for which both of the following hold: +- If no candidates remain, the search failes - - There is another candidate :math:`IY` that is strictly more specific; that +- Eliminate any candidate :math:`IX` for which there is another candidate + :math:`IY` such that both of the following hold: + + - :math:`IY` is strictly more specific than :math:`IX`. That is, :math:`IY` is a substitution instance of :math:`IX` but not vice versa. - Either :math:`IX` is *overlappable*, or :math:`IY` is *overlapping*. (This @@ -6802,19 +6805,20 @@ like this: client to deliberately override an instance from a library, without requiring a change to the library.) -- If exactly one non-incoherent candidate remains, select it. If all - remaining candidates are incoherent, select an arbitrary one. - Otherwise the search fails (i.e. when more than one surviving - candidate is not incoherent). +- If all the remaining candidates are incoherent, the search suceeds, returning + an arbitrary surviving candidate. + +- If more than one non-incoherent candidate remains, the search fails. -- If the selected candidate (from the previous step) is incoherent, the - search succeeds, returning that candidate. +- Otherwise there is exactly one non-incoherent candidate; call it the + "prime candidate". -- If not, find all instances that *unify* with the target constraint, +- Now find all instances, or in-scope given constraints, that *unify* with + the target constraint, but do not *match* it. Such non-candidate instances might match when the target constraint is further instantiated. If all of them are - incoherent, the search succeeds, returning the selected candidate; if - not, the search fails. + incoherent top-level instances, the search succeeds, returning the prime candidate. + Otherwise the search fails. Notice that these rules are not influenced by flag settings in the client module, where the instances are *used*. These rules make it @@ -6856,15 +6860,16 @@ former is a substitution instance of the latter. For example (D) is "more specific" than (C) because you can get from (C) to (D) by substituting ``a := Int``. -GHC is conservative about committing to an overlapping instance. For -example: :: +The final bullet (about unifiying instances) +makes GHC conservative about committing to an +overlapping instance. For example: :: f :: [b] -> [b] f x = ... Suppose that from the RHS of ``f`` we get the constraint ``C b [b]``. But GHC does not commit to instance (C), because in a particular call of -``f``, ``b`` might be instantiate to ``Int``, in which case instance (D) +``f``, ``b`` might be instantiated to ``Int``, in which case instance (D) would be more specific still. So GHC rejects the program. If, however, you enable the extension :extension:`IncoherentInstances` when compiling @@ -6905,6 +6910,23 @@ declaration, thus: :: (You need :extension:`FlexibleInstances` to do this.) +In the unification check in the final bullet, GHC also uses the +"in-scope given constraints". Consider for example :: + + instance C a Int + + g :: forall b c. C b Int => blah + g = ...needs (C c Int)... + +Here GHC will not solve the constraint ``(C c Int)`` from the +top-level instance, because a particular call of ``g`` might +instantiate both ``b`` and ``c`` to the same type, which would +allow the constraint to be solved in a different way. This latter +restriction is principally to make the constraint-solver complete. +(Interested folk can read ``Note [Instance and Given overlap]`` in ``TcInteract``.) +It is easy to avoid: in a type signature avoid a constraint that +matches a top-level instance. The flag :ghc-flag:`-Wsimplifiable-class-constraints` warns about such signatures. + .. warning:: Overlapping instances must be used with care. They can give rise to incoherence (i.e. different instance choices are made in From git at git.haskell.org Thu Oct 25 11:49:24 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 25 Oct 2018 11:49:24 +0000 (UTC) Subject: [commit: ghc] master: Improve comments, triggered by Trac #15135 (a9a09b5) Message-ID: <20181025114924.2DD583ABBA@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/a9a09b53c3f50df576564e8616b6dd4be029dcf6/ghc >--------------------------------------------------------------- commit a9a09b53c3f50df576564e8616b6dd4be029dcf6 Author: Simon Peyton Jones Date: Thu Oct 25 12:47:48 2018 +0100 Improve comments, triggered by Trac #15135 >--------------------------------------------------------------- a9a09b53c3f50df576564e8616b6dd4be029dcf6 compiler/typecheck/ClsInst.hs | 21 +++++++++++++++++++++ compiler/typecheck/TcInteract.hs | 14 +------------- 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/compiler/typecheck/ClsInst.hs b/compiler/typecheck/ClsInst.hs index cacceef..03adfde 100644 --- a/compiler/typecheck/ClsInst.hs +++ b/compiler/typecheck/ClsInst.hs @@ -170,6 +170,27 @@ match_one so dfun_id mb_inst_tys , iw_safe_over = so } } } +{- Note [Shortcut solving: overlap] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Suppose we have + instance {-# OVERLAPPABLE #-} C a where ... +and we are typechecking + f :: C a => a -> a + f = e -- Gives rise to [W] C a + +We don't want to solve the wanted constraint with the overlappable +instance; rather we want to use the supplied (C a)! That was the whole +point of it being overlappable! Trac #14434 wwas an example. + +Alas even if the instance has no overlap flag, thus + instance C a where ... +there is nothing to stop it being overlapped. GHC provides no way to +declare an instance as "final" so it can't be overlapped. But really +only final instances are OK for short-cut solving. Sigh. Trac #15135 +was a puzzling example. +-} + + {- ******************************************************************** * * Class lookup for CTuples diff --git a/compiler/typecheck/TcInteract.hs b/compiler/typecheck/TcInteract.hs index 3914db6..32b4718 100644 --- a/compiler/typecheck/TcInteract.hs +++ b/compiler/typecheck/TcInteract.hs @@ -921,18 +921,6 @@ unique match on the (Take n) instance. That leads immediately to an infinite loop. Hence the check that 'preds' have no type families (isTyFamFree). -Note [Shortcut solving: overlap] -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Suppose we have - instance {-# OVERLAPPABLE #-} C a where ... -and we are typechecking - f :: C a => a -> a - f = e -- Gives rise to [W] C a - -We don't want to solve the wanted constraint with the overlappable -instance; rather we want to use the supplied (C a)! That was the whole -point of it being overlappable! Trac #14434 wwas an example. - Note [Shortcut solving: incoherence] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This optimization relies on coherence of dictionaries to be correct. When we @@ -1002,7 +990,7 @@ The workhorse of the short-cut solver is -> MaybeT TcS (EvBindMap, DictMap CtEvidence) Note that: -* The CtEvidence is teh goal to be solved +* The CtEvidence is the goal to be solved * The MaybeT anages early failure if we find a subgoal that cannot be solved from instances. From git at git.haskell.org Thu Oct 25 13:31:13 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 25 Oct 2018 13:31:13 +0000 (UTC) Subject: [commit: ghc] master: Fix comment in TcType (d85606d) Message-ID: <20181025133113.35C9B3ABBA@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/d85606d6dcc439a5d3e32da920cf605c13ce0781/ghc >--------------------------------------------------------------- commit d85606d6dcc439a5d3e32da920cf605c13ce0781 Author: Simon Peyton Jones Date: Thu Oct 25 14:30:40 2018 +0100 Fix comment in TcType >--------------------------------------------------------------- d85606d6dcc439a5d3e32da920cf605c13ce0781 compiler/typecheck/TcType.hs | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/compiler/typecheck/TcType.hs b/compiler/typecheck/TcType.hs index 3202636..5bbaa0f 100644 --- a/compiler/typecheck/TcType.hs +++ b/compiler/typecheck/TcType.hs @@ -891,28 +891,13 @@ Note [Silly type synonym] Consider type T a = Int What are the free tyvars of (T x)? Empty, of course! -Here's the example that Ralf Laemmel showed me: - foo :: (forall a. C u a -> C u a) -> u - mappend :: Monoid u => u -> u -> u - - bar :: Monoid u => u - bar = foo (\t -> t `mappend` t) -We have to generalise at the arg to f, and we don't -want to capture the constraint (Monad (C u a)) because -it appears to mention a. Pretty silly, but it was useful to him. exactTyCoVarsOfType is used by the type checker to figure out exactly -which type variables are mentioned in a type. It's also used in the -smart-app checking code --- see TcExpr.tcIdApp - -On the other hand, consider a *top-level* definition - f = (\x -> x) :: T a -> T a -If we don't abstract over 'a' it'll get fixed to GHC.Prim.Any, and then -if we have an application like (f "x") we get a confusing error message -involving Any. So the conclusion is this: when generalising - - at top level use tyCoVarsOfType - - in nested bindings use exactTyCoVarsOfType -See Trac #1813 for example. +which type variables are mentioned in a type. It only matters +occasionally -- see the calls to exactTyCoVarsOfType. + +Historical note: years and years ago this function was used during +generalisation -- see Trac #1813. But that code has long since died. -} exactTyCoVarsOfType :: Type -> TyCoVarSet From git at git.haskell.org Thu Oct 25 14:02:41 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 25 Oct 2018 14:02:41 +0000 (UTC) Subject: [commit: ghc] master: Update core-spec for Coercion Quantification (3905c3c) Message-ID: <20181025140241.C3F1F3ABBA@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/3905c3c07ba2735e5b3d2dc3389272d5dbb1c503/ghc >--------------------------------------------------------------- commit 3905c3c07ba2735e5b3d2dc3389272d5dbb1c503 Author: Ningning Xie Date: Thu Oct 25 22:01:21 2018 +0800 Update core-spec for Coercion Quantification Summary: Update details for `ForAllTy` and `ForAllCo` in core-spec, as they can now quantify over coercion variables. Test Plan: Please read core-spec.pdf Reviewers: goldfire, simonpj, bgamari Reviewed By: goldfire Subscribers: rwbarton, carter GHC Trac Issues: #15497, #15589 Differential Revision: https://phabricator.haskell.org/D5247 >--------------------------------------------------------------- 3905c3c07ba2735e5b3d2dc3389272d5dbb1c503 docs/core-spec/Makefile | 4 +++- docs/core-spec/core-spec.mng | 10 +++++++++- docs/core-spec/core-spec.pdf | Bin 356480 -> 366926 bytes 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/docs/core-spec/Makefile b/docs/core-spec/Makefile index de0cac6..06b41ca 100644 --- a/docs/core-spec/Makefile +++ b/docs/core-spec/Makefile @@ -3,6 +3,8 @@ OTT_TEX = CoreOtt.tex OTT_OPTS = -tex_show_meta false TARGET = core-spec +all: $(TARGET).pdf + $(TARGET).pdf: $(TARGET).tex $(OTT_TEX) latex -output-format=pdf $< latex -output-format=pdf $< @@ -13,6 +15,6 @@ $(TARGET).tex: $(TARGET).mng $(OTT_FILES) $(OTT_TEX): $(OTT_FILES) ott -tex_wrap false $(OTT_OPTS) -o $@ $^ -.PHONY: clean +.PHONY: all clean clean: rm -f $(TARGET).pdf $(TARGET).tex $(OTT_TEX) *.aux *.fdb_latexmk *.log *.fls diff --git a/docs/core-spec/core-spec.mng b/docs/core-spec/core-spec.mng index 952a172..bdebc32 100644 --- a/docs/core-spec/core-spec.mng +++ b/docs/core-spec/core-spec.mng @@ -188,6 +188,10 @@ The constructor for a saturated $[[(->)]]$ is \texttt{FunTy}. a term-level literal, but we are ignoring this distinction here. \item A coercion used as a type should appear only in the right-hand side of an application. +\item If $[[forall n. t]]$ is a polymorphic type over a coercion variable (i.e. + $[[n]]$ is a coercion variable), then $[[n]]$ must appear in $[[t]]$; + otherwise it should be represented as a \texttt{FunTy}. See \texttt{Note + [Unused coercion variable in ForAllTy]} in \ghcfile{types/TyCoRep.hs}. \end{itemize} Note that the use of the $[[T ]]$ form and the $[[t1 -> t2]]$ form @@ -195,7 +199,7 @@ are purely representational. The metatheory would remain the same if these forms were removed in favor of $[[t1 t2]]$. Nevertheless, we keep all three forms in this documentation to accurately reflect the implementation. -The \texttt{ArgFlag} field of a \texttt{TyVarBinder} (the first argument to a +The \texttt{ArgFlag} field of a \texttt{TyCoVarBinder} (the first argument to a \texttt{ForAllTy}) also tracks visibility of arguments. Visibility affects only source Haskell, and is omitted from this presentation. @@ -216,6 +220,10 @@ be a type function. \item The name in a coercion must be a term-level name (\ctor{Id}). \item The contents of $[[]]$ must not be a coercion. In other words, the payload in a \texttt{Refl} must not be built with \texttt{CoercionTy}. +\item If $[[forall z: h .g]]$ is a polymorphic coercion over a coercion variable + (i.e. $[[z]]$ is a coercion variable), then $[[z]]$ can only appear in + \texttt{Refl} and \texttt{GRefl} in $[[g]]$. See \texttt{Note[Unused coercion + variable in ForAllCo] in \ghcfile{types/Coercion.hs}}. \end{itemize} The \texttt{UnivCo} constructor takes several arguments: the two types coerced diff --git a/docs/core-spec/core-spec.pdf b/docs/core-spec/core-spec.pdf index a0a73cb..0c238c5 100644 Binary files a/docs/core-spec/core-spec.pdf and b/docs/core-spec/core-spec.pdf differ From git at git.haskell.org Thu Oct 25 15:34:28 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 25 Oct 2018 15:34:28 +0000 (UTC) Subject: [commit: ghc] master: A little more wibbling to -ddump-types (9a779d9) Message-ID: <20181025153428.38A0F3ABBA@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/9a779d9fe05a0e6eec1db9b5c22fb5e9ae81eb91/ghc >--------------------------------------------------------------- commit 9a779d9fe05a0e6eec1db9b5c22fb5e9ae81eb91 Author: Simon Peyton Jones Date: Thu Oct 25 16:33:47 2018 +0100 A little more wibbling to -ddump-types >--------------------------------------------------------------- 9a779d9fe05a0e6eec1db9b5c22fb5e9ae81eb91 compiler/typecheck/TcRnDriver.hs | 3 +-- testsuite/tests/indexed-types/should_compile/T3017.stderr | 2 ++ testsuite/tests/roles/should_compile/Roles3.stderr | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/compiler/typecheck/TcRnDriver.hs b/compiler/typecheck/TcRnDriver.hs index b327789..4d2141b 100644 --- a/compiler/typecheck/TcRnDriver.hs +++ b/compiler/typecheck/TcRnDriver.hs @@ -2734,8 +2734,7 @@ ppr_tycons debug fam_insts type_env , want_tycon tycon] -- Sort by OccName to reduce unnecessary changes want_tycon tycon | debug = True - | otherwise = not (isImplicitTyCon tycon) && - isExternalName (tyConName tycon) && + | otherwise = isExternalName (tyConName tycon) && not (tycon `elem` fi_tycons) ppr_tc tc = vcat [ ppWhen show_roles $ diff --git a/testsuite/tests/indexed-types/should_compile/T3017.stderr b/testsuite/tests/indexed-types/should_compile/T3017.stderr index 2a57edf..3b4361a 100644 --- a/testsuite/tests/indexed-types/should_compile/T3017.stderr +++ b/testsuite/tests/indexed-types/should_compile/T3017.stderr @@ -6,6 +6,8 @@ TYPE SIGNATURES forall c a b. (Coll c, Num a, Num b, Elem c ~ (a, b)) => c -> c TYPE CONSTRUCTORS Coll :: * -> Constraint + type role Elem nominal + Elem :: * -> * ListColl :: * -> * COERCION AXIOMS axiom Foo.D:R:ElemListColl :: diff --git a/testsuite/tests/roles/should_compile/Roles3.stderr b/testsuite/tests/roles/should_compile/Roles3.stderr index ff36be8..b3507b0 100644 --- a/testsuite/tests/roles/should_compile/Roles3.stderr +++ b/testsuite/tests/roles/should_compile/Roles3.stderr @@ -8,6 +8,8 @@ TYPE CONSTRUCTORS C2 :: * -> * -> Constraint C3 :: * -> * -> Constraint C4 :: * -> * -> Constraint + type role F3 nominal + F3 :: * -> * type role F4 nominal F4 :: * -> * type role Syn1 nominal From git at git.haskell.org Fri Oct 26 09:54:39 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 26 Oct 2018 09:54:39 +0000 (UTC) Subject: [commit: ghc] master: De-monadise the 'extract' functions in RnTypes (e6bf96c) Message-ID: <20181026095439.4F7813ABBA@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/e6bf96c9700aacbd75169dbf2cc14c9216c0133f/ghc >--------------------------------------------------------------- commit e6bf96c9700aacbd75169dbf2cc14c9216c0133f Author: Simon Peyton Jones Date: Thu Oct 25 17:33:12 2018 +0100 De-monadise the 'extract' functions in RnTypes As Trac #15765 says, Once upon a time, the extract functions at the bottom of RnTypes were pure. Then, along came -XTypeInType, which needed to do a check in these functions for users mixing type variables with kind variables. Now, however, with -XTypeInType gone again, we no longer do this check. Thus, there is no reason to keep these functions monadic. >--------------------------------------------------------------- e6bf96c9700aacbd75169dbf2cc14c9216c0133f compiler/rename/RnSource.hs | 26 +++--- compiler/rename/RnTypes.hs | 184 ++++++++++++++++++++--------------------- compiler/typecheck/TcSplice.hs | 3 +- 3 files changed, 102 insertions(+), 111 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc e6bf96c9700aacbd75169dbf2cc14c9216c0133f From git at git.haskell.org Fri Oct 26 09:58:26 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 26 Oct 2018 09:58:26 +0000 (UTC) Subject: [commit: ghc] branch 'wip/T15791' created Message-ID: <20181026095826.2F7553ABBD@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/T15791 Referencing: 339b814bb45d9ccb658c7ea9fb038a73f790ddd9 From git at git.haskell.org Fri Oct 26 09:58:29 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 26 Oct 2018 09:58:29 +0000 (UTC) Subject: [commit: ghc] wip/T15791: Work in progress on Trac #15791 (339b814) Message-ID: <20181026095829.5A4DC3ABBD@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T15791 Link : http://ghc.haskell.org/trac/ghc/changeset/339b814bb45d9ccb658c7ea9fb038a73f790ddd9/ghc >--------------------------------------------------------------- commit 339b814bb45d9ccb658c7ea9fb038a73f790ddd9 Author: Simon Peyton Jones Date: Fri Oct 26 10:57:51 2018 +0100 Work in progress on Trac #15791 >--------------------------------------------------------------- 339b814bb45d9ccb658c7ea9fb038a73f790ddd9 compiler/typecheck/ClsInst.hs | 4 +-- compiler/typecheck/FamInst.hs | 4 +-- compiler/typecheck/Inst.hs | 8 +++--- compiler/typecheck/TcCanonical.hs | 16 +++++------ compiler/typecheck/TcDeriv.hs | 10 +++---- compiler/typecheck/TcDerivInfer.hs | 6 ++-- compiler/typecheck/TcErrors.hs | 12 ++++---- compiler/typecheck/TcExpr.hs | 4 +-- compiler/typecheck/TcFlatten.hs | 38 +++++++++++++------------- compiler/typecheck/TcHsSyn.hs | 2 +- compiler/typecheck/TcHsType.hs | 14 +++++----- compiler/typecheck/TcInteract.hs | 4 +-- compiler/typecheck/TcMType.hs | 10 +++---- compiler/typecheck/TcPat.hs | 2 +- compiler/typecheck/TcPatSyn.hs | 4 +-- compiler/typecheck/TcRnDriver.hs | 2 +- compiler/typecheck/TcRnTypes.hs | 4 +-- compiler/typecheck/TcSimplify.hs | 4 +-- compiler/typecheck/TcSplice.hs | 6 ++-- compiler/typecheck/TcTyClsDecls.hs | 8 +++--- compiler/typecheck/TcType.hs | 22 +++++++-------- compiler/typecheck/TcUnify.hs | 12 ++++---- compiler/typecheck/TcValidity.hs | 10 +++---- compiler/types/Type.hs | 56 ++++++++++++++++++++++++++++++-------- 24 files changed, 148 insertions(+), 114 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 339b814bb45d9ccb658c7ea9fb038a73f790ddd9 From git at git.haskell.org Fri Oct 26 13:05:02 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 26 Oct 2018 13:05:02 +0000 (UTC) Subject: [commit: ghc] master: Fix generalisation for type constructors (4de4b22) Message-ID: <20181026130502.911493ABBD@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/4de4b2253caa685a39cc654d553cdf63b8babbee/ghc >--------------------------------------------------------------- commit 4de4b2253caa685a39cc654d553cdf63b8babbee Author: Simon Peyton Jones Date: Thu Oct 25 15:16:19 2018 +0100 Fix generalisation for type constructors Fixing the way that we close-over-kinds when taking the free vars of a type revealed that the way we generalise type constructors was a bit wrong. This fixes it. See TcTyClDecls Note [Generalisation for type constructors] >--------------------------------------------------------------- 4de4b2253caa685a39cc654d553cdf63b8babbee compiler/typecheck/TcTyClsDecls.hs | 58 +++++++++++++++++++++--- compiler/typecheck/TcValidity.hs | 92 +++++++++++++++----------------------- 2 files changed, 86 insertions(+), 64 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 4de4b2253caa685a39cc654d553cdf63b8babbee From git at git.haskell.org Fri Oct 26 13:05:05 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 26 Oct 2018 13:05:05 +0000 (UTC) Subject: [commit: ghc] master: Fix nasty bug in the type free-var finder, at last (503514b) Message-ID: <20181026130505.94BF93ABBD@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/503514b94f8dc7bd9eab5392206649aee45f140b/ghc >--------------------------------------------------------------- commit 503514b94f8dc7bd9eab5392206649aee45f140b Author: Simon Peyton Jones Date: Fri Oct 26 11:54:20 2018 +0100 Fix nasty bug in the type free-var finder, at last Consider the type forall k. b -> k where b :: k -> Type Here the 'k' in b's kind must be a different 'k' to the forall k, because 'b' is free in the expression. So we must return 'k' among the free vars returned from tyCoVarsOfType applied that type. But we weren't. This is an outright bug, although we don't have a program that fails because of it. It's easy to fix, too: see TyCoRep Note [Closing over free variable kinds] This fix has been in the pipeline for ages because it fell into the Trac #14880 swamp. But this patch nails it. >--------------------------------------------------------------- 503514b94f8dc7bd9eab5392206649aee45f140b compiler/types/TyCoRep.hs | 106 ++++++++++++++++++--- .../partial-sigs/should_compile/T12844.stderr | 2 +- .../partial-sigs/should_compile/T15039a.stderr | 2 +- .../partial-sigs/should_compile/T15039b.stderr | 2 +- .../partial-sigs/should_compile/T15039c.stderr | 2 +- .../partial-sigs/should_compile/T15039d.stderr | 2 +- .../tests/partial-sigs/should_run/T15415.stderr | 8 +- testsuite/tests/polykinds/T14265.stderr | 2 +- 8 files changed, 104 insertions(+), 22 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 503514b94f8dc7bd9eab5392206649aee45f140b From git at git.haskell.org Fri Oct 26 16:18:23 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 26 Oct 2018 16:18:23 +0000 (UTC) Subject: [commit: ghc] branch 'wip/T15809' created Message-ID: <20181026161823.33E503ABBD@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/T15809 Referencing: a91bf67d3b8e10e433f8bda356400a03c80baa92 From git at git.haskell.org Fri Oct 26 16:18:26 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 26 Oct 2018 16:18:26 +0000 (UTC) Subject: [commit: ghc] wip/T15809: Tc-tracing, and order of arguments only (547f2d2) Message-ID: <20181026161826.330263ABBD@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T15809 Link : http://ghc.haskell.org/trac/ghc/changeset/547f2d219219b16e6a01d8446ec82a308daced57/ghc >--------------------------------------------------------------- commit 547f2d219219b16e6a01d8446ec82a308daced57 Author: Simon Peyton Jones Date: Fri Oct 26 14:15:31 2018 +0100 Tc-tracing, and order of arguments only I changed the order of arguments to reportAllUnsolved, and the tc-tracing that surrounds it. No change in behaviour >--------------------------------------------------------------- 547f2d219219b16e6a01d8446ec82a308daced57 compiler/typecheck/TcErrors.hs | 29 ++++++++++++++++------------- compiler/typecheck/TcRnMonad.hs | 2 ++ compiler/typecheck/TcSimplify.hs | 4 ---- 3 files changed, 18 insertions(+), 17 deletions(-) diff --git a/compiler/typecheck/TcErrors.hs b/compiler/typecheck/TcErrors.hs index 951107b..85ef381 100644 --- a/compiler/typecheck/TcErrors.hs +++ b/compiler/typecheck/TcErrors.hs @@ -146,8 +146,9 @@ reportUnsolved wanted | warn_out_of_scope = HoleWarn | otherwise = HoleDefer - ; report_unsolved binds_var type_errors expr_holes - type_holes out_of_scope_holes wanted + ; report_unsolved type_errors expr_holes + type_holes out_of_scope_holes + binds_var wanted ; ev_binds <- getTcEvBindsMap binds_var ; return (evBindMapBinds ev_binds)} @@ -162,8 +163,8 @@ reportUnsolved wanted reportAllUnsolved :: WantedConstraints -> TcM () reportAllUnsolved wanted = do { ev_binds <- newNoTcEvBinds - ; report_unsolved ev_binds TypeError - HoleError HoleError HoleError wanted } + ; report_unsolved TypeError HoleError HoleError HoleError + ev_binds wanted } -- | Report all unsolved goals as warnings (but without deferring any errors to -- run-time). See Note [Safe Haskell Overlapping Instances Implementation] in @@ -171,22 +172,23 @@ reportAllUnsolved wanted warnAllUnsolved :: WantedConstraints -> TcM () warnAllUnsolved wanted = do { ev_binds <- newTcEvBinds - ; report_unsolved ev_binds (TypeWarn NoReason) - HoleWarn HoleWarn HoleWarn wanted } + ; report_unsolved (TypeWarn NoReason) HoleWarn HoleWarn HoleWarn + ev_binds wanted } -- | Report unsolved goals as errors or warnings. -report_unsolved :: EvBindsVar -- cec_binds - -> TypeErrorChoice -- Deferred type errors +report_unsolved :: TypeErrorChoice -- Deferred type errors -> HoleChoice -- Expression holes -> HoleChoice -- Type holes -> HoleChoice -- Out of scope holes + -> EvBindsVar -- cec_binds -> WantedConstraints -> TcM () -report_unsolved mb_binds_var type_errors expr_holes - type_holes out_of_scope_holes wanted +report_unsolved type_errors expr_holes + type_holes out_of_scope_holes binds_var wanted | isEmptyWC wanted = return () | otherwise - = do { traceTc "reportUnsolved warning/error settings:" $ + = do { traceTc "reportUnsolved {" empty + ; traceTc "reportUnsolved warning/error settings:" $ vcat [ text "type errors:" <+> ppr type_errors , text "expr holes:" <+> ppr expr_holes , text "type holes:" <+> ppr type_holes @@ -219,10 +221,11 @@ report_unsolved mb_binds_var type_errors expr_holes -- See Trac #15539 and c.f. setting ic_status -- in TcSimplify.setImplicationStatus , cec_warn_redundant = warn_redundant - , cec_binds = mb_binds_var } + , cec_binds = binds_var } ; tc_lvl <- getTcLevel - ; reportWanteds err_ctxt tc_lvl wanted } + ; reportWanteds err_ctxt tc_lvl wanted + ; traceTc "reportUnsolved }" empty } -------------------------------------------- -- Internal functions diff --git a/compiler/typecheck/TcRnMonad.hs b/compiler/typecheck/TcRnMonad.hs index bef1044..5e6cb8f 100644 --- a/compiler/typecheck/TcRnMonad.hs +++ b/compiler/typecheck/TcRnMonad.hs @@ -1532,8 +1532,10 @@ pushLevelAndCaptureConstraints :: TcM a -> TcM (TcLevel, WantedConstraints, a) pushLevelAndCaptureConstraints thing_inside = do { env <- getLclEnv ; let tclvl' = pushTcLevel (tcl_tclvl env) + ; traceTc "pushLevelAndCaptureConstraints {" (ppr tclvl') ; (res, lie) <- setLclEnv (env { tcl_tclvl = tclvl' }) $ captureConstraints thing_inside + ; traceTc "pushLevelAndCaptureConstraints }" (ppr tclvl') ; return (tclvl', lie, res) } pushTcLevelM_ :: TcM a -> TcM a diff --git a/compiler/typecheck/TcSimplify.hs b/compiler/typecheck/TcSimplify.hs index 562340f..64b73a0 100644 --- a/compiler/typecheck/TcSimplify.hs +++ b/compiler/typecheck/TcSimplify.hs @@ -178,9 +178,7 @@ solveEqualities thing_inside -- vars to LiftedRep. This is needed to avoid #14991. ; traceTc "End solveEqualities }" empty - ; traceTc "reportAllUnsolved {" empty ; reportAllUnsolved final_wc - ; traceTc "reportAllUnsolved }" empty ; return result } -- | Simplify top-level constraints, but without reporting any unsolved @@ -514,9 +512,7 @@ simplifyDefault theta = do { traceTc "simplifyDefault" empty ; wanteds <- newWanteds DefaultOrigin theta ; unsolved <- runTcSDeriveds (solveWantedsAndDrop (mkSimpleWC wanteds)) - ; traceTc "reportUnsolved {" empty ; reportAllUnsolved unsolved - ; traceTc "reportUnsolved }" empty ; return () } ------------------ From git at git.haskell.org Fri Oct 26 16:18:29 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 26 Oct 2018 16:18:29 +0000 (UTC) Subject: [commit: ghc] wip/T15809: WIP on using level numbers for generalisation (a91bf67) Message-ID: <20181026161829.4721C3ABBD@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T15809 Link : http://ghc.haskell.org/trac/ghc/changeset/a91bf67d3b8e10e433f8bda356400a03c80baa92/ghc >--------------------------------------------------------------- commit a91bf67d3b8e10e433f8bda356400a03c80baa92 Author: Simon Peyton Jones Date: Fri Oct 26 17:11:07 2018 +0100 WIP on using level numbers for generalisation This mostly works. So far I simply have a WARNING in quantifyTyVars which fires if the two methods (old "global-tyvars" and new "level-numbers") give different answers. Some modest but important refactoring along the way. Main thing that is still wrong: in instance declarations we are not skoelmising. Here's a partial patch to TcInstDcls, that /doesn't/ yet work -- Next, process any associated types. ; traceTc "tcLocalInstDecl" (ppr poly_ty) - ; tyfam_insts0 <- scopeTyVars InstSkol tyvars $ - mapAndRecoverM (tcTyFamInstDecl mb_info) ats - ; datafam_stuff <- scopeTyVars InstSkol tyvars $ - mapAndRecoverM (tcDataFamInstDecl mb_info) adts + ; (_subst, skol_tvs) <- tcInstSkolTyVars tyvars + ; (tyfam_insts0, datafam_stuff) + <- tcExtendNameTyVarEnv (map tyVarName tyvars `zip` skol_tvs) $ + do { tfs <- mapAndRecoverM (tcTyFamInstDecl mb_info) ats + ; dfs <- mapAndRecoverM (tcDataFamInstDecl mb_info) adts + ; return (tfs, dfs) } ; let (datafam_insts, m_deriv_infos) = unzip datafam_stuff >--------------------------------------------------------------- a91bf67d3b8e10e433f8bda356400a03c80baa92 compiler/typecheck/TcHsType.hs | 93 +++++++++++++++++++++----------- compiler/typecheck/TcMType.hs | 107 +++++++++++++++++++++++++------------ compiler/typecheck/TcSimplify.hs | 19 ++++--- compiler/typecheck/TcTyClsDecls.hs | 86 ++++++++++++++--------------- compiler/typecheck/TcValidity.hs | 12 ++--- 5 files changed, 196 insertions(+), 121 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc a91bf67d3b8e10e433f8bda356400a03c80baa92 From git at git.haskell.org Fri Oct 26 17:31:12 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 26 Oct 2018 17:31:12 +0000 (UTC) Subject: [commit: ghc] master: Remove redundant SOURCE import (23956b2) Message-ID: <20181026173112.A81B93ABBD@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/23956b2ada690c78a134fe6d149940c777c7efcc/ghc >--------------------------------------------------------------- commit 23956b2ada690c78a134fe6d149940c777c7efcc Author: Simon Jakobi Date: Tue Oct 23 10:53:22 2018 +0200 Remove redundant SOURCE import >--------------------------------------------------------------- 23956b2ada690c78a134fe6d149940c777c7efcc compiler/prelude/PrelInfo.hs | 2 +- compiler/typecheck/TcTypeNats.hs-boot | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/compiler/prelude/PrelInfo.hs b/compiler/prelude/PrelInfo.hs index a76a78a..aab23de 100644 --- a/compiler/prelude/PrelInfo.hs +++ b/compiler/prelude/PrelInfo.hs @@ -70,7 +70,7 @@ import Class import TyCon import UniqFM import Util -import {-# SOURCE #-} TcTypeNats ( typeNatTyCons ) +import TcTypeNats ( typeNatTyCons ) import Control.Applicative ((<|>)) import Data.List ( intercalate ) diff --git a/compiler/typecheck/TcTypeNats.hs-boot b/compiler/typecheck/TcTypeNats.hs-boot deleted file mode 100644 index 12f3e41..0000000 --- a/compiler/typecheck/TcTypeNats.hs-boot +++ /dev/null @@ -1,5 +0,0 @@ -module TcTypeNats where - -import TyCon (TyCon) - -typeNatTyCons :: [TyCon] From git at git.haskell.org Sat Oct 27 18:55:15 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 27 Oct 2018 18:55:15 +0000 (UTC) Subject: [commit: ghc] master: More explicit foralls (GHC Proposal 0007) (512eeb9) Message-ID: <20181027185515.D25C73ABBD@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/512eeb9bb9a81e915bfab25ca16bc87c62252064/ghc >--------------------------------------------------------------- commit 512eeb9bb9a81e915bfab25ca16bc87c62252064 Author: Matthew Yacavone Date: Sat Oct 27 14:01:42 2018 -0400 More explicit foralls (GHC Proposal 0007) Allow the user to explicitly bind type/kind variables in type and data family instances (including associated instances), closed type family equations, and RULES pragmas. Follows the specification of GHC Proposal 0007, also fixes #2600. Advised by Richard Eisenberg. This modifies the Template Haskell AST -- old code may break! Other Changes: - convert HsRule to a record - make rnHsSigWcType more general - add repMaybe to DsMeta Includes submodule update for Haddock. Test Plan: validate Reviewers: goldfire, bgamari, alanz Subscribers: simonpj, RyanGlScott, goldfire, rwbarton, thomie, mpickering, carter GHC Trac Issues: #2600, #14268 Differential Revision: https://phabricator.haskell.org/D4894 >--------------------------------------------------------------- 512eeb9bb9a81e915bfab25ca16bc87c62252064 compiler/deSugar/Check.hs | 2 +- compiler/deSugar/Coverage.hs | 13 +- compiler/deSugar/Desugar.hs | 8 +- compiler/deSugar/DsArrows.hs | 2 +- compiler/deSugar/DsExpr.hs | 4 +- compiler/deSugar/DsMeta.hs | 189 +++++++++++++-------- compiler/deSugar/Match.hs | 4 +- compiler/deSugar/PmExpr.hs | 2 +- compiler/hsSyn/Convert.hs | 63 ++++--- compiler/hsSyn/HsDecls.hs | 85 +++++---- compiler/hsSyn/HsExpr.hs | 22 +-- compiler/hsSyn/HsExtension.hs | 40 +++-- compiler/hsSyn/HsPat.hs | 18 +- compiler/hsSyn/HsTypes.hs | 22 ++- compiler/hsSyn/HsUtils.hs | 8 +- compiler/main/HscMain.hs | 2 +- compiler/main/HscStats.hs | 3 +- compiler/parser/Parser.y | 177 +++++++++++++------ compiler/parser/RdrHsSyn.hs | 53 +++++- compiler/rename/RnBinds.hs | 2 +- compiler/rename/RnExpr.hs | 14 +- compiler/rename/RnPat.hs | 6 +- compiler/rename/RnSource.hs | 123 +++++++++----- compiler/rename/RnTypes.hs | 53 +++--- compiler/rename/RnUtils.hs | 5 +- compiler/typecheck/TcAnnotations.hs | 1 + compiler/typecheck/TcEnv.hs | 1 + compiler/typecheck/TcExpr.hs | 14 +- compiler/typecheck/TcGenDeriv.hs | 5 +- compiler/typecheck/TcHsSyn.hs | 30 ++-- compiler/typecheck/TcInstDcls.hs | 11 +- compiler/typecheck/TcPat.hs | 4 +- compiler/typecheck/TcPatSyn.hs | 4 +- compiler/typecheck/TcRnDriver.hs | 2 +- compiler/typecheck/TcRnTypes.hs | 2 +- compiler/typecheck/TcRules.hs | 100 +++++++---- compiler/typecheck/TcSplice.hs | 25 ++- compiler/typecheck/TcTyClsDecls.hs | 74 ++++++-- docs/users_guide/glasgow_exts.rst | 68 +++++++- docs/users_guide/using-warnings.rst | 18 +- ghc/GHCi/UI.hs | 4 +- .../template-haskell/Language/Haskell/TH/Lib.hs | 21 ++- .../Language/Haskell/TH/Lib/Internal.hs | 57 ++++--- .../template-haskell/Language/Haskell/TH/Ppr.hs | 41 +++-- .../template-haskell/Language/Haskell/TH/Syntax.hs | 12 +- libraries/template-haskell/changelog.md | 12 ++ .../tests/ghc-api/annotations/stringSource.hs | 2 +- testsuite/tests/ghc-api/annotations/t11430.hs | 6 +- .../should_compile/ExplicitForAllFams1.hs | 31 ++++ .../should_compile/ExplicitForAllFams2.hs | 39 +++++ .../should_compile/ExplicitForAllFams2.stderr | 12 ++ .../should_compile/UnusedTyVarWarnings.stderr | 14 +- .../UnusedTyVarWarningsNamedWCs.stderr | 14 +- testsuite/tests/indexed-types/should_compile/all.T | 3 + .../should_fail/ExplicitForAllFams3.hs | 23 +++ .../should_fail/ExplicitForAllFams3.stderr | 17 ++ .../should_fail/ExplicitForAllFams4a.hs | 8 + .../should_fail/ExplicitForAllFams4a.stderr | 8 + .../should_fail/ExplicitForAllFams4b.hs | 26 +++ .../should_fail/ExplicitForAllFams4b.stderr | 44 +++++ testsuite/tests/indexed-types/should_fail/all.T | 4 + .../parser/should_compile/DumpParsedAst.stderr | 2 + .../parser/should_compile/DumpRenamedAst.stderr | 3 + .../tests/parser/should_compile/KindSigs.stderr | 1 + .../rename/should_compile/ExplicitForAllRules1.hs | 45 +++++ .../should_compile/ExplicitForAllRules1.stderr | 4 + testsuite/tests/rename/should_compile/T2600.hs | 19 +++ testsuite/tests/rename/should_compile/T2600.stderr | 10 ++ testsuite/tests/rename/should_compile/all.T | 4 + .../rename/should_fail/ExplicitForAllRules2.hs | 12 ++ .../rename/should_fail/ExplicitForAllRules2.stderr | 10 ++ testsuite/tests/rename/should_fail/all.T | 2 + testsuite/tests/th/ClosedFam2TH.hs | 6 +- testsuite/tests/th/T12503.hs | 2 +- testsuite/tests/th/T12646.stderr | 5 +- testsuite/tests/th/T13618.hs | 8 +- testsuite/tests/th/T5886a.hs | 4 +- testsuite/tests/th/T6018th.hs | 30 ++-- testsuite/tests/th/T6018th.stderr | 6 +- testsuite/tests/th/T7532a.hs | 2 +- testsuite/tests/th/T8884.stderr | 5 +- testsuite/tests/th/T8953.stderr | 10 +- testsuite/tests/th/TH_ExplicitForAllRules.hs | 9 + testsuite/tests/th/TH_ExplicitForAllRules.stdout | 3 + testsuite/tests/th/TH_ExplicitForAllRules_a.hs | 10 ++ testsuite/tests/th/TH_reifyExplicitForAllFams.hs | 35 ++++ .../tests/th/TH_reifyExplicitForAllFams.stderr | 16 ++ testsuite/tests/th/all.T | 4 + utils/ghctags/Main.hs | 2 +- utils/haddock | 2 +- 90 files changed, 1411 insertions(+), 537 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 512eeb9bb9a81e915bfab25ca16bc87c62252064 From git at git.haskell.org Sun Oct 28 14:28:58 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 28 Oct 2018 14:28:58 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: Bump version to 8.6.2 (6f590e9) Message-ID: <20181028142858.90FBC3ABBD@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/6f590e9c65016e7605e8c2fba931c7536769fa0a/ghc >--------------------------------------------------------------- commit 6f590e9c65016e7605e8c2fba931c7536769fa0a Author: Ben Gamari Date: Wed Oct 17 18:39:25 2018 -0400 Bump version to 8.6.2 >--------------------------------------------------------------- 6f590e9c65016e7605e8c2fba931c7536769fa0a configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 5fd3441..257c4e5 100644 --- a/configure.ac +++ b/configure.ac @@ -13,7 +13,7 @@ dnl # see what flags are available. (Better yet, read the documentation!) # -AC_INIT([The Glorious Glasgow Haskell Compilation System], [8.6.1], [glasgow-haskell-bugs at haskell.org], [ghc-AC_PACKAGE_VERSION]) +AC_INIT([The Glorious Glasgow Haskell Compilation System], [8.6.2], [glasgow-haskell-bugs at haskell.org], [ghc-AC_PACKAGE_VERSION]) # Set this to YES for a released version, otherwise NO : ${RELEASE=YES} From git at git.haskell.org Sun Oct 28 14:29:11 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 28 Oct 2018 14:29:11 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: Bump hsc2hs submodule (093bbff) Message-ID: <20181028142911.4C6D43ABBD@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/093bbff2ce85709117280c9ec7855b1f201d894f/ghc >--------------------------------------------------------------- commit 093bbff2ce85709117280c9ec7855b1f201d894f Author: Ben Gamari Date: Thu Oct 18 09:17:53 2018 -0400 Bump hsc2hs submodule >--------------------------------------------------------------- 093bbff2ce85709117280c9ec7855b1f201d894f utils/hsc2hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/hsc2hs b/utils/hsc2hs index 769ac3c..0212778 160000 --- a/utils/hsc2hs +++ b/utils/hsc2hs @@ -1 +1 @@ -Subproject commit 769ac3cda8bd766e9a41a74eb681e2de1bac6795 +Subproject commit 0212778440cc83dabc3f1206fe04a3b934faf152 From git at git.haskell.org Sun Oct 28 15:44:32 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 28 Oct 2018 15:44:32 +0000 (UTC) Subject: [commit: ghc] master: Bump template-haskell version to 2.15.0.0 (32f47e3) Message-ID: <20181028154432.7BBD53ABBE@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/32f47e33f75efba9d61f7cca33158ea8a342b07e/ghc >--------------------------------------------------------------- commit 32f47e33f75efba9d61f7cca33158ea8a342b07e Author: Ryan Scott Date: Sun Oct 28 11:42:13 2018 -0400 Bump template-haskell version to 2.15.0.0 Summary: Commit 512eeb9bb9a81e915bfab25ca16bc87c62252064 (`More explicit foralls (GHC Proposal 0007)`) introduced breaking changes to the Template Haskell AST. As a consequence of this, there are libraries in the wild that now fail to build on GHC HEAD (for instance, `th-abstraction`). This properly bumps the `template-haskell` library's version number to `2.15.0.0` so that these libraries can guard against these changes using `MIN_VERSION_template_haskell`. Test Plan: ./validate Reviewers: bgamari Reviewed By: bgamari Subscribers: rwbarton, carter GHC Trac Issues: #15818 Differential Revision: https://phabricator.haskell.org/D5272 >--------------------------------------------------------------- 32f47e33f75efba9d61f7cca33158ea8a342b07e compiler/ghc.cabal.in | 2 +- libraries/ghci/ghci.cabal.in | 2 +- libraries/template-haskell/template-haskell.cabal | 2 +- testsuite/tests/th/TH_Roles2.stderr | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/compiler/ghc.cabal.in b/compiler/ghc.cabal.in index 5c9d88f..f952b88 100644 --- a/compiler/ghc.cabal.in +++ b/compiler/ghc.cabal.in @@ -64,7 +64,7 @@ Library containers >= 0.5 && < 0.7, array >= 0.1 && < 0.6, filepath >= 1 && < 1.5, - template-haskell == 2.14.*, + template-haskell == 2.15.*, hpc == 0.6.*, transformers == 0.5.*, ghc-boot == @ProjectVersionMunged@, diff --git a/libraries/ghci/ghci.cabal.in b/libraries/ghci/ghci.cabal.in index f49acf5..467ed8f 100644 --- a/libraries/ghci/ghci.cabal.in +++ b/libraries/ghci/ghci.cabal.in @@ -79,7 +79,7 @@ library ghc-boot == @ProjectVersionMunged@, ghc-boot-th == @ProjectVersionMunged@, ghc-heap == @ProjectVersionMunged@, - template-haskell == 2.14.*, + template-haskell == 2.15.*, transformers == 0.5.* if !os(windows) diff --git a/libraries/template-haskell/template-haskell.cabal b/libraries/template-haskell/template-haskell.cabal index 2b2c5db..90d67fc 100644 --- a/libraries/template-haskell/template-haskell.cabal +++ b/libraries/template-haskell/template-haskell.cabal @@ -1,5 +1,5 @@ name: template-haskell -version: 2.14.0.0 +version: 2.15.0.0 -- NOTE: Don't forget to update ./changelog.md license: BSD3 license-file: LICENSE diff --git a/testsuite/tests/th/TH_Roles2.stderr b/testsuite/tests/th/TH_Roles2.stderr index 3752e8c..c988015 100644 --- a/testsuite/tests/th/TH_Roles2.stderr +++ b/testsuite/tests/th/TH_Roles2.stderr @@ -4,7 +4,7 @@ TYPE CONSTRUCTORS Dependent modules: [] Dependent packages: [array-0.5.2.0, base-4.12.0.0, deepseq-1.4.4.0, ghc-boot-th-8.7, ghc-prim-0.5.3, integer-gmp-1.0.2.0, - pretty-1.1.3.6, template-haskell-2.14.0.0] + pretty-1.1.3.6, template-haskell-2.15.0.0] ==================== Typechecker ==================== TH_Roles2.$tcT From git at git.haskell.org Sun Oct 28 17:41:03 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 28 Oct 2018 17:41:03 +0000 (UTC) Subject: [commit: ghc] master: Fix `:k` command: add validity checking (c4a876d) Message-ID: <20181028174103.0ECFF3ABBE@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/c4a876d5f99554e87400946dd26ca11819d11673/ghc >--------------------------------------------------------------- commit c4a876d5f99554e87400946dd26ca11819d11673 Author: Ningning Xie Date: Sun Oct 28 12:26:12 2018 -0400 Fix `:k` command: add validity checking Summary: This patch fixes #15806, where we found that the `:k` command in GHCi misses a validity checking for the type. Missing validity checking causes `:k` to accept types that are not validated. For example, `:k (Maybe (forall a. a -> a))` (incorrectly) returns `*`, while impredictivity of type instantiation shouldn't be allowed. Test Plan: ./validate Reviewers: simonpj, goldfire, bgamari Reviewed By: bgamari Subscribers: rwbarton, carter GHC Trac Issues: #15806 Differential Revision: https://phabricator.haskell.org/D5265 >--------------------------------------------------------------- c4a876d5f99554e87400946dd26ca11819d11673 compiler/typecheck/TcHsType.hs | 2 +- compiler/typecheck/TcRnDriver.hs | 4 ++++ testsuite/tests/ghci/should_run/T15806.script | 3 +++ testsuite/tests/ghci/should_run/T15806.stderr | 3 +++ testsuite/tests/ghci/should_run/T15806.stdout | 1 + testsuite/tests/ghci/should_run/all.T | 1 + 6 files changed, 13 insertions(+), 1 deletion(-) diff --git a/compiler/typecheck/TcHsType.hs b/compiler/typecheck/TcHsType.hs index 24299dd..2194fa0 100644 --- a/compiler/typecheck/TcHsType.hs +++ b/compiler/typecheck/TcHsType.hs @@ -174,7 +174,7 @@ pprSigCtxt ctxt hs_ty tcHsSigWcType :: UserTypeCtxt -> LHsSigWcType GhcRn -> TcM Type -- This one is used when we have a LHsSigWcType, but in --- a place where wildards aren't allowed. The renamer has +-- a place where wildcards aren't allowed. The renamer has -- already checked this, so we can simply ignore it. tcHsSigWcType ctxt sig_ty = tcHsSigType ctxt (dropWildCards sig_ty) diff --git a/compiler/typecheck/TcRnDriver.hs b/compiler/typecheck/TcRnDriver.hs index 814a580..1c04327 100644 --- a/compiler/typecheck/TcRnDriver.hs +++ b/compiler/typecheck/TcRnDriver.hs @@ -51,6 +51,7 @@ import {-# SOURCE #-} TcSplice ( finishTH, runRemoteModFinalizers ) import RnSplice ( rnTopSpliceDecls, traceSplice, SpliceInfo(..) ) import IfaceEnv( externaliseName ) import TcHsType +import TcValidity( checkValidType ) import TcMatches import Inst( deeplyInstantiate ) import TcUnify( checkConstraints ) @@ -2397,6 +2398,9 @@ tcRnType hsc_env normalise rdr_type ; kvs <- kindGeneralize kind ; ty <- zonkTcTypeToType ty + -- Do validity checking on type + ; checkValidType GhciCtxt ty + ; ty' <- if normalise then do { fam_envs <- tcGetFamInstEnvs ; let (_, ty') diff --git a/testsuite/tests/ghci/should_run/T15806.script b/testsuite/tests/ghci/should_run/T15806.script new file mode 100644 index 0000000..71f0dee --- /dev/null +++ b/testsuite/tests/ghci/should_run/T15806.script @@ -0,0 +1,3 @@ +:set -XRankNTypes +:k (Maybe Int) +:k (Maybe (forall a. a -> a)) \ No newline at end of file diff --git a/testsuite/tests/ghci/should_run/T15806.stderr b/testsuite/tests/ghci/should_run/T15806.stderr new file mode 100644 index 0000000..b7e0b4b --- /dev/null +++ b/testsuite/tests/ghci/should_run/T15806.stderr @@ -0,0 +1,3 @@ +:1:1: error: + Illegal polymorphic type: forall a. a -> a + GHC doesn't yet support impredicative polymorphism \ No newline at end of file diff --git a/testsuite/tests/ghci/should_run/T15806.stdout b/testsuite/tests/ghci/should_run/T15806.stdout new file mode 100644 index 0000000..f4e9f23 --- /dev/null +++ b/testsuite/tests/ghci/should_run/T15806.stdout @@ -0,0 +1 @@ +(Maybe Int) :: * \ No newline at end of file diff --git a/testsuite/tests/ghci/should_run/all.T b/testsuite/tests/ghci/should_run/all.T index 70e200c..855b603 100644 --- a/testsuite/tests/ghci/should_run/all.T +++ b/testsuite/tests/ghci/should_run/all.T @@ -35,3 +35,4 @@ test('T14963a', just_ghci, ghci_script, ['T14963a.script']) test('T14963b', just_ghci, ghci_script, ['T14963b.script']) test('T14963c', [extra_hc_opts("-fdefer-type-errors")], ghci_script, ['T14963c.script']) test('T15007', just_ghci, ghci_script, ['T15007.script']) +test('T15806', just_ghci, ghci_script, ['T15806.script']) From git at git.haskell.org Sun Oct 28 17:41:06 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 28 Oct 2018 17:41:06 +0000 (UTC) Subject: [commit: ghc] master: Fix rare undefined asm temp end label error in x86 (3c452d0) Message-ID: <20181028174106.13F7A3ABBE@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/3c452d0dce33cb06ef739f4e44549a499277e11b/ghc >--------------------------------------------------------------- commit 3c452d0dce33cb06ef739f4e44549a499277e11b Author: Zejun Wu Date: Sun Oct 28 12:22:25 2018 -0400 Fix rare undefined asm temp end label error in x86 Summary: Encountered assembly error due to undefined label `.LcaDcU_info_end` for following code generated by `pprFrameProc`: ``` .Lsat_sa8fp{v}_info_fde_end: .long .Lblock{v caDcU}_info_fde_end-.Lblock{v caDcU}_info_fde .Lblock{v caDcU}_info_fde: .long _nbHlD-.Lsection_frame .quad block{v caDcU}_info-1 .quad .Lblock{v caDcU}_info_end-block{v caDcU}_info+1 .byte 1 ``` This diff fixed the error. Test Plan: ./validate Also the case where we used to have assembly error is now fixed. Unfortunately, I have limited insight here and cannot get a small enough repro or test case for this. Ben says: > I think I see: Previously we only produced end symbols for the info > tables of top-level procedures. However, blocks within a procedure may > also have info tables, we will dutifully generate debug information for > and consequently we get undefined symbols. Reviewers: simonmar, scpmw, last_g, bgamari Reviewed By: bgamari Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5246 >--------------------------------------------------------------- 3c452d0dce33cb06ef739f4e44549a499277e11b compiler/nativeGen/X86/Ppr.hs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/compiler/nativeGen/X86/Ppr.hs b/compiler/nativeGen/X86/Ppr.hs index 03d4fce..808d22a 100644 --- a/compiler/nativeGen/X86/Ppr.hs +++ b/compiler/nativeGen/X86/Ppr.hs @@ -115,8 +115,6 @@ pprNatCmmDecl proc@(CmmProc top_info lbl _ (ListGraph blocks)) = <+> char '-' <+> ppr (mkDeadStripPreventer info_lbl) else empty) $$ - (if debugLevel dflags > 0 - then ppr (mkAsmTempEndLabel info_lbl) <> char ':' else empty) $$ pprSizeDecl info_lbl -- | Output the ELF .size directive. @@ -130,20 +128,23 @@ pprSizeDecl lbl pprBasicBlock :: LabelMap CmmStatics -> NatBasicBlock Instr -> SDoc pprBasicBlock info_env (BasicBlock blockid instrs) = sdocWithDynFlags $ \dflags -> - maybe_infotable $$ + maybe_infotable dflags $ pprLabel asmLbl $$ vcat (map pprInstr instrs) $$ (if debugLevel dflags > 0 then ppr (mkAsmTempEndLabel asmLbl) <> char ':' else empty) where asmLbl = blockLbl blockid - maybe_infotable = case mapLookup blockid info_env of - Nothing -> empty - Just (Statics info_lbl info) -> + maybe_infotable dflags c = case mapLookup blockid info_env of + Nothing -> c + Just (Statics infoLbl info) -> pprAlignForSection Text $$ infoTableLoc $$ vcat (map pprData info) $$ - pprLabel info_lbl + pprLabel infoLbl $$ + c $$ + (if debugLevel dflags > 0 + then ppr (mkAsmTempEndLabel infoLbl) <> char ':' else empty) -- Make sure the info table has the right .loc for the block -- coming right after it. See [Note: Info Offset] infoTableLoc = case instrs of From git at git.haskell.org Sun Oct 28 17:41:09 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 28 Oct 2018 17:41:09 +0000 (UTC) Subject: [commit: ghc] master: includes: Allow headers to be built with C++11 compilers (134de45) Message-ID: <20181028174109.0EF153ABBE@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/134de45117bdbb031f513734b84403443e083fbe/ghc >--------------------------------------------------------------- commit 134de45117bdbb031f513734b84403443e083fbe Author: Ben Gamari Date: Sun Oct 28 12:24:06 2018 -0400 includes: Allow headers to be built with C++11 compilers Summary: Fixes #14784. Note that C++11 is quite conservative; we could likely accept C++03 as well. Test Plan: ``` $ cat >hi.c < EOF $ g++ -std=c++11 hi.c ``` Reviewers: simonmar, hvr Subscribers: rwbarton, carter GHC Trac Issues: #14784 Differential Revision: https://phabricator.haskell.org/D5244 >--------------------------------------------------------------- 134de45117bdbb031f513734b84403443e083fbe includes/Stg.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/Stg.h b/includes/Stg.h index 19069d8..3a11af1 100644 --- a/includes/Stg.h +++ b/includes/Stg.h @@ -25,8 +25,8 @@ #pragma once -#if !(__STDC_VERSION__ >= 199901L) -# error __STDC_VERSION__ does not advertise C99 or later +#if !(__STDC_VERSION__ >= 199901L) && !(__cplusplus >= 201103L) +# error __STDC_VERSION__ does not advertise C99, C++11 or later #endif /* From git at git.haskell.org Sun Oct 28 17:41:12 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 28 Oct 2018 17:41:12 +0000 (UTC) Subject: [commit: ghc] master: Fix for T14251 on ARM (d849554) Message-ID: <20181028174112.0BB213ABBE@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/d8495549ba9d194815c2d0eaee6797fc7c00756a/ghc >--------------------------------------------------------------- commit d8495549ba9d194815c2d0eaee6797fc7c00756a Author: Kavon Farvardin Date: Sun Oct 28 12:11:49 2018 -0400 Fix for T14251 on ARM We now calculate the SSE register padding needed to fix the calling convention in LLVM in a robust way: grouping them by whether registers in that class overlap (with the same class overlapping itself). My prior patch assumed that no matter the platform, physical register Fx aliases with Dx, etc, for our calling convention. This is unfortunately not the case for any platform except x86-64. Test Plan: Only know how to test on x86-64, but it should be tested on ARM with: `make test WAYS=llvm && make test WAYS=optllvm` Reviewers: bgamari, angerman Reviewed By: bgamari Subscribers: rwbarton, carter GHC Trac Issues: #15780, #14251, #15747 Differential Revision: https://phabricator.haskell.org/D5254 >--------------------------------------------------------------- d8495549ba9d194815c2d0eaee6797fc7c00756a compiler/llvmGen/LlvmCodeGen/Base.hs | 123 ++++++++++++++++++++++---------- compiler/llvmGen/LlvmCodeGen/CodeGen.hs | 6 +- 2 files changed, 90 insertions(+), 39 deletions(-) diff --git a/compiler/llvmGen/LlvmCodeGen/Base.hs b/compiler/llvmGen/LlvmCodeGen/Base.hs index ec91bac..0a40b73 100644 --- a/compiler/llvmGen/LlvmCodeGen/Base.hs +++ b/compiler/llvmGen/LlvmCodeGen/Base.hs @@ -26,7 +26,7 @@ module LlvmCodeGen.Base ( cmmToLlvmType, widthToLlvmFloat, widthToLlvmInt, llvmFunTy, llvmFunSig, llvmFunArgs, llvmStdFunAttrs, llvmFunAlign, llvmInfAlign, - llvmPtrBits, tysToParams, llvmFunSection, padLiveArgs, isSSE, + llvmPtrBits, tysToParams, llvmFunSection, padLiveArgs, isFPR, strCLabel_llvm, strDisplayName_llvm, strProcedureName_llvm, getGlobalPtr, generateExternDecls, @@ -47,6 +47,7 @@ import CodeGen.Platform ( activeStgRegs ) import DynFlags import FastString import Cmm hiding ( succ ) +import CmmUtils ( regsOverlap ) import Outputable as Outp import Platform import UniqFM @@ -58,8 +59,7 @@ import ErrUtils import qualified Stream import Control.Monad (ap) -import Data.List (sort) -import Data.Maybe (mapMaybe) +import Data.List (sort, groupBy, head) -- ---------------------------------------------------------------------------- -- * Some Data Types @@ -152,36 +152,91 @@ llvmFunArgs dflags live = map (lmGlobalRegArg dflags) (filter isPassed allRegs) where platform = targetPlatform dflags allRegs = activeStgRegs platform - paddedLive = map (\(_,r) -> r) $ padLiveArgs live + paddedLive = map (\(_,r) -> r) $ padLiveArgs dflags live isLive r = r `elem` alwaysLive || r `elem` paddedLive - isPassed r = not (isSSE r) || isLive r - - -isSSE :: GlobalReg -> Bool -isSSE (FloatReg _) = True -isSSE (DoubleReg _) = True -isSSE (XmmReg _) = True -isSSE (YmmReg _) = True -isSSE (ZmmReg _) = True -isSSE _ = False - -sseRegNum :: GlobalReg -> Maybe Int -sseRegNum (FloatReg i) = Just i -sseRegNum (DoubleReg i) = Just i -sseRegNum (XmmReg i) = Just i -sseRegNum (YmmReg i) = Just i -sseRegNum (ZmmReg i) = Just i -sseRegNum _ = Nothing - --- the bool indicates whether the global reg was added as padding. --- the returned list is not sorted in any particular order, --- but does indicate the set of live registers needed, with SSE padding. -padLiveArgs :: LiveGlobalRegs -> [(Bool, GlobalReg)] -padLiveArgs live = allRegs + isPassed r = not (isFPR r) || isLive r + + +isFPR :: GlobalReg -> Bool +isFPR (FloatReg _) = True +isFPR (DoubleReg _) = True +isFPR (XmmReg _) = True +isFPR (YmmReg _) = True +isFPR (ZmmReg _) = True +isFPR _ = False + +sameFPRClass :: GlobalReg -> GlobalReg -> Bool +sameFPRClass (FloatReg _) (FloatReg _) = True +sameFPRClass (DoubleReg _) (DoubleReg _) = True +sameFPRClass (XmmReg _) (XmmReg _) = True +sameFPRClass (YmmReg _) (YmmReg _) = True +sameFPRClass (ZmmReg _) (ZmmReg _) = True +sameFPRClass _ _ = False + +normalizeFPRNum :: GlobalReg -> GlobalReg +normalizeFPRNum (FloatReg _) = FloatReg 1 +normalizeFPRNum (DoubleReg _) = DoubleReg 1 +normalizeFPRNum (XmmReg _) = XmmReg 1 +normalizeFPRNum (YmmReg _) = YmmReg 1 +normalizeFPRNum (ZmmReg _) = ZmmReg 1 +normalizeFPRNum _ = error "normalizeFPRNum expected only FPR regs" + +getFPRCtor :: GlobalReg -> Int -> GlobalReg +getFPRCtor (FloatReg _) = FloatReg +getFPRCtor (DoubleReg _) = DoubleReg +getFPRCtor (XmmReg _) = XmmReg +getFPRCtor (YmmReg _) = YmmReg +getFPRCtor (ZmmReg _) = ZmmReg +getFPRCtor _ = error "getFPRCtor expected only FPR regs" + +fprRegNum :: GlobalReg -> Int +fprRegNum (FloatReg i) = i +fprRegNum (DoubleReg i) = i +fprRegNum (XmmReg i) = i +fprRegNum (YmmReg i) = i +fprRegNum (ZmmReg i) = i +fprRegNum _ = error "fprRegNum expected only FPR regs" + +-- | Input: dynflags, and the list of live registers +-- +-- Output: An augmented list of live registers, where padding was +-- added to the list of registers to ensure the calling convention is +-- correctly used by LLVM. +-- +-- Each global reg in the returned list is tagged with a bool, which +-- indicates whether the global reg was added as padding, or was an original +-- live register. +-- +-- That is, True => padding, False => a real, live global register. +-- +-- Also, the returned list is not sorted in any particular order. +-- +padLiveArgs :: DynFlags -> LiveGlobalRegs -> [(Bool, GlobalReg)] +padLiveArgs dflags live = + if platformUnregisterised plat + then taggedLive -- not using GHC's register convention for platform. + else padding ++ taggedLive + where + taggedLive = map (\x -> (False, x)) live + plat = targetPlatform dflags + + fprLive = filter isFPR live + padding = concatMap calcPad $ groupBy sharesClass fprLive + + sharesClass :: GlobalReg -> GlobalReg -> Bool + sharesClass a b = sameFPRClass a b || overlappingClass + where + overlappingClass = regsOverlap dflags (norm a) (norm b) + norm = CmmGlobal . normalizeFPRNum + + calcPad :: [GlobalReg] -> [(Bool, GlobalReg)] + calcPad rs = getFPRPadding (getFPRCtor $ head rs) rs + +getFPRPadding :: (Int -> GlobalReg) -> LiveGlobalRegs -> [(Bool, GlobalReg)] +getFPRPadding paddingCtor live = padding where - sseRegNums = sort $ mapMaybe sseRegNum live - (_, padding) = foldl assignSlots (1, []) $ sseRegNums - allRegs = padding ++ map (\r -> (False, r)) live + fprRegNums = sort $ map fprRegNum live + (_, padding) = foldl assignSlots (1, []) $ fprRegNums assignSlots (i, acc) regNum | i == regNum = -- don't need padding here @@ -195,11 +250,7 @@ padLiveArgs live = allRegs genPad start n = take n $ flip map (iterate (+1) start) (\i -> - (True, FloatReg i)) - -- NOTE: Picking float should be fine for the following reasons: - -- (1) Float aliases with all the other SSE register types on - -- the given platform. - -- (2) The argument is not live anyways. + (True, paddingCtor i)) -- | Llvm standard fun attributes diff --git a/compiler/llvmGen/LlvmCodeGen/CodeGen.hs b/compiler/llvmGen/LlvmCodeGen/CodeGen.hs index 1873400..21abc65 100644 --- a/compiler/llvmGen/LlvmCodeGen/CodeGen.hs +++ b/compiler/llvmGen/LlvmCodeGen/CodeGen.hs @@ -1814,14 +1814,14 @@ funPrologue live cmmBlocks = do -- STG Liveness optimisation done here. funEpilogue :: LiveGlobalRegs -> LlvmM ([LlvmVar], LlvmStatements) funEpilogue live = do + dflags <- getDynFlags -- the bool indicates whether the register is padding. let alwaysNeeded = map (\r -> (False, r)) alwaysLive - livePadded = alwaysNeeded ++ padLiveArgs live + livePadded = alwaysNeeded ++ padLiveArgs dflags live -- Set to value or "undef" depending on whether the register is -- actually live - dflags <- getDynFlags let loadExpr r = do (v, _, s) <- getCmmRegVal (CmmGlobal r) return (Just $ v, s) @@ -1833,7 +1833,7 @@ funEpilogue live = do loads <- flip mapM allRegs $ \r -> case () of _ | (False, r) `elem` livePadded -> loadExpr r -- if r is not padding, load it - | not (isSSE r) || (True, r) `elem` livePadded + | not (isFPR r) || (True, r) `elem` livePadded -> loadUndef r | otherwise -> return (Nothing, nilOL) From git at git.haskell.org Sun Oct 28 17:41:15 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 28 Oct 2018 17:41:15 +0000 (UTC) Subject: [commit: ghc] master: Plugins: Add documentation and missing exports (49f5c6c) Message-ID: <20181028174115.089193ABBE@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/49f5c6c33a6668152f0fb306075c891f317249d7/ghc >--------------------------------------------------------------- commit 49f5c6c33a6668152f0fb306075c891f317249d7 Author: Ben Gamari Date: Sun Oct 28 12:36:15 2018 -0400 Plugins: Add documentation and missing exports Summary: Previously the TcPlugin and CorePlugin type synonyms were not exporting, resulting in much confusion. Reviewers: mpickering Reviewed By: mpickering Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5237 >--------------------------------------------------------------- 49f5c6c33a6668152f0fb306075c891f317249d7 compiler/main/Plugins.hs | 36 ++++++++++++++++++++++++++++++++---- compiler/typecheck/TcRnDriver.hs | 2 +- 2 files changed, 33 insertions(+), 5 deletions(-) diff --git a/compiler/main/Plugins.hs b/compiler/main/Plugins.hs index 01a9841..430b079 100644 --- a/compiler/main/Plugins.hs +++ b/compiler/main/Plugins.hs @@ -1,11 +1,39 @@ {-# LANGUAGE RankNTypes #-} {-# LANGUAGE CPP #-} module Plugins ( - FrontendPlugin(..), defaultFrontendPlugin, FrontendPluginAction - , Plugin(..), CommandLineOption, LoadedPlugin(..), lpModuleName - , defaultPlugin, keepRenamedSource, withPlugins, withPlugins_ - , PluginRecompile(..) + -- * Plugins + Plugin(..) + , defaultPlugin + , CommandLineOption + -- ** Recompilation checking , purePlugin, impurePlugin, flagRecompile + , PluginRecompile(..) + + -- * Plugin types + -- ** Frontend plugins + , FrontendPlugin(..), defaultFrontendPlugin, FrontendPluginAction + -- ** Core plugins + -- | Core plugins allow plugins to register as a Core-to-Core pass. + , CorePlugin + -- ** Typechecker plugins + -- | Typechecker plugins allow plugins to provide evidence to the + -- typechecker. + , TcPlugin + -- ** Source plugins + -- | GHC offers a number of points where plugins can access and modify its + -- front-end (\"source\") representation. These include: + -- + -- - access to the parser result with 'parsedResultAction' + -- - access to the renamed AST with 'renamedResultAction' + -- - access to the typechecked AST with 'typeCheckResultAction' + -- - access to the Template Haskell splices with 'spliceRunAction' + -- - access to loaded interface files with 'interfaceLoadAction' + -- + , keepRenamedSource + + -- * Internal + , LoadedPlugin(..), lpModuleName + , withPlugins, withPlugins_ ) where import GhcPrelude diff --git a/compiler/typecheck/TcRnDriver.hs b/compiler/typecheck/TcRnDriver.hs index 1c04327..a0a837e 100644 --- a/compiler/typecheck/TcRnDriver.hs +++ b/compiler/typecheck/TcRnDriver.hs @@ -2821,7 +2821,7 @@ withTcPlugins hsc_env m = do s <- runTcPluginM start ev_binds_var return (solve s, stop s) -getTcPlugins :: DynFlags -> [TcPlugin] +getTcPlugins :: DynFlags -> [TcRnMonad.TcPlugin] getTcPlugins dflags = catMaybes $ map get_plugin (plugins dflags) where get_plugin p = tcPlugin (lpPlugin p) (lpArguments p) From git at git.haskell.org Sun Oct 28 17:41:18 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 28 Oct 2018 17:41:18 +0000 (UTC) Subject: [commit: ghc] master: Fix TcType.anyRewritableTyVar (a7f64c6) Message-ID: <20181028174118.04B7C3ABBE@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/a7f64c6cbfc5562adff207945576d1c9db2a58d9/ghc >--------------------------------------------------------------- commit a7f64c6cbfc5562adff207945576d1c9db2a58d9 Author: Ningning Xie Date: Sun Oct 28 12:29:55 2018 -0400 Fix TcType.anyRewritableTyVar Summary: This patch fixes #15805, where we found that `TcType.anyRewritableTyVar` has one wrong case. Besides the fix, it also: - removed some unnecessary `ASSERT2(tcIsTcTyVar...)` in `TcType`, as now we have `tcIsTcTyVar = isTyVar`. - fixed some comments Test Plan: ./validate Reviewers: goldfire, simonpj, bgamari Reviewed By: simonpj Subscribers: rwbarton, carter GHC Trac Issues: #15805 Differential Revision: https://phabricator.haskell.org/D5263 >--------------------------------------------------------------- a7f64c6cbfc5562adff207945576d1c9db2a58d9 compiler/typecheck/TcType.hs | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/compiler/typecheck/TcType.hs b/compiler/typecheck/TcType.hs index 5bbaa0f..8fcdde1 100644 --- a/compiler/typecheck/TcType.hs +++ b/compiler/typecheck/TcType.hs @@ -569,7 +569,7 @@ pprTcTyVarDetails (MetaTv { mtv_info = info, mtv_tclvl = tclvl }) ------------------------------------- -- UserTypeCtxt describes the origin of the polymorphic type --- in the places where we need to an expression has that type +-- in the places where we need an expression to have that type data UserTypeCtxt = FunSigCtxt -- Function type signature, when checking the type @@ -708,7 +708,7 @@ Note [TcLevel and untouchable type variables] * A unification variable is *touchable* if its level number is EQUAL TO that of its immediate parent implication, - and it is a TauTv or TyVarTv (but /not/ FlatMetaTv or FlatSkolTv + and it is a TauTv or TyVarTv (but /not/ FlatMetaTv or FlatSkolTv) Note [WantedInv] ~~~~~~~~~~~~~~~~ @@ -975,7 +975,7 @@ anyRewritableTyVar ignore_cos role pred ty go rl bvs (CoercionTy co) = go_co rl bvs co -- ToDo: check go_tc NomEq bvs _ tys = any (go NomEq bvs) tys - go_tc ReprEq bvs tc tys = foldr ((&&) . go_arg bvs) False $ + go_tc ReprEq bvs tc tys = any (go_arg bvs) (tyConRolesRepresentational tc `zip` tys) go_arg bvs (Nominal, ty) = go NomEq bvs ty @@ -1014,7 +1014,7 @@ out the other (Trac #14363). ********************************************************************* -} data CandidatesQTvs -- See Note [Dependent type variables] - -- See Note [CandidatesQTvs determinism] + -- See Note [CandidatesQTvs determinism and order] = DV { dv_kvs :: DTyCoVarSet -- "kind" variables (dependent) , dv_tvs :: DTyVarSet -- "type" variables (non-dependent) -- A variable may appear in both sets @@ -1178,8 +1178,7 @@ isFloatedTouchableMetaTyVar ctxt_tclvl tv | isTyVar tv -- See Note [Coercion variables in free variable lists] , MetaTv { mtv_tclvl = tv_tclvl, mtv_info = info } <- tcTyVarDetails tv , not (isFlattenInfo info) - = ASSERT2( tcIsTcTyVar tv, ppr tv ) - tv_tclvl `strictlyDeeperThan` ctxt_tclvl + = tv_tclvl `strictlyDeeperThan` ctxt_tclvl | otherwise = False @@ -1195,8 +1194,7 @@ isTyConableTyVar tv -- with a type constructor application; in particular, -- not a TyVarTv | isTyVar tv -- See Note [Coercion variables in free variable lists] - = ASSERT2( tcIsTcTyVar tv, ppr tv ) - case tcTyVarDetails tv of + = case tcTyVarDetails tv of MetaTv { mtv_info = TyVarTv } -> False _ -> True | otherwise = True @@ -1213,7 +1211,7 @@ isFskTyVar tv MetaTv { mtv_info = FlatSkolTv } -> True _ -> False --- | True of both given and wanted flatten-skolems (fak and usk) +-- | True of both given and wanted flatten-skolems (fmv and fsk) isFlattenTyVar tv = ASSERT2( tcIsTcTyVar tv, ppr tv ) case tcTyVarDetails tv of @@ -1228,16 +1226,14 @@ isSkolemTyVar tv isOverlappableTyVar tv | isTyVar tv -- See Note [Coercion variables in free variable lists] - = ASSERT2( tcIsTcTyVar tv, ppr tv ) - case tcTyVarDetails tv of + = case tcTyVarDetails tv of SkolemTv _ overlappable -> overlappable _ -> False | otherwise = False isMetaTyVar tv | isTyVar tv -- See Note [Coercion variables in free variable lists] - = ASSERT2( tcIsTcTyVar tv, ppr tv ) - case tcTyVarDetails tv of + = case tcTyVarDetails tv of MetaTv {} -> True _ -> False | otherwise = False From git at git.haskell.org Sun Oct 28 17:41:21 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 28 Oct 2018 17:41:21 +0000 (UTC) Subject: [commit: ghc] master: Comment out CONSTANT_FOLDED in GHC.Natural (2f2308e) Message-ID: <20181028174121.0B2A63ABBE@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/2f2308e26579959d6c217150e1033c2faedc0bb5/ghc >--------------------------------------------------------------- commit 2f2308e26579959d6c217150e1033c2faedc0bb5 Author: Christiaan Baaij Date: Sun Oct 28 12:29:23 2018 -0400 Comment out CONSTANT_FOLDED in GHC.Natural Summary: Although these functions were marked as CONSTANT_FOLDED, they did not have a corresponding builtinRule in PrelRules. The idea was probably to add them eventually, but this hasn't manifested so far. The plan is to eventually add builtin rules for these functions over Natural, so as a reminder we simply comment out the CONSTANT_FOLDED annotation instead of removing it completely. Reviewers: hvr, bgamari Reviewed By: bgamari Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5267 >--------------------------------------------------------------- 2f2308e26579959d6c217150e1033c2faedc0bb5 libraries/base/GHC/Natural.hs | 55 ++++++++++++---------- .../tests/numeric/should_compile/T14465.stdout | 15 ++++-- 2 files changed, 40 insertions(+), 30 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 2f2308e26579959d6c217150e1033c2faedc0bb5 From git at git.haskell.org Sun Oct 28 17:41:24 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 28 Oct 2018 17:41:24 +0000 (UTC) Subject: [commit: ghc] master: testsuite: EtaExpandLevPoly now passes in profiled ways (e69590f) Message-ID: <20181028174124.063693ABBE@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/e69590f1bdbbb605921f125050929c7b84f00d28/ghc >--------------------------------------------------------------- commit e69590f1bdbbb605921f125050929c7b84f00d28 Author: Ben Gamari Date: Sun Oct 28 12:32:40 2018 -0400 testsuite: EtaExpandLevPoly now passes in profiled ways Summary: This failure was originally tracked in #15066 but it seems the problem has somehow resolved itself. Reviewers: alpmestan Reviewed By: alpmestan Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5242 >--------------------------------------------------------------- e69590f1bdbbb605921f125050929c7b84f00d28 testsuite/tests/typecheck/should_run/all.T | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/testsuite/tests/typecheck/should_run/all.T b/testsuite/tests/typecheck/should_run/all.T index 4f75c70..bdf70e0 100755 --- a/testsuite/tests/typecheck/should_run/all.T +++ b/testsuite/tests/typecheck/should_run/all.T @@ -119,10 +119,7 @@ test('KindInvariant', normal, ghci_script, ['KindInvariant.script']) # unboxed sums and ghci does not support those yet. test('StrictPats', omit_ways(['ghci']), compile_and_run, ['']) test('T12809', omit_ways(['ghci']), compile_and_run, ['']) -test('EtaExpandLevPoly', [ omit_ways(['ghci']) - # triggers a core lint error in profiled ways - , expect_broken_for(15066, ['profasm', 'profthreaded']) - ], compile_and_run, ['']) +test('EtaExpandLevPoly', omit_ways(['ghci']), compile_and_run, ['']) test('TestTypeableBinary', normal, compile_and_run, ['']) test('Typeable1', normal, compile_fail, ['-Werror']) From git at git.haskell.org Sun Oct 28 17:41:27 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 28 Oct 2018 17:41:27 +0000 (UTC) Subject: [commit: ghc] master: Fix integer overflow when encoding doubles (Trac #15271) (8e1a559) Message-ID: <20181028174127.CF2213ABBE@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/8e1a5593f940b9d2882a5e81abf028e7b99aff3a/ghc >--------------------------------------------------------------- commit 8e1a5593f940b9d2882a5e81abf028e7b99aff3a Author: Fangyi Zhou Date: Sun Oct 28 12:28:53 2018 -0400 Fix integer overflow when encoding doubles (Trac #15271) Summary: Ticket #15271 reports a case where 1e1000000000 is incorrectly converted to 0.0. After some investigation, I discovered the number is converted to rational correctly, but converting the ratio into a double introduced an error. Tracking down to how the conversion is done, I found the rts float implementation uses `ldexp`, whose signature is `double ldexp (double x, int exp);` The callsite passes an `I_` to the second argument, which is platform-dependent. On machines where `I_` is 64 bits and `int` is 32 bits, we observe integer overflow behaviour. Here is a mapping from rational to exponent with observations 1e646457008 -> 2147483645 (result = infinity, positive in int32) 1e646457009 -> 2147483648 (result = 0.0, overflow to negative in int32) 1e1000000000 -> 3321928042 (result = infinity, overflow to positive in int32) 1e1555550000 -> 5167425196 (result = 0.0, overflow to negative in int32) We fix this issue by comparing STG_INT_MIN/MAX and INT_MIN/MAX and bound the value appropriately. Test Plan: New test cases Reviewers: bgamari, erikd, simonmar Reviewed By: bgamari Subscribers: rwbarton, carter GHC Trac Issues: #15271 Differential Revision: https://phabricator.haskell.org/D5271 >--------------------------------------------------------------- 8e1a5593f940b9d2882a5e81abf028e7b99aff3a rts/StgPrimFloat.c | 26 ++++++++++++++++++---- testsuite/tests/numeric/should_run/T15271.hs | 5 +++++ .../tests/numeric/should_run/T15271.stdout | 2 -- 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/rts/StgPrimFloat.c b/rts/StgPrimFloat.c index 277ae66..f1f6736 100644 --- a/rts/StgPrimFloat.c +++ b/rts/StgPrimFloat.c @@ -14,6 +14,7 @@ #include #include +#include #define IEEE_FLOATING_POINT 1 @@ -47,6 +48,23 @@ #define __abs(a) (( (a) >= 0 ) ? (a) : (-(a))) +/** Trac #15271: Some large ratios are converted into double incorrectly. + * This occurs when StgInt has 64 bits and C int has 32 bits, where wrapping + * occurs and an incorrect signed value is passed into ldexp */ +STATIC_INLINE int +truncExponent(I_ e) +{ +#if INT_MAX < STG_INT_MAX + if (RTS_UNLIKELY(e > INT_MAX)) + e = INT_MAX; +#endif +#if INT_MIN > STG_INT_MIN + if (RTS_UNLIKELY(e < INT_MIN)) + e = INT_MIN; +#endif + return e; +} + /* Special version for words */ StgDouble __word_encodeDouble (W_ j, I_ e) @@ -57,7 +75,7 @@ __word_encodeDouble (W_ j, I_ e) /* Now raise to the exponent */ if ( r != 0.0 ) /* Lennart suggests this avoids a bug in MIPS's ldexp */ - r = ldexp(r, e); + r = ldexp(r, truncExponent(e)); return r; } @@ -72,7 +90,7 @@ __int_encodeDouble (I_ j, I_ e) /* Now raise to the exponent */ if ( r != 0.0 ) /* Lennart suggests this avoids a bug in MIPS's ldexp */ - r = ldexp(r, e); + r = ldexp(r, truncExponent(e)); /* sign is encoded in the size */ if (j < 0) @@ -91,7 +109,7 @@ __int_encodeFloat (I_ j, I_ e) /* Now raise to the exponent */ if ( r != 0.0 ) /* Lennart suggests this avoids a bug in MIPS's ldexp */ - r = ldexp(r, e); + r = ldexp(r, truncExponent(e)); /* sign is encoded in the size */ if (j < 0) @@ -110,7 +128,7 @@ __word_encodeFloat (W_ j, I_ e) /* Now raise to the exponent */ if ( r != 0.0 ) /* Lennart suggests this avoids a bug in MIPS's ldexp */ - r = ldexp(r, e); + r = ldexp(r, truncExponent(e)); return r; } diff --git a/testsuite/tests/numeric/should_run/T15271.hs b/testsuite/tests/numeric/should_run/T15271.hs new file mode 100644 index 0000000..c8f2c95 --- /dev/null +++ b/testsuite/tests/numeric/should_run/T15271.hs @@ -0,0 +1,5 @@ +main = do + print 1e646457008 + print 1e646457009 -- T15271: This incorrectly printed 0.0 + print 1e1555550000 -- This is still infinity + print 1e1000000000 -- T15271: This incorrectly printed 0.0 diff --git a/libraries/base/tests/T7034.stdout b/testsuite/tests/numeric/should_run/T15271.stdout similarity index 66% copy from libraries/base/tests/T7034.stdout copy to testsuite/tests/numeric/should_run/T15271.stdout index 2675153..6e89f24 100644 --- a/libraries/base/tests/T7034.stdout +++ b/testsuite/tests/numeric/should_run/T15271.stdout @@ -2,5 +2,3 @@ Infinity Infinity Infinity Infinity -Infinity -Infinity From git at git.haskell.org Sun Oct 28 17:41:30 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 28 Oct 2018 17:41:30 +0000 (UTC) Subject: [commit: ghc] master: plugins: search for .a files if necessary (be88c81) Message-ID: <20181028174130.CF1F73ABBE@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/be88c818a2962adbdaca0eda539412a9bfec4384/ghc >--------------------------------------------------------------- commit be88c818a2962adbdaca0eda539412a9bfec4384 Author: sheaf Date: Sun Oct 28 12:30:13 2018 -0400 plugins: search for .a files if necessary Summary: on windows, plugins are loaded via .a files, but those paths were not being searched when loading plugins Test Plan: ./validate Reviewers: Phyx, bgamari Reviewed By: Phyx Subscribers: RyanGlScott, rwbarton, carter GHC Trac Issues: #15700 Differential Revision: https://phabricator.haskell.org/D5253 >--------------------------------------------------------------- be88c818a2962adbdaca0eda539412a9bfec4384 compiler/deSugar/DsUsage.hs | 78 ++++++++++++++++++++++----------------------- testsuite/config/ghc | 21 ++---------- 2 files changed, 40 insertions(+), 59 deletions(-) diff --git a/compiler/deSugar/DsUsage.hs b/compiler/deSugar/DsUsage.hs index 58c31ee..39b4855 100644 --- a/compiler/deSugar/DsUsage.hs +++ b/compiler/deSugar/DsUsage.hs @@ -140,7 +140,7 @@ with optimisations turned on, and give basically all binders an INLINE pragma. So instead: - * For plugins that were build locally: we store the filepath and hash of the + * For plugins that were built locally: we store the filepath and hash of the object files of the module with the `plugin` binder, and the object files of modules that are dependencies of the plugin module and belong to the same `UnitId` as the plugin @@ -165,59 +165,57 @@ One way to improve this is to either: mkPluginUsage :: HscEnv -> ModIface -> IO [Usage] mkPluginUsage hsc_env pluginModule = case lookupPluginModuleWithSuggestions dflags pNm Nothing of - -- The plug is from an external package, we just look up the dylib that - -- contains the plugin LookupFound _ pkg -> do + -- The plugin is from an external package: + -- search for the library files containing the plugin. let searchPaths = collectLibraryPaths dflags [pkg] - libs = packageHsLibs dflags pkg - dynlibLocs = [ searchPath mkHsSOName platform lib - | searchPath <- searchPaths - , lib <- libs - ] - dynlibs <- filterM doesFileExist dynlibLocs - case dynlibs of - [] -> pprPanic - ("mkPluginUsage: no dylibs, tried:\n" ++ unlines dynlibLocs) - (ppr pNm) - _ -> mapM hashFile (nub dynlibs) + useDyn = WayDyn `elem` ways dflags + suffix = if useDyn then soExt platform else "a" + libLocs = [ searchPath "lib" ++ libLoc <.> suffix + | searchPath <- searchPaths + , libLoc <- packageHsLibs dflags pkg + ] + -- we also try to find plugin library files by adding WayDyn way, + -- if it isn't already present (see trac #15492) + paths = + if useDyn + then libLocs + else + let dflags' = updateWays (addWay' WayDyn dflags) + dlibLocs = [ searchPath mkHsSOName platform dlibLoc + | searchPath <- searchPaths + , dlibLoc <- packageHsLibs dflags' pkg + ] + in libLocs ++ dlibLocs + files <- filterM doesFileExist paths + case files of + [] -> + pprPanic + ( "mkPluginUsage: missing plugin library, tried:\n" + ++ unlines paths + ) + (ppr pNm) + _ -> mapM hashFile (nub files) _ -> do foundM <- findPluginModule hsc_env pNm case foundM of - -- The plugin was built locally, look up the object file containing - -- the `plugin` binder, and all object files belong to modules that are - -- transitive dependencies of the plugin that belong to the same package + -- The plugin was built locally: look up the object file containing + -- the `plugin` binder, and all object files belong to modules that are + -- transitive dependencies of the plugin that belong to the same package. Found ml _ -> do - pluginObject <- hashFile (ml_obj_file ml) + pluginObject <- hashFile (ml_obj_file ml) depObjects <- catMaybes <$> mapM lookupObjectFile deps return (nub (pluginObject : depObjects)) - _ -> pprPanic "mkPluginUsage: no object or dylib" (ppr pNm) + _ -> pprPanic "mkPluginUsage: no object file found" (ppr pNm) where - -- plugins are shared libraries, so WayDyn should be part of the dflags in - -- order to get the correct filenames and library paths. - -- - -- We can distinguish two scenarios: - -- - -- 1. The dflags do not contain WayDyn, in this case we need to remove - -- all other ways and only add WayDyn. Why? Because other ways change - -- the library tags, i.e. WayProf adds `_p`, and we would end up looking - -- for a profiled plugin which might not be installed. See #15492 - -- - -- 2. The dflags do contain WayDyn, in this case we can leave the ways as - -- is, because the plugin must be compiled with the same ways as the - -- module that is currently being build, e.g., if the module is - -- build with WayDyn and WayProf, then the plugin that was used - -- would've also had to been build with WayProf (and WayDyn). - dflags1 = hsc_dflags hsc_env - dflags = if WayDyn `elem` ways dflags1 - then dflags1 - else updateWays (addWay' WayDyn (dflags1 {ways = []})) + dflags = hsc_dflags hsc_env platform = targetPlatform dflags pNm = moduleName (mi_module pluginModule) pPkg = moduleUnitId (mi_module pluginModule) deps = map fst (dep_mods (mi_deps pluginModule)) - -- loopup object file for a plugin dependencies from the same package as the - -- the plugin + -- Lookup object file for a plugin dependency, + -- from the same package as the plugin. lookupObjectFile nm = do foundM <- findImportedModule hsc_env nm Nothing case foundM of diff --git a/testsuite/config/ghc b/testsuite/config/ghc index b2edfd0..eae88ed 100644 --- a/testsuite/config/ghc +++ b/testsuite/config/ghc @@ -185,7 +185,6 @@ def get_compiler_info(): config.package_conf_cache_file = '' # See Note [WayFlags] - # See Note [PluginWay] if config.ghc_dynamic: config.ghc_th_way_flags = "-dynamic" config.ghci_way_flags = "-dynamic" @@ -201,25 +200,9 @@ def get_compiler_info(): else: config.ghc_th_way_flags = "-static" config.ghci_way_flags = "-static" - config.plugin_way_flags = "-dynamic" + config.plugin_way_flags = "-static" config.ghc_th_way = "normal" - config.ghc_plugin_way = "dyn" - -# Note [PluginWay] -# -# Unfortunately the implementation has confused the ability to make dynamic -# libraries with dynamic way. -# -# This constraint is only true for systems that require -fPIC for -# shared libraries. -# -# It may not be worth fixing this assumption since the only platform that doesn't -# require -fPIC is Windows. These plugins require libghc to be linked so in -# doing so you would exceed the amount of allowed symbols in a single shared -# library. The only way these would ever work is thus with DynWay. -# -# Since the implementation has this implicit assumption, mark the tests as -# always requiring DynWay. + config.ghc_plugin_way = "normal" # Note [Replacing backward slashes in config.libdir] # From git at git.haskell.org Sun Oct 28 17:41:33 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 28 Oct 2018 17:41:33 +0000 (UTC) Subject: [commit: ghc] master: Fix ghc-pkg when only prof way is enabled (e400b9b) Message-ID: <20181028174133.D2DE43ABBE@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/e400b9babdcf11669f963aeec20078fe7ccfca0d/ghc >--------------------------------------------------------------- commit e400b9babdcf11669f963aeec20078fe7ccfca0d Author: Zejun Wu Date: Sun Oct 28 12:38:07 2018 -0400 Fix ghc-pkg when only prof way is enabled Summary: We saw following errors: ``` $ cabal install --disable-library-vanilla --disable-shared --enable-library-profiling hashable-1.2.7.0: cannot find any of ["libHShashable-1.2.7.0-Q2TKVDwk4GBEHmizb4teZ.a", "libHShashable-1.2.7.0-Q2TKVDwk4GBEHmizb4teZ.p_a", "libHShashable-1.2.7.0-Q2TKVDwk4GBEHmizb4teZ-ghc8.4.3.so", "libHShashable-1.2.7.0-Q2TKVDwk4GBEHmizb4teZ-ghc8.4.3.dylib", "HShashable-1.2.7.0-Q2TKVDwk4GBEHmizb4teZ-ghc8.4.3.dll"] ``` This is because ghc-pkg is looking for `libHShashable-1.2.7.0-Q2TKVDwk4GBEHmizb4teZ.p_a` instead of `libHShashable-1.2.7.0-Q2TKVDwk4GBEHmizb4teZ_p.a`. Test Plan: ./validate Reviewers: simonmar, bgamari Reviewed By: simonmar Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5234 >--------------------------------------------------------------- e400b9babdcf11669f963aeec20078fe7ccfca0d testsuite/tests/cabal/ghcpkg03.stderr | 6 +++--- testsuite/tests/cabal/ghcpkg03.stderr-mingw32 | 6 +++--- testsuite/tests/cabal/ghcpkg05.stderr | 2 +- testsuite/tests/cabal/ghcpkg05.stderr-mingw32 | 2 +- utils/ghc-pkg/Main.hs | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc e400b9babdcf11669f963aeec20078fe7ccfca0d From git at git.haskell.org Sun Oct 28 17:41:36 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 28 Oct 2018 17:41:36 +0000 (UTC) Subject: [commit: ghc] master: Improve diagnostic when using `make fast` in top directory (4257570) Message-ID: <20181028174136.D95B13ABBE@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/42575701b5e71ec5c5e5418a4530e40e6487684c/ghc >--------------------------------------------------------------- commit 42575701b5e71ec5c5e5418a4530e40e6487684c Author: Victor Nawothnig Date: Sun Oct 28 12:39:05 2018 -0400 Improve diagnostic when using `make fast` in top directory Reviewers: bgamari Reviewed By: bgamari Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5113 >--------------------------------------------------------------- 42575701b5e71ec5c5e5418a4530e40e6487684c Makefile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Makefile b/Makefile index 8046e36..73dc7ed 100644 --- a/Makefile +++ b/Makefile @@ -103,6 +103,7 @@ REALGOALS=$(filter-out \ fulltest \ slowtest \ fasttest \ + fast \ ,$(MAKECMDGOALS)) # configure touches certain files even if they haven't changed. This @@ -225,3 +226,8 @@ test: .PHONY: slowtest fulltest slowtest fulltest: $(MAKE) -C testsuite/tests CLEANUP=1 SUMMARY_FILE=../../testsuite_summary.txt slow + +.PHONY: fast +fast: + @echo "You can use 'make fast' only from inside a sub-component directory." + @exit 1 From git at git.haskell.org Sun Oct 28 17:41:41 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 28 Oct 2018 17:41:41 +0000 (UTC) Subject: [commit: ghc] master: Rewrite FastString table in concurrent hashtable (5126764) Message-ID: <20181028174141.112223ABBE@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/5126764be614cc43b435e3f5ff34ea593c30269a/ghc >--------------------------------------------------------------- commit 5126764be614cc43b435e3f5ff34ea593c30269a Author: Zejun Wu Date: Sun Oct 28 12:39:58 2018 -0400 Rewrite FastString table in concurrent hashtable Summary: Reimplement global FastString table using a concurrent hashatable with fixed size segments and dynamically growing buckets instead of fixed size buckets. This addresses the problem that `mkFastString` was not linear when the total number of entries was large. Test Plan: ./validate ``` inplace/bin/ghc-stage2 --interactive -dfaststring-stats < /dev/null GHCi, version 8.7.20181005: http://www.haskell.org/ghc/ :? for help Prelude> Leaving GHCi. FastString stats: segments: 256 buckets: 16384 entries: 7117 largest segment: 64 smallest segment: 64 longest bucket: 5 has z-encoding: 0% ``` Also comapre the two implementation using {P187} The new implementation is on a par with the old version with different conbination of parameters and perform better when the number of FastString's are large. {P188} Reviewers: simonmar, bgamari, niteria Reviewed By: simonmar, bgamari Subscribers: rwbarton, carter GHC Trac Issues: #14854 Differential Revision: https://phabricator.haskell.org/D5211 >--------------------------------------------------------------- 5126764be614cc43b435e3f5ff34ea593c30269a compiler/utils/FastString.hs | 235 +++++++++++++-------- ghc/Main.hs | 34 ++- testsuite/tests/{ado => utils}/Makefile | 0 .../should_compile => utils/should_run}/Makefile | 0 testsuite/tests/utils/should_run/T14854.hs | 87 ++++++++ .../tests/utils/should_run/T14854.stdout | 0 testsuite/tests/utils/should_run/all.T | 7 + 7 files changed, 257 insertions(+), 106 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 5126764be614cc43b435e3f5ff34ea593c30269a From git at git.haskell.org Sun Oct 28 18:41:14 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 28 Oct 2018 18:41:14 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: Fix for T14251 on ARM (2e23e1c) Message-ID: <20181028184114.783C23ABBE@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/2e23e1c7de01c92b038e55ce53d11bf9db993dd4/ghc >--------------------------------------------------------------- commit 2e23e1c7de01c92b038e55ce53d11bf9db993dd4 Author: Kavon Farvardin Date: Sun Oct 28 12:11:49 2018 -0400 Fix for T14251 on ARM We now calculate the SSE register padding needed to fix the calling convention in LLVM in a robust way: grouping them by whether registers in that class overlap (with the same class overlapping itself). My prior patch assumed that no matter the platform, physical register Fx aliases with Dx, etc, for our calling convention. This is unfortunately not the case for any platform except x86-64. Test Plan: Only know how to test on x86-64, but it should be tested on ARM with: `make test WAYS=llvm && make test WAYS=optllvm` Reviewers: bgamari, angerman Reviewed By: bgamari Subscribers: rwbarton, carter GHC Trac Issues: #15780, #14251, #15747 Differential Revision: https://phabricator.haskell.org/D5254 (cherry picked from commit c36a2b596a6ba9d7a0a80df01b3c041720c727ca) >--------------------------------------------------------------- 2e23e1c7de01c92b038e55ce53d11bf9db993dd4 compiler/llvmGen/LlvmCodeGen/Base.hs | 123 ++++++++++++++++++++++---------- compiler/llvmGen/LlvmCodeGen/CodeGen.hs | 6 +- 2 files changed, 90 insertions(+), 39 deletions(-) diff --git a/compiler/llvmGen/LlvmCodeGen/Base.hs b/compiler/llvmGen/LlvmCodeGen/Base.hs index ec91bac..0a40b73 100644 --- a/compiler/llvmGen/LlvmCodeGen/Base.hs +++ b/compiler/llvmGen/LlvmCodeGen/Base.hs @@ -26,7 +26,7 @@ module LlvmCodeGen.Base ( cmmToLlvmType, widthToLlvmFloat, widthToLlvmInt, llvmFunTy, llvmFunSig, llvmFunArgs, llvmStdFunAttrs, llvmFunAlign, llvmInfAlign, - llvmPtrBits, tysToParams, llvmFunSection, padLiveArgs, isSSE, + llvmPtrBits, tysToParams, llvmFunSection, padLiveArgs, isFPR, strCLabel_llvm, strDisplayName_llvm, strProcedureName_llvm, getGlobalPtr, generateExternDecls, @@ -47,6 +47,7 @@ import CodeGen.Platform ( activeStgRegs ) import DynFlags import FastString import Cmm hiding ( succ ) +import CmmUtils ( regsOverlap ) import Outputable as Outp import Platform import UniqFM @@ -58,8 +59,7 @@ import ErrUtils import qualified Stream import Control.Monad (ap) -import Data.List (sort) -import Data.Maybe (mapMaybe) +import Data.List (sort, groupBy, head) -- ---------------------------------------------------------------------------- -- * Some Data Types @@ -152,36 +152,91 @@ llvmFunArgs dflags live = map (lmGlobalRegArg dflags) (filter isPassed allRegs) where platform = targetPlatform dflags allRegs = activeStgRegs platform - paddedLive = map (\(_,r) -> r) $ padLiveArgs live + paddedLive = map (\(_,r) -> r) $ padLiveArgs dflags live isLive r = r `elem` alwaysLive || r `elem` paddedLive - isPassed r = not (isSSE r) || isLive r - - -isSSE :: GlobalReg -> Bool -isSSE (FloatReg _) = True -isSSE (DoubleReg _) = True -isSSE (XmmReg _) = True -isSSE (YmmReg _) = True -isSSE (ZmmReg _) = True -isSSE _ = False - -sseRegNum :: GlobalReg -> Maybe Int -sseRegNum (FloatReg i) = Just i -sseRegNum (DoubleReg i) = Just i -sseRegNum (XmmReg i) = Just i -sseRegNum (YmmReg i) = Just i -sseRegNum (ZmmReg i) = Just i -sseRegNum _ = Nothing - --- the bool indicates whether the global reg was added as padding. --- the returned list is not sorted in any particular order, --- but does indicate the set of live registers needed, with SSE padding. -padLiveArgs :: LiveGlobalRegs -> [(Bool, GlobalReg)] -padLiveArgs live = allRegs + isPassed r = not (isFPR r) || isLive r + + +isFPR :: GlobalReg -> Bool +isFPR (FloatReg _) = True +isFPR (DoubleReg _) = True +isFPR (XmmReg _) = True +isFPR (YmmReg _) = True +isFPR (ZmmReg _) = True +isFPR _ = False + +sameFPRClass :: GlobalReg -> GlobalReg -> Bool +sameFPRClass (FloatReg _) (FloatReg _) = True +sameFPRClass (DoubleReg _) (DoubleReg _) = True +sameFPRClass (XmmReg _) (XmmReg _) = True +sameFPRClass (YmmReg _) (YmmReg _) = True +sameFPRClass (ZmmReg _) (ZmmReg _) = True +sameFPRClass _ _ = False + +normalizeFPRNum :: GlobalReg -> GlobalReg +normalizeFPRNum (FloatReg _) = FloatReg 1 +normalizeFPRNum (DoubleReg _) = DoubleReg 1 +normalizeFPRNum (XmmReg _) = XmmReg 1 +normalizeFPRNum (YmmReg _) = YmmReg 1 +normalizeFPRNum (ZmmReg _) = ZmmReg 1 +normalizeFPRNum _ = error "normalizeFPRNum expected only FPR regs" + +getFPRCtor :: GlobalReg -> Int -> GlobalReg +getFPRCtor (FloatReg _) = FloatReg +getFPRCtor (DoubleReg _) = DoubleReg +getFPRCtor (XmmReg _) = XmmReg +getFPRCtor (YmmReg _) = YmmReg +getFPRCtor (ZmmReg _) = ZmmReg +getFPRCtor _ = error "getFPRCtor expected only FPR regs" + +fprRegNum :: GlobalReg -> Int +fprRegNum (FloatReg i) = i +fprRegNum (DoubleReg i) = i +fprRegNum (XmmReg i) = i +fprRegNum (YmmReg i) = i +fprRegNum (ZmmReg i) = i +fprRegNum _ = error "fprRegNum expected only FPR regs" + +-- | Input: dynflags, and the list of live registers +-- +-- Output: An augmented list of live registers, where padding was +-- added to the list of registers to ensure the calling convention is +-- correctly used by LLVM. +-- +-- Each global reg in the returned list is tagged with a bool, which +-- indicates whether the global reg was added as padding, or was an original +-- live register. +-- +-- That is, True => padding, False => a real, live global register. +-- +-- Also, the returned list is not sorted in any particular order. +-- +padLiveArgs :: DynFlags -> LiveGlobalRegs -> [(Bool, GlobalReg)] +padLiveArgs dflags live = + if platformUnregisterised plat + then taggedLive -- not using GHC's register convention for platform. + else padding ++ taggedLive + where + taggedLive = map (\x -> (False, x)) live + plat = targetPlatform dflags + + fprLive = filter isFPR live + padding = concatMap calcPad $ groupBy sharesClass fprLive + + sharesClass :: GlobalReg -> GlobalReg -> Bool + sharesClass a b = sameFPRClass a b || overlappingClass + where + overlappingClass = regsOverlap dflags (norm a) (norm b) + norm = CmmGlobal . normalizeFPRNum + + calcPad :: [GlobalReg] -> [(Bool, GlobalReg)] + calcPad rs = getFPRPadding (getFPRCtor $ head rs) rs + +getFPRPadding :: (Int -> GlobalReg) -> LiveGlobalRegs -> [(Bool, GlobalReg)] +getFPRPadding paddingCtor live = padding where - sseRegNums = sort $ mapMaybe sseRegNum live - (_, padding) = foldl assignSlots (1, []) $ sseRegNums - allRegs = padding ++ map (\r -> (False, r)) live + fprRegNums = sort $ map fprRegNum live + (_, padding) = foldl assignSlots (1, []) $ fprRegNums assignSlots (i, acc) regNum | i == regNum = -- don't need padding here @@ -195,11 +250,7 @@ padLiveArgs live = allRegs genPad start n = take n $ flip map (iterate (+1) start) (\i -> - (True, FloatReg i)) - -- NOTE: Picking float should be fine for the following reasons: - -- (1) Float aliases with all the other SSE register types on - -- the given platform. - -- (2) The argument is not live anyways. + (True, paddingCtor i)) -- | Llvm standard fun attributes diff --git a/compiler/llvmGen/LlvmCodeGen/CodeGen.hs b/compiler/llvmGen/LlvmCodeGen/CodeGen.hs index 041329e..91c6a88 100644 --- a/compiler/llvmGen/LlvmCodeGen/CodeGen.hs +++ b/compiler/llvmGen/LlvmCodeGen/CodeGen.hs @@ -1806,14 +1806,14 @@ funPrologue live cmmBlocks = do -- STG Liveness optimisation done here. funEpilogue :: LiveGlobalRegs -> LlvmM ([LlvmVar], LlvmStatements) funEpilogue live = do + dflags <- getDynFlags -- the bool indicates whether the register is padding. let alwaysNeeded = map (\r -> (False, r)) alwaysLive - livePadded = alwaysNeeded ++ padLiveArgs live + livePadded = alwaysNeeded ++ padLiveArgs dflags live -- Set to value or "undef" depending on whether the register is -- actually live - dflags <- getDynFlags let loadExpr r = do (v, _, s) <- getCmmRegVal (CmmGlobal r) return (Just $ v, s) @@ -1825,7 +1825,7 @@ funEpilogue live = do loads <- flip mapM allRegs $ \r -> case () of _ | (False, r) `elem` livePadded -> loadExpr r -- if r is not padding, load it - | not (isSSE r) || (True, r) `elem` livePadded + | not (isFPR r) || (True, r) `elem` livePadded -> loadUndef r | otherwise -> return (Nothing, nilOL) From git at git.haskell.org Sun Oct 28 18:41:17 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 28 Oct 2018 18:41:17 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: Fix rare undefined asm temp end label error in x86 (38618f7) Message-ID: <20181028184117.4D7E03ABBE@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/38618f7474d803b1f89cbc3ea50c0a5528484585/ghc >--------------------------------------------------------------- commit 38618f7474d803b1f89cbc3ea50c0a5528484585 Author: Zejun Wu Date: Sun Oct 28 12:22:25 2018 -0400 Fix rare undefined asm temp end label error in x86 Summary: Encountered assembly error due to undefined label `.LcaDcU_info_end` for following code generated by `pprFrameProc`: ``` .Lsat_sa8fp{v}_info_fde_end: .long .Lblock{v caDcU}_info_fde_end-.Lblock{v caDcU}_info_fde .Lblock{v caDcU}_info_fde: .long _nbHlD-.Lsection_frame .quad block{v caDcU}_info-1 .quad .Lblock{v caDcU}_info_end-block{v caDcU}_info+1 .byte 1 ``` This diff fixed the error. Test Plan: ./validate Also the case where we used to have assembly error is now fixed. Unfortunately, I have limited insight here and cannot get a small enough repro or test case for this. Ben says: > I think I see: Previously we only produced end symbols for the info > tables of top-level procedures. However, blocks within a procedure may > also have info tables, we will dutifully generate debug information for > and consequently we get undefined symbols. Reviewers: simonmar, scpmw, last_g, bgamari Reviewed By: bgamari Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5246 (cherry picked from commit cf961dcf5ebc26cbd960196ba387736334088303) >--------------------------------------------------------------- 38618f7474d803b1f89cbc3ea50c0a5528484585 compiler/nativeGen/X86/Ppr.hs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/compiler/nativeGen/X86/Ppr.hs b/compiler/nativeGen/X86/Ppr.hs index c5fbeb5..287ba03 100644 --- a/compiler/nativeGen/X86/Ppr.hs +++ b/compiler/nativeGen/X86/Ppr.hs @@ -115,8 +115,6 @@ pprNatCmmDecl proc@(CmmProc top_info lbl _ (ListGraph blocks)) = <+> char '-' <+> ppr (mkDeadStripPreventer info_lbl) else empty) $$ - (if debugLevel dflags > 0 - then ppr (mkAsmTempEndLabel info_lbl) <> char ':' else empty) $$ pprSizeDecl info_lbl -- | Output the ELF .size directive. @@ -130,20 +128,23 @@ pprSizeDecl lbl pprBasicBlock :: LabelMap CmmStatics -> NatBasicBlock Instr -> SDoc pprBasicBlock info_env (BasicBlock blockid instrs) = sdocWithDynFlags $ \dflags -> - maybe_infotable $$ + maybe_infotable dflags $ pprLabel asmLbl $$ vcat (map pprInstr instrs) $$ (if debugLevel dflags > 0 then ppr (mkAsmTempEndLabel asmLbl) <> char ':' else empty) where asmLbl = blockLbl blockid - maybe_infotable = case mapLookup blockid info_env of - Nothing -> empty - Just (Statics info_lbl info) -> + maybe_infotable dflags c = case mapLookup blockid info_env of + Nothing -> c + Just (Statics infoLbl info) -> pprAlignForSection Text $$ infoTableLoc $$ vcat (map pprData info) $$ - pprLabel info_lbl + pprLabel infoLbl $$ + c $$ + (if debugLevel dflags > 0 + then ppr (mkAsmTempEndLabel infoLbl) <> char ':' else empty) -- Make sure the info table has the right .loc for the block -- coming right after it. See [Note: Info Offset] infoTableLoc = case instrs of From git at git.haskell.org Sun Oct 28 18:41:20 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 28 Oct 2018 18:41:20 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: includes: Allow headers to be built with C++11 compilers (b539a99) Message-ID: <20181028184120.335953ABBE@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/b539a99cd0d53706092bcbab371bb3af74ba652d/ghc >--------------------------------------------------------------- commit b539a99cd0d53706092bcbab371bb3af74ba652d Author: Ben Gamari Date: Sun Oct 28 12:24:06 2018 -0400 includes: Allow headers to be built with C++11 compilers Summary: Fixes #14784. Note that C++11 is quite conservative; we could likely accept C++03 as well. Test Plan: ``` $ cat >hi.c < EOF $ g++ -std=c++11 hi.c ``` Reviewers: simonmar, hvr Subscribers: rwbarton, carter GHC Trac Issues: #14784 Differential Revision: https://phabricator.haskell.org/D5244 (cherry picked from commit d3a1022fabb0ad337003fac774c6929f402ecb8b) >--------------------------------------------------------------- b539a99cd0d53706092bcbab371bb3af74ba652d includes/Stg.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/Stg.h b/includes/Stg.h index 2e02347..31b2c45 100644 --- a/includes/Stg.h +++ b/includes/Stg.h @@ -25,8 +25,8 @@ #pragma once -#if !(__STDC_VERSION__ >= 199901L) -# error __STDC_VERSION__ does not advertise C99 or later +#if !(__STDC_VERSION__ >= 199901L) && !(__cplusplus >= 201103L) +# error __STDC_VERSION__ does not advertise C99, C++11 or later #endif /* From git at git.haskell.org Sun Oct 28 18:41:23 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 28 Oct 2018 18:41:23 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: Fix `:k` command: add validity checking (804518f) Message-ID: <20181028184123.ABBD73ABBE@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/804518f703076829aa1f5206beaf83e4c1e0c68f/ghc >--------------------------------------------------------------- commit 804518f703076829aa1f5206beaf83e4c1e0c68f Author: Ningning Xie Date: Sun Oct 28 12:26:12 2018 -0400 Fix `:k` command: add validity checking Summary: This patch fixes #15806, where we found that the `:k` command in GHCi misses a validity checking for the type. Missing validity checking causes `:k` to accept types that are not validated. For example, `:k (Maybe (forall a. a -> a))` (incorrectly) returns `*`, while impredictivity of type instantiation shouldn't be allowed. Test Plan: ./validate Reviewers: simonpj, goldfire, bgamari Reviewed By: bgamari Subscribers: rwbarton, carter GHC Trac Issues: #15806 Differential Revision: https://phabricator.haskell.org/D5265 (cherry picked from commit 12cb5cf50b8b35394e2e2d57e1ac693c76f90833) >--------------------------------------------------------------- 804518f703076829aa1f5206beaf83e4c1e0c68f compiler/typecheck/TcHsType.hs | 2 +- compiler/typecheck/TcRnDriver.hs | 4 ++++ testsuite/tests/ghci/should_run/T15806.script | 3 +++ testsuite/tests/ghci/should_run/T15806.stderr | 3 +++ testsuite/tests/ghci/should_run/T15806.stdout | 1 + testsuite/tests/ghci/should_run/all.T | 1 + 6 files changed, 13 insertions(+), 1 deletion(-) diff --git a/compiler/typecheck/TcHsType.hs b/compiler/typecheck/TcHsType.hs index a9e48a6..0810941 100644 --- a/compiler/typecheck/TcHsType.hs +++ b/compiler/typecheck/TcHsType.hs @@ -171,7 +171,7 @@ pprSigCtxt ctxt hs_ty tcHsSigWcType :: UserTypeCtxt -> LHsSigWcType GhcRn -> TcM Type -- This one is used when we have a LHsSigWcType, but in --- a place where wildards aren't allowed. The renamer has +-- a place where wildcards aren't allowed. The renamer has -- already checked this, so we can simply ignore it. tcHsSigWcType ctxt sig_ty = tcHsSigType ctxt (dropWildCards sig_ty) diff --git a/compiler/typecheck/TcRnDriver.hs b/compiler/typecheck/TcRnDriver.hs index 4259b04..2f81e07 100644 --- a/compiler/typecheck/TcRnDriver.hs +++ b/compiler/typecheck/TcRnDriver.hs @@ -51,6 +51,7 @@ import {-# SOURCE #-} TcSplice ( finishTH ) import RnSplice ( rnTopSpliceDecls, traceSplice, SpliceInfo(..) ) import IfaceEnv( externaliseName ) import TcHsType +import TcValidity( checkValidType ) import TcMatches import Inst( deeplyInstantiate ) import TcUnify( checkConstraints ) @@ -2375,6 +2376,9 @@ tcRnType hsc_env normalise rdr_type ; kvs <- kindGeneralize kind ; ty <- zonkTcTypeToType emptyZonkEnv ty + -- Do validity checking on type + ; checkValidType GhciCtxt ty + ; ty' <- if normalise then do { fam_envs <- tcGetFamInstEnvs ; let (_, ty') diff --git a/testsuite/tests/ghci/should_run/T15806.script b/testsuite/tests/ghci/should_run/T15806.script new file mode 100644 index 0000000..71f0dee --- /dev/null +++ b/testsuite/tests/ghci/should_run/T15806.script @@ -0,0 +1,3 @@ +:set -XRankNTypes +:k (Maybe Int) +:k (Maybe (forall a. a -> a)) \ No newline at end of file diff --git a/testsuite/tests/ghci/should_run/T15806.stderr b/testsuite/tests/ghci/should_run/T15806.stderr new file mode 100644 index 0000000..b7e0b4b --- /dev/null +++ b/testsuite/tests/ghci/should_run/T15806.stderr @@ -0,0 +1,3 @@ +:1:1: error: + Illegal polymorphic type: forall a. a -> a + GHC doesn't yet support impredicative polymorphism \ No newline at end of file diff --git a/testsuite/tests/ghci/should_run/T15806.stdout b/testsuite/tests/ghci/should_run/T15806.stdout new file mode 100644 index 0000000..f4e9f23 --- /dev/null +++ b/testsuite/tests/ghci/should_run/T15806.stdout @@ -0,0 +1 @@ +(Maybe Int) :: * \ No newline at end of file diff --git a/testsuite/tests/ghci/should_run/all.T b/testsuite/tests/ghci/should_run/all.T index 430df28..02ef665 100644 --- a/testsuite/tests/ghci/should_run/all.T +++ b/testsuite/tests/ghci/should_run/all.T @@ -33,3 +33,4 @@ test('T13825-ghci',just_ghci, ghci_script, ['T13825-ghci.script']) test('T14963a', just_ghci, ghci_script, ['T14963a.script']) test('T14963b', just_ghci, ghci_script, ['T14963b.script']) test('T14963c', [extra_hc_opts("-fdefer-type-errors")], ghci_script, ['T14963c.script']) +test('T15806', just_ghci, ghci_script, ['T15806.script']) From git at git.haskell.org Sun Oct 28 18:41:27 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 28 Oct 2018 18:41:27 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: Fix integer overflow when encoding doubles (Trac #15271) (37d1460) Message-ID: <20181028184127.410033ABBE@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/37d14601af6ff5c2c590d30fccbb6eb56b88780e/ghc >--------------------------------------------------------------- commit 37d14601af6ff5c2c590d30fccbb6eb56b88780e Author: Fangyi Zhou Date: Sun Oct 28 12:28:53 2018 -0400 Fix integer overflow when encoding doubles (Trac #15271) Summary: Ticket #15271 reports a case where 1e1000000000 is incorrectly converted to 0.0. After some investigation, I discovered the number is converted to rational correctly, but converting the ratio into a double introduced an error. Tracking down to how the conversion is done, I found the rts float implementation uses `ldexp`, whose signature is `double ldexp (double x, int exp);` The callsite passes an `I_` to the second argument, which is platform-dependent. On machines where `I_` is 64 bits and `int` is 32 bits, we observe integer overflow behaviour. Here is a mapping from rational to exponent with observations 1e646457008 -> 2147483645 (result = infinity, positive in int32) 1e646457009 -> 2147483648 (result = 0.0, overflow to negative in int32) 1e1000000000 -> 3321928042 (result = infinity, overflow to positive in int32) 1e1555550000 -> 5167425196 (result = 0.0, overflow to negative in int32) We fix this issue by comparing STG_INT_MIN/MAX and INT_MIN/MAX and bound the value appropriately. Test Plan: New test cases Reviewers: bgamari, erikd, simonmar Reviewed By: bgamari Subscribers: rwbarton, carter GHC Trac Issues: #15271 Differential Revision: https://phabricator.haskell.org/D5271 (cherry picked from commit 311a63979cfa2c1e81be54b82205e681f6ec4f14) >--------------------------------------------------------------- 37d14601af6ff5c2c590d30fccbb6eb56b88780e rts/StgPrimFloat.c | 26 ++++++++++++++++++---- testsuite/tests/numeric/should_run/T15271.hs | 5 +++++ .../tests/numeric/should_run/T15271.stdout | 2 -- 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/rts/StgPrimFloat.c b/rts/StgPrimFloat.c index 277ae66..f1f6736 100644 --- a/rts/StgPrimFloat.c +++ b/rts/StgPrimFloat.c @@ -14,6 +14,7 @@ #include #include +#include #define IEEE_FLOATING_POINT 1 @@ -47,6 +48,23 @@ #define __abs(a) (( (a) >= 0 ) ? (a) : (-(a))) +/** Trac #15271: Some large ratios are converted into double incorrectly. + * This occurs when StgInt has 64 bits and C int has 32 bits, where wrapping + * occurs and an incorrect signed value is passed into ldexp */ +STATIC_INLINE int +truncExponent(I_ e) +{ +#if INT_MAX < STG_INT_MAX + if (RTS_UNLIKELY(e > INT_MAX)) + e = INT_MAX; +#endif +#if INT_MIN > STG_INT_MIN + if (RTS_UNLIKELY(e < INT_MIN)) + e = INT_MIN; +#endif + return e; +} + /* Special version for words */ StgDouble __word_encodeDouble (W_ j, I_ e) @@ -57,7 +75,7 @@ __word_encodeDouble (W_ j, I_ e) /* Now raise to the exponent */ if ( r != 0.0 ) /* Lennart suggests this avoids a bug in MIPS's ldexp */ - r = ldexp(r, e); + r = ldexp(r, truncExponent(e)); return r; } @@ -72,7 +90,7 @@ __int_encodeDouble (I_ j, I_ e) /* Now raise to the exponent */ if ( r != 0.0 ) /* Lennart suggests this avoids a bug in MIPS's ldexp */ - r = ldexp(r, e); + r = ldexp(r, truncExponent(e)); /* sign is encoded in the size */ if (j < 0) @@ -91,7 +109,7 @@ __int_encodeFloat (I_ j, I_ e) /* Now raise to the exponent */ if ( r != 0.0 ) /* Lennart suggests this avoids a bug in MIPS's ldexp */ - r = ldexp(r, e); + r = ldexp(r, truncExponent(e)); /* sign is encoded in the size */ if (j < 0) @@ -110,7 +128,7 @@ __word_encodeFloat (W_ j, I_ e) /* Now raise to the exponent */ if ( r != 0.0 ) /* Lennart suggests this avoids a bug in MIPS's ldexp */ - r = ldexp(r, e); + r = ldexp(r, truncExponent(e)); return r; } diff --git a/testsuite/tests/numeric/should_run/T15271.hs b/testsuite/tests/numeric/should_run/T15271.hs new file mode 100644 index 0000000..c8f2c95 --- /dev/null +++ b/testsuite/tests/numeric/should_run/T15271.hs @@ -0,0 +1,5 @@ +main = do + print 1e646457008 + print 1e646457009 -- T15271: This incorrectly printed 0.0 + print 1e1555550000 -- This is still infinity + print 1e1000000000 -- T15271: This incorrectly printed 0.0 diff --git a/libraries/base/tests/T7034.stdout b/testsuite/tests/numeric/should_run/T15271.stdout similarity index 66% copy from libraries/base/tests/T7034.stdout copy to testsuite/tests/numeric/should_run/T15271.stdout index 2675153..6e89f24 100644 --- a/libraries/base/tests/T7034.stdout +++ b/testsuite/tests/numeric/should_run/T15271.stdout @@ -2,5 +2,3 @@ Infinity Infinity Infinity Infinity -Infinity -Infinity From git at git.haskell.org Sun Oct 28 18:41:30 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 28 Oct 2018 18:41:30 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: Comment out CONSTANT_FOLDED in GHC.Natural (de9a8fe) Message-ID: <20181028184130.1DE633ABBE@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/de9a8febde8cb7945d36d7e0bb7e12ddffca50bd/ghc >--------------------------------------------------------------- commit de9a8febde8cb7945d36d7e0bb7e12ddffca50bd Author: Christiaan Baaij Date: Sun Oct 28 12:29:23 2018 -0400 Comment out CONSTANT_FOLDED in GHC.Natural Summary: Although these functions were marked as CONSTANT_FOLDED, they did not have a corresponding builtinRule in PrelRules. The idea was probably to add them eventually, but this hasn't manifested so far. The plan is to eventually add builtin rules for these functions over Natural, so as a reminder we simply comment out the CONSTANT_FOLDED annotation instead of removing it completely. Reviewers: hvr, bgamari Reviewed By: bgamari Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5267 (cherry picked from commit 3ec6fe8827956cc36b58cdf0bb1f5752eaa2a8ea) >--------------------------------------------------------------- de9a8febde8cb7945d36d7e0bb7e12ddffca50bd libraries/base/GHC/Natural.hs | 55 ++++++++++++---------- .../tests/numeric/should_compile/T14465.stdout | 15 ++++-- 2 files changed, 40 insertions(+), 30 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc de9a8febde8cb7945d36d7e0bb7e12ddffca50bd From git at git.haskell.org Sun Oct 28 18:41:32 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 28 Oct 2018 18:41:32 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: plugins: search for .a files if necessary (d2cd150) Message-ID: <20181028184132.E60073ABBE@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/d2cd150eda599d0de83fc687efc48e22a2e74a5e/ghc >--------------------------------------------------------------- commit d2cd150eda599d0de83fc687efc48e22a2e74a5e Author: sheaf Date: Sun Oct 28 12:30:13 2018 -0400 plugins: search for .a files if necessary Summary: on windows, plugins are loaded via .a files, but those paths were not being searched when loading plugins Test Plan: ./validate Reviewers: Phyx, bgamari Reviewed By: Phyx Subscribers: RyanGlScott, rwbarton, carter GHC Trac Issues: #15700 Differential Revision: https://phabricator.haskell.org/D5253 (cherry picked from commit 70298db16c3f0ea4adb603ccb2b5e93eb9c7a556) >--------------------------------------------------------------- d2cd150eda599d0de83fc687efc48e22a2e74a5e compiler/deSugar/DsUsage.hs | 78 ++++++++++++++++++++++----------------------- 1 file changed, 38 insertions(+), 40 deletions(-) diff --git a/compiler/deSugar/DsUsage.hs b/compiler/deSugar/DsUsage.hs index 58c31ee..39b4855 100644 --- a/compiler/deSugar/DsUsage.hs +++ b/compiler/deSugar/DsUsage.hs @@ -140,7 +140,7 @@ with optimisations turned on, and give basically all binders an INLINE pragma. So instead: - * For plugins that were build locally: we store the filepath and hash of the + * For plugins that were built locally: we store the filepath and hash of the object files of the module with the `plugin` binder, and the object files of modules that are dependencies of the plugin module and belong to the same `UnitId` as the plugin @@ -165,59 +165,57 @@ One way to improve this is to either: mkPluginUsage :: HscEnv -> ModIface -> IO [Usage] mkPluginUsage hsc_env pluginModule = case lookupPluginModuleWithSuggestions dflags pNm Nothing of - -- The plug is from an external package, we just look up the dylib that - -- contains the plugin LookupFound _ pkg -> do + -- The plugin is from an external package: + -- search for the library files containing the plugin. let searchPaths = collectLibraryPaths dflags [pkg] - libs = packageHsLibs dflags pkg - dynlibLocs = [ searchPath mkHsSOName platform lib - | searchPath <- searchPaths - , lib <- libs - ] - dynlibs <- filterM doesFileExist dynlibLocs - case dynlibs of - [] -> pprPanic - ("mkPluginUsage: no dylibs, tried:\n" ++ unlines dynlibLocs) - (ppr pNm) - _ -> mapM hashFile (nub dynlibs) + useDyn = WayDyn `elem` ways dflags + suffix = if useDyn then soExt platform else "a" + libLocs = [ searchPath "lib" ++ libLoc <.> suffix + | searchPath <- searchPaths + , libLoc <- packageHsLibs dflags pkg + ] + -- we also try to find plugin library files by adding WayDyn way, + -- if it isn't already present (see trac #15492) + paths = + if useDyn + then libLocs + else + let dflags' = updateWays (addWay' WayDyn dflags) + dlibLocs = [ searchPath mkHsSOName platform dlibLoc + | searchPath <- searchPaths + , dlibLoc <- packageHsLibs dflags' pkg + ] + in libLocs ++ dlibLocs + files <- filterM doesFileExist paths + case files of + [] -> + pprPanic + ( "mkPluginUsage: missing plugin library, tried:\n" + ++ unlines paths + ) + (ppr pNm) + _ -> mapM hashFile (nub files) _ -> do foundM <- findPluginModule hsc_env pNm case foundM of - -- The plugin was built locally, look up the object file containing - -- the `plugin` binder, and all object files belong to modules that are - -- transitive dependencies of the plugin that belong to the same package + -- The plugin was built locally: look up the object file containing + -- the `plugin` binder, and all object files belong to modules that are + -- transitive dependencies of the plugin that belong to the same package. Found ml _ -> do - pluginObject <- hashFile (ml_obj_file ml) + pluginObject <- hashFile (ml_obj_file ml) depObjects <- catMaybes <$> mapM lookupObjectFile deps return (nub (pluginObject : depObjects)) - _ -> pprPanic "mkPluginUsage: no object or dylib" (ppr pNm) + _ -> pprPanic "mkPluginUsage: no object file found" (ppr pNm) where - -- plugins are shared libraries, so WayDyn should be part of the dflags in - -- order to get the correct filenames and library paths. - -- - -- We can distinguish two scenarios: - -- - -- 1. The dflags do not contain WayDyn, in this case we need to remove - -- all other ways and only add WayDyn. Why? Because other ways change - -- the library tags, i.e. WayProf adds `_p`, and we would end up looking - -- for a profiled plugin which might not be installed. See #15492 - -- - -- 2. The dflags do contain WayDyn, in this case we can leave the ways as - -- is, because the plugin must be compiled with the same ways as the - -- module that is currently being build, e.g., if the module is - -- build with WayDyn and WayProf, then the plugin that was used - -- would've also had to been build with WayProf (and WayDyn). - dflags1 = hsc_dflags hsc_env - dflags = if WayDyn `elem` ways dflags1 - then dflags1 - else updateWays (addWay' WayDyn (dflags1 {ways = []})) + dflags = hsc_dflags hsc_env platform = targetPlatform dflags pNm = moduleName (mi_module pluginModule) pPkg = moduleUnitId (mi_module pluginModule) deps = map fst (dep_mods (mi_deps pluginModule)) - -- loopup object file for a plugin dependencies from the same package as the - -- the plugin + -- Lookup object file for a plugin dependency, + -- from the same package as the plugin. lookupObjectFile nm = do foundM <- findImportedModule hsc_env nm Nothing case foundM of From git at git.haskell.org Mon Oct 29 00:33:06 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 29 Oct 2018 00:33:06 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: users-guide: Add release notes for 8.6.2 (9f80277) Message-ID: <20181029003306.ECF843ABBE@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/9f802777f958a6bc2152662d90edb6016b40a43d/ghc >--------------------------------------------------------------- commit 9f802777f958a6bc2152662d90edb6016b40a43d Author: Ben Gamari Date: Sun Oct 28 16:02:51 2018 -0400 users-guide: Add release notes for 8.6.2 >--------------------------------------------------------------- 9f802777f958a6bc2152662d90edb6016b40a43d docs/users_guide/8.6.2-notes.rst | 70 ++++++++++++++++++++++++++++++++++++++++ docs/users_guide/index.rst | 1 + 2 files changed, 71 insertions(+) diff --git a/docs/users_guide/8.6.2-notes.rst b/docs/users_guide/8.6.2-notes.rst new file mode 100644 index 0000000..9ee94df --- /dev/null +++ b/docs/users_guide/8.6.2-notes.rst @@ -0,0 +1,70 @@ +.. _release-8-6-2: + +Release notes for version 8.6.2 +=============================== + +GHC 8.6.2 is a bug-fix release, fixing a few regressions found in 8.6.1. + + +Highlights +---------- + +The highlights, since the 8.6.2 release, are: + +- A long-standing bug exposed in GHC 8.6.1, :ghc-ticket:`15696`, has been fixed. + This issue resulted in undefined runtime behavior with some uses of the + ``dataToTag#`` primop. Note that this issue, while less likely to manifest, + has existed in some form in all GHC releases prior to this release and may + result in silent, incorrect evaluation. For this reason, users are strongly + encouraged to upgrade to 8.6.2. + +- A long-standing bug in the LLVM code generator (:ghc-ticket:`14251`), + resulting in incorrect floating point evaluation, has been fixed. + +- Several compiler panics observed in GHC 8.6.1 have been fixed + (:ghc-ticket:`15499`, :ghc-ticket:`15053`, :ghc-ticket:`15692`, + :ghc-ticket:`15695`) + +- GHC now runs without complaining when installed to a read-only location on + Windows (:ghc-ticket:`15667`) + +- An integer overflow, resulting in some ``encodeFloat`` uses returning + incorrect results, has been fixed (:ghc-ticket:`15271`) + + +Included libraries +------------------ + +The package database provided with this distribution also contains a number of +packages other than GHC itself. See the changelogs provided with these packages +for further change information. + +.. ghc-package-list:: + + libraries/array/array.cabal: Dependency of ``ghc`` library + libraries/base/base.cabal: Core library + libraries/binary/binary.cabal: Dependency of ``ghc`` library + libraries/bytestring/bytestring.cabal: Deppendency of ``ghc`` library + libraries/Cabal/Cabal/Cabal.cabal: Dependency of ``ghc-pkg`` utility + libraries/containers/containers.cabal: Dependency of ``ghc`` library + libraries/deepseq/deepseq.cabal: Dependency of ``ghc`` library + libraries/directory/directory.cabal: Dependency of ``ghc`` library + libraries/filepath/filepath.cabal: Dependency of ``ghc`` library + compiler/ghc.cabal: The compiler itself + libraries/ghci/ghci.cabal: The REPL interface + libraries/ghc-boot/ghc-boot.cabal: Internal compiler library + libraries/ghc-compact/ghc-compact.cabal: Core library + libraries/ghc-prim/ghc-prim.cabal: Core library + libraries/haskeline/haskeline.cabal: Dependency of ``ghci`` executable + libraries/hpc/hpc.cabal: Dependency of ``hpc`` executable + libraries/integer-gmp/integer-gmp.cabal: Core library + libraries/mtl/mtl.cabal: Dependency of ``Cabal`` library + libraries/parsec/parsec.cabal: Dependency of ``Cabal`` library + libraries/process/process.cabal: Dependency of ``ghc`` library + libraries/template-haskell/template-haskell.cabal: Core library + libraries/text/text.cabal: Dependency of ``Cabal`` library + libraries/time/time.cabal: Dependency of ``ghc`` library + libraries/transformers/transformers.cabal: Dependency of ``ghc`` library + libraries/unix/unix.cabal: Dependency of ``ghc`` library + libraries/Win32/Win32.cabal: Dependency of ``ghc`` library + libraries/xhtml/xhtml.cabal: Dependency of ``haddock`` executable diff --git a/docs/users_guide/index.rst b/docs/users_guide/index.rst index b1b0141..2d184ab 100644 --- a/docs/users_guide/index.rst +++ b/docs/users_guide/index.rst @@ -13,6 +13,7 @@ Contents: license intro 8.6.1-notes + 8.6.2-notes ghci runghc usage From git at git.haskell.org Mon Oct 29 00:33:09 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 29 Oct 2018 00:33:09 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: Fix TcType.anyRewritableTyVar (b391cae) Message-ID: <20181029003309.BF91C3ABBE@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/b391cae1c2b0d27425c2f0cd24d627e2742bfbed/ghc >--------------------------------------------------------------- commit b391cae1c2b0d27425c2f0cd24d627e2742bfbed Author: Ningning Xie Date: Sun Oct 28 12:29:55 2018 -0400 Fix TcType.anyRewritableTyVar Summary: This patch fixes #15805, where we found that `TcType.anyRewritableTyVar` has one wrong case. Besides the fix, it also: - removed some unnecessary `ASSERT2(tcIsTcTyVar...)` in `TcType`, as now we have `tcIsTcTyVar = isTyVar`. - fixed some comments Test Plan: ./validate Reviewers: goldfire, simonpj, bgamari Reviewed By: simonpj Subscribers: rwbarton, carter GHC Trac Issues: #15805 Differential Revision: https://phabricator.haskell.org/D5263 (cherry picked from commit a7f64c6cbfc5562adff207945576d1c9db2a58d9) >--------------------------------------------------------------- b391cae1c2b0d27425c2f0cd24d627e2742bfbed compiler/typecheck/TcType.hs | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/compiler/typecheck/TcType.hs b/compiler/typecheck/TcType.hs index eca7c01..ef77200 100644 --- a/compiler/typecheck/TcType.hs +++ b/compiler/typecheck/TcType.hs @@ -577,7 +577,7 @@ pprTcTyVarDetails (MetaTv { mtv_info = info, mtv_tclvl = tclvl }) ------------------------------------- -- UserTypeCtxt describes the origin of the polymorphic type --- in the places where we need to an expression has that type +-- in the places where we need an expression to have that type data UserTypeCtxt = FunSigCtxt -- Function type signature, when checking the type @@ -713,7 +713,7 @@ Note [TcLevel and untouchable type variables] * A unification variable is *touchable* if its level number is EQUAL TO that of its immediate parent implication, - and it is a TauTv or SigTv (but /not/ FlatMetaTv or FlatSkolTv + and it is a TauTv or SigTv (but /not/ FlatMetaTv or FlatSkolTv) Note [WantedInv] ~~~~~~~~~~~~~~~~ @@ -992,7 +992,7 @@ anyRewritableTyVar ignore_cos role pred ty go rl bvs (CoercionTy co) = go_co rl bvs co -- ToDo: check go_tc NomEq bvs _ tys = any (go NomEq bvs) tys - go_tc ReprEq bvs tc tys = foldr ((&&) . go_arg bvs) False $ + go_tc ReprEq bvs tc tys = any (go_arg bvs) (tyConRolesRepresentational tc `zip` tys) go_arg bvs (Nominal, ty) = go NomEq bvs ty @@ -1031,7 +1031,7 @@ out the other (Trac #14363). ********************************************************************* -} data CandidatesQTvs -- See Note [Dependent type variables] - -- See Note [CandidatesQTvs determinism] + -- See Note [CandidatesQTvs determinism and order] = DV { dv_kvs :: DTyCoVarSet -- "kind" variables (dependent) , dv_tvs :: DTyVarSet -- "type" variables (non-dependent) -- A variable may appear in both sets @@ -1195,8 +1195,7 @@ isFloatedTouchableMetaTyVar ctxt_tclvl tv | isTyVar tv -- See Note [Coercion variables in free variable lists] , MetaTv { mtv_tclvl = tv_tclvl, mtv_info = info } <- tcTyVarDetails tv , not (isFlattenInfo info) - = ASSERT2( tcIsTcTyVar tv, ppr tv ) - tv_tclvl `strictlyDeeperThan` ctxt_tclvl + = tv_tclvl `strictlyDeeperThan` ctxt_tclvl | otherwise = False @@ -1212,10 +1211,9 @@ isTyConableTyVar tv -- with a type constructor application; in particular, -- not a SigTv | isTyVar tv -- See Note [Coercion variables in free variable lists] - = ASSERT2( tcIsTcTyVar tv, ppr tv ) - case tcTyVarDetails tv of - MetaTv { mtv_info = SigTv } -> False - _ -> True + = case tcTyVarDetails tv of + MetaTv { mtv_info = SigTv } -> False + _ -> True | otherwise = True isFmvTyVar tv @@ -1230,7 +1228,7 @@ isFskTyVar tv MetaTv { mtv_info = FlatSkolTv } -> True _ -> False --- | True of both given and wanted flatten-skolems (fak and usk) +-- | True of both given and wanted flatten-skolems (fmv and fsk) isFlattenTyVar tv = ASSERT2( tcIsTcTyVar tv, ppr tv ) case tcTyVarDetails tv of @@ -1245,16 +1243,14 @@ isSkolemTyVar tv isOverlappableTyVar tv | isTyVar tv -- See Note [Coercion variables in free variable lists] - = ASSERT2( tcIsTcTyVar tv, ppr tv ) - case tcTyVarDetails tv of + = case tcTyVarDetails tv of SkolemTv _ overlappable -> overlappable _ -> False | otherwise = False isMetaTyVar tv | isTyVar tv -- See Note [Coercion variables in free variable lists] - = ASSERT2( tcIsTcTyVar tv, ppr tv ) - case tcTyVarDetails tv of + = case tcTyVarDetails tv of MetaTv {} -> True _ -> False | otherwise = False From git at git.haskell.org Mon Oct 29 02:35:22 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 29 Oct 2018 02:35:22 +0000 (UTC) Subject: [commit: ghc] master: Bump template-haskell version to 2.15.0.0 (e8a652f) Message-ID: <20181029023522.67A583ABBE@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/e8a652f65318cf60e856f7c2777a003eba10ddc6/ghc >--------------------------------------------------------------- commit e8a652f65318cf60e856f7c2777a003eba10ddc6 Author: Ryan Scott Date: Sun Oct 28 22:25:05 2018 -0400 Bump template-haskell version to 2.15.0.0 Summary: Commit 512eeb9bb9a81e915bfab25ca16bc87c62252064 (`More explicit foralls (GHC Proposal 0007)`) introduced breaking changes to the Template Haskell AST. As a consequence of this, there are libraries in the wild that now fail to build on GHC HEAD (for instance, `th-abstraction`). This properly bumps the `template-haskell` library's version number to `2.15.0.0` so that these libraries can guard against these changes using `MIN_VERSION_template_haskell`. Test Plan: ./validate Reviewers: bgamari Reviewed By: bgamari Subscribers: rwbarton, carter GHC Trac Issues: #15818 Differential Revision: https://phabricator.haskell.org/D5272 >--------------------------------------------------------------- e8a652f65318cf60e856f7c2777a003eba10ddc6 compiler/ghc.cabal.in | 2 +- libraries/ghci/ghci.cabal.in | 2 +- libraries/template-haskell/template-haskell.cabal | 2 +- testsuite/tests/th/TH_Roles2.stderr | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/compiler/ghc.cabal.in b/compiler/ghc.cabal.in index 5c9d88f..f952b88 100644 --- a/compiler/ghc.cabal.in +++ b/compiler/ghc.cabal.in @@ -64,7 +64,7 @@ Library containers >= 0.5 && < 0.7, array >= 0.1 && < 0.6, filepath >= 1 && < 1.5, - template-haskell == 2.14.*, + template-haskell == 2.15.*, hpc == 0.6.*, transformers == 0.5.*, ghc-boot == @ProjectVersionMunged@, diff --git a/libraries/ghci/ghci.cabal.in b/libraries/ghci/ghci.cabal.in index f49acf5..467ed8f 100644 --- a/libraries/ghci/ghci.cabal.in +++ b/libraries/ghci/ghci.cabal.in @@ -79,7 +79,7 @@ library ghc-boot == @ProjectVersionMunged@, ghc-boot-th == @ProjectVersionMunged@, ghc-heap == @ProjectVersionMunged@, - template-haskell == 2.14.*, + template-haskell == 2.15.*, transformers == 0.5.* if !os(windows) diff --git a/libraries/template-haskell/template-haskell.cabal b/libraries/template-haskell/template-haskell.cabal index 2b2c5db..90d67fc 100644 --- a/libraries/template-haskell/template-haskell.cabal +++ b/libraries/template-haskell/template-haskell.cabal @@ -1,5 +1,5 @@ name: template-haskell -version: 2.14.0.0 +version: 2.15.0.0 -- NOTE: Don't forget to update ./changelog.md license: BSD3 license-file: LICENSE diff --git a/testsuite/tests/th/TH_Roles2.stderr b/testsuite/tests/th/TH_Roles2.stderr index 3752e8c..c988015 100644 --- a/testsuite/tests/th/TH_Roles2.stderr +++ b/testsuite/tests/th/TH_Roles2.stderr @@ -4,7 +4,7 @@ TYPE CONSTRUCTORS Dependent modules: [] Dependent packages: [array-0.5.2.0, base-4.12.0.0, deepseq-1.4.4.0, ghc-boot-th-8.7, ghc-prim-0.5.3, integer-gmp-1.0.2.0, - pretty-1.1.3.6, template-haskell-2.14.0.0] + pretty-1.1.3.6, template-haskell-2.15.0.0] ==================== Typechecker ==================== TH_Roles2.$tcT From git at git.haskell.org Mon Oct 29 03:18:07 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 29 Oct 2018 03:18:07 +0000 (UTC) Subject: [commit: ghc] master: Finish fix for #14880. (5e45ad1) Message-ID: <20181029031807.0B7A13ABBE@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/5e45ad10ffca1ad175b10f6ef3327e1ed8ba25f3/ghc >--------------------------------------------------------------- commit 5e45ad10ffca1ad175b10f6ef3327e1ed8ba25f3 Author: Tobias Dammers Date: Thu Sep 13 09:56:02 2018 +0200 Finish fix for #14880. The real change that fixes the ticket is described in Note [Naughty quantification candidates] in TcMType. Fixing this required reworking candidateQTyVarsOfType, the function that extracts free variables as candidates for quantification. One consequence is that we now must be more careful when quantifying: any skolems around must be quantified manually, and quantifyTyVars will now only quantify over metavariables. This makes good sense, as skolems are generally user-written and are listed in the AST. As a bonus, we now have more control over the ordering of such skolems. Along the way, this commit fixes #15711 and refines the fix to #14552 (by accepted a program that was previously rejected, as we can now accept that program by zapping variables to Any). This commit also does a fair amount of rejiggering kind inference of datatypes. Notably, we now can skip the generalization step in kcTyClGroup for types with CUSKs, because we get the kind right the first time. This commit also thus fixes #15743 and #15592, which both concern datatype kind generalisation. (#15591 is also very relevant.) For this aspect of the commit, see Note [Required, Specified, and Inferred in types] in TcTyClsDecls. Test cases: dependent/should_fail/T14880{,-2}, dependent/should_fail/T15743[cd] dependent/should_compile/T15743{,e} ghci/scripts/T15743b polykinds/T15592 dependent/should_fail/T15591[bc] ghci/scripts/T15591 >--------------------------------------------------------------- 5e45ad10ffca1ad175b10f6ef3327e1ed8ba25f3 compiler/basicTypes/Var.hs | 59 +-- compiler/basicTypes/VarSet.hs | 1 + compiler/coreSyn/MkCore.hs | 2 +- compiler/deSugar/DsBinds.hs | 2 +- compiler/main/HscTypes.hs | 4 +- compiler/prelude/TysWiredIn.hs-boot | 2 + compiler/rename/RnTypes.hs | 21 +- compiler/simplCore/SetLevels.hs | 3 +- compiler/simplCore/SimplUtils.hs | 4 +- compiler/specialise/SpecConstr.hs | 2 +- compiler/typecheck/FamInst.hs | 10 +- compiler/typecheck/TcClassDcl.hs | 4 +- compiler/typecheck/TcDeriv.hs | 2 +- compiler/typecheck/TcErrors.hs | 2 +- compiler/typecheck/TcGenDeriv.hs | 4 +- compiler/typecheck/TcGenGenerics.hs | 4 +- compiler/typecheck/TcHsSyn.hs | 2 +- compiler/typecheck/TcHsType.hs | 235 +++++---- compiler/typecheck/TcInstDcls.hs | 2 +- compiler/typecheck/TcMType.hs | 411 +++++++++++++-- compiler/typecheck/TcPatSyn.hs | 52 -- compiler/typecheck/TcRules.hs | 26 +- compiler/typecheck/TcSMonad.hs | 15 +- compiler/typecheck/TcSigs.hs | 6 +- compiler/typecheck/TcSimplify.hs | 21 +- compiler/typecheck/TcTyClsDecls.hs | 573 +++++++++++---------- compiler/typecheck/TcType.hs | 149 +----- compiler/typecheck/TcValidity.hs | 48 +- compiler/types/TyCoRep.hs | 35 +- compiler/types/TyCon.hs | 68 ++- compiler/types/Type.hs | 143 ++++- compiler/types/Type.hs-boot | 2 +- compiler/types/Unify.hs | 2 +- compiler/utils/UniqDFM.hs | 2 + compiler/utils/UniqDSet.hs | 1 + compiler/utils/Util.hs | 6 +- docs/users_guide/glasgow_exts.rst | 259 +++++++--- docs/users_guide/using.rst | 11 +- .../InferDependency.hs | 0 .../tests/dependent/should_compile/T14066a.stderr | 2 +- .../tests/dependent/should_compile/T14880-2.hs | 13 + .../tests/dependent/should_compile/T14880-2.stderr | 12 + testsuite/tests/dependent/should_compile/T14880.hs | 15 + testsuite/tests/dependent/should_compile/T15743.hs | 7 + .../tests/dependent/should_compile/T15743.stderr | 6 + .../tests/dependent/should_compile/T15743e.hs | 21 + .../tests/dependent/should_compile/T15743e.stderr | 32 ++ testsuite/tests/dependent/should_compile/all.T | 5 + .../dependent/should_fail/InferDependency.stderr | 10 - .../tests/dependent/should_fail/SelfDep.stderr | 1 + .../tests/dependent/should_fail/T13895.stderr | 14 +- .../tests/dependent/should_fail/T14066d.stderr | 2 +- .../tests/dependent/should_fail/T14066e.stderr | 12 +- testsuite/tests/dependent/should_fail/T15591b.hs | 9 + .../tests/dependent/should_fail/T15591b.stderr | 7 + testsuite/tests/dependent/should_fail/T15591c.hs | 9 + .../tests/dependent/should_fail/T15591c.stderr | 7 + testsuite/tests/dependent/should_fail/T15743c.hs | 11 + .../tests/dependent/should_fail/T15743c.stderr | 16 + testsuite/tests/dependent/should_fail/T15743d.hs | 10 + .../tests/dependent/should_fail/T15743d.stderr | 16 + testsuite/tests/dependent/should_fail/all.T | 5 +- testsuite/tests/ghci/scripts/T15591.hs | 16 + testsuite/tests/ghci/scripts/T15591.script | 4 + testsuite/tests/ghci/scripts/T15591.stdout | 4 + testsuite/tests/ghci/scripts/T15743b.hs | 6 + testsuite/tests/ghci/scripts/T15743b.script | 3 + testsuite/tests/ghci/scripts/T15743b.stdout | 1 + testsuite/tests/ghci/scripts/T6018ghcifail.stderr | 2 +- testsuite/tests/ghci/scripts/all.T | 1 + .../tests/indexed-types/should_fail/T14175.stderr | 1 + .../tests/patsyn/should_compile/T14394.stdout | 2 +- .../{should_fail => should_compile}/T14552.hs | 0 testsuite/tests/patsyn/should_compile/all.T | 1 + testsuite/tests/patsyn/should_fail/T14552.stderr | 9 - testsuite/tests/patsyn/should_fail/all.T | 1 - testsuite/tests/polykinds/PolyKinds06.stderr | 9 +- testsuite/tests/polykinds/T13625.stderr | 1 + testsuite/tests/polykinds/T14846.stderr | 18 +- testsuite/tests/polykinds/T15592.hs | 2 +- testsuite/tests/polykinds/T7524.stderr | 2 +- .../should_compile/ExplicitForAllRules1.stderr | 10 + .../tests/typecheck/should_fail/T14350.stderr | 10 +- .../tests/typecheck/should_fail/T6018fail.stderr | 2 +- .../typecheck/should_fail/T6018failclosed.stderr | 4 +- testsuite/tests/typecheck/should_fail/T7892.stderr | 4 +- 86 files changed, 1600 insertions(+), 950 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 5e45ad10ffca1ad175b10f6ef3327e1ed8ba25f3 From git at git.haskell.org Mon Oct 29 03:18:10 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 29 Oct 2018 03:18:10 +0000 (UTC) Subject: [commit: ghc] master: Fix #15787 by squashing a coercion hole. (4427315) Message-ID: <20181029031810.CC8D03ABBE@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/4427315a65b25db22e1754d41b43dd4b782b022f/ghc >--------------------------------------------------------------- commit 4427315a65b25db22e1754d41b43dd4b782b022f Author: Richard Eisenberg Date: Sun Oct 28 16:06:17 2018 -0400 Fix #15787 by squashing a coercion hole. In type-incorrect code, we can sometimes let a coercion hole make it through the zonker. If this coercion hole then ends up in the environment (e.g., in the type of a data constructor), then it causes trouble later. This patch avoids trouble by substituting the coercion hole for its representative CoVar. Really, any coercion would do, but the CoVar was very handy. test case: polykinds/T15787 >--------------------------------------------------------------- 4427315a65b25db22e1754d41b43dd4b782b022f compiler/typecheck/TcHsSyn.hs | 4 +++- testsuite/tests/polykinds/T15787.hs | 19 +++++++++++++++++++ testsuite/tests/polykinds/T15787.stderr | 6 ++++++ testsuite/tests/polykinds/all.T | 1 + 4 files changed, 29 insertions(+), 1 deletion(-) diff --git a/compiler/typecheck/TcHsSyn.hs b/compiler/typecheck/TcHsSyn.hs index f5fedc9..99e2172 100644 --- a/compiler/typecheck/TcHsSyn.hs +++ b/compiler/typecheck/TcHsSyn.hs @@ -1810,7 +1810,9 @@ zonkCoHole env hole@(CoercionHole { ch_ref = ref, ch_co_var = cv }) , text "Type-correct unfilled coercion hole" <+> ppr hole ) ; cv' <- zonkCoVar cv - ; return $ mkHoleCo (hole { ch_co_var = cv' }) } } + ; return $ mkCoVarCo cv' } } + -- This will be an out-of-scope variable, but keeping + -- this as a coercion hole led to #15787 zonk_tycomapper :: TyCoMapper ZonkEnv TcM zonk_tycomapper = TyCoMapper diff --git a/testsuite/tests/polykinds/T15787.hs b/testsuite/tests/polykinds/T15787.hs new file mode 100644 index 0000000..85e737a --- /dev/null +++ b/testsuite/tests/polykinds/T15787.hs @@ -0,0 +1,19 @@ +{-# Language RankNTypes #-} +{-# Language TypeApplications #-} +{-# Language DataKinds #-} +{-# Language PolyKinds #-} +{-# Language GADTs #-} +{-# Language TypeFamilies #-} + +import Data.Kind + +class Ríki (ob :: Type) where + type Hom :: ob -> ob -> Type + +data + Kl_kind :: forall ob . (ob -> ob) -> ob -> Type where + Kl :: k -> Kl_kind (m :: ob -> ob) k + +type family + UnKl (kl :: Kl_kind m k) = (res :: k) where + UnKl (Kl a) = a diff --git a/testsuite/tests/polykinds/T15787.stderr b/testsuite/tests/polykinds/T15787.stderr new file mode 100644 index 0000000..6d368d5 --- /dev/null +++ b/testsuite/tests/polykinds/T15787.stderr @@ -0,0 +1,6 @@ + +T15787.hs:15:43: error: + • Expected kind ‘ob’, but ‘k’ has kind ‘*’ + • In the second argument of ‘Kl_kind’, namely ‘k’ + In the type ‘Kl_kind (m :: ob -> ob) k’ + In the definition of data constructor ‘Kl’ diff --git a/testsuite/tests/polykinds/all.T b/testsuite/tests/polykinds/all.T index 010d0ac..371fbf2 100644 --- a/testsuite/tests/polykinds/all.T +++ b/testsuite/tests/polykinds/all.T @@ -194,3 +194,4 @@ test('T15170', normal, compile, ['']) test('T14939', normal, compile, ['-O']) test('T15577', normal, compile_fail, ['-O']) test('T15592', normal, compile, ['']) +test('T15787', normal, compile_fail, ['']) From git at git.haskell.org Mon Oct 29 13:46:50 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 29 Oct 2018 13:46:50 +0000 (UTC) Subject: [commit: ghc] wip/T15809: More progress on Trac #15809 (a54f71e) Message-ID: <20181029134650.538D63ABBE@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T15809 Link : http://ghc.haskell.org/trac/ghc/changeset/a54f71e29de47bf16e6675dc1ed39870a3bf3d54/ghc >--------------------------------------------------------------- commit a54f71e29de47bf16e6675dc1ed39870a3bf3d54 Author: Simon Peyton Jones Date: Mon Oct 29 13:44:47 2018 +0000 More progress on Trac #15809 >--------------------------------------------------------------- a54f71e29de47bf16e6675dc1ed39870a3bf3d54 compiler/typecheck/TcHsSyn.hs | 2 +- compiler/typecheck/TcHsType.hs | 176 ++++++++++++++++++++++++------------- compiler/typecheck/TcInstDcls.hs | 11 ++- compiler/typecheck/TcMType.hs | 5 +- compiler/typecheck/TcSimplify.hs | 11 ++- compiler/typecheck/TcTyClsDecls.hs | 121 +++++++++++++------------ 6 files changed, 194 insertions(+), 132 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc a54f71e29de47bf16e6675dc1ed39870a3bf3d54 From git at git.haskell.org Mon Oct 29 13:52:38 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 29 Oct 2018 13:52:38 +0000 (UTC) Subject: [commit: ghc] master: Remove kind generalisation from tcRnType (3a51abd) Message-ID: <20181029135238.926B33ABBF@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/3a51abd04432ea3d13e4ea3c5a592f038bd57432/ghc >--------------------------------------------------------------- commit 3a51abd04432ea3d13e4ea3c5a592f038bd57432 Author: Richard Eisenberg Date: Sun Oct 28 23:05:36 2018 -0400 Remove kind generalisation from tcRnType There is no need to kind-generalise in tcRnType. Types are not instantiated eagerly, so there's never anything to generalise. >--------------------------------------------------------------- 3a51abd04432ea3d13e4ea3c5a592f038bd57432 compiler/typecheck/TcRnDriver.hs | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/compiler/typecheck/TcRnDriver.hs b/compiler/typecheck/TcRnDriver.hs index a0a837e..9b4565f 100644 --- a/compiler/typecheck/TcRnDriver.hs +++ b/compiler/typecheck/TcRnDriver.hs @@ -2375,7 +2375,7 @@ tcRnType :: HscEnv -> IO (Messages, Maybe (Type, Kind)) tcRnType hsc_env normalise rdr_type = runTcInteractive hsc_env $ - setXOptM LangExt.PolyKinds $ -- See Note [Kind-generalise in tcRnType] + setXOptM LangExt.PolyKinds $ -- See Note [Turn on PolyKinds in tcRnType] do { (HsWC { hswc_ext = wcs, hswc_body = rn_type }, _fvs) <- rnHsWcType GHCiCtx (mkHsWildCardBndrs rdr_type) -- The type can have wild cards, but no implicit @@ -2386,16 +2386,13 @@ tcRnType hsc_env normalise rdr_type -- It can have any rank or kind -- First bring into scope any wildcards ; traceTc "tcRnType" (vcat [ppr wcs, ppr rn_type]) - ; ((ty, kind), lie) <- + ; ((ty, _), lie) <- captureConstraints $ tcWildCardBinders wcs $ \ wcs' -> do { emitWildCardHoleConstraints wcs' ; tcLHsTypeUnsaturated rn_type } ; _ <- checkNoErrs (simplifyInteractive lie) - -- Do kind generalisation; see Note [Kind-generalise in tcRnType] - ; kind <- zonkTcType kind - ; kvs <- kindGeneralize kind ; ty <- zonkTcTypeToType ty -- Do validity checking on type @@ -2408,7 +2405,7 @@ tcRnType hsc_env normalise rdr_type ; return ty' } else return ty ; - ; return (ty', mkInvForAllTys kvs (typeKind ty')) } + ; return (ty', typeKind ty') } {- Note [TcRnExprMode] ~~~~~~~~~~~~~~~~~~~~~~ @@ -2468,7 +2465,7 @@ considers this example, with -fprint-explicit-foralls enabled: modified to include an element that is both Num and Monoid, the defaulting would succeed, of course.) -Note [Kind-generalise in tcRnType] +Note [Turn on PolyKinds in tcRnType] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ We switch on PolyKinds when kind-checking a user type, so that we will kind-generalise the type, even when PolyKinds is not otherwise on. @@ -2479,19 +2476,6 @@ anything unexpected, but the apparent *loss* of polymorphism, for types that you know are polymorphic, is quite surprising. See Trac #7688 for a discussion. -Note that the goal is to generalise the *kind of the type*, not -the type itself! Example: - ghci> data T m a = MkT (m a) -- T :: forall . (k -> *) -> k -> * - ghci> :k T -We instantiate T to get (T kappa). We do not want to kind-generalise -that to forall k. T k! Rather we want to take its kind - T kappa :: (kappa -> *) -> kappa -> * -and now kind-generalise that kind, to forall k. (k->*) -> k -> * -(It was Trac #10122 that made me realise how wrong the previous -approach was.) -} - - -{- ************************************************************************ * * tcRnDeclsi From git at git.haskell.org Mon Oct 29 13:52:42 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 29 Oct 2018 13:52:42 +0000 (UTC) Subject: [commit: ghc] master: Test T15711 in indexed-types/should_compile/T15711 (c1db1eb) Message-ID: <20181029135242.549083ABBF@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/c1db1eb028b6962bac904975a6730edc6935ca8f/ghc >--------------------------------------------------------------- commit c1db1eb028b6962bac904975a6730edc6935ca8f Author: Richard Eisenberg Date: Mon Oct 29 09:51:52 2018 -0400 Test T15711 in indexed-types/should_compile/T15711 >--------------------------------------------------------------- c1db1eb028b6962bac904975a6730edc6935ca8f testsuite/tests/indexed-types/should_compile/T15711.hs | 6 ++++++ .../AddAndOr3.stderr => indexed-types/should_compile/T15711.stderr} | 6 ++++-- testsuite/tests/indexed-types/should_compile/all.T | 1 + 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/testsuite/tests/indexed-types/should_compile/T15711.hs b/testsuite/tests/indexed-types/should_compile/T15711.hs new file mode 100644 index 0000000..4014cfa --- /dev/null +++ b/testsuite/tests/indexed-types/should_compile/T15711.hs @@ -0,0 +1,6 @@ +{-# LANGUAGE TypeFamilies, PolyKinds, DataKinds #-} + +module Bug where + +class C a where + type F (x :: Maybe a) diff --git a/testsuite/tests/partial-sigs/should_compile/AddAndOr3.stderr b/testsuite/tests/indexed-types/should_compile/T15711.stderr similarity index 53% copy from testsuite/tests/partial-sigs/should_compile/AddAndOr3.stderr copy to testsuite/tests/indexed-types/should_compile/T15711.stderr index d7a164b..1d23612 100644 --- a/testsuite/tests/partial-sigs/should_compile/AddAndOr3.stderr +++ b/testsuite/tests/indexed-types/should_compile/T15711.stderr @@ -1,5 +1,7 @@ -TYPE SIGNATURES - addAndOr3 :: (Int, Bool) -> (Bool, Int) -> (Int, Bool) +TYPE CONSTRUCTORS + C :: * -> Constraint + type role F nominal nominal + F :: forall a. Maybe a -> * Dependent modules: [] Dependent packages: [base-4.12.0.0, ghc-prim-0.5.3, integer-gmp-1.0.2.0] diff --git a/testsuite/tests/indexed-types/should_compile/all.T b/testsuite/tests/indexed-types/should_compile/all.T index d95826c..687e71d 100644 --- a/testsuite/tests/indexed-types/should_compile/all.T +++ b/testsuite/tests/indexed-types/should_compile/all.T @@ -294,3 +294,4 @@ test('T15322a', normal, compile_fail, ['']) test('T15142', normal, compile, ['']) test('T15352', normal, compile, ['']) test('T15664', normal, compile, ['']) +test('T15711', normal, compile, ['-ddump-types']) From git at git.haskell.org Mon Oct 29 16:37:33 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 29 Oct 2018 16:37:33 +0000 (UTC) Subject: [commit: ghc] master: Test #15825 in dependent/should_fail/T15825 (731c95f) Message-ID: <20181029163733.E26C73ABC0@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/731c95f5167246aecd2205743a9b0d8d21bcccf9/ghc >--------------------------------------------------------------- commit 731c95f5167246aecd2205743a9b0d8d21bcccf9 Author: Richard Eisenberg Date: Mon Oct 29 09:59:07 2018 -0400 Test #15825 in dependent/should_fail/T15825 >--------------------------------------------------------------- 731c95f5167246aecd2205743a9b0d8d21bcccf9 testsuite/tests/dependent/should_fail/T15825.hs | 14 ++++++++++++++ testsuite/tests/dependent/should_fail/T15825.stderr | 5 +++++ testsuite/tests/dependent/should_fail/all.T | 1 + 3 files changed, 20 insertions(+) diff --git a/testsuite/tests/dependent/should_fail/T15825.hs b/testsuite/tests/dependent/should_fail/T15825.hs new file mode 100644 index 0000000..01227a8 --- /dev/null +++ b/testsuite/tests/dependent/should_fail/T15825.hs @@ -0,0 +1,14 @@ +{-# Language RankNTypes #-} +{-# Language PolyKinds #-} +{-# Language KindSignatures #-} +{-# Language DataKinds #-} +{-# Language FlexibleInstances #-} + +{-# Options_GHC -dcore-lint #-} + +module T15825 where + +type C k = (forall (x::k). *) + +class X (a :: *) +instance forall (a :: C k). X (a :: *) diff --git a/testsuite/tests/dependent/should_fail/T15825.stderr b/testsuite/tests/dependent/should_fail/T15825.stderr new file mode 100644 index 0000000..5e67bf7 --- /dev/null +++ b/testsuite/tests/dependent/should_fail/T15825.stderr @@ -0,0 +1,5 @@ + +T15825.hs:14:29: error: + • Illegal type synonym family application ‘GHC.Types.Any’ in instance: + X a + • In the instance declaration for ‘X (a :: *)’ diff --git a/testsuite/tests/dependent/should_fail/all.T b/testsuite/tests/dependent/should_fail/all.T index 2b602fa..d76fc35 100644 --- a/testsuite/tests/dependent/should_fail/all.T +++ b/testsuite/tests/dependent/should_fail/all.T @@ -37,3 +37,4 @@ test('T15591b', normal, compile_fail, ['']) test('T15591c', normal, compile_fail, ['']) test('T15743c', normal, compile_fail, ['']) test('T15743d', normal, compile_fail, ['']) +test('T15825', normal, compile_fail, ['']) From git at git.haskell.org Mon Oct 29 16:37:37 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 29 Oct 2018 16:37:37 +0000 (UTC) Subject: [commit: ghc] master: Test #15076 in dependent/should_compile/T15076* (2adffd8) Message-ID: <20181029163737.D23883ABC0@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/2adffd854effc0708b9fb268749aceaf3c20a169/ghc >--------------------------------------------------------------- commit 2adffd854effc0708b9fb268749aceaf3c20a169 Author: Richard Eisenberg Date: Mon Oct 29 10:01:15 2018 -0400 Test #15076 in dependent/should_compile/T15076* >--------------------------------------------------------------- 2adffd854effc0708b9fb268749aceaf3c20a169 .../dependent/should_compile/{T14880-2.hs => T15076.hs} | 10 +++++----- testsuite/tests/dependent/should_compile/T15076.stderr | 12 ++++++++++++ testsuite/tests/dependent/should_compile/T15076b.hs | 11 +++++++++++ testsuite/tests/dependent/should_compile/T15076c.hs | 16 ++++++++++++++++ testsuite/tests/dependent/should_compile/all.T | 3 +++ 5 files changed, 47 insertions(+), 5 deletions(-) diff --git a/testsuite/tests/dependent/should_compile/T14880-2.hs b/testsuite/tests/dependent/should_compile/T15076.hs similarity index 51% copy from testsuite/tests/dependent/should_compile/T14880-2.hs copy to testsuite/tests/dependent/should_compile/T15076.hs index e7057a3..0890cf9 100644 --- a/testsuite/tests/dependent/should_compile/T14880-2.hs +++ b/testsuite/tests/dependent/should_compile/T15076.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE GADTs #-} +{-# LANGUAGE RankNTypes #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeInType #-} {-# LANGUAGE PartialTypeSignatures #-} @@ -7,7 +7,7 @@ module Bug where import Data.Kind import Data.Proxy -data Foo (x :: Type) :: forall (a :: x). Proxy a -> Type - -quux :: forall arg. Proxy (Foo arg) -> () -quux (_ :: _) = () +foo :: forall (a :: Type) + (f :: forall (x :: a). Proxy x -> Type). + Proxy f -> () +foo (_ :: _) = () diff --git a/testsuite/tests/dependent/should_compile/T15076.stderr b/testsuite/tests/dependent/should_compile/T15076.stderr new file mode 100644 index 0000000..43f4772 --- /dev/null +++ b/testsuite/tests/dependent/should_compile/T15076.stderr @@ -0,0 +1,12 @@ + +T15076.hs:13:11: warning: [-Wpartial-type-signatures (in -Wdefault)] + • Found type wildcard ‘_’ standing for ‘Proxy f’ + Where: ‘f’, ‘a’ are rigid type variables bound by + the type signature for: + foo :: forall a (f :: forall (x :: a). Proxy x -> *). Proxy f -> () + at T15076.hs:(10,1)-(12,20) + • In a pattern type signature: _ + In the pattern: _ :: _ + In an equation for ‘foo’: foo (_ :: _) = () + • Relevant bindings include + foo :: Proxy f -> () (bound at T15076.hs:13:1) diff --git a/testsuite/tests/dependent/should_compile/T15076b.hs b/testsuite/tests/dependent/should_compile/T15076b.hs new file mode 100644 index 0000000..15fce82 --- /dev/null +++ b/testsuite/tests/dependent/should_compile/T15076b.hs @@ -0,0 +1,11 @@ +{-# LANGUAGE RankNTypes #-} +{-# LANGUAGE TypeInType #-} +module Bug where + +import Data.Kind +import Data.Proxy + +foo :: forall (a :: Type) + (f :: forall (x :: a). Proxy x -> Type). + Proxy f -> () +foo _ = () diff --git a/testsuite/tests/dependent/should_compile/T15076c.hs b/testsuite/tests/dependent/should_compile/T15076c.hs new file mode 100644 index 0000000..b689b5b --- /dev/null +++ b/testsuite/tests/dependent/should_compile/T15076c.hs @@ -0,0 +1,16 @@ +{-# LANGUAGE PolyKinds, MultiParamTypeClasses, GADTs, ScopedTypeVariables, + TypeOperators #-} +{-# OPTIONS_GHC -fno-warn-redundant-constraints #-} + +module Super where + +import Data.Kind +import Data.Proxy +import GHC.Prim + +class (a ~ b) => C a b +data SameKind :: k -> k -> Type where + SK :: SameKind a b + +bar :: forall (a :: Type) (b :: Type). C a b => Proxy a -> Proxy b -> () +bar _ _ = const () (undefined :: forall (x :: a) (y :: b). SameKind x y) diff --git a/testsuite/tests/dependent/should_compile/all.T b/testsuite/tests/dependent/should_compile/all.T index 16c6d13..341a44c 100644 --- a/testsuite/tests/dependent/should_compile/all.T +++ b/testsuite/tests/dependent/should_compile/all.T @@ -61,3 +61,6 @@ test('T14880-2', normal, compile, ['']) test('T15743', normal, compile, ['-ddump-types -fprint-explicit-foralls']) test('InferDependency', normal, compile, ['']) test('T15743e', normal, compile, ['-ddump-types -fprint-explicit-foralls']) +test('T15076', normal, compile, ['']) +test('T15076b', normal, compile, ['']) +test('T15076c', normal, compile, ['']) From git at git.haskell.org Mon Oct 29 16:37:40 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 29 Oct 2018 16:37:40 +0000 (UTC) Subject: [commit: ghc] master: Revert "Remove kind generalisation from tcRnType" (09740d5) Message-ID: <20181029163740.CE1963ABC0@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/09740d50e74ac93a0309544a62e9efc52b27adff/ghc >--------------------------------------------------------------- commit 09740d50e74ac93a0309544a62e9efc52b27adff Author: Richard Eisenberg Date: Mon Oct 29 12:15:58 2018 -0400 Revert "Remove kind generalisation from tcRnType" This reverts commit 3a51abd04432ea3d13e4ea3c5a592f038bd57432. I had hit the wrong button when trying to validate the original commit... and ended up committing it prematurely instead. This reversion commit also updates the comments to explain why we kind-generalise. >--------------------------------------------------------------- 09740d50e74ac93a0309544a62e9efc52b27adff compiler/main/HscMain.hs | 3 +-- compiler/typecheck/TcRnDriver.hs | 21 +++++++++++++++++---- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/compiler/main/HscMain.hs b/compiler/main/HscMain.hs index 77bcd76..9dd7507 100644 --- a/compiler/main/HscMain.hs +++ b/compiler/main/HscMain.hs @@ -1693,8 +1693,7 @@ hscTcExpr hsc_env0 mode expr = runInteractiveHsc hsc_env0 $ do parsed_expr <- hscParseExpr expr ioMsgMaybe $ tcRnExpr hsc_env mode parsed_expr --- | Find the kind of a type --- Currently this does *not* generalise the kinds of the type +-- | Find the kind of a type, after generalisation hscKcType :: HscEnv -> Bool -- ^ Normalise the type diff --git a/compiler/typecheck/TcRnDriver.hs b/compiler/typecheck/TcRnDriver.hs index 9b4565f..4fa1723 100644 --- a/compiler/typecheck/TcRnDriver.hs +++ b/compiler/typecheck/TcRnDriver.hs @@ -2375,7 +2375,7 @@ tcRnType :: HscEnv -> IO (Messages, Maybe (Type, Kind)) tcRnType hsc_env normalise rdr_type = runTcInteractive hsc_env $ - setXOptM LangExt.PolyKinds $ -- See Note [Turn on PolyKinds in tcRnType] + setXOptM LangExt.PolyKinds $ -- See Note [Kind-generalise in tcRnType] do { (HsWC { hswc_ext = wcs, hswc_body = rn_type }, _fvs) <- rnHsWcType GHCiCtx (mkHsWildCardBndrs rdr_type) -- The type can have wild cards, but no implicit @@ -2386,13 +2386,16 @@ tcRnType hsc_env normalise rdr_type -- It can have any rank or kind -- First bring into scope any wildcards ; traceTc "tcRnType" (vcat [ppr wcs, ppr rn_type]) - ; ((ty, _), lie) <- + ; ((ty, kind), lie) <- captureConstraints $ tcWildCardBinders wcs $ \ wcs' -> do { emitWildCardHoleConstraints wcs' ; tcLHsTypeUnsaturated rn_type } ; _ <- checkNoErrs (simplifyInteractive lie) + -- Do kind generalisation; see Note [Kind-generalise in tcRnType] + ; kind <- zonkTcType kind + ; kvs <- kindGeneralize kind ; ty <- zonkTcTypeToType ty -- Do validity checking on type @@ -2405,7 +2408,7 @@ tcRnType hsc_env normalise rdr_type ; return ty' } else return ty ; - ; return (ty', typeKind ty') } + ; return (ty', mkInvForAllTys kvs (typeKind ty')) } {- Note [TcRnExprMode] ~~~~~~~~~~~~~~~~~~~~~~ @@ -2465,7 +2468,7 @@ considers this example, with -fprint-explicit-foralls enabled: modified to include an element that is both Num and Monoid, the defaulting would succeed, of course.) -Note [Turn on PolyKinds in tcRnType] +Note [Kind-generalise in tcRnType] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ We switch on PolyKinds when kind-checking a user type, so that we will kind-generalise the type, even when PolyKinds is not otherwise on. @@ -2476,6 +2479,16 @@ anything unexpected, but the apparent *loss* of polymorphism, for types that you know are polymorphic, is quite surprising. See Trac #7688 for a discussion. +Note that the goal is to generalise the *kind of the type*, not +the type itself! Example: + ghci> data SameKind :: k -> k -> Type + ghci> :k SameKind _ + +We want to get `k -> Type`, not `Any -> Type`, which is what we would +get without kind-generalisation. Note that `:k SameKind` is OK, as +GHC will not instantiate SameKind here, and so we see its full kind +of `forall k. k -> k -> Type`. + ************************************************************************ * * tcRnDeclsi From git at git.haskell.org Mon Oct 29 17:01:41 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 29 Oct 2018 17:01:41 +0000 (UTC) Subject: [commit: ghc] master: Add a test case for #15829 (331081b) Message-ID: <20181029170141.25A813ABC0@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/331081b03f67c94b908136339aebf36d07d45c21/ghc >--------------------------------------------------------------- commit 331081b03f67c94b908136339aebf36d07d45c21 Author: Ryan Scott Date: Mon Oct 29 12:59:46 2018 -0400 Add a test case for #15829 This happened to get fixed as a consequence of commit 5e45ad10ffca1ad175b10f6ef3327e1ed8ba25f3. This adds a test case to ensure that it stays fixed. >--------------------------------------------------------------- 331081b03f67c94b908136339aebf36d07d45c21 testsuite/tests/dependent/should_compile/T15829.hs | 9 +++++++++ testsuite/tests/dependent/should_compile/all.T | 1 + 2 files changed, 10 insertions(+) diff --git a/testsuite/tests/dependent/should_compile/T15829.hs b/testsuite/tests/dependent/should_compile/T15829.hs new file mode 100644 index 0000000..ec6f5d1 --- /dev/null +++ b/testsuite/tests/dependent/should_compile/T15829.hs @@ -0,0 +1,9 @@ +{-# LANGUAGE DataKinds #-} +{-# LANGUAGE PolyKinds #-} +module T15829 where + +import Data.Kind + +data A :: Type -> Type +data B a :: A a -> Type +type C a = B a diff --git a/testsuite/tests/dependent/should_compile/all.T b/testsuite/tests/dependent/should_compile/all.T index 341a44c..632ef40 100644 --- a/testsuite/tests/dependent/should_compile/all.T +++ b/testsuite/tests/dependent/should_compile/all.T @@ -64,3 +64,4 @@ test('T15743e', normal, compile, ['-ddump-types -fprint-explicit-foralls']) test('T15076', normal, compile, ['']) test('T15076b', normal, compile, ['']) test('T15076c', normal, compile, ['']) +test('T15829', normal, compile, ['']) From git at git.haskell.org Mon Oct 29 19:10:43 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 29 Oct 2018 19:10:43 +0000 (UTC) Subject: [commit: ghc] master: Fix #15815 by parenthesizing the arguments to infix ~ (b8a797e) Message-ID: <20181029191043.2FB8A3ABC0@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/b8a797ecc34a309bd78f5a290e3554642a3a478a/ghc >--------------------------------------------------------------- commit b8a797ecc34a309bd78f5a290e3554642a3a478a Author: Ryan Scott Date: Sun Oct 28 16:08:11 2018 -0400 Fix #15815 by parenthesizing the arguments to infix ~ An unfortunate consequence of commit b9483981d128f55d8dae3f434f49fa6b5b30c779 (`Remove HsEqTy and XEqTy`) is infix uses of `~` in TH quotes now desugar differently than before. In particular, we have that: ```haskell a ~ (Int -> Int) ``` Now desugars to: ```haskell HsOpTy a (~) (HsOpTy Int (->) Int) ``` Which GHC interprets as being: ```haskell a ~ Int -> Int ``` Or, equivalently: ```haskell (a ~ Int) -> Int ``` Which is different than what was intended! This is the cause of #15815. All of this has revealed that we likely need to renovate the way we desugar infix type operators to be more consistent with the treatment for infix expressions (see https://ghc.haskell.org/trac/ghc/ticket/15815#comment:5 for more on this.) Doing so would constitute a breaking change, however, so we will likely want to wait until another major GHC release to do this. In the meantime, this patch offers a non-invasive change to the way that infix uses of `~` are desugared. This makes the program in #15815 compile again by inserting extra `HsParTy`s around the arguments to `~` if they are lacking them. Test Plan: make test TEST=T15815 Reviewers: int-index, goldfire, bgamari Reviewed By: int-index Subscribers: int-e, rwbarton, carter GHC Trac Issues: #15815 Differential Revision: https://phabricator.haskell.org/D5274 >--------------------------------------------------------------- b8a797ecc34a309bd78f5a290e3554642a3a478a compiler/hsSyn/Convert.hs | 8 +++++++- testsuite/tests/th/T15815A.hs | 7 +++++++ testsuite/tests/th/T15815B.hs | 6 ++++++ testsuite/tests/th/all.T | 2 ++ 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/compiler/hsSyn/Convert.hs b/compiler/hsSyn/Convert.hs index 8b12a78..06d5d6c 100644 --- a/compiler/hsSyn/Convert.hs +++ b/compiler/hsSyn/Convert.hs @@ -1437,7 +1437,13 @@ cvtTypeKind ty_str ty EqualityT | [x',y'] <- tys' -> - returnL (HsOpTy noExt x' (noLoc eqTyCon_RDR) y') + let px = parenthesizeHsType opPrec x' + py = parenthesizeHsType opPrec y' + in returnL (HsOpTy noExt px (noLoc eqTyCon_RDR) py) + -- The long-term goal is to remove the above case entirely and + -- subsume it under the case for InfixT. See #15815, comment:6, + -- for more details. + | otherwise -> mk_apps (HsTyVar noExt NotPromoted (noLoc eqTyCon_RDR)) tys' diff --git a/testsuite/tests/th/T15815A.hs b/testsuite/tests/th/T15815A.hs new file mode 100644 index 0000000..4025f38 --- /dev/null +++ b/testsuite/tests/th/T15815A.hs @@ -0,0 +1,7 @@ +{-# LANGUAGE TemplateHaskell #-} +module T15815A where + +mkFoo tyQ = [d| + foo :: a ~ $(tyQ) => a + foo = undefined + |] diff --git a/testsuite/tests/th/T15815B.hs b/testsuite/tests/th/T15815B.hs new file mode 100644 index 0000000..32bf2ed --- /dev/null +++ b/testsuite/tests/th/T15815B.hs @@ -0,0 +1,6 @@ +{-# LANGUAGE TemplateHaskell, GADTs #-} +module T15815B where + +import T15815A + +mkFoo [t| Int -> Int |] diff --git a/testsuite/tests/th/all.T b/testsuite/tests/th/all.T index 50154a4..2481a2a 100644 --- a/testsuite/tests/th/all.T +++ b/testsuite/tests/th/all.T @@ -446,3 +446,5 @@ test('T15738', normal, compile, ['-v0 -ddump-splices -dsuppress-uniques']) test('T15783', normal, multimod_compile, ['T15783A', '-v0 ' + config.ghc_th_way_flags]) test('T15792', normal, compile, ['-v0 -dsuppress-uniques']) +test('T15815', normal, multimod_compile, + ['T15815B', '-v0 ' + config.ghc_th_way_flags]) From git at git.haskell.org Mon Oct 29 19:10:58 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 29 Oct 2018 19:10:58 +0000 (UTC) Subject: [commit: ghc] master: users guide: Mention :since: in editing-guide (b2db706) Message-ID: <20181029191058.9818A3ABC0@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/b2db706fe360e74544d787f8dab0e8af90e531db/ghc >--------------------------------------------------------------- commit b2db706fe360e74544d787f8dab0e8af90e531db Author: Ben Gamari Date: Tue Jan 17 13:51:56 2017 -0500 users guide: Mention :since: in editing-guide >--------------------------------------------------------------- b2db706fe360e74544d787f8dab0e8af90e531db docs/users_guide/editing-guide.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/users_guide/editing-guide.rst b/docs/users_guide/editing-guide.rst index 8dd3701..27ddbd2 100644 --- a/docs/users_guide/editing-guide.rst +++ b/docs/users_guide/editing-guide.rst @@ -334,6 +334,7 @@ respectively. For instance, .. rts-flag:: -C ⟨seconds⟩ + :since: 8.2 :default: 20 milliseconds Sets the context switch interval to ⟨s⟩ seconds. @@ -343,6 +344,7 @@ Will be rendered as, .. rts-flag:: -C ⟨seconds⟩ :noindex: + :since: 8.2 :default: 20 milliseconds Sets the context switch interval to ⟨s⟩ seconds. From git at git.haskell.org Mon Oct 29 19:11:14 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 29 Oct 2018 19:11:14 +0000 (UTC) Subject: [commit: ghc] master: users guide: Introduce :pragma: directive (e35ed9d) Message-ID: <20181029191114.4B5623ABC0@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/e35ed9dccf07578931f9077268579af25879466e/ghc >--------------------------------------------------------------- commit e35ed9dccf07578931f9077268579af25879466e Author: Ben Gamari Date: Tue Jan 17 14:43:52 2017 -0500 users guide: Introduce :pragma: directive >--------------------------------------------------------------- e35ed9dccf07578931f9077268579af25879466e docs/users_guide/conf.py | 14 +++ docs/users_guide/glasgow_exts.rst | 219 +++++++++++++++++++++++++------------- 2 files changed, 158 insertions(+), 75 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc e35ed9dccf07578931f9077268579af25879466e From git at git.haskell.org Mon Oct 29 19:12:14 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 29 Oct 2018 19:12:14 +0000 (UTC) Subject: [commit: ghc] master: Fix sample code of -fprint-explicit-kinds, plus sample when disabling PolyKinds (44a1d1f) Message-ID: <20181029191214.104203ABC0@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/44a1d1f6612e1e9ef07626e1d2536bb6ba55dbd2/ghc >--------------------------------------------------------------- commit 44a1d1f6612e1e9ef07626e1d2536bb6ba55dbd2 Author: Yuji Yamamoto Date: Thu Oct 25 10:59:29 2018 +0900 Fix sample code of -fprint-explicit-kinds, plus sample when disabling PolyKinds - Although the sample is for `-fprint-explicit-kinds`, the sample code uses `-fprint-explicit-foralls` (but perhaps the output used to be correct one of `-fprint-explicit-kinds`). - Update the output with the recent version of GHC (ver. 8.4.3. I guess it doesn't change in GHC 8.6...) - Add more samples to clarify the difference of kinds, which tells effect of `-fprint-explicit-kinds` more clearly. >--------------------------------------------------------------- 44a1d1f6612e1e9ef07626e1d2536bb6ba55dbd2 docs/users_guide/using.rst | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/docs/users_guide/using.rst b/docs/users_guide/using.rst index e0807a9..e22622e 100644 --- a/docs/users_guide/using.rst +++ b/docs/users_guide/using.rst @@ -784,13 +784,16 @@ messages and in GHCi: .. code-block:: none - ghci> :set -XPolyKinds - ghci> data T a = MkT - ghci> :t MkT - MkT :: forall (k :: Type) (a :: k). T a - ghci> :set -fprint-explicit-kinds - ghci> :t MkT - MkT :: forall (k :: Type) (a :: k). T k a + ghci> :set -XPolyKinds + ghci> data T a = MkT + ghci> :t MkT + MkT :: forall (k :: Type) (a :: k). T a + ghci> :set -fprint-explicit-kinds + ghci> :t MkT + MkT :: forall (k :: Type) (a :: k). T k a + ghci> :set -XNoPolyKinds + ghci> :t MkT + MkT :: T * a .. ghc-flag:: -fprint-explicit-runtime-reps :shortdesc: Print ``RuntimeRep`` variables in types which are From git at git.haskell.org Mon Oct 29 19:12:29 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 29 Oct 2018 19:12:29 +0000 (UTC) Subject: [commit: ghc] master: Docs: clarify the interaction between throwSTM and catchSTM. (503ddd6) Message-ID: <20181029191229.DFDC33ABC0@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/503ddd6ede3e54748360f86ed744dcef0be71a28/ghc >--------------------------------------------------------------- commit 503ddd6ede3e54748360f86ed744dcef0be71a28 Author: Ian Denhardt Date: Fri Oct 26 18:05:05 2018 -0400 Docs: clarify the interaction between throwSTM and catchSTM. The previous doc comments were not terribly clear on what was or wasn't rolled back when an exception was caught in STM. This misunderstanding was the source of a bug in another project of mine, and folks on `#haskell` found it confusing as well. >--------------------------------------------------------------- 503ddd6ede3e54748360f86ed744dcef0be71a28 libraries/base/GHC/Conc/Sync.hs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/libraries/base/GHC/Conc/Sync.hs b/libraries/base/GHC/Conc/Sync.hs index 6751de7..7038b0d 100644 --- a/libraries/base/GHC/Conc/Sync.hs +++ b/libraries/base/GHC/Conc/Sync.hs @@ -752,7 +752,12 @@ orElse (STM m) e = STM $ \s -> catchRetry# m (unSTM e) s -- | A variant of 'throw' that can only be used within the 'STM' monad. -- -- Throwing an exception in @STM@ aborts the transaction and propagates the --- exception. +-- exception. If the exception is caught via 'catchSTM', only the changes +-- enclosed by the catch are rolled back; changes made outside of 'catchSTM' +-- persist. +-- +-- If the exception is not caught inside of the 'STM', it is re-thrown by +-- 'atomically', and the entire 'STM' is rolled back. -- -- Although 'throwSTM' has a type that is an instance of the type of 'throw', the -- two functions are subtly different: @@ -770,7 +775,12 @@ orElse (STM m) e = STM $ \s -> catchRetry# m (unSTM e) s throwSTM :: Exception e => e -> STM a throwSTM e = STM $ raiseIO# (toException e) --- |Exception handling within STM actions. +-- | Exception handling within STM actions. +-- +-- @'catchSTM' m f@ catches any exception thrown by @m@ using 'throwSTM', +-- using the function @f@ to handle the exception. If an exception is +-- thrown, any changes made by @m@ are rolled back, but changes prior to +-- @m@ persist. catchSTM :: Exception e => STM a -> (e -> STM a) -> STM a catchSTM (STM m) handler = STM $ catchSTM# m handler' where From git at git.haskell.org Mon Oct 29 19:12:45 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 29 Oct 2018 19:12:45 +0000 (UTC) Subject: [commit: ghc] master: Improve documentation for warning options (b8e30e4) Message-ID: <20181029191245.5B68E3ABC0@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/b8e30e40b08db3dd50e7a972a4969c8f8f784eaa/ghc >--------------------------------------------------------------- commit b8e30e40b08db3dd50e7a972a4969c8f8f784eaa Author: Nathan Collins Date: Fri Oct 19 14:44:19 2018 -0700 Improve documentation for warning options My main goal was to make it easy to discover how to reverse `-Werror`, since `Wno-error` doesn't work, and the fact that `-Wwarn` negates `-Werror` was only mentioned in the `-Wwarn` docs before. Other changes: - explain at the outset that some options control individual warnings while others control warning families. - explain at the outset that `-Wno-` can be used to reverse `-W`. This is no mentioned in two places, but I don't think that's a bad thing. >--------------------------------------------------------------- b8e30e40b08db3dd50e7a972a4969c8f8f784eaa docs/users_guide/using-warnings.rst | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/docs/users_guide/using-warnings.rst b/docs/users_guide/using-warnings.rst index f0c4ac4..fe3c8cb 100644 --- a/docs/users_guide/using-warnings.rst +++ b/docs/users_guide/using-warnings.rst @@ -8,8 +8,13 @@ Warnings and sanity-checking single: warnings GHC has a number of options that select which types of non-fatal error -messages, otherwise known as warnings, can be generated during -compilation. By default, you get a standard set of warnings which are +messages, otherwise known as warnings, can be generated during compilation. +Some options control individual warnings and others control collections +of warnings. +To turn off an individual warning ``-W``, use ``-Wno-``. +To reverse``-Werror``, which makes all warnings into errors, use ``-Wwarn``. + +By default, you get a standard set of warnings which are generally likely to indicate bugs in your program. These are: .. hlist:: @@ -146,7 +151,9 @@ to abort. :category: Makes any warning into a fatal error. Useful so that you don't miss - warnings when doing batch compilation. + warnings when doing batch compilation. To reverse ``-Werror`` and stop + treating any warnings as errors use ``-Wwarn``, or use ``-Wwarn=`` + to stop treating specific warnings as errors. .. ghc-flag:: -Werror=⟨wflag⟩ :shortdesc: make a specific warning fatal @@ -158,7 +165,7 @@ to abort. :implies: ``-W`` Makes a specific warning into a fatal error. The warning will be enabled if - it hasn't been enabled yet. + it hasn't been enabled yet. Can be reversed with ``-Wwarn=``. ``-Werror=compat`` has the same effect as ``-Werror=...`` for each warning flag in the :ghc-flag:`-Wcompat` option group. From git at git.haskell.org Mon Oct 29 19:13:01 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 29 Oct 2018 19:13:01 +0000 (UTC) Subject: [commit: ghc] master: circleci: Build with in-tree GMP on Darwin (78fb310) Message-ID: <20181029191301.026E03ABC0@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/78fb31077e58d949ea644c9d51abe53de9a9d2cb/ghc >--------------------------------------------------------------- commit 78fb31077e58d949ea644c9d51abe53de9a9d2cb Author: Ben Gamari Date: Wed Oct 17 15:31:36 2018 -0400 circleci: Build with in-tree GMP on Darwin Fixes #15404. (cherry picked from commit 578012be13eb1548050d51c0a23bd1a98423f03e) >--------------------------------------------------------------- 78fb31077e58d949ea644c9d51abe53de9a9d2cb .circleci/config.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 53962c9..02c151d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -35,7 +35,7 @@ aliases: - &configure_unix run: name: Configure - command: ./configure + command: ./configure $CONFIGURE_OPTS - &configure_unix_32 run: name: Configure @@ -144,6 +144,8 @@ jobs: # Only Sierra and onwards supports clock_gettime. See #12858 ac_cv_func_clock_gettime: "no" GHC_COLLECTOR_FLAVOR: x86_64-darwin + # Build with in-tree GMP since this isn't available on OS X by default. + CONFIGURE_OPTS: --with-intree-gmp <<: *buildenv steps: - checkout From git at git.haskell.org Mon Oct 29 22:13:23 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 29 Oct 2018 22:13:23 +0000 (UTC) Subject: [commit: ghc] master: Correctly detect GIT in a subtree (66cb344) Message-ID: <20181029221323.9474A3ABC0@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/66cb344dc70d447d2d1c8bc3865bc5a8e68a8656/ghc >--------------------------------------------------------------- commit 66cb344dc70d447d2d1c8bc3865bc5a8e68a8656 Author: Sylvain Henry Date: Mon Oct 29 19:02:45 2018 +0100 Correctly detect GIT in a subtree When we use a git subtree, .git is a file, not a directory. The script was already fixed for the commit ID but not for its date. PR: https://github.com/ghc/ghc/pull/212/ >--------------------------------------------------------------- 66cb344dc70d447d2d1c8bc3865bc5a8e68a8656 aclocal.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aclocal.m4 b/aclocal.m4 index 55b4162..18e0d7e 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1536,7 +1536,7 @@ if test "$RELEASE" = "NO"; then if test -f VERSION_DATE; then PACKAGE_VERSION=${PACKAGE_VERSION}.`cat VERSION_DATE` AC_MSG_RESULT(given $PACKAGE_VERSION) - elif test -d .git; then + elif test -e .git; then changequote(, )dnl ver_posixtime=`git log -1 --pretty=format:%ct` ver_date=`perl -MPOSIX -e "print strftime('%Y%m%d', gmtime($ver_posixtime));"` From git at git.haskell.org Mon Oct 29 22:27:59 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 29 Oct 2018 22:27:59 +0000 (UTC) Subject: [commit: ghc] master: Bump time submodule (0bdbbd4) Message-ID: <20181029222759.3932C3ABC0@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/0bdbbd4a637b169aa7043e0d9898ad1ecd5d14ef/ghc >--------------------------------------------------------------- commit 0bdbbd4a637b169aa7043e0d9898ad1ecd5d14ef Author: Ben Gamari Date: Mon Oct 29 17:15:40 2018 -0400 Bump time submodule >--------------------------------------------------------------- 0bdbbd4a637b169aa7043e0d9898ad1ecd5d14ef libraries/time | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/time b/libraries/time index 1fcaa07..9e96c26 160000 --- a/libraries/time +++ b/libraries/time @@ -1 +1 @@ -Subproject commit 1fcaa07e10d7966356373ed0e946eb078fcdd6e6 +Subproject commit 9e96c26132fef01a3113c8b152b1be96c0eccd86 From git at git.haskell.org Tue Oct 30 14:04:13 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 30 Oct 2018 14:04:13 +0000 (UTC) Subject: [commit: ghc] master: Revert "Bump time submodule" (849d384) Message-ID: <20181030140413.713AF3ABC0@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/849d3848f6a43c36eb0fffe45894be947ad66bfc/ghc >--------------------------------------------------------------- commit 849d3848f6a43c36eb0fffe45894be947ad66bfc Author: Ben Gamari Date: Tue Oct 30 10:03:49 2018 -0400 Revert "Bump time submodule" This reverts commit 0bdbbd4a637b169aa7043e0d9898ad1ecd5d14ef. >--------------------------------------------------------------- 849d3848f6a43c36eb0fffe45894be947ad66bfc libraries/time | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/time b/libraries/time index 9e96c26..1fcaa07 160000 --- a/libraries/time +++ b/libraries/time @@ -1 +1 @@ -Subproject commit 9e96c26132fef01a3113c8b152b1be96c0eccd86 +Subproject commit 1fcaa07e10d7966356373ed0e946eb078fcdd6e6 From git at git.haskell.org Tue Oct 30 14:51:44 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 30 Oct 2018 14:51:44 +0000 (UTC) Subject: [commit: ghc] master: Add second test case for #15592 (42faeb3) Message-ID: <20181030145144.658C53ABC0@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/42faeb3bf0a167ec4d449f27d8ca37501d96d24d/ghc >--------------------------------------------------------------- commit 42faeb3bf0a167ec4d449f27d8ca37501d96d24d Author: Ryan Scott Date: Tue Oct 30 10:49:59 2018 -0400 Add second test case for #15592 This adds a program from https://ghc.haskell.org/trac/ghc/ticket/15592#comment:9 (which briefly refused to typecheck on GHC HEAD) as a test case. >--------------------------------------------------------------- 42faeb3bf0a167ec4d449f27d8ca37501d96d24d testsuite/tests/polykinds/T15592b.hs | 8 ++++++++ .../should_compile/T15743.stderr => polykinds/T15592b.stderr} | 5 +++-- testsuite/tests/polykinds/all.T | 1 + 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/testsuite/tests/polykinds/T15592b.hs b/testsuite/tests/polykinds/T15592b.hs new file mode 100644 index 0000000..43671e5 --- /dev/null +++ b/testsuite/tests/polykinds/T15592b.hs @@ -0,0 +1,8 @@ +{-# LANGUAGE PolyKinds #-} +{-# LANGUAGE TypeFamilies #-} +module T15592b where + +import Data.Kind + +class C a where + type T (x :: (f :: k -> Type) a) diff --git a/testsuite/tests/dependent/should_compile/T15743.stderr b/testsuite/tests/polykinds/T15592b.stderr similarity index 50% copy from testsuite/tests/dependent/should_compile/T15743.stderr copy to testsuite/tests/polykinds/T15592b.stderr index 7162a87..c51416f 100644 --- a/testsuite/tests/dependent/should_compile/T15743.stderr +++ b/testsuite/tests/polykinds/T15592b.stderr @@ -1,6 +1,7 @@ TYPE CONSTRUCTORS - type role T nominal nominal nominal phantom phantom phantom - T :: forall {k1} k2 (k3 :: k2). Proxy k3 -> k1 -> k2 -> * + C :: forall {k}. k -> Constraint + type role T nominal nominal nominal nominal + T :: forall {k} (a :: k) (f :: k -> *). f a -> * Dependent modules: [] Dependent packages: [base-4.12.0.0, ghc-prim-0.5.3, integer-gmp-1.0.2.0] diff --git a/testsuite/tests/polykinds/all.T b/testsuite/tests/polykinds/all.T index 371fbf2..6ffb318 100644 --- a/testsuite/tests/polykinds/all.T +++ b/testsuite/tests/polykinds/all.T @@ -194,4 +194,5 @@ test('T15170', normal, compile, ['']) test('T14939', normal, compile, ['-O']) test('T15577', normal, compile_fail, ['-O']) test('T15592', normal, compile, ['']) +test('T15592b', normal, compile, ['-ddump-types -fprint-explicit-foralls']) test('T15787', normal, compile_fail, ['']) From git at git.haskell.org Tue Oct 30 16:18:21 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 30 Oct 2018 16:18:21 +0000 (UTC) Subject: [commit: ghc] branch 'wip/fix-i386-1' created Message-ID: <20181030161821.856193ABC0@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/fix-i386-1 Referencing: a815a22cadfab6ab6f8d23f1140e7584713e896c From git at git.haskell.org Tue Oct 30 16:18:24 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 30 Oct 2018 16:18:24 +0000 (UTC) Subject: [commit: ghc] wip/fix-i386-1: circleci: Disable everything but i386 (0673f6b) Message-ID: <20181030161824.8F9D53ABC0@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/fix-i386-1 Link : http://ghc.haskell.org/trac/ghc/changeset/0673f6bc2640c89e94c3c3e1ae5bb3d054cb6aec/ghc >--------------------------------------------------------------- commit 0673f6bc2640c89e94c3c3e1ae5bb3d054cb6aec Author: Ben Gamari Date: Tue Oct 30 12:17:04 2018 -0400 circleci: Disable everything but i386 >--------------------------------------------------------------- 0673f6bc2640c89e94c3c3e1ae5bb3d054cb6aec .circleci/config.yml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 02c151d..a5f677d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -289,18 +289,8 @@ workflows: version: 2 validate: jobs: - - validate-x86_64-linux: - *trigger_on_tags - # FreeBSD disabled: https://github.com/haskell/unix/issues/102 - # - validate-x86_64-freebsd - - validate-x86_64-darwin: - *trigger_on_tags - - validate-x86_64-linux-llvm - validate-i386-linux: *trigger_on_tags - - validate-hadrian-x86_64-linux - - validate-x86_64-fedora: - *trigger_on_tags nightly: triggers: From git at git.haskell.org Tue Oct 30 16:18:27 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 30 Oct 2018 16:18:27 +0000 (UTC) Subject: [commit: ghc] wip/fix-i386-1: Revert "ghc-heap: Fix writing closures on big endian" (a815a22) Message-ID: <20181030161827.911C73ABC0@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/fix-i386-1 Link : http://ghc.haskell.org/trac/ghc/changeset/a815a22cadfab6ab6f8d23f1140e7584713e896c/ghc >--------------------------------------------------------------- commit a815a22cadfab6ab6f8d23f1140e7584713e896c Author: Ben Gamari Date: Tue Oct 30 12:17:34 2018 -0400 Revert "ghc-heap: Fix writing closures on big endian" This reverts commit 058c2813d882266309e8045af7a72eedecbf2dbb. >--------------------------------------------------------------- a815a22cadfab6ab6f8d23f1140e7584713e896c libraries/ghc-heap/GHC/Exts/Heap/InfoTable.hsc | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/libraries/ghc-heap/GHC/Exts/Heap/InfoTable.hsc b/libraries/ghc-heap/GHC/Exts/Heap/InfoTable.hsc index 95151b4..25fe498 100644 --- a/libraries/ghc-heap/GHC/Exts/Heap/InfoTable.hsc +++ b/libraries/ghc-heap/GHC/Exts/Heap/InfoTable.hsc @@ -59,7 +59,7 @@ pokeItbl a0 itbl = do #endif (#poke StgInfoTable, layout.payload.ptrs) a0 (ptrs itbl) (#poke StgInfoTable, layout.payload.nptrs) a0 (nptrs itbl) - (#poke StgInfoTable, type) a0 (toHalfWord (fromEnum (tipe itbl))) + (#poke StgInfoTable, type) a0 (fromEnum (tipe itbl)) #if __GLASGOW_HASKELL__ > 804 (#poke StgInfoTable, srt) a0 (srtlen itbl) #else @@ -72,9 +72,6 @@ pokeItbl a0 itbl = do Just (Left xs) -> pokeArray code_offset xs Just (Right xs) -> pokeArray code_offset xs #endif - where - toHalfWord :: Int -> HalfWord - toHalfWord i = fromIntegral i -- | Size in bytes of a standard InfoTable itblSize :: Int From git at git.haskell.org Tue Oct 30 16:22:40 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 30 Oct 2018 16:22:40 +0000 (UTC) Subject: [commit: ghc] branch 'wip/fix-i386-2' created Message-ID: <20181030162240.B2DD03ABC0@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/fix-i386-2 Referencing: e019ec94f12268dd92ea5d5204e9e57e7ebf10ca From git at git.haskell.org Tue Oct 30 16:22:43 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 30 Oct 2018 16:22:43 +0000 (UTC) Subject: [commit: ghc] wip/fix-i386-1, wip/fix-i386-2: circleci: Disable everything but i386 (5ed640e) Message-ID: <20181030162243.8FBD23ABC0@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/fix-i386-1,wip/fix-i386-2 Link : http://ghc.haskell.org/trac/ghc/changeset/5ed640e111e1c4a54affbfbbbd6a66f779b9e8df/ghc >--------------------------------------------------------------- commit 5ed640e111e1c4a54affbfbbbd6a66f779b9e8df Author: Ben Gamari Date: Tue Oct 30 12:17:04 2018 -0400 circleci: Disable everything but i386 >--------------------------------------------------------------- 5ed640e111e1c4a54affbfbbbd6a66f779b9e8df .circleci/config.yml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 53962c9..5be4fd5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -287,18 +287,8 @@ workflows: version: 2 validate: jobs: - - validate-x86_64-linux: - *trigger_on_tags - # FreeBSD disabled: https://github.com/haskell/unix/issues/102 - # - validate-x86_64-freebsd - - validate-x86_64-darwin: - *trigger_on_tags - - validate-x86_64-linux-llvm - validate-i386-linux: *trigger_on_tags - - validate-hadrian-x86_64-linux - - validate-x86_64-fedora: - *trigger_on_tags nightly: triggers: From git at git.haskell.org Tue Oct 30 16:22:46 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 30 Oct 2018 16:22:46 +0000 (UTC) Subject: [commit: ghc] wip/fix-i386-1, wip/fix-i386-2: Add a RTS option -xp to load PIC object anywhere in address space (5403a86) Message-ID: <20181030162246.70E9D3ABC0@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/fix-i386-1,wip/fix-i386-2 Link : http://ghc.haskell.org/trac/ghc/changeset/5403a8636fe82f971234873564f3a05393b89b7a/ghc >--------------------------------------------------------------- commit 5403a8636fe82f971234873564f3a05393b89b7a Author: Zejun Wu Date: Mon Oct 15 13:52:36 2018 -0400 Add a RTS option -xp to load PIC object anywhere in address space Add a RTS option -xp to load PIC object anywhere in address space. We do this by relaxing the requirement of <0x80000000 result of `mmapForLinker` and implying USE_CONTIGUOUS_MMAP. We also need to change calls to `ocInit` and `ocGetNames` to avoid dangling pointers when the address of `oc->image` is changed by `ocAllocateSymbolExtra`. Test Plan: ``` $ uname -a Linux localhost 4.18.8-arch1-1-ARCH #1 SMP PREEMPT Sat Sep 15 20:34:48 UTC 2018 x86_64 GNU/Linux $ cat mk/build.mk DYNAMIC_GHC_PROGRAMS = NO DYNAMIC_BY_DEFAULT = NO GhcRTSWays += thr_debug EXTRA_HC_OPTS += -debug WAY_p_HC_OPTS += -fPIC -fexternal-dynamic-refs $ inplace/bin/ghc-stage2 --interactive -prof +RTS -xp GHCi, version 8.7.20180928: http://www.haskell.org/ghc/ :? for help ghc-stage2: R_X86_64_32 relocation out of range: ghczmprim_GHCziTypes_ZMZN_closure = 7f690bffab59 Recompile /data/users/watashi/ghc/libraries/ghc-prim/dist-install/build/HSghc-prim -0.5.3.o with -fPIC -fexternal-dynamic-refs. ghc-stage2: unable to load package `ghc-prim-0.5.3' $ strace -f -e open,mmap inplace/bin/ghc-stage2 --interactive -prof -fexternal-interpreter -opti+RTS -opti-xp ... [pid 1355283] open("/data/users/watashi/ghc/libraries/base/dist-install/build/libHSbas e-4.12.0.0_p.a", O_RDONLY) = 14 [pid 1355283] mmap(NULL, 8192, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f6a84842000 [pid 1355283] open("/data/users/watashi/ghc/libraries/base/dist-install/build/libHSbas e-4.12.0.0_p.a", O_RDONLY) = 14 [pid 1355283] mmap(NULL, 8192, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f6a84676000 ... Prelude> System.Posix.Process.getProcessID ... [pid 1355283] open("/data/users/watashi/ghc/libraries/unix/dist-install/build/libHSuni x-2.7.2.2_p.a", O_RDONLY) = 14 [pid 1355283] mmap(NULL, 45056, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f6a67d60000 [pid 1355283] open("/data/users/watashi/ghc/libraries/unix/dist-install/build/libHSuni x-2.7.2.2_p.a", O_RDONLY) = 14 [pid 1355283] mmap(NULL, 57344, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f6a67d52000 ... ``` ``` $ uname -a Darwin watashis-iMac.local 18.0.0 Darwin Kernel Version 18.0.0: Wed Aug 22 20:13:40 PDT 2018; root:xnu-4903.201.2~1/RELEASE_X86_64 x86_64 $ mv /Users/watashi/gao/ghc/libraries/integer-gmp/dist-install/build/HSintege r-gmp-1.0.2.0.o{,._DISABLE_GHC_ISSUE_15105} $ inplace/bin/ghc-stage2 --interactive +RTS -xp GHCi, version 8.7.20181003: http://www.haskell.org/ghc/ :? for help Prelude> System.Posix.Process.getProcessID 42791 Prelude> Data.Set.fromList [1 .. 10] fromList [1,2,3,4,5,6,7,8,9,10] Prelude> Leaving GHCi. $ inplace/bin/ghc-stage2 --interactive -prof -fexternal-interpreter GHCi, version 8.7.20181003: http://www.haskell.org/ghc/ :? for help Prelude> System.Posix.Process.getProcessID 42806 Prelude> Data.Set.fromList [1 .. 10] fromList [1,2,3,4,5,6,7,8,9,10] Prelude> Leaving GHCi. ``` Also test with something that used to hit the 2Gb limit and it loads and runs without problem. Reviewers: simonmar, bgamari, angerman, Phyx, hvr, erikd Reviewed By: simonmar Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5195 >--------------------------------------------------------------- 5403a8636fe82f971234873564f3a05393b89b7a docs/users_guide/8.8.1-notes.rst | 4 ++ docs/users_guide/runtime_control.rst | 28 ++++++++++++- includes/rts/Flags.h | 12 ++++++ libraries/base/GHC/RTS/Flags.hsc | 3 ++ rts/Linker.c | 80 ++++++++++++++++++------------------ rts/RtsFlags.c | 11 +++++ rts/linker/Elf.c | 25 ++--------- rts/linker/MachO.c | 21 ++++++---- rts/linker/SymbolExtras.c | 61 +++++++++++++++++---------- 9 files changed, 151 insertions(+), 94 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 5403a8636fe82f971234873564f3a05393b89b7a From git at git.haskell.org Tue Oct 30 16:22:50 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 30 Oct 2018 16:22:50 +0000 (UTC) Subject: [commit: ghc] wip/fix-i386-2: Allocate bss section within proper range of other sections (e019ec9) Message-ID: <20181030162250.8C83A3ABC0@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/fix-i386-2 Link : http://ghc.haskell.org/trac/ghc/changeset/e019ec94f12268dd92ea5d5204e9e57e7ebf10ca/ghc >--------------------------------------------------------------- commit e019ec94f12268dd92ea5d5204e9e57e7ebf10ca Author: Zejun Wu Date: Mon Oct 15 13:52:53 2018 -0400 Allocate bss section within proper range of other sections Allocate bss section within proper range of other sections: * when `+RTS -xp` is passed, allocate it contiguously as we did for jump islands * when we mmap the code to lower 2Gb, we should allocate bss section there too This depends on {D5195} Test Plan: 1. `./validate` 2. with ``` DYNAMIC_GHC_PROGRAMS = NO DYNAMIC_BY_DEFAULT = NO ``` `TEST="T15729" make test` passed in both linux and macos. 3. Also test in a use case where we used to encouter error like: ``` ghc-iserv-prof: R_X86_64_PC32 relocation out of range: (noname) = b90282ba ``` and now, everything works fine. Reviewers: simonmar, bgamari, angerman, erikd Reviewed By: simonmar Subscribers: rwbarton, carter GHC Trac Issues: #15729 Differential Revision: https://phabricator.haskell.org/D5219 >--------------------------------------------------------------- e019ec94f12268dd92ea5d5204e9e57e7ebf10ca rts/Linker.c | 22 +++++---- rts/LinkerInternals.h | 4 ++ rts/linker/Elf.c | 73 ++++++++++++++++++------------ rts/linker/Elf.h | 2 +- rts/linker/MachO.c | 27 ++++++----- rts/linker/MachO.h | 2 +- rts/linker/PEi386.c | 2 +- rts/linker/PEi386.h | 2 +- rts/linker/SymbolExtras.c | 31 ++++++------- rts/linker/SymbolExtras.h | 2 +- rts/sm/OSMem.h | 10 +++- testsuite/tests/ghci/linking/Makefile | 5 ++ testsuite/tests/ghci/linking/T15729.c | 4 ++ testsuite/tests/ghci/linking/T15729.hs | 14 ++++++ testsuite/tests/ghci/linking/T15729.stdout | 2 + testsuite/tests/ghci/linking/all.T | 6 +++ 16 files changed, 132 insertions(+), 76 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc e019ec94f12268dd92ea5d5204e9e57e7ebf10ca From git at git.haskell.org Tue Oct 30 17:54:32 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 30 Oct 2018 17:54:32 +0000 (UTC) Subject: [commit: ghc] branch 'wip-fix-i386-3' created Message-ID: <20181030175432.7E2BE3ABC0@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip-fix-i386-3 Referencing: 5ed640e111e1c4a54affbfbbbd6a66f779b9e8df From git at git.haskell.org Tue Oct 30 17:55:43 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 30 Oct 2018 17:55:43 +0000 (UTC) Subject: [commit: ghc] master: circleci: Store test results of slow validation builds (21d169b) Message-ID: <20181030175543.648A23ABC0@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/21d169b660dd95f7d382d63bc21c45279e096351/ghc >--------------------------------------------------------------- commit 21d169b660dd95f7d382d63bc21c45279e096351 Author: Ben Gamari Date: Tue Oct 30 13:47:53 2018 -0400 circleci: Store test results of slow validation builds >--------------------------------------------------------------- 21d169b660dd95f7d382d63bc21c45279e096351 .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 02c151d..f356901 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -284,6 +284,7 @@ jobs: - *configure_unix - *make - *slowtest + - *store_test_results workflows: version: 2 From git at git.haskell.org Tue Oct 30 18:58:54 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 30 Oct 2018 18:58:54 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: Revert "Multiple fixes / improvements for LLVM backend" (377fe39) Message-ID: <20181030185854.E50163ABC0@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/377fe39888b1c711d15c94583ec83680d8ae7bf4/ghc >--------------------------------------------------------------- commit 377fe39888b1c711d15c94583ec83680d8ae7bf4 Author: Ben Gamari Date: Tue Oct 30 11:12:46 2018 -0400 Revert "Multiple fixes / improvements for LLVM backend" This reverts commit 73273be476a8cc6c13368660b042b3b0614fd928. Unfortunately we were unable to come to a fix that didn't sacrifice the ability to bootstrap GHC using the LLVM backend. Reverting for 8.6.2. >--------------------------------------------------------------- 377fe39888b1c711d15c94583ec83680d8ae7bf4 compiler/llvmGen/Llvm/Types.hs | 2 +- compiler/llvmGen/LlvmCodeGen/Base.hs | 62 +++++--------------------------- compiler/llvmGen/LlvmCodeGen/CodeGen.hs | 60 +++++++++++++++++++++++++------ llvm-passes | 2 +- testsuite/tests/codeGen/should_run/all.T | 2 +- 5 files changed, 61 insertions(+), 67 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 377fe39888b1c711d15c94583ec83680d8ae7bf4 From git at git.haskell.org Tue Oct 30 18:58:57 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 30 Oct 2018 18:58:57 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: Revert "Fix for T14251 on ARM" (9c4314e) Message-ID: <20181030185857.B804D3ABC0@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/9c4314ec0f7814c5a79c7ea5811355bcdad79e2a/ghc >--------------------------------------------------------------- commit 9c4314ec0f7814c5a79c7ea5811355bcdad79e2a Author: Ben Gamari Date: Tue Oct 30 11:12:12 2018 -0400 Revert "Fix for T14251 on ARM" This reverts commit 2e23e1c7de01c92b038e55ce53d11bf9db993dd4. >--------------------------------------------------------------- 9c4314ec0f7814c5a79c7ea5811355bcdad79e2a compiler/llvmGen/LlvmCodeGen/Base.hs | 123 ++++++++++---------------------- compiler/llvmGen/LlvmCodeGen/CodeGen.hs | 6 +- 2 files changed, 39 insertions(+), 90 deletions(-) diff --git a/compiler/llvmGen/LlvmCodeGen/Base.hs b/compiler/llvmGen/LlvmCodeGen/Base.hs index 0a40b73..ec91bac 100644 --- a/compiler/llvmGen/LlvmCodeGen/Base.hs +++ b/compiler/llvmGen/LlvmCodeGen/Base.hs @@ -26,7 +26,7 @@ module LlvmCodeGen.Base ( cmmToLlvmType, widthToLlvmFloat, widthToLlvmInt, llvmFunTy, llvmFunSig, llvmFunArgs, llvmStdFunAttrs, llvmFunAlign, llvmInfAlign, - llvmPtrBits, tysToParams, llvmFunSection, padLiveArgs, isFPR, + llvmPtrBits, tysToParams, llvmFunSection, padLiveArgs, isSSE, strCLabel_llvm, strDisplayName_llvm, strProcedureName_llvm, getGlobalPtr, generateExternDecls, @@ -47,7 +47,6 @@ import CodeGen.Platform ( activeStgRegs ) import DynFlags import FastString import Cmm hiding ( succ ) -import CmmUtils ( regsOverlap ) import Outputable as Outp import Platform import UniqFM @@ -59,7 +58,8 @@ import ErrUtils import qualified Stream import Control.Monad (ap) -import Data.List (sort, groupBy, head) +import Data.List (sort) +import Data.Maybe (mapMaybe) -- ---------------------------------------------------------------------------- -- * Some Data Types @@ -152,91 +152,36 @@ llvmFunArgs dflags live = map (lmGlobalRegArg dflags) (filter isPassed allRegs) where platform = targetPlatform dflags allRegs = activeStgRegs platform - paddedLive = map (\(_,r) -> r) $ padLiveArgs dflags live + paddedLive = map (\(_,r) -> r) $ padLiveArgs live isLive r = r `elem` alwaysLive || r `elem` paddedLive - isPassed r = not (isFPR r) || isLive r - - -isFPR :: GlobalReg -> Bool -isFPR (FloatReg _) = True -isFPR (DoubleReg _) = True -isFPR (XmmReg _) = True -isFPR (YmmReg _) = True -isFPR (ZmmReg _) = True -isFPR _ = False - -sameFPRClass :: GlobalReg -> GlobalReg -> Bool -sameFPRClass (FloatReg _) (FloatReg _) = True -sameFPRClass (DoubleReg _) (DoubleReg _) = True -sameFPRClass (XmmReg _) (XmmReg _) = True -sameFPRClass (YmmReg _) (YmmReg _) = True -sameFPRClass (ZmmReg _) (ZmmReg _) = True -sameFPRClass _ _ = False - -normalizeFPRNum :: GlobalReg -> GlobalReg -normalizeFPRNum (FloatReg _) = FloatReg 1 -normalizeFPRNum (DoubleReg _) = DoubleReg 1 -normalizeFPRNum (XmmReg _) = XmmReg 1 -normalizeFPRNum (YmmReg _) = YmmReg 1 -normalizeFPRNum (ZmmReg _) = ZmmReg 1 -normalizeFPRNum _ = error "normalizeFPRNum expected only FPR regs" - -getFPRCtor :: GlobalReg -> Int -> GlobalReg -getFPRCtor (FloatReg _) = FloatReg -getFPRCtor (DoubleReg _) = DoubleReg -getFPRCtor (XmmReg _) = XmmReg -getFPRCtor (YmmReg _) = YmmReg -getFPRCtor (ZmmReg _) = ZmmReg -getFPRCtor _ = error "getFPRCtor expected only FPR regs" - -fprRegNum :: GlobalReg -> Int -fprRegNum (FloatReg i) = i -fprRegNum (DoubleReg i) = i -fprRegNum (XmmReg i) = i -fprRegNum (YmmReg i) = i -fprRegNum (ZmmReg i) = i -fprRegNum _ = error "fprRegNum expected only FPR regs" - --- | Input: dynflags, and the list of live registers --- --- Output: An augmented list of live registers, where padding was --- added to the list of registers to ensure the calling convention is --- correctly used by LLVM. --- --- Each global reg in the returned list is tagged with a bool, which --- indicates whether the global reg was added as padding, or was an original --- live register. --- --- That is, True => padding, False => a real, live global register. --- --- Also, the returned list is not sorted in any particular order. --- -padLiveArgs :: DynFlags -> LiveGlobalRegs -> [(Bool, GlobalReg)] -padLiveArgs dflags live = - if platformUnregisterised plat - then taggedLive -- not using GHC's register convention for platform. - else padding ++ taggedLive - where - taggedLive = map (\x -> (False, x)) live - plat = targetPlatform dflags - - fprLive = filter isFPR live - padding = concatMap calcPad $ groupBy sharesClass fprLive - - sharesClass :: GlobalReg -> GlobalReg -> Bool - sharesClass a b = sameFPRClass a b || overlappingClass - where - overlappingClass = regsOverlap dflags (norm a) (norm b) - norm = CmmGlobal . normalizeFPRNum - - calcPad :: [GlobalReg] -> [(Bool, GlobalReg)] - calcPad rs = getFPRPadding (getFPRCtor $ head rs) rs - -getFPRPadding :: (Int -> GlobalReg) -> LiveGlobalRegs -> [(Bool, GlobalReg)] -getFPRPadding paddingCtor live = padding + isPassed r = not (isSSE r) || isLive r + + +isSSE :: GlobalReg -> Bool +isSSE (FloatReg _) = True +isSSE (DoubleReg _) = True +isSSE (XmmReg _) = True +isSSE (YmmReg _) = True +isSSE (ZmmReg _) = True +isSSE _ = False + +sseRegNum :: GlobalReg -> Maybe Int +sseRegNum (FloatReg i) = Just i +sseRegNum (DoubleReg i) = Just i +sseRegNum (XmmReg i) = Just i +sseRegNum (YmmReg i) = Just i +sseRegNum (ZmmReg i) = Just i +sseRegNum _ = Nothing + +-- the bool indicates whether the global reg was added as padding. +-- the returned list is not sorted in any particular order, +-- but does indicate the set of live registers needed, with SSE padding. +padLiveArgs :: LiveGlobalRegs -> [(Bool, GlobalReg)] +padLiveArgs live = allRegs where - fprRegNums = sort $ map fprRegNum live - (_, padding) = foldl assignSlots (1, []) $ fprRegNums + sseRegNums = sort $ mapMaybe sseRegNum live + (_, padding) = foldl assignSlots (1, []) $ sseRegNums + allRegs = padding ++ map (\r -> (False, r)) live assignSlots (i, acc) regNum | i == regNum = -- don't need padding here @@ -250,7 +195,11 @@ getFPRPadding paddingCtor live = padding genPad start n = take n $ flip map (iterate (+1) start) (\i -> - (True, paddingCtor i)) + (True, FloatReg i)) + -- NOTE: Picking float should be fine for the following reasons: + -- (1) Float aliases with all the other SSE register types on + -- the given platform. + -- (2) The argument is not live anyways. -- | Llvm standard fun attributes diff --git a/compiler/llvmGen/LlvmCodeGen/CodeGen.hs b/compiler/llvmGen/LlvmCodeGen/CodeGen.hs index 91c6a88..041329e 100644 --- a/compiler/llvmGen/LlvmCodeGen/CodeGen.hs +++ b/compiler/llvmGen/LlvmCodeGen/CodeGen.hs @@ -1806,14 +1806,14 @@ funPrologue live cmmBlocks = do -- STG Liveness optimisation done here. funEpilogue :: LiveGlobalRegs -> LlvmM ([LlvmVar], LlvmStatements) funEpilogue live = do - dflags <- getDynFlags -- the bool indicates whether the register is padding. let alwaysNeeded = map (\r -> (False, r)) alwaysLive - livePadded = alwaysNeeded ++ padLiveArgs dflags live + livePadded = alwaysNeeded ++ padLiveArgs live -- Set to value or "undef" depending on whether the register is -- actually live + dflags <- getDynFlags let loadExpr r = do (v, _, s) <- getCmmRegVal (CmmGlobal r) return (Just $ v, s) @@ -1825,7 +1825,7 @@ funEpilogue live = do loads <- flip mapM allRegs $ \r -> case () of _ | (False, r) `elem` livePadded -> loadExpr r -- if r is not padding, load it - | not (isFPR r) || (True, r) `elem` livePadded + | not (isSSE r) || (True, r) `elem` livePadded -> loadUndef r | otherwise -> return (Nothing, nilOL) From git at git.haskell.org Tue Oct 30 18:59:01 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 30 Oct 2018 18:59:01 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: Fix #15815 by parenthesizing the arguments to infix ~ (2567e8f) Message-ID: <20181030185901.1BC573ABC0@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/2567e8f341ef638b8a93054d1be75c176bfaee66/ghc >--------------------------------------------------------------- commit 2567e8f341ef638b8a93054d1be75c176bfaee66 Author: Ryan Scott Date: Sun Oct 28 16:08:11 2018 -0400 Fix #15815 by parenthesizing the arguments to infix ~ An unfortunate consequence of commit b9483981d128f55d8dae3f434f49fa6b5b30c779 (`Remove HsEqTy and XEqTy`) is infix uses of `~` in TH quotes now desugar differently than before. In particular, we have that: ```haskell a ~ (Int -> Int) ``` Now desugars to: ```haskell HsOpTy a (~) (HsOpTy Int (->) Int) ``` Which GHC interprets as being: ```haskell a ~ Int -> Int ``` Or, equivalently: ```haskell (a ~ Int) -> Int ``` Which is different than what was intended! This is the cause of #15815. All of this has revealed that we likely need to renovate the way we desugar infix type operators to be more consistent with the treatment for infix expressions (see https://ghc.haskell.org/trac/ghc/ticket/15815#comment:5 for more on this.) Doing so would constitute a breaking change, however, so we will likely want to wait until another major GHC release to do this. In the meantime, this patch offers a non-invasive change to the way that infix uses of `~` are desugared. This makes the program in #15815 compile again by inserting extra `HsParTy`s around the arguments to `~` if they are lacking them. Test Plan: make test TEST=T15815 Reviewers: int-index, goldfire, bgamari Reviewed By: int-index Subscribers: int-e, rwbarton, carter GHC Trac Issues: #15815 Differential Revision: https://phabricator.haskell.org/D5274 (cherry picked from commit b8a797ecc34a309bd78f5a290e3554642a3a478a) >--------------------------------------------------------------- 2567e8f341ef638b8a93054d1be75c176bfaee66 compiler/hsSyn/Convert.hs | 8 +++++++- testsuite/tests/th/T15815A.hs | 7 +++++++ testsuite/tests/th/T15815B.hs | 6 ++++++ testsuite/tests/th/all.T | 2 ++ 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/compiler/hsSyn/Convert.hs b/compiler/hsSyn/Convert.hs index c44abf6..3bdac98 100644 --- a/compiler/hsSyn/Convert.hs +++ b/compiler/hsSyn/Convert.hs @@ -1389,7 +1389,13 @@ cvtTypeKind ty_str ty EqualityT | [x',y'] <- tys' -> - returnL (HsOpTy noExt x' (noLoc eqTyCon_RDR) y') + let px = parenthesizeHsType opPrec x' + py = parenthesizeHsType opPrec y' + in returnL (HsOpTy noExt px (noLoc eqTyCon_RDR) py) + -- The long-term goal is to remove the above case entirely and + -- subsume it under the case for InfixT. See #15815, comment:6, + -- for more details. + | otherwise -> mk_apps (HsTyVar noExt NotPromoted (noLoc eqTyCon_RDR)) tys' diff --git a/testsuite/tests/th/T15815A.hs b/testsuite/tests/th/T15815A.hs new file mode 100644 index 0000000..4025f38 --- /dev/null +++ b/testsuite/tests/th/T15815A.hs @@ -0,0 +1,7 @@ +{-# LANGUAGE TemplateHaskell #-} +module T15815A where + +mkFoo tyQ = [d| + foo :: a ~ $(tyQ) => a + foo = undefined + |] diff --git a/testsuite/tests/th/T15815B.hs b/testsuite/tests/th/T15815B.hs new file mode 100644 index 0000000..32bf2ed --- /dev/null +++ b/testsuite/tests/th/T15815B.hs @@ -0,0 +1,6 @@ +{-# LANGUAGE TemplateHaskell, GADTs #-} +module T15815B where + +import T15815A + +mkFoo [t| Int -> Int |] diff --git a/testsuite/tests/th/all.T b/testsuite/tests/th/all.T index 6e56446..ddc2708 100644 --- a/testsuite/tests/th/all.T +++ b/testsuite/tests/th/all.T @@ -425,3 +425,5 @@ test('T15550', normal, compile, ['-v0 -ddump-splices -dsuppress-uniques']) test('T15572', normal, compile, ['-v0 -ddump-splices -dsuppress-uniques']) test('T15481', normal, compile, ['-v0 -ddump-splices -dsuppress-uniques']) test('TH_recover_warns', normal, compile, ['-v0 -ddump-splices -dsuppress-uniques']) +test('T15815', normal, multimod_compile, + ['T15815B', '-v0 ' + config.ghc_th_way_flags]) From git at git.haskell.org Tue Oct 30 18:59:03 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 30 Oct 2018 18:59:03 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: users-guide: Fix typo (d67cbce) Message-ID: <20181030185903.E1A0B3ABC0@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/d67cbced6c21ac904d2121389dd1b38270ebceb7/ghc >--------------------------------------------------------------- commit d67cbced6c21ac904d2121389dd1b38270ebceb7 Author: Ben Gamari Date: Mon Oct 29 13:56:40 2018 -0400 users-guide: Fix typo >--------------------------------------------------------------- d67cbced6c21ac904d2121389dd1b38270ebceb7 docs/users_guide/8.6.2-notes.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/users_guide/8.6.2-notes.rst b/docs/users_guide/8.6.2-notes.rst index 9ee94df..fdb1489 100644 --- a/docs/users_guide/8.6.2-notes.rst +++ b/docs/users_guide/8.6.2-notes.rst @@ -9,7 +9,7 @@ GHC 8.6.2 is a bug-fix release, fixing a few regressions found in 8.6.1. Highlights ---------- -The highlights, since the 8.6.2 release, are: +The highlights, since the 8.6.1 release, are: - A long-standing bug exposed in GHC 8.6.1, :ghc-ticket:`15696`, has been fixed. This issue resulted in undefined runtime behavior with some uses of the From git at git.haskell.org Tue Oct 30 18:59:06 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 30 Oct 2018 18:59:06 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: users-guide: Note existence of #14251 (a876edc) Message-ID: <20181030185906.B4BE43ABC0@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/a876edcbcf3317aae487be4b5cf57acd6537d0dd/ghc >--------------------------------------------------------------- commit a876edcbcf3317aae487be4b5cf57acd6537d0dd Author: Ben Gamari Date: Tue Oct 30 14:13:22 2018 -0400 users-guide: Note existence of #14251 >--------------------------------------------------------------- a876edcbcf3317aae487be4b5cf57acd6537d0dd docs/users_guide/8.6.2-notes.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/users_guide/8.6.2-notes.rst b/docs/users_guide/8.6.2-notes.rst index fdb1489..2dd2508 100644 --- a/docs/users_guide/8.6.2-notes.rst +++ b/docs/users_guide/8.6.2-notes.rst @@ -32,6 +32,16 @@ The highlights, since the 8.6.1 release, are: incorrect results, has been fixed (:ghc-ticket:`15271`) +Known issues +------------ + +Note that the LLVM code generator (:ghc-flag:`-fllvm`) in GHC 8.8, as well as +all earlier releases, are affected by :ghc-ticket:`14251`, which can result in +miscompilation of some programs calling functions with unboxed floating-point +arguments. While originally scheduled to be fixed for this release, the fix +ended up being more difficult than anticipated and, given that issue is not a +strict regression from 8.4, we decided to proceed with the release. + Included libraries ------------------ From git at git.haskell.org Tue Oct 30 18:59:10 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 30 Oct 2018 18:59:10 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: Report a Wanted error even if there are Given ones (a49f95c) Message-ID: <20181030185910.839173ABC0@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/a49f95c29b3a5f665b3ec0f1f05d78b73244b1f1/ghc >--------------------------------------------------------------- commit a49f95c29b3a5f665b3ec0f1f05d78b73244b1f1 Author: Simon Peyton Jones Date: Thu Oct 18 15:41:44 2018 +0100 Report a Wanted error even if there are Given ones We suppress some Given errors; see Note [Given errors] in TcErrors. But we must be careful not to suppress Wanted errors because of the presence of these Given errors -- else we might allow compilation to bogusly proceed The rubber hits the road in TcRnTypes.insolubleCt, where we don't want to treat Givens as insoluble, nor (and this is the new bit) Deriveds that arise from Givens. See Note [Given insolubles] in TcRnTypes. This fixes #15767. (cherry picked from commit 6b1102e2cfcffb265fd33cf8a99ab5e6b3f14906) Ben notes: I have folded some test output changes in `TEST="T12529 T12921 mc13 mc14"` into this patch that were not in the original. >--------------------------------------------------------------- a49f95c29b3a5f665b3ec0f1f05d78b73244b1f1 compiler/typecheck/TcErrors.hs | 2 +- compiler/typecheck/TcRnTypes.hs | 24 +++++++++------ testsuite/tests/rename/should_fail/mc13.stderr | 18 +++++++++++- testsuite/tests/rename/should_fail/mc14.stderr | 34 +++++++++++++++++++++- .../tests/typecheck/should_fail/T12529.stderr | 2 -- .../tests/typecheck/should_fail/T12921.stderr | 3 -- testsuite/tests/typecheck/should_fail/T15767.hs | 9 ++++++ .../tests/typecheck/should_fail/T15767.stderr | 9 ++++++ testsuite/tests/typecheck/should_fail/all.T | 1 + 9 files changed, 85 insertions(+), 17 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc a49f95c29b3a5f665b3ec0f1f05d78b73244b1f1 From git at git.haskell.org Tue Oct 30 21:29:56 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 30 Oct 2018 21:29:56 +0000 (UTC) Subject: [commit: ghc] master: Fix docs typo in Bitraversable composition law (7e1690d) Message-ID: <20181030212956.4C37A3ABC0@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/7e1690d17b39a9491e46b12297adad8d0c89b550/ghc >--------------------------------------------------------------- commit 7e1690d17b39a9491e46b12297adad8d0c89b550 Author: Mark Seemann Date: Tue Oct 30 10:02:42 2018 +0100 Fix docs typo in Bitraversable composition law (cherry picked from commit 7c2bcc00e22ca8cebd9ffb2ee1741a86a5c4ebb9) >--------------------------------------------------------------- 7e1690d17b39a9491e46b12297adad8d0c89b550 libraries/base/Data/Bitraversable.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/base/Data/Bitraversable.hs b/libraries/base/Data/Bitraversable.hs index 4064929..cf1272a 100644 --- a/libraries/base/Data/Bitraversable.hs +++ b/libraries/base/Data/Bitraversable.hs @@ -55,7 +55,7 @@ import GHC.Generics (K1(..)) -- @'Data.Functor.Compose.Compose' . -- 'fmap' ('bitraverse' g1 g2) . -- 'bitraverse' f1 f2 --- ≡ 'traverse' ('Data.Functor.Compose.Compose' . 'fmap' g1 . f1) +-- ≡ 'bitraverse' ('Data.Functor.Compose.Compose' . 'fmap' g1 . f1) -- ('Data.Functor.Compose.Compose' . 'fmap' g2 . f2)@ -- -- where an /applicative transformation/ is a function From git at git.haskell.org Tue Oct 30 21:29:59 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 30 Oct 2018 21:29:59 +0000 (UTC) Subject: [commit: ghc] master: Revert "Allocate bss section within proper range of other sections" (9cbf6f2) Message-ID: <20181030212959.563BE3ABC0@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/9cbf6f2baf793e361d41b9c36497c5601ff22253/ghc >--------------------------------------------------------------- commit 9cbf6f2baf793e361d41b9c36497c5601ff22253 Author: Ben Gamari Date: Tue Oct 30 14:47:53 2018 -0400 Revert "Allocate bss section within proper range of other sections" This reverts commit e019ec94f12268dd92ea5d5204e9e57e7ebf10ca. This sadly breaks the external interpreter on i386. For instance, see https://circleci.com/gh/ghc/ghc/10925. >--------------------------------------------------------------- 9cbf6f2baf793e361d41b9c36497c5601ff22253 rts/Linker.c | 22 ++++----- rts/LinkerInternals.h | 4 -- rts/linker/Elf.c | 73 ++++++++++++------------------ rts/linker/Elf.h | 2 +- rts/linker/MachO.c | 27 +++++------ rts/linker/MachO.h | 2 +- rts/linker/PEi386.c | 2 +- rts/linker/PEi386.h | 2 +- rts/linker/SymbolExtras.c | 31 +++++++------ rts/linker/SymbolExtras.h | 2 +- rts/sm/OSMem.h | 10 +--- testsuite/tests/ghci/linking/Makefile | 5 -- testsuite/tests/ghci/linking/T15729.c | 4 -- testsuite/tests/ghci/linking/T15729.hs | 14 ------ testsuite/tests/ghci/linking/T15729.stdout | 2 - testsuite/tests/ghci/linking/all.T | 6 --- 16 files changed, 76 insertions(+), 132 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 9cbf6f2baf793e361d41b9c36497c5601ff22253 From git at git.haskell.org Wed Oct 31 02:07:27 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 31 Oct 2018 02:07:27 +0000 (UTC) Subject: [commit: ghc] master: Revert "Add a RTS option -xp to load PIC object anywhere in address space" (82a7164) Message-ID: <20181031020727.C4C093ABC0@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/82a716431cc680392e332bc2b1a1fd0d7faa4cd8/ghc >--------------------------------------------------------------- commit 82a716431cc680392e332bc2b1a1fd0d7faa4cd8 Author: Ben Gamari Date: Tue Oct 30 20:38:24 2018 -0400 Revert "Add a RTS option -xp to load PIC object anywhere in address space" This reverts commit 5403a8636fe82f971234873564f3a05393b89b7a. >--------------------------------------------------------------- 82a716431cc680392e332bc2b1a1fd0d7faa4cd8 docs/users_guide/8.8.1-notes.rst | 4 -- docs/users_guide/runtime_control.rst | 28 +------------ includes/rts/Flags.h | 12 ------ libraries/base/GHC/RTS/Flags.hsc | 3 -- rts/Linker.c | 80 ++++++++++++++++++------------------ rts/RtsFlags.c | 11 ----- rts/linker/Elf.c | 25 +++++++++-- rts/linker/MachO.c | 21 ++++------ rts/linker/SymbolExtras.c | 61 ++++++++++----------------- 9 files changed, 94 insertions(+), 151 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 82a716431cc680392e332bc2b1a1fd0d7faa4cd8