summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Backport fixes from !1953 fixing #17334.wip/andreask/1953_backportAndreas Klebinger2019-11-128-266/+830
|
* On FreeBSD 12 sys/sysctl.h requires sys/types.hViktor Dukhovni2019-11-101-0/+1
| | | | | | | | | | | | | | Else build fails with: In file included from ExecutablePath.hsc:42: /usr/include/sys/sysctl.h:1062:25: error: unknown type name 'u_int'; did you mean 'int'? int sysctl(const int *, u_int, void *, size_t *, const void *, size_t); ^~~~~ int compiling libraries/base/dist-install/build/System/Environment/ExecutablePath_hsc_make.c failed (exit code 1) Perhaps also also other FreeBSD releases, but additional include will no harm even if not needed.
* Improve error recovery in the typecheckerSimon Peyton Jones2019-11-0821-214/+327
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #16418 showed that we were carrying on too eagerly after a bogus type signature was identified (a bad telescope in fact), leading to a subsequent crash. This led me in to a maze of twisty little passages in the typechecker's error recovery, and I ended up doing some refactoring in TcRnMonad. Some specfifics * TcRnMonad.try_m is now called attemptM. * I switched the order of the result pair in tryTc, to make it consistent with other similar functions. * The actual exception used in the Tc monad is irrelevant so, to avoid polluting type signatures, I made tcTryM, a simple wrapper around tryM, and used it. The more important changes are in * TcSimplify.captureTopConstraints, where we should have been calling simplifyTop rather than reportUnsolved, so that levity defaulting takes place properly. * TcUnify.emitResidualTvConstraint, where we need to set the correct status for a new implication constraint. (Previously we ended up with an Insoluble constraint wrapped in an Unsolved implication, which meant that insolubleWC gave the wrong answer. (cherry picked from commit 4927117cd6166a97455d788dbf7433c95441b57a)
* Fix #17112Sebastian Graf2019-11-083-27/+54
| | | | | | | | | | | | | | | The `mkOneConFull` function of the pattern match checker used to try to guess the type arguments of the data type's type constructor by looking at the ambient type of the match. This doesn't work well for Pattern Synonyms, where the result type isn't even necessarily a TyCon application, and it shows in #11336 and #17112. Also the effort seems futile; why try to try hard when the type checker has already done the hard lifting? After this patch, we instead supply the type constructors arguments as an argument to the function and lean on the type-annotated AST. (cherry picked from commit a308b435afed0f2416f4e5a153cafebe8d3cf3c6)
* Don't do binder-swap for GlobalIdsSimon Peyton Jones2019-11-071-3/+8
| | | | | | | | | | | | | | This patch disables the binder-swap transformation in the (relatively rare) case when the scrutinee is a GlobalId. Reason: we are getting Lint errors so that GHC doesn't even validate. Trac #16346. This is NOT the final solution -- it's just a stop-gap to get us running again. The final solution is in Trac #16296 (cherry picked from commit 0eb7cf03da3783ca887d5de44d312cf6f3a4113c)
* Parenthesize GADT return types in pprIfaceConDecl (#17384)wip/backport-T17296-and-T17384Ryan Scott2019-11-045-1/+16
| | | | | | | We were using `pprIfaceAppArgs` instead of `pprParendIfaceAppArgs` in `pprIfaceConDecl`. Oops. Fixes #17384.
* Reify oversaturated data family instances correctly (#17296)Ryan Scott2019-11-036-21/+175
| | | | | | | | | | | | | | | | | | | | `TcSplice` was not properly handling oversaturated data family instances, such as the example in #17296, as it dropped arguments due to carelessly zipping data family instance arguments with `tyConTyVars`. For data families, the number of `tyConTyVars` can sometimes be less than the number of arguments it can accept in a data family instance due to the fact that data family instances can be oversaturated. To account for this, `TcSplice.mkIsPolyTvs` has now been renamed to `tyConArgsPolyKinded` and now factors in `tyConResKind` in addition to `tyConTyVars`. I've also added `Note [Reified instances and explicit kind signatures]` which explains the various subtleties in play here. Fixes #17296. (cherry picked from commit e3636a688fe11a9a171c55416a507e7c520299ef)
* Fix #14579 by defining tyConAppNeedsKindSig, and using itRyan Scott2019-11-039-205/+421
| | | | (cherry picked from commit e88e083d62389d5c8d082a25395a3d933ab2f03b)
* configure: Search for LLVM executables with two-number versionsBen Gamari2019-11-031-2/+3
| | | | | | | | | Fedora uses the naming llc-7.0 while Debian uses llc-7. Ensure that both are found. Fixes #16990. (cherry picked from commit 90bf11c6519783a7d686d02e1fc6f6f50298b850)
* testsuite: Add tests for #16943Ben Gamari2019-11-035-0/+23
| | | | (cherry picked from commit f1d0e49f8a9a9175c83442430fac76ae225e52ae)
* expose ModuleInfo.minf_rdr_env for tooling authorsSam Halliday2019-11-031-0/+4
| | | | (cherry picked from commit 993804bf40dea77c36f50ff772d112ec69c8a222)
* Fix bounds check in ocResolve_PEi386 for relocation values.Andreas Klebinger2019-11-031-2/+2
| | | | | | | | | | The old test was wrong at least for gcc and the value -2287728808L. It also relied on implementation defined behaviour (right shift on a negative value), which might or might not be ok. Either way it's now a simple comparison which will always work. (cherry picked from commit abfbdff2b1d8c8baecb457cbf8bf6e2016c276ec)
* configure: Don't depend upon alex in source dist buildBen Gamari2019-11-031-2/+5
| | | | | | | | This fixes #16860 by verifying that the generated sources don't already exist before asserting that the `alex` executable was found. This replicates the logic already used for `happy` in the case of `alex`. (cherry picked from commit 68dc96a00cc1f4d4d0d5f6520b0ce8f5c240b752)
* Fix new compact block allocation in allocateForCompactÖmer Sinan Ağacan2019-11-033-2/+32
| | | | | | | | | | | | | | | allocateForCompact() is called when nursery of a compact region is full, to add new blocks to the compact. New blocks added to an existing region needs a StgCompactNFDataBlock header, not a StgCompactNFData. This fixes allocateForCompact() so that it now correctly allocates space for StgCompactNFDataBlock instead of StgCompactNFData as before. Fixes #17044. A regression test T17044 added. (cherry picked from commit 981d3b9ecf0397744df9e1cbfdc805d1f9c29ef0)
* Exclude rts.cabal from source distributionsBen Gamari2019-11-032-0/+2
| | | | | | | | | This modifies both the Hadrian and make build systems to avoid included the rts.cabal generated by autoconf in the source distribution. Fixes #17265. (cherry picked from commit e81d4bc7d1cea52b81f20d8eef6b5d1b14570230)
* rules/haddock: Ensure that RTS stats directory existsBen Gamari2019-11-031-0/+2
| | | | | | | It may not exist if the source tarball was extracted yet not the testsuite tarball. (cherry picked from commit 624eb0fca63e49694e93df37a616d2162b8ded13)
* rts: Fix CNF dirtying logicBen Gamari2019-11-031-3/+3
| | | | | | | | | | Previously due to a silly implementation bug CNFs would never have their dirty flag set, resulting in their being added again and again to the `mut_list`. Fix this. Fixes #17297. (cherry picked from commit ba27fe740d4b141d2a2fa209f98a0946cb80f379)
* Extend argument of createIOThread to word sizeStefan Schulze Frielinghaus2019-11-031-2/+2
| | | | | | | | | Function createIOThread expects its second argument to be of size word. The natural size of the second parameter is 32bits. Thus for some 64bit architectures, where a write of the lower half of a register does not clear the upper half, the value must be zero extended. (cherry picked from commit d0924b153b093a925c9e721f2540f3dfd6c278ae)
* configure: Determine library versions of template-haskell, et al.Ben Gamari2019-11-032-0/+9
| | | | | | These are needed by the user guide documentation. Fixes #17260. (cherry picked from commit 0c53d0aa87d884707f77beea4f42b59d056116ea)
* New fix for #11647. Avoid side effects like #17171Roland Senn2019-11-038-6/+37
| | | | | | | If a main module doesn't contain a header, we omit the check whether the main module is exported. With this patch GHC, GHCi and runghc use the same code. (cherry picked from commit 93f02b6223b8fc4d85ece389ac0520ee9cc20f2f)
* Don't skip validity checks for built-in classes (#17355)Ryan Scott2019-11-035-6/+27
| | | | | | | | | | | | | | | | | | | | | | Issue #17355 occurred because the control flow for `TcValidity.check_valid_inst_head` was structured in such a way that whenever it checked a special, built-in class (like `Generic` or `HasField`), it would skip the most important check of all: `checkValidTypePats`, which rejects nonsense like this: ```hs instance Generic (forall a. a) ``` This fixes the issue by carving out `checkValidTypePats` from `check_valid_inst_head` so that `checkValidTypePats` is always invoked. `check_valid_inst_head` has also been renamed to `check_special_inst_head` to reflect its new purpose of _only_ checking for instances headed by special classes. Fixes #17355. (cherry picked from commit f375e3fb060653beb12b05b48ac0fd3f88eb2f45)
* Bump stm submoduleBen Gamari2019-11-031-0/+0
| | | | (cherry picked from commit 8b578e72949f1a3fa398be2f1d37977b3747fa62)
* Full abort on validate failure merging `orElse`.Ryan Yates2019-11-033-20/+103
| | | | | | | | | | Previously partial roll back of a branch of an `orElse` was attempted if validation failure was observed. Validation here, however, does not account for what part of the transaction observed inconsistent state. This commit fixes this by fully aborting and restarting the transaction. (cherry picked from commit 998f2e18ec1a23c987142551f751b3e0f8431970)
* Drop duplicate -optl's from GHC invocationsBen Gamari2019-11-031-2/+2
| | | | | | | | | | | | | | | Previously the make build system would pass things like `-optl-optl-Wl,-x -optl-optl-Wl,noexecstack` to GHC. This would naturally result in mass confusion as GHC would pass `-optl-Wl,-x` to GCC. GCC would in turn interpret this as `-o ptl-Wl,-x`, setting the output pass of the invocation. The problem that `-optl` was added to the command-line in two places in the build system. Fix this. Fixes #17385. (cherry picked from commit 2d12d59ec989d0f174f5f15e0a92cb1a9cc017e4)
* base: Add @since on GHC.IO.Handle.Lock.hUnlockBen Gamari2019-11-031-0/+2
| | | | | | | | Unfortunately this was introduced in base-4.11.0 (GHC 8.4.1) whereas the other locking primitives were added in base-4.10.0 (GHC 8.2.1). (cherry picked from commit 3ad35f766e6869087c97a5c8129ab06ddf1856d4)
* Fix #14690 - :steplocal panics after break-on-errorRoland Senn2019-11-038-1/+27
| | | | | | | | | | | | | | | | `:steplocal` enables only breakpoints in the current top-level binding. When a normal breakpoint is hit, then the module name and the break id from the `BRK_FUN` byte code allow us to access the corresponding entry in a ModBreak table. From this entry we then get the SrcSpan (see compiler/main/InteractiveEval.hs:bindLocalsAtBreakpoint). With this source-span we can then determine the current top-level binding, needed for the steplocal command. However, if we break at an exception or at an error, we don't have an BRK_FUN byte-code, so we don't have any source information. The function `bindLocalsAtBreakpoint` creates an `UnhelpfulSpan`, which doesn't allow us to determine the current top-level binding. To avoid a `panic`, we have to check for `UnhelpfulSpan` in the function `ghc/GHCi/UI.hs:stepLocalCmd`. Hence a :steplocal command after a break-on-exception or a break-on-error is not possible. (cherry picked from commit 1be9c35c940e9a1edbb44a0e7dd51b48529ffb9b)
* testsuite: Add test for #17414Ben Gamari2019-11-032-0/+20
| | | | (cherry picked from commit 1ce3d98213902ccb483d5c5f426484e0d7be0245)
* base: Clamp IO operation size to 2GB on DarwinBen Gamari2019-11-031-4/+17
| | | | | | | As reported in #17414, Darwin throws EINVAL in response to large writes. (cherry picked from commit 08810f123eb3b49bcfb3dd1d46284ec9d53d2612)
* Fix LLVM version check yet againÖmer Sinan Ağacan2019-11-034-47/+52
| | | | | | | | | | | | | | | | | There were two problems with LLVM version checking: - The parser would only parse x and x.y formatted versions. E.g. 1.2.3 would be rejected. - The version check was too strict and would reject x.y formatted versions. E.g. when we support version 7 it'd reject 7.0 ("LLVM version 7.0") and only accept 7 ("LLVM version 7"). We now parse versions with arbitrarily deep minor numbering (x.y.z.t...) and accept versions as long as the major version matches the supported version (e.g. 7.1, 7.1.2, 7.1.2.3 ...). (cherry picked from commit bf9dfe1ca32270f5e946e0f8ac1bb97184de6e4c)
* gitlab-ci: Fix URL of Windows cabal-install tarballcherry-pick-ae382245Ben Gamari2019-10-221-1/+1
| | | | (cherry picked from commit 68ddb43c44065d0d3a8a6893f7f8e87f15ee9c1e)
* rts/RtsSymbols: Drop __mingw_vsnwprintfBen Gamari2019-10-221-1/+0
| | | | | | | | As described in #16387, this is already defined by mingw and consequently defining it in the RTS as well leads to multiple definition errors from the RTS linker at runtime. (cherry picked from commit ae382245ea65bf8824db7f4dbab5ade78e6ed9dd)
* gitlab-ci: Fix URL of Darwin's cabal-install tarballBen Gamari2019-10-092-1/+2
| | | | | | | This was inadvertently referring to the cabal-install-latest/ directory which is volatile. (cherry picked from commit fc746e98d8ee7ac22224ba7d7fd1c38e16dfad30)
* Bump hsc2hs submodule to final 0.68.6 tagwip/ghc-8.8-finalizationBen Gamari2019-08-261-0/+0
|
* Restore bytestring submodule to 0.10.10.0Ben Gamari2019-08-261-0/+0
| | | | This was inadvertently reverted in 0bce423c016a02a0e384378eb729ffeb79df005b
* relnotes: Clarify reference to VKABen Gamari2019-08-261-1/+1
|
* gitlab-ci: Propagate BUILD_PROF_LIBS to make on Windowsghc-8.8.1-releaseBen Gamari2019-08-251-3/+7
| | | | Ensures that #15934 doesn't break the 32-bit Windows release build.
* Bump hsc2hs submoduleBen Gamari2019-08-251-0/+0
|
* gitlab-ci: Don't build PDF user's guide on AArch64Ben Gamari2019-08-221-0/+2
| | | | | | | For reasons I don't understand sphinx seems to fail to produce a .idx file for makeindex. (cherry picked from commit 9721b40db9b87c0135613649f9f1e129eb49795b)
* gitlab-ci: Bump Docker images revisionBen Gamari2019-08-211-1/+1
|
* SetLevels: Don't set context level when floating casesBen Gamari2019-08-211-4/+2
| | | | | | When floating a single-alternative case we previously would set the context level to the level where we were floating the case. However, this is not what FloatOut did: it rather left
* testsuite: Add cut-down test for #16978Ben Gamari2019-08-212-0/+19
|
* rts: Do not traverse nursery for dead closures in LDV profileMatthew Pickering2019-08-211-23/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | It is important that `heapCensus` and `LdvCensusForDead` traverse the same areas. `heapCensus` increases the `not_used` counter which tracks how many closures are live but haven't been used yet. `LdvCensusForDead` increases the `void_total` counter which tracks how many dead closures there are. The `LAG` is then calculated by substracting the `void_total` from `not_used` and so it is essential that `not_used >= void_total`. This fact is checked by quite a few assertions. However, if a program has low maximum residency but allocates a lot in the nursery then these assertions were failing (see #16753 and #15903) because `LdvCensusForDead` was observing dead closures from the nursery which totalled more than the `not_used`. The same closures were not counted by `heapCensus`. Therefore, it seems that the correct fix is to make `LdvCensusForDead` agree with `heapCensus` and not traverse the nursery for dead closures. Fixes #16100 #16753 #15903 #8982 (cherry picked from commit 1dc61c1ae7b80822612844d760eaebe6eb1f0ed4)
* rts: Correct assertion in LDV_recordDeadMatthew Pickering2019-08-211-1/+1
| | | | | | | It is possible that void_total is exactly equal to not_used and the other assertions for this check for <= rather than <. (cherry picked from commit a196d9c391aa488d58fb3d787637c6c0402958cb)
* rts: Correct handling of LARGE ARR_WORDS in LDV profilerMatthew Pickering2019-08-213-19/+20
| | | | | | | | | | | This implements the correct fix for #11627 by skipping over the slop (which is zeroed) rather than adding special case logic for LARGE ARR_WORDS which runs the risk of not performing a correct census by ignoring any subsequent blocks. This approach implements similar logic to that in Sanity.c (cherry picked from commit 808a87ff9be4d92d3124c7d70104f6a339880021)
* Fix erroneous float in CoreOptSimon Peyton Jones2019-08-214-3/+60
| | | | | | | | | | | | | The simple optimiser was making an invalid transformation to join points -- yikes. The fix is easy. I also added some documentation about the fact that GHC uses a slightly more restrictive version of join points than does the paper. Fix #16918 (cherry picked from commit d2e290d3280841647354ddf5ca9abdd974bce0d5)
* Minor refactoring in CoreSimplÖmer Sinan Ağacan2019-08-211-3/+0
| | | | | | | | When `join_ids` is empty `extendVarSetList existing_joins join_ids` is already no-op, so no need to check whether `join_ids` is empty or not before extending the joins set. (cherry picked from commit 897a59a5c0a08985ddccf00a4961cc2d080324e8)
* Release GHC 8.8.1Ben Gamari2019-08-211-2/+2
|
* Bump Cabal submodule to 3.0Ben Gamari2019-08-211-0/+0
|
* users-guide: Note TTGBen Gamari2019-08-211-0/+1
|
* gitlab-ci: Manually set SPHINXBUILD on WindowsBen Gamari2019-08-211-0/+1
| | | | | | | | | For some reason configure seems unable to find it on its own. Let's try giving it a hint. Addresses #16398. (cherry picked from commit 7e404afd7c923bf275093c7fa1b278d484cfdd82)