ghc.git
19 months agoSet RELEASE=YES ghc-8.2.2-release
Ben Gamari [Mon, 20 Nov 2017 13:01:45 +0000 (08:01 -0500)] 
Set RELEASE=YES

19 months agoghc-prim: Bump and update changelog
Ben Gamari [Mon, 20 Nov 2017 19:14:49 +0000 (14:14 -0500)] 
ghc-prim: Bump and update changelog

After some last-minute reflection I concluded it would be best that we
advertised the strictness change with a patch-level version bump, even
if it is strictly a bug-fix.

19 months agousers-guide: Move :shortdesc:s to mkUserGuidePart
Ben Gamari [Mon, 20 Nov 2017 14:31:44 +0000 (09:31 -0500)] 
users-guide: Move :shortdesc:s to mkUserGuidePart

19 months agobase: Bump and write changelog
Ben Gamari [Mon, 20 Nov 2017 13:01:21 +0000 (08:01 -0500)] 
base: Bump and write changelog

19 months agoWrite release notes for 8.2.2
Ben Gamari [Mon, 20 Nov 2017 13:01:04 +0000 (08:01 -0500)] 
Write release notes for 8.2.2

19 months agoBump Cabal submodule
Ben Gamari [Thu, 16 Nov 2017 22:31:21 +0000 (17:31 -0500)] 
Bump Cabal submodule

20 months agoDynFlags: Introduce -show-mods-loaded flag ghc-8.2.2-rc3
Ben Gamari [Mon, 6 Nov 2017 20:35:19 +0000 (15:35 -0500)] 
DynFlags: Introduce -show-mods-loaded flag

This flag reintroduces the verbose module name output produced by GHCi's
:load command behind a new flag, -show-mods-loaded. This was originally
removed in D3651 but apparently some tools (e.g. haskell-mode) rely on
this output.

Addresses #14427.

Test Plan: Validate

Reviewers: svenpanne

Reviewed By: svenpanne

Subscribers: rwbarton, thomie

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

(cherry picked from commit 8613e61de62178e76cd0f8915bd1fbe9c200a039)

20 months agoAdd a missing zonk in TcDerivInfer.simplifyDeriv
Simon Peyton Jones [Wed, 11 Oct 2017 15:17:41 +0000 (16:17 +0100)] 
Add a missing zonk in TcDerivInfer.simplifyDeriv

I'm astonished that anything worked without this!

Fixes Trac #14339

(cherry picked from commit 13fdca3d174ff15ac347c5db78370f457a3013ee)

20 months agoBump Cabal submodule ghc-8.2.2-rc2
Ben Gamari [Mon, 6 Nov 2017 18:37:19 +0000 (13:37 -0500)] 
Bump Cabal submodule

20 months agotestsuite: Bump metrics of T9203
Ben Gamari [Mon, 30 Oct 2017 22:10:18 +0000 (18:10 -0400)] 
testsuite: Bump metrics of T9203

20 months agoFix an exponential-blowup case in SpecConstr
Simon Peyton Jones [Thu, 26 Oct 2017 16:24:52 +0000 (17:24 +0100)] 
Fix an exponential-blowup case in SpecConstr

Trac #14379 showed a case where use of "forcing" to do
"damn the torpedos" specialisation without resource limits
(which 'vector' does a lot) led to exponential blowup.

The fix is easy.  Finding it wasn't.  See Note [Forcing
specialisation] and the one-line change in decreaseSpecCount.

(cherry picked from commit 7d7d94fb4876dc7e58263abc9dd65921e09cddac)

20 months agobase: Implement file locking in terms of POSIX locks
Ben Gamari [Mon, 30 Oct 2017 00:46:21 +0000 (20:46 -0400)] 
base: Implement file locking in terms of POSIX locks

Hopefully these are more robust to NFS malfunction than BSD flock-style
locks.  See #13945.

Test Plan: Validate via @simonpj

Reviewers: austin, hvr

Subscribers: rwbarton, thomie, erikd, simonpj

GHC Trac Issues: #13945

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

(cherry picked from commit 3b784d440d4b01b4c549df7c9a3ed2058edfc780)

20 months agoDeal with JoinIds before void types
Simon Peyton Jones [Fri, 10 Mar 2017 11:12:12 +0000 (11:12 +0000)] 
Deal with JoinIds before void types

Trac #13394, comment:4 showed up another place where we were testing
for the representation of of a type; and it turned out to be a JoinId
which can be rep-polymorphic.

Just putting the test in the right places solves this easily.

(cherry picked from commit bc0f3abd0914808e33f84229818ab90842611bdd)

20 months agoBump Cabal submodule
Ben Gamari [Thu, 26 Oct 2017 20:19:41 +0000 (16:19 -0400)] 
Bump Cabal submodule

20 months agoFix over-eager error suppression in TcErrors
Simon Peyton Jones [Thu, 5 Oct 2017 16:40:28 +0000 (17:40 +0100)] 
Fix over-eager error suppression in TcErrors

See Note [Given insolubles] in TcRnTypes

Fixes Trac #14325.

(cherry picked from commit c81f66ccafdb4c6c7a09cfaf6819c8797c518491)

20 months agobase: Make Foreign.Marshal.Alloc.allocBytes[Aligned] NOINLINE
Ben Gamari [Tue, 24 Oct 2017 16:19:08 +0000 (12:19 -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.

20 months agorts/posix: Ensure that memory commit succeeds
Ben Gamari [Mon, 16 Oct 2017 21:30:12 +0000 (17:30 -0400)] 
rts/posix: Ensure that memory commit succeeds

Previously we wouldn't check that mmap would succeed. I suspect this may
have been the cause of #14329.

Test Plan: Validate under low-memory condition

Reviewers: simonmar, austin, erikd

Reviewed By: simonmar

Subscribers: rwbarton, thomie

GHC Trac Issues: #14329

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

(cherry picked from commit a69fa5441c944d7f74c76bdae9f3dd198007ee42)

21 months agoFix panic for `ByteArray#` arguments in CApiFFI foreign imports
Herbert Valerio Riedel [Mon, 16 Oct 2017 17:02:01 +0000 (19:02 +0200)] 
Fix panic for `ByteArray#` arguments in CApiFFI foreign imports

Declarations such as

  foreign import capi  unsafe "string.h strlen"
      c_strlen_capi :: ByteArray# -> IO CSize

  foreign import capi  unsafe "string.h memset"
      c_memset_capi :: MutableByteArray# s -> CInt -> CSize -> IO ()

would cause GHC to panic because the CApiFFI c-wrapper generator didn't
know what C type to use for `(Mutable)ByteArray#` types (unlike the
`ccall` codepath).

This addresses #9274

Reviewed By: bgamari

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

(cherry picked from commit add85cc2a3ec0bda810dca2a35264308ffaab069)

21 months agoEnable testing 'Natural' type in TEST=arith011
Herbert Valerio Riedel [Sat, 14 Oct 2017 18:37:47 +0000 (20:37 +0200)] 
Enable testing 'Natural' type in TEST=arith011

This now passes thanks to 5984a698fc2974b719365a9647a7cae1bed51eec (re #13203)

(cherry picked from commit 843772b86b62df686a9e57648fa9d3ed06b13973)

21 months agoOverride default `clearBit` method impl for `Natural`
Herbert Valerio Riedel [Mon, 16 Oct 2017 20:12:03 +0000 (22:12 +0200)] 
Override default `clearBit` method impl for `Natural`

The default implementation of `clearBit` is in terms of
`complement`. However, `complement` is not well-defined
for `Natural` and this consequently renders the default
implementation of `clearBit` dysfunctional.

This implements `clearBit` in terms of `testBit`
and `setBit` which are both well-defined for `Natural`s.

This addresses #13203

(cherry picked from commit 5984a698fc2974b719365a9647a7cae1bed51eec)

21 months agoDo not quantify over deriving clauses
Simon Peyton Jones [Thu, 12 Oct 2017 08:25:25 +0000 (09:25 +0100)] 
Do not quantify over deriving clauses

Trac #14331 showed that in a data type decl like

   data D = D deriving (C (a :: k))

we were quantifying D over the 'k' in the deriving clause.  Yikes.

Easily fixed, by deleting code in RnTypes.extractDataDefnKindVars

See the discussion on the ticket, esp comment:8.

(cherry picked from commit 82b77ec375ab74678ac2afecf55dc574fa24490f)

21 months agoFix nasty bug in w/w for absence analysis
Simon Peyton Jones [Mon, 2 Oct 2017 14:25:02 +0000 (15:25 +0100)] 
Fix nasty bug in w/w for absence analysis

This dark corner was exposed by Trac #14285.  It involves the
interaction between absence analysis and INLINABLE pragmas.

There is a full explanation in Note [aBSENT_ERROR_ID] in MkCore,
which you can read there.  The changes in this patch are

* Make exprIsHNF return True for absentError, treating
  absentError like an honorary data constructor.

* Make absentError /not/ be diverging, unlike other error Ids.

This is all a bit horrible.

* While doing this I found that exprOkForSpeculation didn't
  have a case for value lambdas so I added one.  It's not
  really called on lifted types much, but it seems like the
  right thing

(cherry picked from commit dbbee1bacef1a8accc630908c31cf267a3cb98a9)

21 months agoPackageDb: Explicitly unlock package database before closing
Ben Gamari [Tue, 29 Aug 2017 18:45:28 +0000 (14:45 -0400)] 
PackageDb: Explicitly unlock package database before closing

Reviewers: austin

Subscribers: rwbarton, thomie

GHC Trac Issues: #13945

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

(cherry picked from commit 779b9e6965416ee08af6eb15354cf09e9f40e0d9)

21 months agoghc-pkg: Try opening lockfiles in read-write mode first
Ben Gamari [Tue, 29 Aug 2017 18:26:55 +0000 (14:26 -0400)] 
ghc-pkg: Try opening lockfiles in read-write mode first

As pointed out in #13945, some filesystems only allow allow exclusive
locks if the fd being locked was opened for write access. This causes
ghc-pkg to fail as it first attempts to open and exclusively lock its
lockfile in read-only mode to accomodate package databases for which we
lack write permissions (e.g.  global package databases).

Instead, we now try read-write mode first, falling back to read-only
mode if this fails.

Reviewers: austin

Subscribers: rwbarton, thomie

GHC Trac Issues: #13945

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

(cherry picked from commit f86de44dac0a6ca40c5fcd65f3a1944c45fa6011)

21 months agoFix bug in the short-cut solver
Simon Peyton Jones [Mon, 2 Oct 2017 14:58:46 +0000 (15:58 +0100)] 
Fix bug in the short-cut solver

Trac #13943 showed that the relatively-new short-cut solver
for class constraints (aka -fsolve-constant-dicts) was wrong.
In particular, see "Type families" under Note [Shortcut solving]
in TcInteract.

The short-cut solver recursively solves sub-goals, but it doesn't
flatten type-family applications, and as a result it erroneously
thought that C (F a) cannot possibly match (C 0), which is
simply untrue.  That led to an inifinte loop in the short-cut
solver.

The significant change is the one line

+                 , all isTyFamFree preds  -- See "Type families" in
+                                          -- Note [Shortcut solving]

but, as ever, I do some other refactoring.  (E.g. I changed the
name of the function to shortCutSolver rather than the more
generic trySolveFromInstance.)

I also made the short-cut solver respect the solver-depth limit,
so that if this happens again it won't just produce an infinite
loop.

A bit of other refactoring, notably moving isTyFamFree
from TcValidity to TcType

(cherry picked from commit a8fde1831f4b99885b8ed444f9cd7dffd9252150)

21 months agoInclude libraries which fill holes as deps when linking.
Edward Z. Yang [Tue, 3 Oct 2017 19:08:24 +0000 (15:08 -0400)] 
Include libraries which fill holes as deps when linking.

Fixes the issue reported at https://github.com/haskell/cabal/issues/4755
and fixes #14304 in the GHC tracker.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: validate

Reviewers: bgamari, austin, goldfire

Reviewed By: bgamari

Subscribers: rwbarton, thomie

GHC Trac Issues: #14304

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

(cherry picked from commit f3f624aeb1360c1f902930b3cc62346d2e5201c0)

21 months agouser-guide: fix examples of ghci commands
Takenobu Tani [Thu, 17 Aug 2017 14:28:01 +0000 (10:28 -0400)] 
user-guide: fix examples of ghci commands

Fix examples of ghci commands:
  * correct typos
  * add top-level binding without let statement
  * modify Time.getClockTime to Data.Time.getZonedTime
  * modify Directory.setCurrentDirectory
  * modify ghc version number

Test Plan: build

Reviewers: austin, bgamari

Reviewed By: bgamari

Subscribers: rwbarton, thomie

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

(cherry picked from commit 3385669683b8bc150c6df3cb43320dfc6f80fcd9)

21 months agouser-guide: add `:type +d` and `:type +v` in release highlight
Takenobu Tani [Thu, 17 Aug 2017 14:29:43 +0000 (10:29 -0400)] 
user-guide: add `:type +d` and `:type +v` in release highlight

Add new ghci command to release highlight and fix link anchor.

This commit is for ghc-8.2 branch.

Test Plan: build

Reviewers: austin, bgamari

Reviewed By: bgamari

Subscribers: rwbarton, thomie

GHC Trac Issues: #11975

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

(cherry picked from commit 82ee71fa85aca087b2cd62cb354fc3df46db4411)

21 months agoModel divergence of retry# as ThrowsExn, not Diverges
Ben Gamari [Wed, 13 Sep 2017 16:22:27 +0000 (12:22 -0400)] 
Model divergence of retry# as ThrowsExn, not Diverges

The demand signature of the retry# primop previously had a Diverges
result.  However, this caused the demand analyser to conclude that a
program of the shape,

    catchRetry# (... >> retry#)

would diverge. Of course, this is plainly wrong; catchRetry#'s sole
reason to exist is to "catch" the "exception" thrown by retry#. While
catchRetry#'s demand signature correctly had the ExnStr flag set on its
first argument, indicating that it should catch divergence, the logic
associated with this flag doesn't apply to Diverges results. This
resulted in #14171.

The solution here is to treat the divergence of retry# as an exception.
Namely, give it a result type of ThrowsExn rather than Diverges.

Updates stm submodule for tests.

Test Plan: Validate with T14171

Reviewers: simonpj, austin

Subscribers: rwbarton, thomie

GHC Trac Issues: #14171, #8091

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

(cherry picked from commit 10a1a4781c646f81ca9e2ef7a2585df2cbe3a014)

21 months ago[RTS] Make -po work
Bartosz Nitka [Thu, 14 Sep 2017 09:50:05 +0000 (02:50 -0700)] 
[RTS] Make -po work

db2a667655506c43dd3c8260d29031bde55f1bee added `-po` option, but
the part that parses it was missing.

Test Plan:
On a simple file:
```
./inplace/bin/ghc-stage2 A.hs -prof -main-is A; ./A +RTS -P -potest
```
produced test.prof file and didn't produce A.prof file.

```
./A +RTS -P
```
produced A.prof file

Reviewers: simonmar, bgamari, austin, erikd

Reviewed By: bgamari

Subscribers: rwbarton, thomie

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

(cherry picked from commit b6b56dd1b6adc9051593955eecaef85c9d6e96b8)

21 months agouser-guide: Fix :since: annotation of -pie and add documentation for -fPIE
Ben Gamari [Mon, 2 Oct 2017 22:02:40 +0000 (18:02 -0400)] 
user-guide: Fix :since: annotation of -pie and add documentation for -fPIE

[skip ci]

(cherry picked from commit d5e60de307874432f42aa7fea2460e6901c057e1)

21 months agoAdd support for producing position-independent executables
Ben Gamari [Tue, 22 Aug 2017 15:41:47 +0000 (11:41 -0400)] 
Add support for producing position-independent executables

Previously due to #12759 we disabled PIE support entirely. However, this
breaks the user's ability to produce PIEs. Add an explicit flag, -fPIE,
allowing the user to build PIEs.

Test Plan: Validate

Reviewers: rwbarton, austin, simonmar

Subscribers: trommler, simonmar, trofi, jrtc27, thomie

GHC Trac Issues: #12759, #13702

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

(cherry-picked from commit 3625728a0e3a9b56c2b85ae7ea8bcabdd83ece6a)

21 months agouser-guide: Mention COMPLETE pragma in release notes
Ben Gamari [Mon, 2 Oct 2017 14:59:13 +0000 (10:59 -0400)] 
user-guide: Mention COMPLETE pragma in release notes

21 months agoRevert "Fix #11963 by checking for more mixed type/kinds"
Ben Gamari [Mon, 2 Oct 2017 14:13:42 +0000 (10:13 -0400)] 
Revert "Fix #11963 by checking for more mixed type/kinds"

This reverts commit 18dee8912f6afdcf13073d3d95d85513c14180e3.

It causes a few Hackage programs to be rejected, which we want to avoid
for a point release.

21 months agoUse libpthread instead of libthr on FreeBSD
Ben Gamari [Mon, 24 Jul 2017 23:02:56 +0000 (19:02 -0400)] 
Use libpthread instead of libthr on FreeBSD

Since #847 we have used libthr due to reported hangs with FreeBSD's
KSE-based M:N pthread implementation. However, this was nearly 12 years
ago and today libpthread seems to work fine. Moreover, adding -lthr to
the linker flags break when used in conjunction with -r when gold is
used (since -l and -r are incompatible although BFD ld doesn't
complain).

Test Plan: Validate on FreeBSD

Reviewers: kgardas, austin

Subscribers: rwbarton, thomie

GHC Trac Issues: #847

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

(cherry picked from commit d8051c6cf08f02331f98fed7d5e88a95bd76e534)

21 months agoconfigure: Make sure we try all possible linkers
Ben Gamari [Wed, 27 Sep 2017 19:30:18 +0000 (15:30 -0400)] 
configure: Make sure we try all possible linkers

Previously if we had both ld.lld and ld.gold installed but a gcc which
didn't support -fuse-ld=lld we would fail when trying ld.lld and fall
immediately back to plain ld. Now we will try ld.gold as well. This was
brought to light by #14280, where using ld.bfd resulted in a broken
stage2 compiler.

Test Plan: Configure

Reviewers: angerman, hvr, austin

Reviewed By: angerman

Subscribers: rwbarton, thomie, erikd

GHC Trac Issues: #14280

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

(cherry picked from commit a10729f028d7175980d9f65e22c9bb9a933461c2)

21 months agoincludes/rts: Drop trailing comma ghc-8.2.2-rc1
Ben Gamari [Fri, 8 Sep 2017 02:49:22 +0000 (22:49 -0400)] 
includes/rts: Drop trailing comma

This trailing comma snuck in in a recent patch. There is nothing wrong with the
comma; it's perfectly valid C99, yet nevertheless Mac OS X's dtrace utility
chokes on it with,

    dtrace: failed to compile script rts/RtsProbes.d:
            "includes/rts/EventLogFormat.h", line 245: syntax error near "}"
    make[1]: *** [rts/dist/build/RtsProbes.h] Error 1

(cherry picked from commit be514a694f2cddbb1b23af971430364a223eb894)

21 months agomkDataConRep: fix bug in strictness signature (#14290)
Simon Marlow [Thu, 28 Sep 2017 17:08:45 +0000 (13:08 -0400)] 
mkDataConRep: fix bug in strictness signature (#14290)

The strictness signature for a data con wrapper wasn't including any
dictionary arguments, which meant that bangs on the fields of a
constructor with an existential context would be moved to the wrong
fields.  See T14290 for an example.

Test Plan:
* New test T14290
* validate

Reviewers: simonpj, niteria, austin, bgamari, erikd

Reviewed By: simonpj, bgamari

Subscribers: rwbarton, thomie

GHC Trac Issues: #14290

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

(cherry picked from commit 5935acdb1302263011c2023d5e7f4ec496c972c0)

21 months agodesugar: Catch levity polymorphism in unboxed sum expressions
Ben Gamari [Tue, 26 Sep 2017 18:52:26 +0000 (14:52 -0400)] 
desugar: Catch levity polymorphism in unboxed sum expressions

Fixes #13929.

(cherry picked from commit 018c40fb1bb27853d0cefa5b90a44ce13e91a856)

21 months agotestsuite: Add unboxed sum to T13929
Ben Gamari [Tue, 19 Sep 2017 23:09:58 +0000 (19:09 -0400)] 
testsuite: Add unboxed sum to T13929

Test Plan: Validate

Reviewers: austin

Subscribers: rwbarton, thomie

GHC Trac Issues: #13929

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

(cherry picked from commit d86b237d612bf6ca1faa61ff1130ad9144e32a52)

21 months agoFix #13929 by adding another levity polymorphism check
Richard Eisenberg [Wed, 16 Aug 2017 15:35:26 +0000 (11:35 -0400)] 
Fix #13929 by adding another levity polymorphism check

test case: typecheck/should_fail/T13929

(cherry picked from commit fa626f3b1c1140a1f10bba60fdde10f767863f70)

21 months agoRelease console for ghci wrapper
Tamar Christina [Tue, 26 Sep 2017 18:43:15 +0000 (19:43 +0100)] 
Release console for ghci wrapper

Summary:
It seems the call that caused issues with the gcc wrapper before
was needed for the ghci wrapper in order for the child process
to be the one handling console events.

This code slightly refactors the wrappers to make sure only ghci
calls FreeConsole and nothing else.

Test Plan: ./validate , open ghci.exe press ctrl+c

Reviewers: RyanGlScott, austin, hvr, bgamari

Reviewed By: bgamari

Subscribers: rwbarton, thomie, erikd

GHC Trac Issues: #14150

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

(cherry picked from commit 3ec579d5d13dd00af58380a34daa2d57f0b9aa9e)

21 months agoFix "Glasgow Haskell Compiler <release> Users Guide"
Bartosz Nitka [Mon, 17 Apr 2017 16:49:34 +0000 (12:49 -0400)] 
Fix "Glasgow Haskell Compiler <release> Users Guide"

If you go to
https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/index.html
the window title has `<release>` in it.  I don't understand how it all
works, but inspired by the line below which produces a correct string in
the docs I just blindly changed it in the same way.  Cabal appears to
have the same problem.

Test Plan:
it'd be nice if I could check the result
on harbormaster, can I?

Reviewers: thomie, bgamari, austin

Reviewed By: bgamari

Subscribers: rwbarton, simonmar

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

21 months agoFix unused-given-constraint bug
Simon Peyton Jones [Tue, 19 Sep 2017 11:37:13 +0000 (12:37 +0100)] 
Fix unused-given-constraint bug

This bug was shown up by Trac #14237.  It turned out
to be an outright error in TcSimplify.neededEvVars,
easily fixed.

I improved the comments.

(cherry picked from commit 1db0f4a48e9db5e85782e32f074cc83bbc145cb7)

21 months agoDeal with large extra-contraints wildcards
Simon Peyton Jones [Thu, 21 Sep 2017 16:35:11 +0000 (17:35 +0100)] 
Deal with large extra-contraints wildcards

For reasons explained in TcHsType
Note [Extra-constraint holes in partial type signatures],
if we had
  f :: (_) => blahs
and the '_' was filled in by more than a 62-tuple of contraints,
GHC crashed.

The same Note explains the hacky solution I have adopted to
evade this.  Maybe there is some better way, but I couldn't
see one that didn't involve a great deal of work. And the problem
is a very narrow one!  If the hack bites us we'll need to think
again.

(cherry picked from commit 3c74a51232813eb733b27c43c94ce005112a0ddb)

21 months agoDocument Typeable's treatment of kind polymorphic tycons
Ben Gamari [Mon, 25 Sep 2017 22:33:06 +0000 (18:33 -0400)] 
Document Typeable's treatment of kind polymorphic tycons

Test Plan: Read it

Reviewers: dfeuer, goldfire, austin, hvr

Reviewed By: dfeuer

Subscribers: rwbarton, thomie

GHC Trac Issues: #14199

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

(cherry picked from commit 6de1a5a96cdaba080570e9f47ff8711796e2e83b)

21 months agoBump Cabal submodule
Ben Gamari [Tue, 26 Sep 2017 14:11:12 +0000 (10:11 -0400)] 
Bump Cabal submodule

21 months agoRevert "Improve error messages around kind mismatches."
Ben Gamari [Tue, 19 Sep 2017 21:14:25 +0000 (17:14 -0400)] 
Revert "Improve error messages around kind mismatches."

This reverts commit eb870ae0e9d3943268263e6f9ef1c844cdd4cdc5.
This reverts commit 6a024a55fa5deefaa45bc2abee9efa63d290266d.

There was some disagreement in #11198 regarding whether this patch was
in fact the right solution to the issue at hand.

21 months agoOption "-ddump-rn-ast" dumps imports and exports too
Alan Zimmerman [Wed, 13 Sep 2017 12:02:42 +0000 (14:02 +0200)] 
Option "-ddump-rn-ast" dumps imports and exports too

Summary:
Previously the renamed source decls only were dumped, now the imports, exports
and doc_hdr are too.

Test Plan: ./validate

Reviewers: bgamari, austin

Reviewed By: bgamari

Subscribers: rwbarton, thomie

GHC Trac Issues: #14197

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

(cherry picked from commit 2fe6f6baba70de071c391bccc77197ab4f81064d)

21 months agoSetLevels: Substitute in ticks in lvlMFE
Ben Gamari [Mon, 4 Sep 2017 12:05:33 +0000 (08:05 -0400)] 
SetLevels: Substitute in ticks in lvlMFE

Previously SetLevels.lvlMFE would fail to substitute in ticks, unlike
lvlExpr.  This lead to #13481. Fix this.

Test Plan: `make test TEST=T12622 WAY=ghci`

Reviewers: austin, simonpj

Reviewed By: simonpj

Subscribers: simonpj, rwbarton, thomie

GHC Trac Issues: #13481

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

(cherry picked from commit cd857dd415378ac4204a164407d350b0c3ede5ae)

21 months agorts: Add heap breakdown type for -hT
Ben Gamari [Mon, 4 Sep 2017 12:15:08 +0000 (08:15 -0400)] 
rts: Add heap breakdown type for -hT

Test Plan: Build, program with `-eventlog`, try running with `+RTS -h`

Reviewers: austin, erikd, simonmar

Subscribers: rwbarton, thomie

GHC Trac Issues: #14096

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

(cherry picked from commit 24e50f988f775c6bba7d1daaee2e23c13650aa3b)

21 months agoeventlog: Clean up profiling heap breakdown type
Ben Gamari [Mon, 4 Sep 2017 12:14:38 +0000 (08:14 -0400)] 
eventlog: Clean up profiling heap breakdown type

Reviewers: austin, erikd, simonmar

Subscribers: rwbarton, thomie

GHC Trac Issues: #14096

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

(cherry picked from commit 822abbb1b4300ebaa3f12014b9fc477261283143)

21 months agoDeal with unbreakable blocks in Applicative Do
David Feuer [Fri, 8 Sep 2017 03:56:35 +0000 (23:56 -0400)] 
Deal with unbreakable blocks in Applicative Do

The renamer wasn't able to deal with more than a couple strict
patterns in a row with `ApplicativeDo` when using the heuristic
splitter. Update it to work with them properly.

Reviewers: simonmar, austin, bgamari, hvr

Reviewed By: simonmar

Subscribers: RyanGlScott, lippling, rwbarton, thomie

GHC Trac Issues: #14163

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

(cherry picked from commit 011e15aa2d6949fc56126f1028ea25d5497196d9)

21 months agoBetter document TypeRep patterns
Ben Gamari [Wed, 13 Sep 2017 16:23:47 +0000 (12:23 -0400)] 
Better document TypeRep patterns

As pointed out in #14199 these are rather non-trivial; extra
documentation is in order.

[skip ci]

Test Plan: Read it

Reviewers: dfeuer, austin, hvr

Subscribers: rwbarton, thomie

GHC Trac Issues: #14199

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

(cherry picked from commit f9bf621caf2fc17d829dee0ee48b204144927e72)

21 months agoReally fix Trac #14158
Simon Peyton Jones [Wed, 30 Aug 2017 15:19:37 +0000 (16:19 +0100)] 
Really fix Trac #14158

I dug more into how #14158 started working. I temporarily reverted the
patch that "fixed" it, namely

    commit a6c448b403dbe8720178ca82100f34baedb1f47e
    Author: Simon Peyton Jones <simonpj@microsoft.com>
    Date:   Mon Aug 28 17:33:59 2017 +0100

    Small refactor of getRuntimeRep

Sure enough, there was a real bug, described in the new
TcExpr Note [Visible type application zonk]

In general, syntactic substituion should be kind-preserving!
Maybe we should check that invariant...

(cherry picked from commit 2c133b67df374c73bc8069cefd7d57e1d2a14fc3)

21 months agoFix subtle bug in TcTyClsDecls.mkGADTVars
Simon Peyton Jones [Sat, 2 Sep 2017 17:13:32 +0000 (18:13 +0100)] 
Fix subtle bug in TcTyClsDecls.mkGADTVars

This bug was revealed by Trac #14162.  In a GADT-style data-family
instance we ended up a data constructor whose type mentioned
an out-of-scope variable.  (This variable was in the kind of
a variable in the kind of a variable.)

Only Lint complained about this (actually only when the
data constructor was injected into the bindings by CorePrep).
So it doesn't matter much -- but it's a solid bug and might
bite us some day.

It took me quite a while to unravel because the test case was itself
quite tricky.  But the fix is easy; just add a missing binding to the
substitution we are building up.  It's in the regrettably-subtle
mkGADTVars function.

(cherry picked from commit 3a27e34f7a59a30f91fad9dd2ca194acdb1bcb1a)

21 months agoRenamer now preserves location for IEThingWith list items
Alan Zimmerman [Fri, 15 Sep 2017 18:35:51 +0000 (14:35 -0400)] 
Renamer now preserves location for IEThingWith list items

Prior to this, in the RenamedSource for

    module Renaming.RenameInExportedType
      (
      MyType (NT)
      ) where

    data MyType = MT Int | NT

The (NT) was given the location of MyType earlier on the line in the
export list.

Also the location was discarded for any field labels, and replaced with
a `noLoc`.

Test Plan: ./validate

Reviewers: bgamari, austin

Reviewed By: bgamari

Subscribers: rwbarton, thomie

GHC Trac Issues: #14189

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

(cherry picked from commit 9498c50ef5af2680305e0aaea6f32439cacc3da0)

21 months agoFix #14228 by marking SumPats as non-irrefutable
Ryan Scott [Fri, 15 Sep 2017 18:34:58 +0000 (14:34 -0400)] 
Fix #14228 by marking SumPats as non-irrefutable

`isIrrefutableHsPat` should always return `False` for unboxed sum
patterns (`SumPat`s), since they always have at least one other
corresponding pattern of the same arity (since the minimum arity for a
`SumPat` is 2). Failure to do so causes incorrect code to be generated
for pattern synonyms that use unboxed sums, as shown in #14228.

Test Plan: make test TEST=T14228

Reviewers: austin, bgamari, simonpj

Reviewed By: simonpj

Subscribers: simonpj, rwbarton, thomie

GHC Trac Issues: #14228

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

(cherry picked from commit f4d50a0ec0d23dbcd61a014c8a773030c8fe310d)

21 months agoAdd a Note describing #14128
Ben Gamari [Tue, 29 Aug 2017 23:14:22 +0000 (19:14 -0400)] 
Add a Note describing #14128

I prematurely committed the D3892 before adding a Note. Fix this.

(cherry picked from commit 6f1ccaa50f905bdc586a7a92ab7e38e30c1e7ff5)

21 months agotestsuite: Add test for #14128
Ben Gamari [Sat, 26 Aug 2017 20:16:47 +0000 (16:16 -0400)] 
testsuite: Add test for #14128

Reviewers: austin, goldfire

Subscribers: rwbarton, thomie

GHC Trac Issues: #14128

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

(cherry picked from commit 248ad30385acc0f81f1959b6345a7388be76dc85)

21 months agodesugar: Ensure that a module's dep_orphs doesn't contain itself
Ben Gamari [Sat, 26 Aug 2017 20:17:18 +0000 (16:17 -0400)] 
desugar: Ensure that a module's dep_orphs doesn't contain itself

Consider that we have two modules, A and B, both with hs-boot files,

  * A.hs contains a SOURCE import of B
  * B.hs-boot contains a SOURCE import of A
  * A.hs-boot declares an orphan instance
  * A.hs defines the orphan instance

In this case, B's dep_orphs will contain A due to its SOURCE import of
A.  Consequently, A will contain itself in its imp_orphs due to its
import of B.  This fact would end up being recorded in A's interface
file. This would then break the invariant asserted by calculateAvails
that a module does not itself in its dep_orphs. This was the cause
of #14128.

The solution is to remove self-references from imp_orphs when
constructing dep_orphs; we already did a similar thing for dep_mods. I
believe we should do the same for dep_finsts, although I'm treating this
as a separate bug.

Reviewers: austin

Subscribers: rwbarton, thomie

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

(cherry picked from commit db3a8e168ad81f54ec58eebc4c75a0eaad889daf)

21 months agoTest #11672 in typecheck/should_fail/T11672.
Richard Eisenberg [Thu, 1 Jun 2017 22:28:57 +0000 (18:28 -0400)] 
Test #11672 in typecheck/should_fail/T11672.

I believe this was fixed with the fix for #11198.

(cherry picked from commit 9a54975665f23df8c8137da24028a5aec4c77fba)

21 months agoFix tests
Ben Gamari [Tue, 19 Sep 2017 20:15:05 +0000 (16:15 -0400)] 
Fix tests

22 months agoImprove error messages around kind mismatches.
Richard Eisenberg [Thu, 1 Jun 2017 21:27:14 +0000 (17:27 -0400)] 
Improve error messages around kind mismatches.

Previously, when canonicalizing (or unifying, in uType) a
heterogeneous equality, we emitted a kind equality and used the
resulting coercion to cast one side of the heterogeneous equality.

While sound, this led to terrible error messages. (See the bugs
listed below.) The problem is that using the coercion built from
the emitted kind equality is a bit like a wanted rewriting a wanted.
The solution is to keep heterogeneous equalities as irreducible.

See Note [Equalities with incompatible kinds] in TcCanonical.

This commit also removes a highly suspicious switch to FM_SubstOnly
when flattening in the kinds of a type variable. I have no idea
why this was there, other than as a holdover from pre-TypeInType.
I've not left a Note because there is simply no reason I can conceive
of that the FM_SubstOnly should be there.

One challenge with this patch is that the emitted derived equalities
might get emitted several times: when a heterogeneous equality is
in an implication and then gets floated out from the implication,
the Derived is present both in and out of the implication. This
causes a duplicate error message. (Test case:
typecheck/should_fail/T7368) Solution: track the provenance of
Derived constraints and refuse to float out a constraint that has
an insoluble Derived.

Lastly, this labels one test (dependent/should_fail/RAE_T32a)
as expect_broken, because the problem is really #12919. The
different handling of constraints in this patch exposes the error.

This fixes bugs #11198, #12373, #13530, and #13610.

test cases:
typecheck/should_fail/{T8262,T8603,tcail122,T12373,T13530,T13610}

(cherry picked from commit 8e15e3d370e9c253ae0dbb330e25b72cb00cdb76)

22 months agoFix decomposition error on Windows
Tamar Christina [Tue, 29 Aug 2017 21:59:38 +0000 (22:59 +0100)] 
Fix decomposition error on Windows

Summary:
Fix the path decomposition error that occurs when the Symlink resolver
fails. `Win32.try` throws an exception, so catch it and assume the path
isn't a symlink to use the old behavior.

Test Plan: ./validate

Reviewers: austin, bgamari

Reviewed By: bgamari

Subscribers: rwbarton, thomie

GHC Trac Issues: #14159

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

(cherry picked from commit 3c6b2fc3b5ca11a5410405664e4640767ef941dd)

22 months agoSmall refactor of getRuntimeRep
Simon Peyton Jones [Mon, 28 Aug 2017 16:33:59 +0000 (17:33 +0100)] 
Small refactor of getRuntimeRep

Instead of using a string argument, use HasDebugCallStack.
(Oddly, some functions were using both!)

Plus, use getRuntimeRep rather than getRuntimeRep_maybe when
if the caller panics on Nothing. Less code, and a better debug
stack.

(cherry picked from commit a6c448b403dbe8720178ca82100f34baedb1f47e)

22 months agoUse a well-kinded substitution to instantiate
Simon Peyton Jones [Mon, 28 Aug 2017 16:21:14 +0000 (17:21 +0100)] 
Use a well-kinded substitution to instantiate

In tcDataConPat we were creating an ill-kinded substitution
-- or at least one that is well kinded only after you have solved
other equalities.  THat led to a crash, because the instantiated
data con type was ill-kinded.

This patch guarantees that the instantiating substitution is
well-kinded.

Fixed Trac #14154

(cherry picked from commit 4455c86d1635bfb846e750b21dda36dcee028b5e)

22 months agoDo not discard insolubles in implications
Simon Peyton Jones [Thu, 27 Jul 2017 13:52:38 +0000 (14:52 +0100)] 
Do not discard insolubles in implications

Trac #14000 showed up two errors

* In TcRnTypes.dropInsolubles we dropped all implications, which
  might contain the very insolubles we wanted to keep.  This was
  an outright error, and is why the out-of-scope error was actually
  lost altogether in Trac #14000

* In TcSimplify.simplifyInfer, if there are definite (insoluble)
  errors, it's better to suppress the following ambiguity test,
  because the type may be bogus anyway.  See TcSimplify
  Note [Quantification with errors].  This fix seems a bit clunky,
  but it'll do for now.

(cherry picked from commit 452755de717fad5d8fbfc6330cb42a3335c8912d)

22 months agoFix string escaping in JSON
Dmitry Malikov [Sat, 5 Aug 2017 14:28:40 +0000 (16:28 +0200)] 
Fix string escaping in JSON

It seems to that double quotes is not escaped well at the moment.

We'd noticed this with @alexbiehl during the work on https://github.com/haskell/haddock/pull/645
(cherry picked from commit e8fe12f83b17dc39d9272d44c4168946fa54e7a0)

22 months agoEnsure that we always link against libm
Ben Gamari [Fri, 28 Jul 2017 17:41:04 +0000 (13:41 -0400)] 
Ensure that we always link against libm

ld.gold is particularly picky that we declare all of our link
dependencies on Nix. See #14022.

Test Plan: Validate on Nix

Reviewers: austin

Subscribers: hvr, rwbarton, thomie

GHC Trac Issues: #14022

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

(cherry picked from commit 0e3c10160472df082fd3decd98c2489a2f8e68bd)

22 months agoFix #13947 by checking for unbounded names more
Ryan Scott [Tue, 11 Jul 2017 17:59:29 +0000 (13:59 -0400)] 
Fix #13947 by checking for unbounded names more

Commit 2484d4dae65c81f218dcfe494b963b2630bb8fa6 accidentally dropped a
call to `isUnboundName` in an important location. This re-adds it.

Fixes #13947.

Test Plan: make test TEST=T13947

Reviewers: adamgundry, austin, bgamari

Reviewed By: adamgundry

Subscribers: rwbarton, thomie

GHC Trac Issues: #13947

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

(cherry picked from commit 85ac65c5f0b057f1b07ed7bf9a8d9aeae4ce1390)

22 months agoFix #11963 by checking for more mixed type/kinds
Richard Eisenberg [Tue, 18 Jul 2017 19:49:38 +0000 (15:49 -0400)] 
Fix #11963 by checking for more mixed type/kinds

This is a straightforward fix -- there were just some omitted
checks.

test case: typecheck/should_fail/T11963

(cherry picked from commit 10d13b62c7ba8c44000a0d25afd66788de8040c4)

22 months agoFix #14125 by normalizing data family instances more aggressively
Ryan Scott [Tue, 22 Aug 2017 13:28:43 +0000 (09:28 -0400)] 
Fix #14125 by normalizing data family instances more aggressively

Summary:
Commit 3540d1e1a23926ce0a8a6ae83a36f5f6b2497ccf inadvertently broke
the ability for newtype instances to be used as marshallable types in FFI
declarations. The reason is a bit silly: an extra check was added for type
synonyms with no type families on the RHS in `normalise_tc_app`, but this check
would only skip over type families, not //data// families, since the predicate
being used was `not . isTypeFamilyCon`.

The fix is simple: just use `not . isFamilyCon` instead so that data families
are also skipped by this check.

Test Plan: make test TEST=T14125

Reviewers: goldfire, simonpj, austin, bgamari

Reviewed By: simonpj

Subscribers: rwbarton, thomie

GHC Trac Issues: #14125

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

(cherry picked from commit 6982ee99fb97c252c3faf37faae34131fb66f67c)

22 months agoFix incorrect retypecheck loop in -j (#14075)
Edward Z. Yang [Tue, 22 Aug 2017 12:44:25 +0000 (08:44 -0400)] 
Fix incorrect retypecheck loop in -j (#14075)

The parallel codepath was incorrectly retypechecking the
hs-boot ModIface prior to typechecking the hs file,
which was inconsistent with the non-parallel case.  The
non-parallel case gets it right: you don't want to retypecheck
the hs-boot file itself (forwarding its declarations to hs)
because you need it to be consistently knot-tied with itself
when you compare the interfaces.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: validate

Reviewers: bgamari, simonpj, austin

Reviewed By: bgamari

Subscribers: duog, rwbarton, thomie

GHC Trac Issues: #14075

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

(cherry picked from commit 4717ce8658f12f425aebd1fc7f7ad8fe04a81df5)

22 months agoKnownUniques: Handle DataCon wrapper names
Ben Gamari [Tue, 1 Aug 2017 02:33:24 +0000 (22:33 -0400)] 
KnownUniques: Handle DataCon wrapper names

For some reason these weren't handled. I seem to remember thinking I had
a reason for omitting them when writing the original patch, but I don't
recall what that reason was at this point and clearly workers do show up
in interface files.

Test Plan: Validate against T14051

Reviewers: austin

Subscribers: rwbarton, thomie, RyanGlScott

GHC Trac Issues: #14051

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

(cherry picked from commit 5a7af95ad2ce38e4b80893d869948c630454683b)

22 months agoCNF: Implement compaction for small pointer arrays
Ben Gamari [Fri, 25 Aug 2017 01:55:27 +0000 (21:55 -0400)] 
CNF: Implement compaction for small pointer arrays

Test Plan: Validate

Reviewers: austin, erikd, simonmar, dfeuer

Reviewed By: dfeuer

Subscribers: rwbarton, andrewthad, thomie, dfeuer

GHC Trac Issues: #13860, #13857

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

(cherry picked from commit 5f3d2d3be034e04ba872f2695ab6d7b75de66663)

22 months agoFix loading of dlls on 32bit windows
Sergey Vinokurov [Sun, 20 Aug 2017 21:40:08 +0000 (00:40 +0300)] 
Fix loading of dlls on 32bit windows

The point of fix is to handle case when loaded dll loads no
other dlls, i.e. it's import table is empty.

GHC Trac Issues: #14081

(cherry picked from commit 34bd43d9c24207a1897aaa4ee6cb70592a3f7acc)

22 months agotestsuite: Fix test output of determ021
Ben Gamari [Mon, 21 Aug 2017 20:32:56 +0000 (16:32 -0400)] 
testsuite: Fix test output of determ021

22 months agoFix #11400, #11560 by documenting an infelicity.
Richard Eisenberg [Thu, 1 Jun 2017 22:09:05 +0000 (18:09 -0400)] 
Fix #11400, #11560 by documenting an infelicity.

Really, the fix for both of these is #11307.

(cherry picked from commit c9667d321c94ff0f67b73aa7bd560c38873f7df5)

23 months agoFix a bug in -foptimal-applicative-do
Simon Marlow [Mon, 12 Jun 2017 21:00:39 +0000 (17:00 -0400)] 
Fix a bug in -foptimal-applicative-do

Test Plan: validate

Reviewers: bgamari, niteria, austin, erikd

Reviewed By: bgamari

Subscribers: rwbarton, thomie

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

(cherry picked from commit 7e0ef11324712b4ff3ac8f39259e5ecbd63c2356)

23 months agoDocument that type holes kill polymorphic recursion
Richard Eisenberg [Tue, 18 Jul 2017 19:55:21 +0000 (15:55 -0400)] 
Document that type holes kill polymorphic recursion

This "fixes" #11995.

(cherry picked from commit ca471860494484210b6291dd96d1e0868da750e7)

23 months agoaclocal.m4: respect user's --with-ar= choice
Sergei Trofimovich [Mon, 17 Apr 2017 08:41:49 +0000 (09:41 +0100)] 
aclocal.m4: respect user's --with-ar= choice

'FP_PROG_AR' macro has a minor bug: it ignores
already existing value stored in '$fp_prog_ar'.

I've noticed it when tried to built UNREG ghc using thin LTO:

  $ ./configure --enable-unregisterised \
                --with-nm=gcc-nm \
                --with-ar=gcc-ar \
                --with-ranlib=gcc-ranlib \

./configure refused to use 'gcc-ar' (LTO-aware variant of 'ar')
and kept using 'ar'.

'$fp_prog_ar' is initialized (in a complex manner) in 'configure.ac' as:

    FP_ARG_WITH_PATH_GNU_PROG([AR], [ar], [ar])
    ArCmd="$AR"
    fp_prog_ar="$AR"
    AC_SUBST([ArCmd])

The change keeps that value.

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
(cherry picked from commit 79848f18805ad8eba48c9897c5d53afbd17ab44d)

23 months agoconfigure: Ensure that user's LD setting is respected
Ben Gamari [Fri, 28 Jul 2017 17:35:01 +0000 (13:35 -0400)] 
configure: Ensure that user's LD setting is respected

This broke in the fix for #13541.

(cherry picked from commit d08b9ccdf2812e8f8fa34d0c89275deee574524c)

23 months agoFix lld detection if both gold and lld are found
Ben Gamari [Fri, 28 Jul 2017 15:48:52 +0000 (11:48 -0400)] 
Fix lld detection if both gold and lld are found

If you have ld.gold and ld.lld, then ld.gold will be selected by the
detection logic. This patch prioritizes lld by changing the order. The
rationale for checking lld first is that it's (right now) not part of,
say, a default Linux distro installation and if it's available, it's
very likely that it was installed explicitly and should be seen as a
sign of preference. On FreeBSD LLVM is the (default) base toolchain and
the changed order makes sense there as well, since ld.gold can be
available in /usr/local via ports/pkg. I don't have access to macOS and
can't say anything about their LLVM toolchain.

At some point we could add a check for LD=ld.lld or LD=ld.gold as an
optional override to explicitly select a linker.

Since I cannot really remove gcc on Linux, this was the only way to
configure GHC to use ld.lld.

Reviewers: austin, hvr, bgamari

Reviewed By: bgamari

Subscribers: rwbarton, thomie, erikd

Tags: PHID-PROJ-5azim3sqhsf7wzvlvaag

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

(cherry picked from commit 2974f81f8c3529657a0b808b8415a4d2ad9ed6d1)

23 months agoFix errant whitespace
Ben Gamari [Sun, 23 Jul 2017 19:48:56 +0000 (15:48 -0400)] 
Fix errant whitespace

[skip-ci]

(cherry picked from commit 0ff40df30128d24118947c82bd970fc013522e18)

23 months agoFix more documentation wibbles
Ben Gamari [Sun, 23 Jul 2017 18:13:16 +0000 (14:13 -0400)] 
Fix more documentation wibbles

Fixes #14020, #14016, #14015, #14019

(cherry picked from commit 2dff2c7fbb5aa68445e617d691451c0427fad0a5)

23 months agousers-guide: Fix various wibbles
Ben Gamari [Sun, 23 Jul 2017 16:59:49 +0000 (12:59 -0400)] 
users-guide: Fix various wibbles

(cherry picked from commit c9451959d8796ee5458cd0666dd2bc2114ac10d7)

23 months agousers-guide: Standardize and repair all flag references
Patrick Dougherty [Sun, 23 Jul 2017 16:55:37 +0000 (12:55 -0400)] 
users-guide: Standardize and repair all flag references

This patch does three things:

1.) It simplifies the flag parsing code in `conf.py` to properly display
flag definitions created by `.. (ghc|rts)-flag::`. Additionally, all flag
references must include the associated arguments. Documentation has been
added to `editing-guide.rst` to explain this.

2.) It normalizes all flag definitions to a similar format. Notably, all
instances of `<>` have been replaced with `⟨⟩`. All references across the
users guide have been updated to match.

3.) It fixes a couple issues with the flag reference table's generation code,
which did not handle comma separated flags in the same cell and did not
properly reference flags with arguments.

Test Plan:
`SPHINXOPTS = -n` to activate "nitpicky" mode, which reports all broken
references. All remaining errors are references to flags without any
documentation.

Reviewers: austin, bgamari

Reviewed By: bgamari

Subscribers: rwbarton, thomie

GHC Trac Issues: #13980

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

(cherry picked from commit 44b090be9a6d0165e2281542a7c713da1799e885)

23 months agodistrib/configure: Carry FFI include/lib paths from source distribution
Ben Gamari [Sun, 23 Jul 2017 14:43:52 +0000 (10:43 -0400)] 
distrib/configure: Carry FFI include/lib paths from source distribution

`FFILibDir` and `FFIIncludeDir` both show up in the `rts` library's
package registration file.  We therefore must define them or else we'll
end up with spurious `@FFILibDir@` strings in the package registration.

In principle I think we could also take these as arguments to the
bindist configure but this seems simpler and I don't want to verify this
at the moment.

Test Plan: Build bindist while passing `--with-ffi-libraries=...` to
source distribution configure then try to install and use bindist.

Reviewers: austin, hvr

Subscribers: rwbarton, thomie, erikd

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

(cherry picked from commit 98ab12ad0c13b6723cc667d6a00fe592f1833bf4)

23 months agoFix up ghci changelog
Ben Gamari [Sun, 23 Jul 2017 15:15:06 +0000 (11:15 -0400)] 
Fix up ghci changelog

23 months agoFix compact regions notes
Ben Gamari [Sun, 23 Jul 2017 14:27:42 +0000 (10:27 -0400)] 
Fix compact regions notes

23 months agoFix links to SPJ’s papers (fixes #12578)
Takenobu Tani [Wed, 19 Jul 2017 19:06:27 +0000 (15:06 -0400)] 
Fix links to SPJ’s papers (fixes #12578)

This fixes #12578.
Update links to SPJ's papers in following files:

  * compiler/coreSyn/CoreSyn.hs
  * docs/users_guide/using-optimisation.rst
  * docs/users_guide/parallel.rst
  * docs/users_guide/glasgow_exts.rst

This commit is for ghc-8.2 branch.

Test Plan: build

Reviewers: austin, bgamari

Reviewed By: bgamari

Subscribers: rwbarton, thomie

GHC Trac Issues: #12578

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

(cherry picked from commit 1ed41a7413a45e11a9bad3aafcfb7ee3f26236e4)

23 months agoAdd some missing release notes entries
Ben Gamari [Sun, 23 Jul 2017 13:29:06 +0000 (09:29 -0400)] 
Add some missing release notes entries

23 months agoSet RELEASE=NO
Ben Gamari [Sat, 22 Jul 2017 21:52:08 +0000 (17:52 -0400)] 
Set RELEASE=NO

23 months agoFix label type for __stginit_* labels: those are .data labels, not .text
Sergei Trofimovich [Sat, 22 Jul 2017 09:49:12 +0000 (10:49 +0100)] 
Fix label type for __stginit_* labels: those are .data labels, not .text

Noticed when was building --enable-unregisterised build for x86_64:

```
  /tmp/ghc22931_0/ghc_3.hc:5:9: error:
       error: '__stginit_ghczmprim_GHCziTypes' redeclared as different kind of symbol
       StgWord __stginit_ghczmprim_GHCziTypes[]__attribute__((aligned(8)))= {
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    |
  5 | StgWord __stginit_ghczmprim_GHCziTypes[]__attribute__((aligned(8)))= {
    |         ^

  In file included from /tmp/ghc22931_0/ghc_3.hc:3:0: error:

  /tmp/ghc22931_0/ghc_3.hc:4:5: error:
       note: previous declaration of '__stginit_ghczmprim_GHCziTypes' was here
       EF_(__stginit_ghczmprim_GHCziTypes);
           ^
```

The error here is mismatch in symbol type: EF_ ("external function")
It should be EC_ ("external closure").

The same build failure does not happen in HEAD because the __stginit_*
is not generated there anymore (see a92ff5d66182d992d02dfaad4c446ad074582368)

Fixes #14009

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
23 months agoaclocal.m4: allow arbitrary <vendor> string in toolchain triplets
Sergei Trofimovich [Sat, 8 Jul 2017 08:47:12 +0000 (09:47 +0100)] 
aclocal.m4: allow arbitrary <vendor> string in toolchain triplets

Canonical triplets have a form of
    <arch>-<vendor>-<os>[-<abi>]

Checking for vendor is almost never correct as it's an
arbitrary string.

It's useful to have multiple "vendors" to denote
otherwise the same (WRT <arch>, <os>, <abi>) target:
    --target=x86_64-pc-linux-gnu
    --target=x86_64-unknown-linux-gnu
    --target=x86_64-ghc80-linux-gnu
    --target=x86_64-ghchead-linux-gnu

Do not fail unknown vendors. Only emit a warning.
Ideally configure checks should never use "vendor".

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
(cherry picked from commit c2303dff95aa174021a1950656fdf9a1cf983959)

23 months agoRelease 8.2.1 ghc-8.2.1-release
Ben Gamari [Fri, 21 Jul 2017 21:28:19 +0000 (17:28 -0400)] 
Release 8.2.1

23 months agorelnotes: Fix wibbles
Ben Gamari [Fri, 21 Jul 2017 22:39:22 +0000 (18:39 -0400)] 
relnotes: Fix wibbles

23 months agorelnotes: Address split sections and linker changes
Ben Gamari [Fri, 21 Jul 2017 22:10:06 +0000 (18:10 -0400)] 
relnotes: Address split sections and linker changes

Thanks to @duog for mentioning that this wasn't covered.

23 months agoUpdate autoconf scripts
Ben Gamari [Fri, 21 Jul 2017 21:58:22 +0000 (17:58 -0400)] 
Update autoconf scripts

Scripts taken from autoconf 81497f5aaf50a12a9fe0cba30ef18bda46b62959