ghc.git
12 months agoTake strict fields into account in coverage checking
Ryan Scott [Mon, 27 Aug 2018 12:05:45 +0000 (14:05 +0200)] 
Take strict fields into account in coverage checking

Summary:
The current pattern-match coverage checker implements the
formalism presented in the //GADTs Meet Their Match// paper in a
fairly faithful matter. However, it was discovered recently that
there is a class of unreachable patterns that
//GADTs Meet Their Match// does not handle: unreachable code due to
strict argument types, as demonstrated in #15305. This patch
therefore goes off-script a little and implements an extension to
the formalism presented in the paper to handle this case.

Essentially, when determining if each constructor can be matched on,
GHC checks if its associated term and type constraints are
satisfiable. This patch introduces a new form of constraint,
`NonVoid(ty)`, and checks if each constructor's strict argument types
satisfy `NonVoid`. If any of them do not, then that constructor is
deemed uninhabitable, and thus cannot be matched on. For the full
story of how this works, see
`Note [Extensions to GADTs Meet Their Match]`.

Along the way, I did a little bit of much-needed refactoring. In
particular, several functions in `Check` were passing a triple of
`(ValAbs, ComplexEq, Bag EvVar)` around to represent a constructor
and its constraints. Now that we're adding yet another form of
constraint to the mix, I thought it appropriate to turn this into
a proper data type, which I call `InhabitationCandidate`.

Test Plan: make test TEST=T15305

Reviewers: simonpj, bgamari

Reviewed By: simonpj

Subscribers: rwbarton, carter

GHC Trac Issues: #15305

Differential Revision: https://phabricator.haskell.org/D5087

12 months agoFix #15502 by not casting to Int during TH conversion
Ryan Scott [Mon, 27 Aug 2018 12:02:49 +0000 (14:02 +0200)] 
Fix #15502 by not casting to Int during TH conversion

Summary:
When turning an `IntegerL` to an `IntegralLit` during TH
conversion, we were stupidly casting an `Integer` to an `Int` in
order to determine how it should be pretty-printed. Unsurprisingly,
this causes problems when the `Integer` doesn't lie within the bounds
of an `Int`, as demonstrated in #15502.

The fix is simple: don't cast to an `Int`.

Test Plan: make test TEST=T15502

Reviewers: bgamari, simonpj

Reviewed By: simonpj

Subscribers: simonpj, rwbarton, carter

GHC Trac Issues: #15502

Differential Revision: https://phabricator.haskell.org/D5089

12 months agoFix #15550 by quoting RULE names during TH conversion
Ryan Scott [Mon, 27 Aug 2018 12:02:42 +0000 (14:02 +0200)] 
Fix #15550 by quoting RULE names during TH conversion

Summary:
When converting a `RuleP` to a GHC source `RuleD` during TH
conversion, we were stupidly not double-quoting the name of the rule.
Easily fixed.

Test Plan: make test TEST=T15550

Reviewers: goldfire, bgamari, simonpj

Reviewed By: simonpj

Subscribers: simonpj, rwbarton, carter

GHC Trac Issues: #15550

Differential Revision: https://phabricator.haskell.org/D5090

12 months agoghc, ghc-pkg: use getExecutablePath on Windows when base >= 4.11.0
Tamar Christina [Sat, 11 Aug 2018 18:25:09 +0000 (19:25 +0100)] 
ghc, ghc-pkg: use getExecutablePath on Windows when base >= 4.11.0

Summary:
This completes the work started in D4227 by using just 'getExecutablePath'
in ghc and ghc-pkg when building with base >= 4.11.0.

On the long term, we will be able to simply kill the existing code that
follows (or not) symlinks and just get this behaviour for free from
getExecutable. For now we however have to require base >= 4.11.0 to be able
to just use getExecutablePath under Windows, and use the current code when
building with an older base.

Original code by @alpmestan commandeering since patch has been stale
and bug remains open.

Test Plan: Validate

Reviewers: angerman, bgamari, erikd, alpmestan

Reviewed By: bgamari

Subscribers: carter, rwbarton, thomie

GHC Trac Issues: #14483

Differential Revision: https://phabricator.haskell.org/D4229

12 months agoBetter error reporting for inaccessible code
Simon Peyton Jones [Fri, 24 Aug 2018 15:40:28 +0000 (16:40 +0100)] 
Better error reporting for inaccessible code

This patch fixes Trac #15558.  There turned out to be
two distinct problems

* In TcExpr.tc_poly_expr_nc we had

    tc_poly_expr_nc (L loc expr) res_ty
      = do { traceTc "tcPolyExprNC" (ppr res_ty)
           ; (wrap, expr')
               <- tcSkolemiseET GenSigCtxt res_ty $ \ res_ty ->
                  setSrcSpan loc $
                    -- NB: setSrcSpan *after* skolemising,
                    -- so we get better skolem locations
                  tcExpr expr res_ty

  Putting the setSrcSpan inside the tcSkolemise means that
  the location on the Implication constraint is the /call/
  to the function rather than the /argument/ to the call,
  and that is really quite wrong.

  I don't know what Richard's comment NB means -- I moved the
  setSrcSpan outside, and the "binding site" info in error
  messages actually improved.

  The reason I found this is that it affects the span reported
  for Trac #15558.

* In TcErrors.mkGivenErrorReporter we carefully munge the location
  for an insoluble Given constraint (Note [Inaccessible code]).
  But the 'implic' passed in wasn't necesarily the immediately-
  enclosing implication -- but for location-munging purposes
  it jolly well should be.

  Solution: use the innermost implication. This actually
  simplifies the code -- no need to pass an implication in to
  mkGivenErrorReporter.

12 months agoAdd comments about pretty-printing via IfaceSyn
Simon Peyton Jones [Fri, 24 Aug 2018 09:29:58 +0000 (10:29 +0100)] 
Add comments about pretty-printing via IfaceSyn

Provoked by discussion on Phab:D5097 (Trac #15546), I'm adding
a big Note explaing the strategy of pretty-printing via IfaceSyn

12 months agoComments only
Simon Peyton Jones [Fri, 24 Aug 2018 09:29:40 +0000 (10:29 +0100)] 
Comments only

12 months agoClean up TcHsSyn.zonkEnv
Simon Peyton Jones [Fri, 24 Aug 2018 07:14:15 +0000 (08:14 +0100)] 
Clean up TcHsSyn.zonkEnv

Triggered by Trac #15552, I'd been looking at ZonkEnv in TcHsSyn.

This patch does some minor refactoring

* Make ZonkEnv into a record with named fields, and use them.
  (I'm planning to add a new field, for TyCons, so this prepares
  the way.)

* Replace UnboundTyVarZonker (a higer order function) with the
  simpler and more self-descriptive ZonkFlexi data type, below.
 It's just much more perspicuous and direct, and (I suspect)
 a tiny bit faster too -- no unknown function calls.

data ZonkFlexi   -- See Note [Un-unified unification variables]
  = DefaultFlexi    -- Default unbound unificaiton variables to Any
  | SkolemiseFlexi  -- Skolemise unbound unification variables
                    -- See Note [Zonking the LHS of a RULE]
  | RuntimeUnkFlexi -- Used in the GHCi debugger

There was one knock-on effect in the GHCi debugger -- the
RuntimeUnkFlexi case.  Somehow previously, these RuntimeUnk
variables were sometimes getting SystemNames (and hence
printed as 'a0', 'a1', etc) and sometimes not (and hence
printed as 'a', 'b' etc).  I'm not sure precisely why, but
the new behaviour seems more uniform, so I just accepted the
(small) renaming wibbles in some ghci.debugger tests.

I had a quick look at perf: any changes are tiny.

12 months agoUpdate unicode tables to v. 12 of the standard
Artem Pelenitsyn [Tue, 21 Aug 2018 23:33:35 +0000 (19:33 -0400)] 
Update unicode tables to v. 12 of the standard

Reviewers: hvr, bgamari, Azel

Reviewed By: bgamari

Subscribers: thomie, Azel, rwbarton, carter

GHC Trac Issues: #5518, #15525

Differential Revision: https://phabricator.haskell.org/D5066

12 months agodocs: Add changelog and release notes entry for traceBinaryEvent#
Ben Gamari [Tue, 21 Aug 2018 23:08:12 +0000 (19:08 -0400)] 
docs: Add changelog and release notes entry for traceBinaryEvent#

12 months agoTcSimplify: Condense MASSERT2() usage onto a single line
Ben Gamari [Fri, 24 Aug 2018 02:39:06 +0000 (22:39 -0400)] 
TcSimplify: Condense MASSERT2() usage onto a single line

Sadly macOS's C preprocessor gets angry at the sight of multi-line macro
invocations.

12 months agoAccommodate API change in transSuperClasses
Simon Peyton Jones [Thu, 23 Aug 2018 08:22:42 +0000 (09:22 +0100)] 
Accommodate API change in transSuperClasses

In this patch

    commit 6eabb6ddb7c53784792ee26b1e0657bde7eee7fb
    Author: Simon Peyton Jones <simonpj@microsoft.com>
    Date:   Tue Dec 15 14:26:13 2015 +0000

    Allow recursive (undecidable) superclasses

I changed (transSuperClasses p) to return only the
superclasses of p, but not p itself. (Previously it always
returned p as well.)

The use of transSuperClasses in TcErrors.warnRedundantConstraints
really needs 'p' in the result -- but I faild to fix this
call site, and instead crippled the test for Trac #10100.

This patch sets things right

* Accomodates the API change
* Re-enables T10100
* And thereby fixes Trac #11474

12 months agoComments only
Simon Peyton Jones [Wed, 22 Aug 2018 09:04:08 +0000 (10:04 +0100)] 
Comments only

12 months agoFix a typo in TcValidity.checkFamInstRhs
Simon Peyton Jones [Wed, 22 Aug 2018 09:00:20 +0000 (10:00 +0100)] 
Fix a typo in TcValidity.checkFamInstRhs

In error message generation we were using the wrong
type constructor in inst_head.  Result: the type became
ill-kinded, and that sent the compiler into a loop.

A separate patch fixes the loop. This patch fixes the
actual bug -- Trac #15473.

I also improved the "occurs more often" error message
a bit.  But it's still pretty terrible:

    * Variable ‘a’ occurs more often
      in the type family application ‘Undefined’
      than in the instance head ‘LetInterleave xs t ts is y z’

It looks like nonsense, but all becomes clear if you use
-fprint-explicit-kinds.  Really we should fix this by spotting
when invisible arguments are involved and at least suggesting
-fprint-explicit-kinds.

12 months agoTurn infinite loop into a panic
Simon Peyton Jones [Wed, 22 Aug 2018 08:51:26 +0000 (09:51 +0100)] 
Turn infinite loop into a panic

In these two functions
  * TcIface.toIfaceAppTyArgsX
  * Type.piResultTys
we take a type application (f t1 .. tn) and try to find
its kind. It turned out that, if (f t1 .. tn) was ill-kinded
the function would go into an infinite loop.

That's not good: it caused the loop in Trac #15473.

This patch doesn't fix the bug in #15473, but it does turn the
loop into a decent panic, which is a step forward.

12 months agoRevert "driver: unconditionally disable relaxation when linking partially"
Ryan Scott [Wed, 22 Aug 2018 13:19:42 +0000 (09:19 -0400)] 
Revert "driver: unconditionally disable relaxation when linking partially"

This reverts commit 1cc9061fce4270739677d475190fd6e890e8b1f9.

This appears to break a clean build with certain versions of
`ld.gold`. See
https://phabricator.haskell.org/rGHC1cc9061fce42#132967.

13 months agoRevert "Properly tag fun field of PAPs generated by ap_0_fast"
Ömer Sinan Ağacan [Wed, 22 Aug 2018 05:52:50 +0000 (08:52 +0300)] 
Revert "Properly tag fun field of PAPs generated by ap_0_fast"

This reverts commit 2693eb11f55f2001701c90c24183e21c794a8be1.

This patch isn't ready yet, see D5051.

13 months agoAdd traceBinaryEvent# primop
Mitsutoshi Aoe [Tue, 21 Aug 2018 20:08:17 +0000 (16:08 -0400)] 
Add traceBinaryEvent# primop

This adds a new primop called traceBinaryEvent# that takes the length
of binary data and a pointer to the data, then emits it to the eventlog.

There is some example code that uses this primop and the new event:

* [traceBinaryEventIO][1] that calls `traceBinaryEvent#`

* [A patch to ghc-events][2] that parses the new `EVENT_USER_BINARY_MSG`

There's no corresponding issue on Trac but it was discussed at
ghc-devs [3].

[1] https://github.com/maoe/ghc-trace-events/blob
    /fb226011ef1f85a97b4da7cc9d5f98f9fe6316ae/src/Debug/Trace/Binary.hs#L29)
[2] https://github.com/maoe/ghc-events/commit
    /239ca77c24d18cdd10d6d85a0aef98e4a7c56ae6)
[3] https://mail.haskell.org/pipermail/ghc-devs/2018-May/015791.html

Reviewers: bgamari, erikd, simonmar

Reviewed By: bgamari

Subscribers: rwbarton, thomie, carter

Differential Revision: https://phabricator.haskell.org/D5007

13 months agodocs: "state transformer" -> "state monad" / "ST" (whichever is meant)
Artem Pelenitsyn [Tue, 21 Aug 2018 20:07:39 +0000 (16:07 -0400)] 
docs: "state transformer" -> "state monad" / "ST" (whichever is meant)

FIxes #15189.

Reviewers: hvr, bgamari, simonmar, simonpj

Reviewed By: simonpj

Subscribers: simonpj, rwbarton, thomie, carter

GHC Trac Issues: #15189

Differential Revision: https://phabricator.haskell.org/D5019

13 months agoFix precision of asinh/acosh/atanh by making them primops
Artem Pelenitsyn [Tue, 21 Aug 2018 20:07:24 +0000 (16:07 -0400)] 
Fix precision of asinh/acosh/atanh by making them primops

Reviewers: hvr, bgamari, simonmar, jrtc27

Reviewed By: bgamari

Subscribers: alpmestan, rwbarton, thomie, carter

Differential Revision: https://phabricator.haskell.org/D5034

13 months agoCorrect limb length and assertion for gcdExtInteger
DavidEichamnn [Tue, 21 Aug 2018 20:06:45 +0000 (16:06 -0400)] 
Correct limb length and assertion for gcdExtInteger

Reviewers: hvr, bgamari, monoidal

Reviewed By: monoidal

Subscribers: monoidal, rwbarton, thomie, carter

GHC Trac Issues: #15350

Differential Revision: https://phabricator.haskell.org/D5042

13 months agoProperly tag fun field of PAPs generated by ap_0_fast
Ömer Sinan Ağacan [Tue, 21 Aug 2018 20:06:29 +0000 (16:06 -0400)] 
Properly tag fun field of PAPs generated by ap_0_fast

Currently ap_0_fast doesn't maintain the invariant for PAP fun fields
which says if the closure can be tagged, it should be. This is checked
by `Sanity.c:checkPAP` and correctly implemented by `genautoapply`.

This causes sanity check failures when we have a profiling code like

    f = {-# SCC scc #-} g

where g is a PAP or a FUN, and `scc` is different than the current cost
centre.

Test Plan: Slow validate (not done yet)

Reviewers: simonmar, bgamari, erikd

Reviewed By: simonmar

Subscribers: rwbarton, carter

GHC Trac Issues: #15508

Differential Revision: https://phabricator.haskell.org/D5051

13 months agorts: Align the_gc_thread to 64 bytes
Ben Gamari [Tue, 21 Aug 2018 20:06:12 +0000 (16:06 -0400)] 
rts: Align the_gc_thread to 64 bytes

In a previous attempt (c6cc93bca69abc258513af8cf2370b14e70fd8fb) I had
tried aligning to 8 bytes under the assumption that the problem was that
the_gc_thread, a StgWord8[], wasn't being aligned to 8-bytes as the
gc_thread struct would expect. However, we actually need even stronger
alignment due to the alignment attribute attached to gen_workspace,
which claims it should be aligned to a 64-byte boundary.

This fixes #15482.

Reviewers: erikd, simonmar

Reviewed By: simonmar

Subscribers: rwbarton, carter

GHC Trac Issues: #15482

Differential Revision: https://phabricator.haskell.org/D5052

13 months agoShow -with-rtsopts options in runtime's --info (#15261)
roland [Tue, 21 Aug 2018 20:05:45 +0000 (16:05 -0400)] 
Show -with-rtsopts options in runtime's --info (#15261)

Add an additional line to the output of +RTS --info.  It shows the value
of the flag -with-rtsopts provided at compile/link time.

Test Plan: make test TESTS="T15261a T15261b"

Reviewers: hvr, erikd, dfeuer, thomie, austin, bgamari, simonmar, osa1,
monoidal

Reviewed By: osa1, monoidal

Subscribers: osa1, rwbarton, carter

GHC Trac Issues: #15261

Differential Revision: https://phabricator.haskell.org/D5053

13 months agoFix ambiguous/out-of-scope Haddock identifiers
Alec Theriault [Tue, 21 Aug 2018 20:05:16 +0000 (16:05 -0400)] 
Fix ambiguous/out-of-scope Haddock identifiers

This drastically cuts down on the number of Haddock warnings when making
docs for `base`.  Plus this means more actual links end up in the docs!
Also fixed other small mostly markup issues in the documentation along
the way.

This is a docs-only change.

Reviewers: hvr, bgamari, thomie

Reviewed By: thomie

Subscribers: thomie, rwbarton, carter

Differential Revision: https://phabricator.haskell.org/D5055

13 months agobase: Mark `findIndices` as INLINABLE instead of INLINE (fixes #15426)
Kevin Buhr [Tue, 21 Aug 2018 20:04:59 +0000 (16:04 -0400)] 
base: Mark `findIndices` as INLINABLE instead of INLINE (fixes #15426)

If `findIndices` is marked INLINE in `Data.OldList`, then the unfolded
versions of `elemIndex` and `findIndex` included in the interface file
are unfusible (even though `findIndices` itself remains fusible).  By
marking it INLINABLE instead, elemIndex` and `findIndex` will fuse
properly.

Test Plan: make TEST=T15426

Reviewers: hvr, bgamari

Reviewed By: bgamari

Subscribers: rwbarton, carter

GHC Trac Issues: #15426

Differential Revision: https://phabricator.haskell.org/D5063

13 months agorts/RetainerProfile: Dump closure type if pop() fails
Ryan Scott [Tue, 21 Aug 2018 20:04:45 +0000 (16:04 -0400)] 
rts/RetainerProfile: Dump closure type if pop() fails

While investigating #15529, I noticed that the `barf`ed
error message in `pop()` doesn't print out the closure type that
causes it to crash. Let's do so.

Reviewers: bgamari, erikd, simonmar

Reviewed By: bgamari

Subscribers: rwbarton, carter

GHC Trac Issues: #15529

Differential Revision: https://phabricator.haskell.org/D5072

13 months agoExplicitly tell 'getNameToInstances' mods to load
Alec Theriault [Tue, 21 Aug 2018 20:03:40 +0000 (16:03 -0400)] 
Explicitly tell 'getNameToInstances' mods to load

Calculating which modules to load based on the InteractiveContext means
maintaining a potentially very large GblRdrEnv.

In Haddock's case, it is much cheaper (from a memory perspective) to
just keep track of which modules interfaces we want loaded then hand
these off explicitly to 'getNameToInstancesIndex'.

Bumps haddock submodule.

Reviewers: alexbiehl, bgamari

Reviewed By: alexbiehl

Subscribers: rwbarton, thomie, carter

Differential Revision: https://phabricator.haskell.org/D5003

13 months agotestsuite: Deduplicate source in wcompat-warnings test
Ben Gamari [Tue, 21 Aug 2018 16:48:34 +0000 (12:48 -0400)] 
testsuite: Deduplicate source in wcompat-warnings test

13 months agoSimplify callSiteInline a little
Simon Peyton Jones [Fri, 4 May 2018 14:47:31 +0000 (15:47 +0100)] 
Simplify callSiteInline a little

This patch has virtually no effect on anything (according to a
nofib run).  But it simplifies the definition of interesting_call
by being a bit less gung-ho about inlining nested function
bindings.  See Note [Nested functions]

-----------------------------------------------------------------------
        Program           Size    Allocs   Runtime   Elapsed  TotalMem
-----------------------------------------------------------------------
           anna          +0.2%     -0.0%     0.163     0.163      0.0%
   binary-trees          +0.1%     +0.0%     -4.5%     -4.5%      0.0%
      cacheprof          -0.1%     +0.1%     -4.7%     -4.8%     +2.7%
          fasta          +0.2%      0.0%     +2.6%     +3.0%      0.0%
          fluid          -0.0%     -0.6%     0.011     0.011      0.0%
         gamteb          -0.1%     -0.0%     0.069     0.070      0.0%
            hpg          +0.1%     +0.0%     +0.7%     +0.7%      0.0%
          infer          +0.3%     +0.2%     0.097     0.098      0.0%
         lambda          -0.1%     -0.0%     +2.0%     +2.0%      0.0%
         n-body          +0.1%     -0.1%     -0.1%     -0.1%      0.0%
         simple          -0.2%     -0.2%     +0.6%     +0.6%      0.0%
  spectral-norm          +0.1%     -0.0%     -0.1%     -0.1%      0.0%
            tak          -0.0%     -0.1%     0.024     0.024      0.0%
--------------------------------------------------------------------------------
            Min          -0.4%     -0.6%     -5.3%     -5.3%      0.0%
            Max          +0.3%     +0.2%     +3.3%     +3.3%    +15.0%
 Geometric Mean          -0.0%     -0.0%     -0.3%     -0.3%     +0.2%

(cherry picked from commit 33de71fa06d03e6da396a7c0a314fea3b492ab91)

(This reverts the previous reversion in commit
9dbf66d74e65309d02c9d700094e363f59c94096)

13 months agoIntroduce flag -keep-hscpp-files
roland [Tue, 21 Aug 2018 16:18:26 +0000 (12:18 -0400)] 
Introduce flag -keep-hscpp-files

Test Plan: `make test=T10869`

Reviewers: mpickering, thomie, ezyang, bgamari

Reviewed By: thomie, bgamari

Subscribers: rwbarton, carter

GHC Trac Issues: #10869

Differential Revision: https://phabricator.haskell.org/D4861

13 months agofunction-section: enable on windows
Tamar Christina [Tue, 21 Aug 2018 16:13:06 +0000 (12:13 -0400)] 
function-section: enable on windows

gc-sections was onced observed to be slow on Windows, which is the only
reason it's not enabled yet.  However, it seems to be better now.

Test Plan: ./validate

Reviewers: bgamari

Reviewed By: bgamari

Subscribers: rwbarton, thomie, carter

GHC Trac Issues: #15051

Differential Revision: https://phabricator.haskell.org/D4916

13 months agoReplace most occurences of foldl with foldl'.
klebinger.andreas@gmx.at [Tue, 21 Aug 2018 16:10:38 +0000 (12:10 -0400)] 
Replace most occurences of foldl with foldl'.

This patch adds foldl' to GhcPrelude and changes must occurences
of foldl to foldl'. This leads to better performance especially
for quick builds where GHC does not perform strictness analysis.

It does change strictness behaviour when we use foldl' to turn
a argument list into function applications. But this is only a
drawback if code looks ONLY at the last argument but not at the first.
And as the benchmarks show leads to fewer allocations in practice
at O2.

Compiler performance for Nofib:

O2 Allocations:
        -1 s.d.                -----            -0.0%
        +1 s.d.                -----            -0.0%
        Average                -----            -0.0%

O2 Compile Time:
        -1 s.d.                -----            -2.8%
        +1 s.d.                -----            +1.3%
        Average                -----            -0.8%

O0 Allocations:
        -1 s.d.                -----            -0.2%
        +1 s.d.                -----            -0.1%
        Average                -----            -0.2%

Test Plan: ci

Reviewers: goldfire, bgamari, simonmar, tdammers, monoidal

Reviewed By: bgamari, monoidal

Subscribers: tdammers, rwbarton, thomie, carter

Differential Revision: https://phabricator.haskell.org/D4929

13 months agoFix #line pragmas in nested comments
Ben Sklaroff [Tue, 21 Aug 2018 16:03:24 +0000 (12:03 -0400)] 
Fix #line pragmas in nested comments

When parsing a nested comment or nested doc comment in the lexer, if we
see a line starting with '#' we attempt to parse a #line pragma. This
fixes how ghc handles output of the C preproccesor (-cpp flag) when the
original source has C comments or pragmas inside haskell comments.

Updates haddock submodule.

Test Plan: ./validate

Reviewers: bgamari

Reviewed By: bgamari

Subscribers: rwbarton, thomie, carter

GHC Trac Issues: #314

Differential Revision: https://phabricator.haskell.org/D4934

13 months agoFix redundant imports of Class
Ben Gamari [Tue, 21 Aug 2018 21:18:14 +0000 (17:18 -0400)] 
Fix redundant imports of Class

13 months agodriver: unconditionally disable relaxation when linking partially
Sergei Trofimovich [Tue, 21 Aug 2018 19:08:42 +0000 (20:08 +0100)] 
driver: unconditionally disable relaxation when linking partially

In https://github.com/gentoo-haskell/gentoo-haskell/issues/704
user explicitly uses -Wl,--relax for most built binaries.

Most of the time this works fine except for capi haskell code
similar to the following:

```haskell
{-# LANGUAGE CApiFFI #-}
module Z where

import Foreign.C

foreign import capi "unistd.h close" c_close :: CInt -> IO CInt
```

In this case compilation fails as:

```
$ inplace/bin/ghc-stage2 -c Z.hs -optl-Wl,--relax -fforce-recomp
ld: --relax and -r may not be used together
```

GHC's driver already disables relaxation on sparc as there relaxation
is already a default mode.

This change disables relaxation on partial linking for all platforms
where linker is binutils linker.

Reported-by: wmyrda
Bug: https://github.com/gentoo-haskell/gentoo-haskell/issues/704
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Test Plan: pass -optl-Wl,--relax in test above

Reviewers: bgamari

Reviewed By: bgamari

Subscribers: rwbarton, thomie, carter

Differential Revision: https://phabricator.haskell.org/D4888

13 months agoAdd a solveEqualities to tcClassDecl1
Simon Peyton Jones [Tue, 21 Aug 2018 14:57:56 +0000 (15:57 +0100)] 
Add a solveEqualities to tcClassDecl1

Trac #15505 showed that, when we have a type error, we
could have an unfilled-in coercion hole.  We don't want an
assertion error in that case.

The underlying cause is that tcClassDecl1 should call
solveEqualities to fully solve all top-level equalities
(or fail in the attempt).

I also refactored the ClassDecl case for tcTyClDecl1 into
a new function tcClassDecl1.  That makes it symmetrical
with the others.

13 months agoComments only
Simon Peyton Jones [Mon, 20 Aug 2018 08:50:31 +0000 (09:50 +0100)] 
Comments only

13 months agoImprove ambiguous-occurrence error message
Simon Peyton Jones [Mon, 20 Aug 2018 09:01:16 +0000 (10:01 +0100)] 
Improve ambiguous-occurrence error message

Trac #15487 correctly reported that the qualification
of a Name in an ambiguous-occurrence error message was
wrong.  This patch fixes it.

It's easily done, in RnUtils.addNameClashErrRn

The problem was that in complaining about M.x we must
enusre that 'M' part is the same as that used in
pprNameProvenance.

13 months agoSet strictness correctly for JoinIds
Simon Peyton Jones [Tue, 21 Aug 2018 08:56:39 +0000 (09:56 +0100)] 
Set strictness correctly for JoinIds

We were failing to keep correct strictness info when eta-expanding
join points; Trac #15517.   The situation was something like

  \q v eta ->
     let j x = error "blah
         -- STR Lx   bottoming!
     in case y of
           A -> j x eta
           B -> blah
           C -> j x eta

So we spot j as a join point and eta-expand it.  But we must
also adjust the stricness info, else it vlaimes to bottom after
one arg is applied but now it has become two.

I fixed this in two places:

 - In CoreOpt.joinPointBinding_maybe, adjust strictness info

 - In SimplUtils.tryEtaExpandRhs, return consistent values
   for arity and bottom-ness

13 months agoExpose the StableName constructor
David Feuer [Tue, 21 Aug 2018 00:08:14 +0000 (20:08 -0400)] 
Expose the StableName constructor

* Move the definition of `StableName` from `System.Mem.StableName`
  to a new `GHC.StableName` module.

* Expose the `StableName` data constructor from `GHC.StableName`.
  Once we have `UnliftedArray#`, this will enable `StableName`s to
  be stored in `UnliftedArray`s (from `primitive`) without unsafe
  coercions.

Reviewers: hvr, bgamari, andrewthad, osa1

Reviewed By: osa1

Subscribers: osa1, rwbarton, carter

GHC Trac Issues: #15535

Differential Revision: https://phabricator.haskell.org/D5078

13 months agoBump stm submodule
Ben Gamari [Mon, 20 Aug 2018 19:07:12 +0000 (15:07 -0400)] 
Bump stm submodule

13 months agoUpdate .mailmap [skip ci]
Thomas Miedema [Fri, 17 Aug 2018 20:25:05 +0000 (22:25 +0200)] 
Update .mailmap [skip ci]

13 months agoInitialise cec_suppress properly
Simon Peyton Jones [Mon, 20 Aug 2018 14:54:14 +0000 (15:54 +0100)] 
Initialise cec_suppress properly

In TcErrors, cec_suppress is used to suppress low-priority
errors in favour of truly insoluble ones.

But I was failing to initialise it correcly at top level, which
resulted in Trac #15539.  Easy to fix.

A few regression tests have fewer errors reported, but that seems to
be an improvement.

13 months agoCSE should deal with letrec (#9441)
roland [Sat, 18 Aug 2018 21:45:31 +0000 (23:45 +0200)] 
CSE should deal with letrec (#9441)

Summary: Write tests with fewer lines. See comments of nomeata in
https://phabricator.haskell.org/D5038.

Test Plan: make test TESTS='T9441a T9441b T9441c'

Reviewers: nomeata, dfeuer, bgamari

Reviewed By: nomeata

Subscribers: rwbarton, carter

GHC Trac Issues: #9441

Differential Revision: https://phabricator.haskell.org/D5076

13 months agoAdd test cases for Ticket #12146.
Aditya [Sat, 9 Jul 2016 06:11:25 +0000 (11:41 +0530)] 
Add test cases for Ticket #12146.

Two tests - a ghci script and a compile fail test have been added.

13 months agoAdd comment explaining change in syntax error suggestion for #12146.
Aditya [Sat, 9 Jul 2016 06:08:38 +0000 (11:38 +0530)] 
Add comment explaining change in syntax error suggestion for #12146.

13 months agoMake ghci work for stage1 and Hadrian
Neil Mitchell [Thu, 9 Aug 2018 12:47:20 +0000 (13:47 +0100)] 
Make ghci work for stage1 and Hadrian

This allows you to use the ghc-in-ghci script in Make even if you
haven't built stage2, and also with Hadrian.  Because of the way -I
works, it will prefer Make/stage2.

13 months agobase: Rewrite semigroup documentation
Tobias Pflug [Fri, 3 Aug 2018 20:52:37 +0000 (22:52 +0200)] 
base: Rewrite semigroup documentation

13 months agobase: rewrite Monoid module docs
Tobias Pflug [Wed, 8 Aug 2018 21:21:02 +0000 (23:21 +0200)] 
base: rewrite Monoid module docs

13 months agoBe mindful of GADT tyvar order when desugaring record updates
Ryan Scott [Fri, 17 Aug 2018 14:31:27 +0000 (16:31 +0200)] 
Be mindful of GADT tyvar order when desugaring record updates

Summary:
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

13 months agoDocument default value of +RTS -N in user's guide
Ömer Sinan Ağacan [Fri, 17 Aug 2018 07:56:28 +0000 (10:56 +0300)] 
Document default value of +RTS -N in user's guide

Summary: (This is documented in `+RTS -?` but wasn't documented in the user's guide)

Reviewers: simonmar, bgamari, monoidal

Reviewed By: monoidal

Subscribers: rwbarton, carter

Differential Revision: https://phabricator.haskell.org/D5065

13 months agoRename SigTv to TyVarTv (#15480)
Joachim Breitner [Fri, 17 Aug 2018 00:16:44 +0000 (17:16 -0700)] 
Rename SigTv to TyVarTv (#15480)

because since #15050, these are no longer used in pattern SIGnatures,
but still in other places where meta-variables should only be unified
with TYpe VARiables.

I also found mentions of `SigTv` in parts of the renamer and desugarer
that do not seem to directly relate to `SigTv` as used in the type
checker, but rather to uses of `forall a.` in type signatures. I renamed
these to `ScopedTv`.

Differential Revision: https://phabricator.haskell.org/D5074

13 months agoFix #15527 by pretty-printing an RdrName prefixly
Ryan Scott [Thu, 16 Aug 2018 09:53:33 +0000 (11:53 +0200)] 
Fix #15527 by pretty-printing an RdrName prefixly

Summary:
When `(.) @Int` is used without enabling `TypeApplications`,
the resulting error message will pretty-print the (symbolic)
`RdrName` `(.)`. However, it does so without parenthesizing it, which
causes the pretty-printed expression to appear as `.@Int`. Yuck.

Since the expression in a type application will always be prefix,
we can fix this issue by using `pprPrefixOcc` instead of plain ol'
`ppr`.

Test Plan: make test TEST=T15527

Reviewers: bgamari, monoidal, simonpj

Reviewed By: monoidal, simonpj

Subscribers: rwbarton, carter

GHC Trac Issues: #15527

Differential Revision: https://phabricator.haskell.org/D5071

13 months agoprimops: Drop documentation for WORD_SIZE_IN_BITS < 32
Chai T. Rex [Wed, 15 Aug 2018 20:37:55 +0000 (16:37 -0400)] 
primops: Drop documentation for WORD_SIZE_IN_BITS < 32

Removes documentation suggesting that 30 and 31-bit code generation is supported
(in support of https://github.com/ghc/ghc/commit/290889927244c79479c4347dfa6c851a134dd6e0).

13 months agoCosmetics in GraphColor
Krzysztof Gogolewski [Wed, 15 Aug 2018 16:20:36 +0000 (18:20 +0200)] 
Cosmetics in GraphColor

This allows to run ghc-in-ghci when :set -XTypeApplications is in
.ghciconfig.

13 months agoAdd a test for Trac #15523
Krzysztof Gogolewski [Wed, 15 Aug 2018 14:49:32 +0000 (16:49 +0200)] 
Add a test for Trac #15523

Summary: Fortunately the bug is not present in master.

Test Plan: make test TEST=T15523

Reviewers: bgamari, RyanGlScott

Reviewed By: RyanGlScott

Subscribers: RyanGlScott, rwbarton, carter

GHC Trac Issues: #15523

Differential Revision: https://phabricator.haskell.org/D5070

13 months agoprimops: Drop support for WORD_SIZE_IN_BITS < 32
Ben Gamari [Wed, 15 Aug 2018 14:49:26 +0000 (16:49 +0200)] 
primops: Drop support for WORD_SIZE_IN_BITS < 32

Summary: Fixes #15486.

Test Plan: Validate

Reviewers: monoidal

Reviewed By: monoidal

Subscribers: rwbarton, carter

GHC Trac Issues: #15486

Differential Revision: https://phabricator.haskell.org/D5050

13 months agoProperly designate LambdaCase alts as CaseAlt in TH
Ryan Scott [Tue, 14 Aug 2018 20:35:23 +0000 (22:35 +0200)] 
Properly designate LambdaCase alts as CaseAlt in TH

Summary:
When `\case` expressions are parsed normally, their
alternatives are marked as `CaseAlt` (which means that they are
pretty-printed without a `\` character in front of them, unlike for
lambda expressions). However, `\case` expressions created by way of
Template Haskell (in `Convert`) inconsistently designated the case
alternatives as `LambdaExpr`, causing them to be pretty-printed
poorly (as shown in #15518). The fix is simple: use `CaseAlt`
consistently.

Test Plan: make test TEST=T15518

Reviewers: goldfire, bgamari

Subscribers: rwbarton, carter

GHC Trac Issues: #15518

Differential Revision: https://phabricator.haskell.org/D5069

13 months agoBump parsec submodule
Ben Gamari [Sat, 11 Aug 2018 16:00:44 +0000 (12:00 -0400)] 
Bump parsec submodule

13 months agoSuppress redundant givens during error reporting
Ryan Scott [Sun, 12 Aug 2018 15:27:27 +0000 (17:27 +0200)] 
Suppress redundant givens during error reporting

Summary:
When GHC reports that it cannot solve a constraint in error
messages, it often reports what given constraints it has in scope.
Unfortunately, sometimes redundant constraints (like `* ~ *`, from
#15361) can sneak in. The fix is simple: blast away these redundant
constraints using `mkMinimalBySCs`.

Test Plan: make test TEST=T15361

Reviewers: simonpj, bgamari

Subscribers: rwbarton, thomie, carter

GHC Trac Issues: #15361

Differential Revision: https://phabricator.haskell.org/D5002

13 months agoCheck if files are same in combineSrcSpans
Zubin Duggal [Sun, 12 Aug 2018 13:51:29 +0000 (15:51 +0200)] 
Check if files are same in combineSrcSpans

Summary: If this is not checked, SrcSpans are sometimes mangled by CPP.

Test Plan: ./validate

Reviewers: bgamari, dfeuer

Reviewed By: bgamari

Subscribers: dfeuer, rwbarton, thomie, carter

GHC Trac Issues: #15279

Differential Revision: https://phabricator.haskell.org/D4866

13 months ago--show-iface: Qualify all non-local names
Simon Jakobi [Sun, 12 Aug 2018 09:10:39 +0000 (11:10 +0200)] 
--show-iface: Qualify all non-local names

Summary:
In order to disambiguate names from different modules, qualify all names
that don't originate in the current module.

Also update docs for QueryQualifyName

Test Plan: validate

Reviewers: simonpj, bgamari

Reviewed By: simonpj

Subscribers: rwbarton, thomie, carter, tdammers

GHC Trac Issues: #15269

Differential Revision: https://phabricator.haskell.org/D4852

13 months agouse *test instead of *slowtest for llvm validation on Circle CI
Alp Mestanogullari [Sun, 12 Aug 2018 08:54:30 +0000 (10:54 +0200)] 
use *test instead of *slowtest for llvm validation on Circle CI

Summary:
Since the LLVM backend is slow enough that *slowtest can't run
in the allocated time on Circle CI, let's just use *test. If that still
doesn't fit in the allocated 5 hours, we can try running just the
compiler tests.

Test Plan: Circle CI validation for LLVM

Reviewers: bgamari

Reviewed By: bgamari

Subscribers: rwbarton, thomie, carter

Differential Revision: https://phabricator.haskell.org/D5033

13 months agoCSE should deal with letrec
roland [Sun, 12 Aug 2018 08:24:29 +0000 (10:24 +0200)] 
CSE should deal with letrec

Summary: Add testcase for  #9441

Test Plan: make test TESTS="T9441a T9441b T9441c"

Reviewers: dfeuer, simonpj, thomie, austin, bgamari

Reviewed By: dfeuer

Subscribers: rwbarton, carter

GHC Trac Issues: #9441

Differential Revision: https://phabricator.haskell.org/D5038

13 months agoSimplify testsuite driver, part 2
Krzysztof Gogolewski [Sun, 12 Aug 2018 08:09:41 +0000 (10:09 +0200)] 
Simplify testsuite driver, part 2

Summary:
- Avoid import *; this helps tools such as pyflakes.
The last occurrence in runtests.py is not easy to remove
as it's used by .T files.
- Use False/True instead of 0/1.

Test Plan: validate

Reviewers: bgamari, thomie, simonmar

Reviewed By: thomie

Subscribers: rwbarton, carter

Differential Revision: https://phabricator.haskell.org/D5062

13 months agoSimplify testsuite driver
Krzysztof Gogolewski [Sat, 11 Aug 2018 19:04:04 +0000 (21:04 +0200)] 
Simplify testsuite driver

Summary:
- remove clean_cmd
- framework_failures was undefined
- times_file was not used
- if_verbose_dump was called only when verbose >= 1; remove the check
- simplify normalise_whitespace

Test Plan: validate

Reviewers: bgamari, thomie

Reviewed By: thomie

Subscribers: rwbarton, carter

Differential Revision: https://phabricator.haskell.org/D5061

13 months agoFilter plugin dylib locations
Christiaan Baaij [Sat, 11 Aug 2018 16:56:34 +0000 (18:56 +0200)] 
Filter plugin dylib locations

Summary:
Previously we just created a cartesian product of the library
paths of the plugin package and the libraries of the package.
Of course, some of these combinations result in a filepath of
a file doesn't exists, leading to #15475.

Instead of making `haskFile` return Nothing in case a file
doesn't exist (which would hide errors), we look at all the
possible dylib locations and ensure that at least one of those
locations is an existing file. If the list turns out to be
empty however, we panic.

Reviewers: mpickering, bgamari

Reviewed By: mpickering

Subscribers: monoidal, rwbarton, carter

GHC Trac Issues: #15475

Differential Revision: https://phabricator.haskell.org/D5048

13 months agotestsuite: Bump for unix 2.7
Ben Gamari [Thu, 9 Aug 2018 16:30:43 +0000 (12:30 -0400)] 
testsuite: Bump for unix 2.7

13 months agoBump unix submodule
Ben Gamari [Thu, 9 Aug 2018 15:28:04 +0000 (11:28 -0400)] 
Bump unix submodule

13 months agobase: improve Functor documentation
Tobias Pflug [Fri, 3 Aug 2018 19:17:51 +0000 (21:17 +0200)] 
base: improve Functor documentation

- Rewrite module documentation
- Rewrite class documentation

13 months agoAdd FreeBSD amd64 LLVM target
Viktor Dukhovni [Thu, 9 Aug 2018 05:47:02 +0000 (01:47 -0400)] 
Add FreeBSD amd64 LLVM target

13 months agocircleci: Reduce compression effort to 3
Ben Gamari [Wed, 8 Aug 2018 22:45:53 +0000 (18:45 -0400)] 
circleci: Reduce compression effort to 3

13 months agocircleci: Reduce build verbosity
Ben Gamari [Wed, 8 Aug 2018 19:53:42 +0000 (15:53 -0400)] 
circleci: Reduce build verbosity

13 months agocircleci: Fix documentation building
Ben Gamari [Fri, 3 Aug 2018 20:48:18 +0000 (16:48 -0400)] 
circleci: Fix documentation building

13 months agoRevert "rts: Ensure that the_gc_thread is aligned"
Ben Gamari [Wed, 8 Aug 2018 23:02:03 +0000 (19:02 -0400)] 
Revert "rts: Ensure that the_gc_thread is aligned"

This caused segmentation faults on Darwin.

This reverts commit c6cc93bca69abc258513af8cf2370b14e70fd8fb.

13 months agoAllow arbitrary options to be passed to tar compression
Ben Gamari [Wed, 8 Aug 2018 20:08:02 +0000 (16:08 -0400)] 
Allow arbitrary options to be passed to tar compression

13 months agoYet another Cabal submodule bump
Ben Gamari [Tue, 7 Aug 2018 19:59:22 +0000 (15:59 -0400)] 
Yet another Cabal submodule bump

13 months agotestsuite: Add (broken) test for #15473
Ben Gamari [Tue, 7 Aug 2018 17:59:31 +0000 (13:59 -0400)] 
testsuite: Add (broken) test for #15473

13 months agoBump Cabal submodule
Ben Gamari [Tue, 7 Aug 2018 17:37:13 +0000 (13:37 -0400)] 
Bump Cabal submodule

13 months agoTurn on MonadFail desugaring by default
Herbert Valerio Riedel [Mon, 6 Aug 2018 16:53:06 +0000 (12:53 -0400)] 
Turn on MonadFail desugaring by default

Summary:
This contains two commits:

----

Make GHC's code-base compatible w/ `MonadFail`

There were a couple of use-sites which implicitly used pattern-matches
in `do`-notation even though the underlying `Monad` didn't explicitly
support `fail`

This refactoring turns those use-sites into explicit case
discrimations and adds an `MonadFail` instance for `UniqSM`
(`UniqSM` was the worst offender so this has been postponed for a
follow-up refactoring)

---

Turn on MonadFail desugaring by default

This finally implements the phase scheduled for GHC 8.6 according to

https://prime.haskell.org/wiki/Libraries/Proposals/MonadFail#Transitionalstrategy

This also preserves some tests that assumed MonadFail desugaring to be
active; all ghc boot libs were already made compatible with this
`MonadFail` long ago, so no changes were needed there.

Test Plan: Locally performed ./validate --fast

Reviewers: bgamari, simonmar, jrtc27, RyanGlScott

Reviewed By: bgamari

Subscribers: bgamari, RyanGlScott, rwbarton, thomie, carter

Differential Revision: https://phabricator.haskell.org/D5028

13 months agousers-guide: Enlarge title underlines in 8.8 release notes
Ben Gamari [Mon, 6 Aug 2018 22:54:06 +0000 (18:54 -0400)] 
users-guide: Enlarge title underlines in 8.8 release notes

Somehow the level-2 headings were all missing a tilde, causing Sphinx to complain.

13 months agoBump binary submodule to 0.8.6.0
Ben Gamari [Mon, 6 Aug 2018 22:39:35 +0000 (18:39 -0400)] 
Bump binary submodule to 0.8.6.0

This is actually a decrease in the version number since a bump to 0.10
wasn't actually necessary.

13 months agoSupport typechecking of type literals in backpack
Piyush P Kurur [Mon, 6 Aug 2018 22:37:56 +0000 (18:37 -0400)] 
Support typechecking of type literals in backpack

Backpack is unable to type check signatures that expect a data which
is a type level literal. This was reported in issue #15138. These
commits are a fix for this. It also includes a minimal test case that
was mentioned in the issue.

Reviewers: bgamari, ezyang, goldfire

Reviewed By: bgamari, ezyang

Subscribers: simonpj, ezyang, rwbarton, thomie, carter

GHC Trac Issues: #15138

Differential Revision: https://phabricator.haskell.org/D4951

13 months agofix timeout related i686 validation issues
Alp Mestanogullari [Mon, 6 Aug 2018 21:53:29 +0000 (17:53 -0400)] 
fix timeout related i686 validation issues

As can be seen on https://circleci.com/gh/ghc/ghc/7578, some
tests are failing on i686 due to too restrictive timeouts. This patch
tweaks those in the hope of solving the 4 failures from that URL due to
timeouts.

Test Plan: ./validate on i686

Reviewers: bgamari

Reviewed By: bgamari

Subscribers: rwbarton, thomie, carter

Differential Revision: https://phabricator.haskell.org/D5031

13 months ago[docs] Add missed specialisations warnings to list of those not enabled by -Wall
Maximilian Tagher [Sat, 28 Jul 2018 21:04:16 +0000 (14:04 -0700)] 
[docs] Add missed specialisations warnings to list of those not enabled by -Wall

Enabling `-Weverything` does enable those warnings.

(cherry picked from commit b062bd10a88ea407ae91610f822f0c352909bcce)

13 months agoUnhide GHC.List for haddock
Simon Jakobi [Thu, 19 Jul 2018 12:35:15 +0000 (14:35 +0200)] 
Unhide GHC.List for haddock

The unhidden module GHC.OldList recommends using GHC.List instead.
In consequence we should also have haddocks for GHC.List.

(cherry picked from commit e3df129c8bf4c35693d01ea66238882f3e3b6fe1)

13 months agodocs: Fix wrong module name in hsig example
Mathieu Boespflug [Sat, 21 Jul 2018 11:48:33 +0000 (13:48 +0200)] 
docs: Fix wrong module name in hsig example

In the module signatures section, two modules were defined, `Str` and
`A`, but `A` was importing `Text`, not `Str`.

(cherry picked from commit 26ab3635ca342c88310321d7f310f1c12c23ec4c)

13 months agoAdd since annotation to GHC.ByteOrder
Alexander Biehl [Sun, 5 Aug 2018 10:29:51 +0000 (12:29 +0200)] 
Add since annotation to GHC.ByteOrder

(cherry picked from commit 6fb2620dbc420c976dc9da90b0efc6eae533ebff)

13 months agorts: Ensure that the_gc_thread is aligned
Ben Gamari [Mon, 6 Aug 2018 18:52:59 +0000 (14:52 -0400)] 
rts: Ensure that the_gc_thread is aligned

Since we cast this to a gc_thread the compiler may assume that it's aligned.
Make sure that this is so. Fixes #15482.

13 months agoImprove error message for flags with missing required arguments (#12625)
roland [Mon, 6 Aug 2018 16:50:38 +0000 (12:50 -0400)] 
Improve error message for flags with missing required arguments (#12625)

Test Plan: make TEST=T12625

Reviewers: jstolarek, austin, bgamari

Reviewed By: bgamari

Subscribers: rwbarton, thomie, carter

GHC Trac Issues: #12625

Differential Revision: https://phabricator.haskell.org/D5030

13 months agoStop the linker panic
Moritz Angermann [Mon, 6 Aug 2018 16:46:26 +0000 (12:46 -0400)] 
Stop the linker panic

If we fail to initialize the liker properly, we still set the
`initLinkerDone`. In fact we even set that prior to actually
initializing the linker. However if the linker initialization fails, we
the `Done` state is still true. As such we run into the `Dynamic Linker
not initialised` error. Which while technically corret is confusing as
it pulls the attation away from the real issue.

This change puts the Done state into an MVar, and as such ensureing
that all parallel access needs to wait for the linker to be actually
initialized, or try to re-initilize if it fails.

Reviewers: bgamari, RyanGlScott, simonmar, hvr

Reviewed By: bgamari

Subscribers: rwbarton, thomie, carter

GHC Trac Issues: #9868, #10355, #13137, #13607, #13531

Differential Revision: https://phabricator.haskell.org/D5012

13 months agoTestsuite driver: fix encoding issue when calling ghc-pkg
Krzysztof Gogolewski [Mon, 6 Aug 2018 19:38:52 +0000 (21:38 +0200)] 
Testsuite driver: fix encoding issue when calling ghc-pkg

Summary:
In Python 3, subprocess.communicate() returns a pair of bytes, which
need to be decoded. In runtests.py, we were just calling str() instead,
which converts b'x' to "b'x'". As a result, the loop that was checking
pkginfo for lines starting with 'library-dirs' couldn't work.

Reviewers: bgamari, thomie, Phyx

Reviewed By: thomie

Subscribers: Phyx, rwbarton, carter

Differential Revision: https://phabricator.haskell.org/D5046

13 months agoStrip ../ from testdir (fixes #15469)
Thomas Miedema [Mon, 6 Aug 2018 17:48:39 +0000 (19:48 +0200)] 
Strip ../ from testdir (fixes #15469)

Test Plan: Harbormaster

Reviewers: bgamari

Reviewed By: bgamari

Subscribers: rwbarton, carter

GHC Trac Issues: #15469

Differential Revision: https://phabricator.haskell.org/D5039

13 months agoUse -fobject-code in the GHCi script for loading GHC
Michael Sloan [Mon, 6 Aug 2018 17:19:47 +0000 (19:19 +0200)] 
Use -fobject-code in the GHCi script for loading GHC

Summary:
My very last commit to D4904 removed -fobject-code.  I should have tested this
more thoroughly, because it is required to do a fresh ghci load, as some code
uses unboxed tuples.

One of my motivations for doing this was that if you run the script without
passing -odir / -hidir, it would pollute the source tree with .hi and .o files.
This also appeared to break subsequent builds. I've made it much less likely
that this will happen by instead specifying -odir and -hidir within the ghci
script rather than on the commandline.

I plan to open a separate diff which adds a test that these scripts work.

Until this patch is merged, the workaround is to do `./utils/ghc-in-ghci/run.sh -fobject-code`

Reviewers: bgamari, alpmestan, monoidal

Reviewed By: alpmestan, monoidal

Subscribers: alpmestan, rwbarton, thomie, carter

Differential Revision: https://phabricator.haskell.org/D5015

13 months agoMention #15050 in the release notes for 8.8.1
Joachim Breitner [Mon, 6 Aug 2018 13:58:27 +0000 (09:58 -0400)] 
Mention #15050 in the release notes for 8.8.1

13 months agoMove 8.8.1-notes.rst to the right directory
Ryan Scott [Mon, 6 Aug 2018 12:03:18 +0000 (08:03 -0400)] 
Move 8.8.1-notes.rst to the right directory

Somehow, this escaped my notice before.

13 months agoCreate 8.8.1 release notes
Ryan Scott [Mon, 6 Aug 2018 11:49:37 +0000 (07:49 -0400)] 
Create 8.8.1 release notes

Summary:
I have some pending commits which will debut in GHC 8.8.1,
but we don't yet have release notes for this. This adds them, and
deletes the stale 8.4.1 and 8.4.2 release notes.

Test Plan: Read it

Reviewers: bgamari

Reviewed By: bgamari

Subscribers: rwbarton, thomie, carter

Differential Revision: https://phabricator.haskell.org/D5025

13 months agoAllow scoped type variables refer to types
Joachim Breitner [Mon, 6 Aug 2018 00:56:21 +0000 (20:56 -0400)] 
Allow scoped type variables refer to types

This patch implements GHC proposal 29:
(sorry, URL is too long for the commit message linter)
and fixess #15050.

The change is simple: Just use a different meta variable form.

Test suite and documentation updated.

Differential Revision: https://phabricator.haskell.org/D4980

13 months agocircleci: Don't build validate-x86_64-linux-debug unregisterised
Ben Gamari [Sun, 5 Aug 2018 20:27:21 +0000 (22:27 +0200)] 
circleci: Don't build validate-x86_64-linux-debug unregisterised

Summary: This was a cut-and-paste error.

Reviewers: alpmestan

Reviewed By: alpmestan

Subscribers: alpmestan, rwbarton, thomie, carter

GHC Trac Issues: #15466

Differential Revision: https://phabricator.haskell.org/D5037