ghc.git
17 months agoExport typeNat{Div;Mod;Log}TyCon from TcTypeNats
Christiaan Baaij [Mon, 8 Jan 2018 17:26:54 +0000 (12:26 -0500)] 
Export typeNat{Div;Mod;Log}TyCon from TcTypeNats

Summary: To be in line with the other typeNatTyCons

Reviewers: bgamari, RyanGlScott

Reviewed By: RyanGlScott

Subscribers: RyanGlScott, rwbarton, thomie, carter

GHC Trac Issues: #14632

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

(cherry picked from commit fb78b0d22635b1d7ae68385c648b8c407f5562c2)

17 months agoMake the Div and Mod type families `infixl 7`
Ryan Scott [Sun, 7 Jan 2018 18:05:13 +0000 (13:05 -0500)] 
Make the Div and Mod type families `infixl 7`

Commit fa8035e3ee83aff5a20fc5e7e2697bac1686d6a6 added `Div`
and `Mod` type families to `GHC.TypeNats`. However, they did not add
the corresponding fixities! Currently, we have that both `div` and
`mod` (at the value level) are `infixl 7`, so we should adopt the
same fixities for the type-level `Div` and `Mod` as well.

Test Plan: It compiles

Reviewers: hvr, bgamari

Reviewed By: bgamari

Subscribers: rwbarton, thomie, carter

GHC Trac Issues: #14640

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

(cherry picked from commit 303106d55d75a9c796e58867cb541ad136bb217f)

17 months agoFix #14608 by restoring an unboxed tuple check
Ryan Scott [Tue, 2 Jan 2018 21:03:08 +0000 (16:03 -0500)] 
Fix #14608 by restoring an unboxed tuple check

Commit 714bebff44076061d0a719c4eda2cfd213b7ac3d removed
a check in the bytecode compiler that caught illegal uses of unboxed
tuples (and now sums) in case alternatives, which causes the program
in #14608 to panic. This restores the check (using modern,
levity-polymorphic vocabulary).

Test Plan: make test TEST=T14608

Reviewers: hvr, bgamari, dfeuer, simonpj

Reviewed By: dfeuer, simonpj

Subscribers: simonpj, rwbarton, thomie, carter

GHC Trac Issues: #14608

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

(cherry picked from commit ecff651fc2f6d9833131e3e7fbc9a37b5b2f84ee)

17 months agoMake System.IO.openTempFile thread-safe on Windows
Tamar Christina [Tue, 2 Jan 2018 21:02:49 +0000 (16:02 -0500)] 
Make System.IO.openTempFile thread-safe on Windows

This calls out to the Win32 API `GetTempFileName` to generate
a temporary file. Using `uUnique = 0` guarantees that the file
we get back is unique and the file is "reserved" by creating it.

Test Plan:
./validate

I can't think of any sensible tests that shouldn't run for a while
to verify. So the example in #10731 was ran for a while and no
collisions in new code

Reviewers: hvr, bgamari, erikd

Reviewed By: bgamari

Subscribers: RyanGlScott, rwbarton, thomie, carter

GHC Trac Issues: #10731

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

(cherry picked from commit 46287af0911f7cb446c62850630f85af567ac512)

17 months agoFix #14618 by applying a subst in deeplyInstantiate
Richard Eisenberg [Tue, 26 Dec 2017 19:23:40 +0000 (14:23 -0500)] 
Fix #14618 by applying a subst in deeplyInstantiate

Previously, we were inexplicably not applying an instantiating
substitution to arguments in non-prenex types. It's amazing this
has been around for so long! I guess there aren't a lot of non-prenex
types around.

test case: typecheck/should_fail/T14618

(cherry picked from commit 722a6584bb338bc77ad978d14113b3b8e6a45cab)

17 months agoBump Cabal submodule
Ben Gamari [Thu, 21 Dec 2017 20:04:05 +0000 (15:04 -0500)] 
Bump Cabal submodule

(cherry picked from commit e237e1f132d0c0e1d9bf24d21cf688110305fb28)

17 months agorelnotes: Remove note about -split-sections on Windows
Ben Gamari [Thu, 21 Dec 2017 20:02:28 +0000 (15:02 -0500)] 
relnotes: Remove note about -split-sections on Windows

Split-sections unfortunately isn't yet working.

17 months agorelnotes: Note GCC compatibility constraint
Ben Gamari [Wed, 20 Dec 2017 19:06:10 +0000 (14:06 -0500)] 
relnotes: Note GCC compatibility constraint

17 months agoMkIface: Ensure syntactic compatibility with ghc 8.0.1
Ben Gamari [Mon, 18 Dec 2017 22:16:22 +0000 (17:16 -0500)] 
MkIface: Ensure syntactic compatibility with ghc 8.0.1

Prior to 8.0.2 MultiWayIf syntax required that the -> token be indented relative
to the guard. See #10807.

17 months agoSync `ghc-prim` changelog from GHC 8.2, again
Herbert Valerio Riedel [Thu, 21 Dec 2017 23:04:19 +0000 (00:04 +0100)] 
Sync `ghc-prim` changelog from GHC 8.2, again

[skip ci]

(cherry picked from commit 4d99a665986f66f403ad49f7d91a1fc069870274)

17 months agoSync up ghc-prim changelog from GHC 8.2 branch
Herbert Valerio Riedel [Wed, 20 Dec 2017 07:10:59 +0000 (08:10 +0100)] 
Sync up ghc-prim changelog from GHC 8.2 branch

[skip ci]

(cherry picked from commit 005656776be8a447785627d549ee393dad468ff6)

18 months agousers-guide: Remove release notes for 8.2 ghc-8.4.1-alpha1
Ben Gamari [Thu, 14 Dec 2017 22:04:19 +0000 (17:04 -0500)] 
users-guide: Remove release notes for 8.2

18 months agousers-guide: Fix various bits of markup
Ben Gamari [Thu, 14 Dec 2017 21:52:59 +0000 (16:52 -0500)] 
users-guide: Fix various bits of markup

18 months agousers-guide: Consistently document LLVM version requirement
Ben Gamari [Thu, 14 Dec 2017 18:44:52 +0000 (13:44 -0500)] 
users-guide: Consistently document LLVM version requirement

18 months agoFix #14135 by validity checking matches
Carlos Tomé [Mon, 11 Dec 2017 20:38:03 +0000 (15:38 -0500)] 
Fix #14135 by validity checking matches

We filter the complete patterns given in a COMPLETE set to only those that
subsume the type we are matching. Otherwise we end up introducing an ill-typed
equation into the overlap checking, provoking a crash. This was the cause of
Trac #14135.

Reviewers: austin, bgamari, mpickering, gkaracha, simonpj, RyanGlScott,
carlostome

Reviewed By: bgamari

Subscribers: carter, dfeuer, RyanGlScott, goldfire, rwbarton, thomie

GHC Trac Issues: #14135

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

(cherry picked from commit 16c7d9dc9ea7505256e0792c958cab8ae7c8a5c4)

18 months agoImprove Control.Monad.guard and Control.Monad.MonadPlus docs
Nathan Collins [Mon, 11 Dec 2017 17:52:55 +0000 (12:52 -0500)] 
Improve Control.Monad.guard and Control.Monad.MonadPlus docs

This fixes Issue #12372: documentation for Control.Monad.guard not
useful after AMP.

Reviewers: hvr, bgamari

Reviewed By: bgamari

Subscribers: rwbarton, thomie, carter

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

(cherry picked from commit 6847c6bf5777eaf507f1cef28c1fc75a2c68bdef)

18 months agoOnly look for locales of the form LL.VV
Gabor Greif [Thu, 30 Nov 2017 19:49:03 +0000 (20:49 +0100)] 
Only look for locales of the form LL.VV

Because in recent RHEL7 suddenly locales like `bokmål` pop up, which
screw up reading-in of ASCII strings a line later. This additional
criterion reliably eliminates those unicode characters.

(cherry picked from commit abd5db6072218ada2b4a21177f5200ea0d3273a0)

18 months agoAllow users to ignore optimization changes
David Feuer [Mon, 11 Dec 2017 18:03:52 +0000 (13:03 -0500)] 
Allow users to ignore optimization changes

* Add a new flag, `-fignore-optim-changes`, allowing them to avoid
  recompilation if the only changes are to the `-O` level or to
  flags controlling optimizations.

* When `-fignore-optim-changes` is *off*, recompile when optimization
  flags (e.g., `-fno-full-laziness`) change. Previously, we ignored
  these unconditionally when deciding whether to recompile a module.

Reviewers: austin, bgamari, simonmar

Reviewed By: simonmar

Subscribers: duog, carter, simonmar, rwbarton, thomie

GHC Trac Issues: #13604

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

(cherry picked from commit 708ed9ca4dbf372817fe84a2fe486940123bddfb)

18 months agorts: Don't default to single capability when profiled
Ben Gamari [Mon, 11 Dec 2017 17:55:31 +0000 (12:55 -0500)] 
rts: Don't default to single capability when profiled

This was presumably a vestige of the days when the profiled RTS couldn't
run threaded. Fixes #14545.

Test Plan: simonmar

Reviewers: erikd, simonmar

Reviewed By: simonmar

Subscribers: rwbarton, thomie, carter

GHC Trac Issues: #14545

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

(cherry picked from commit 4bfff7a507b5807736e9c6ce9814a9cfa60faeff)

18 months agoAlways use the safe open() call
Simon Marlow [Mon, 11 Dec 2017 17:56:09 +0000 (12:56 -0500)] 
Always use the safe open() call

open() can sometimes take a long time, for example on NFS or FUSE
filesystems.  We recently had a case where open() was taking multiple
seconds to return for a (presumably overloaded) FUSE filesystem, which
blocked GC and caused severe issues.

Test Plan: validate

Reviewers: niteria, bgamari, nh2, hvr, erikd

Reviewed By: bgamari

Subscribers: rwbarton, thomie, carter

GHC Trac Issues: #13296

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

(cherry picked from commit cafe98345cb5d4b11f2059d60d2f20e976ef4f2a)

18 months agoAdd hadrian as a submodule
Ben Gamari [Fri, 8 Dec 2017 18:02:06 +0000 (13:02 -0500)] 
Add hadrian as a submodule

It will remain a submodule until we are ready to merge Hadrian into the
tree.

18 months agoRip out hadrian subtree
Ben Gamari [Fri, 8 Dec 2017 17:42:35 +0000 (12:42 -0500)] 
Rip out hadrian subtree

Sadly subtrees haven't worked quite as well as we would have liked for
developers. See Hadrian #440.

18 months agoBump version to 8.4
Ben Gamari [Mon, 4 Dec 2017 22:01:15 +0000 (17:01 -0500)] 
Bump version to 8.4

Updates haddock dsubmodule

18 months agoFix ghc_packages
Ben Gamari [Mon, 4 Dec 2017 21:15:52 +0000 (16:15 -0500)] 
Fix ghc_packages

The LaTeX produced by this previously failed to compile. Changing the first cell
of the row from an inline to a paragraph fixes this. Then I noticed that the
table overflowed the page. This is fixed by applying the longtable class.

18 months agotemplate-haskell: Rip out FamFlavour
Ben Gamari [Mon, 4 Dec 2017 18:50:36 +0000 (13:50 -0500)] 
template-haskell: Rip out FamFlavour

This was scheduled to happen for 8.2, it looks like it will actually
happen in 8.4.

18 months agoMake the Con and Con' patterns produce evidence
David Feuer [Mon, 4 Dec 2017 13:27:18 +0000 (08:27 -0500)] 
Make the Con and Con' patterns produce evidence

Matching with the `Con` and `Con'` patterns can reveal evidence
that the type in question is *not* an application. This can help
the pattern checker.

Reviewers: austin, hvr, bgamari

Reviewed By: bgamari

Subscribers: carter, rwbarton, thomie

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

18 months agoCache TypeRep kinds aggressively
David Feuer [Fri, 1 Dec 2017 22:00:24 +0000 (17:00 -0500)] 
Cache TypeRep kinds aggressively

Cache `TypeRep k` in each `TrApp` or `TrTyCon` constructor of
`TypeRep (a :: k)`. This makes `typeRepKind` cheap.

With this change, we won't need any special effort to deserialize
typereps efficiently. The downside, of course, is that we make
`TypeRep`s slightly larger.

Reviewers: austin, hvr, bgamari, simonpj

Reviewed By: bgamari, simonpj

Subscribers: carter, simonpj, rwbarton, thomie

GHC Trac Issues: #14254

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

18 months agoAdd trace injection
David Feuer [Fri, 1 Dec 2017 20:59:24 +0000 (15:59 -0500)] 
Add trace injection

Add support for injecting runtime calls to `trace` in `DsM`. This
allows the desugarer to add compile-time information to a runtime
trace.

Reviewers: austin, hvr, bgamari

Reviewed By: bgamari

Subscribers: carter, thomie, rwbarton

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

18 months agoHandle CPP properly in Backpack
Edward Z. Yang [Sat, 25 Nov 2017 02:12:05 +0000 (10:12 +0800)] 
Handle CPP properly in Backpack

Summary:
Previously, we attempted to lookup 'hole' packages for
include directories; this obviously is not going to work.

Signed-off-by: Edward Z. Yang <ezyang@fb.com>
Test Plan: validate

Reviewers: ekmett, bgamari

Subscribers: rwbarton, thomie

GHC Trac Issues: #14525

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

18 months agoMake use of boot TyThings during typechecking.
Edward Z. Yang [Mon, 30 Oct 2017 00:15:07 +0000 (20:15 -0400)] 
Make use of boot TyThings during typechecking.

Summary:
Suppose that you are typechecking A.hs, which transitively imports,
via B.hs, A.hs-boot.  When we poke on B.hs and discover that it
has a reference to a type from A, what TyThing should we wire
it up with?  Clearly, if we have already typechecked A, we
should use the most up-to-date TyThing: the one we freshly
generated when we typechecked A.  But what if we haven't typechecked
it yet?

For the longest time, GHC adopted the policy that this was
*an error condition*; that you MUST NEVER poke on B.hs's reference
to a thing defined in A.hs until A.hs has gotten around to checking
this.  However, actually ensuring this is the case has proven
to be a bug farm.  The problem was especially poignant with
type family consistency checks, which eagerly happen before
any typechecking takes place.

This patch takes a different strategy: if we ever try to access
an entity from A which doesn't exist, we just fall back on the
definition of A from the hs-boot file.  This means that you may
end up with a mix of A.hs and A.hs-boot TyThings during the
course of typechecking.

Signed-off-by: Edward Z. Yang <ezyang@fb.com>
Test Plan: validate

Reviewers: simonpj, bgamari, austin, goldfire

Subscribers: thomie, rwbarton

GHC Trac Issues: #14396

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

18 months agoDarwin: Use gmp from homebrew
Ben Gamari [Wed, 29 Nov 2017 22:02:17 +0000 (17:02 -0500)] 
Darwin: Use gmp from homebrew

As discussed on ghc-devs, OS X appears to ship an old or otherwise broken gmp.

https://mail.haskell.org/pipermail/ghc-devs/2017-June/014321.html

18 months agoDarwin: Set deployment target
Ben Gamari [Wed, 29 Nov 2017 22:01:07 +0000 (17:01 -0500)] 
Darwin: Set deployment target

18 months agoBump unix submodule
Ben Gamari [Wed, 29 Nov 2017 20:23:41 +0000 (15:23 -0500)] 
Bump unix submodule

Fixes FreeBSD build.

18 months agoComments only: Trac #14511
Simon Peyton Jones [Tue, 28 Nov 2017 16:02:18 +0000 (16:02 +0000)] 
Comments only: Trac #14511

18 months agoMinor tweaks to codegens.rst
Steven Shaw [Wed, 29 Nov 2017 07:16:14 +0000 (17:16 +1000)] 
Minor tweaks to codegens.rst

A couple of nits involving the letter 'C'.

18 months agoCircleCI: Freeze all packages at fixed index state
Ben Gamari [Wed, 29 Nov 2017 15:22:50 +0000 (10:22 -0500)] 
CircleCI: Freeze all packages at fixed index state

We will periodically bump this as necessary.

18 months agoCircleCI: Disallow hscolour 1.24.3
Ben Gamari [Wed, 29 Nov 2017 14:58:42 +0000 (09:58 -0500)] 
CircleCI: Disallow hscolour 1.24.3

This release does not build.

18 months agoCLabel: A bit of documentation
Ben Gamari [Tue, 28 Nov 2017 20:35:32 +0000 (15:35 -0500)] 
CLabel: A bit of documentation

18 months agoCmm: Add missing cases for BlockInfoTable
Ben Gamari [Tue, 28 Nov 2017 19:32:34 +0000 (14:32 -0500)] 
Cmm: Add missing cases for BlockInfoTable

Silly rabbit, BlockInfoTables are data. This fixes the unregisterised build,
finally fixing #14454.

18 months agoCLabel: More specific debug output from CLabel
Ben Gamari [Tue, 28 Nov 2017 19:23:02 +0000 (14:23 -0500)] 
CLabel: More specific debug output from CLabel

18 months agonativeGen: Use foldl' instead of foldl
Ben Gamari [Tue, 28 Nov 2017 01:02:55 +0000 (20:02 -0500)] 
nativeGen: Use foldl' instead of foldl

18 months agonativeGen: Use plusUFMList instead of foldr
Ben Gamari [Tue, 28 Nov 2017 01:02:25 +0000 (20:02 -0500)] 
nativeGen: Use plusUFMList instead of foldr

18 months agoCLabel: Refactor pprDynamicLinkerAsmLabel
Ben Gamari [Tue, 14 Nov 2017 19:58:40 +0000 (14:58 -0500)] 
CLabel: Refactor pprDynamicLinkerAsmLabel

18 months agocmm: Use LocalBlockLabel instead of AsmTempLabel to represent blocks
Ben Gamari [Mon, 13 Nov 2017 17:34:54 +0000 (12:34 -0500)] 
cmm: Use LocalBlockLabel instead of AsmTempLabel to represent blocks

blockLbl was originally changed in 8b007abbeb3045900a11529d907a835080129176 to
use mkTempAsmLabel to fix an inconsistency resulting in #14221. However, this
breaks the C code generator, which doesn't support AsmTempLabels (#14454).

Instead let's try going the other direction: use a new CLabel variety,
LocalBlockLabel. Then we can teach the C code generator to deal with
these as well.

18 months agoCLabel.labelType: Make catch-all case explicit
Ben Gamari [Tue, 14 Nov 2017 22:34:36 +0000 (17:34 -0500)] 
CLabel.labelType: Make catch-all case explicit

18 months agobase: Rip out old RTS statistics interface
Ben Gamari [Mon, 27 Nov 2017 19:02:56 +0000 (14:02 -0500)] 
base: Rip out old RTS statistics interface

Test Plan: Validate

Reviewers: simonmar, hvr

Subscribers: rwbarton, thomie

GHC Trac Issues: #14516

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

18 months agorelnotes: Rework treatment of included package list
Ben Gamari [Mon, 27 Nov 2017 19:01:02 +0000 (14:01 -0500)] 
relnotes: Rework treatment of included package list

Previously the included package lists took a disproportionate amount of
space in the resulting document and were difficult to maintain. Turn it
into a table.

Subscribers: rwbarton, thomie

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

18 months agoDon't call alex for Cabal lib during GHC build
Tobias Dammers [Mon, 27 Nov 2017 19:00:50 +0000 (14:00 -0500)] 
Don't call alex for Cabal lib during GHC build

The Cabal library now commits `Lexer.hs` directly to the source tree,
so the build step where we'd call alex ourselves to generate that file
is no longer necessary, nor will it work.

See also: https://ghc.haskell.org/trac/ghc/ticket/14459

Reviewers: bgamari, hvr

Reviewed By: bgamari

Subscribers: rwbarton, thomie, carter

GHC Trac Issues: #14459

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

18 months agotypecheck: Consistently use pretty quotes in error messages
Ben Gamari [Mon, 27 Nov 2017 19:00:06 +0000 (14:00 -0500)] 
typecheck: Consistently use pretty quotes in error messages

Subscribers: rwbarton, thomie, carter

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

18 months agoCheck quantification for partial type signatues
Simon Peyton Jones [Tue, 14 Nov 2017 15:26:19 +0000 (15:26 +0000)] 
Check quantification for partial type signatues

Trac #14449 showed that we were failing to check that the
quantified type variables of a partial type signature remained
distinct.

See Note [Quantified variables in partial type signatures]
in TcBinds.

A little refactoring along the way.

18 months agoboot: Eliminate superfluous output
Ben Gamari [Mon, 27 Nov 2017 15:20:59 +0000 (10:20 -0500)] 
boot: Eliminate superfluous output

18 months agoRtsFlags: allow +RTS -K0
Ben Gamari [Mon, 27 Nov 2017 14:46:55 +0000 (09:46 -0500)] 
RtsFlags: allow +RTS -K0

Reviewers: erikd, simonmar, hvr

Reviewed By: hvr

Subscribers: hvr, rwbarton, thomie

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

18 months agoAdd obvious Outputable Integer instance.
klebinger.andreas@gmx.at [Mon, 27 Nov 2017 14:46:32 +0000 (09:46 -0500)] 
Add obvious Outputable Integer instance.

Reviewers: bgamari

Reviewed By: bgamari

Subscribers: rwbarton, thomie

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

18 months agoFollow symlinks in the Win32 code for System.Environment.getExecutablePath
Alp Mestanogullari [Mon, 27 Nov 2017 14:45:52 +0000 (09:45 -0500)] 
Follow symlinks in the Win32 code for System.Environment.getExecutablePath

This partially addresses #14483 by fixing the Windows implementation of
System.Environment.getExecutablePath. This is achieved by using
GetFinalPathNameByHandleW to resolve potential symlinks, while making
sure we do not get back a UNC path (see #14460).

Test Plan: Validate

Reviewers: Phyx, bgamari, angerman, hvr, goldfire

Reviewed By: Phyx, bgamari

GHC Trac Issues: #14483

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

18 months agoDon't complain about UNPACK in -fno-code.
Edward Z. Yang [Mon, 27 Nov 2017 14:45:23 +0000 (09:45 -0500)] 
Don't complain about UNPACK in -fno-code.

Test Plan: validate

Reviewers: ekmett, austin, bgamari

Reviewed By: bgamari

Subscribers: duog, goldfire, rwbarton, thomie

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

18 months agoCircleCI: Reenable artifact collection on Darwin
Ben Gamari [Thu, 23 Nov 2017 20:03:18 +0000 (15:03 -0500)] 
CircleCI: Reenable artifact collection on Darwin

Supposedly the original issue has been fixed.

18 months agobase: fdReady(): Fix timeouts > ~49 days overflowing. Fixes #14262.
Niklas Hambüchen [Thu, 23 Nov 2017 18:17:24 +0000 (13:17 -0500)] 
base: fdReady(): Fix timeouts > ~49 days overflowing. Fixes #14262.

On 64-bit UNIX and Windows, Haskell `Int` has 64 bits
but C `int msecs` has 32 bits, resulting in an overflow.

This commit fixes it by switching fdReady() to take int64_t,
into which a Haskell `Int` will always fit.

(Note we could not switch to `long long` because that is
32 bit on 64-bit Windows machines.)

Further, to be able to actually wait longer than ~49 days,
we put loops around the waiting syscalls (they all accept only
32-bit integers).

Note the timer signal would typically interrupt the syscalls
before the ~49 days are over, but you can run Haskell programs
without the timer signal, an we want it to be correct in all
cases.

Reviewers: bgamari, austin, hvr, NicolasT, Phyx

Reviewed By: bgamari, Phyx

Subscribers: syd, Phyx, rwbarton, thomie

GHC Trac Issues: #14262

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

18 months agousers-guide: Fix :default: placement
Ben Gamari [Thu, 23 Nov 2017 18:14:33 +0000 (13:14 -0500)] 
users-guide: Fix :default: placement

18 months agoDynFlags: Expand $topdir in --info output
Ben Gamari [Thu, 23 Nov 2017 18:05:30 +0000 (13:05 -0500)] 
DynFlags: Expand $topdir in --info output

Test Plan: Try running nofib on Windows

Reviewers: Phyx

Subscribers: rwbarton, thomie

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

18 months agoSysTools: Split up TopDir logic into new module
Ben Gamari [Thu, 23 Nov 2017 18:05:05 +0000 (13:05 -0500)] 
SysTools: Split up TopDir logic into new module

Test Plan: Validate on Linux and Windows

Reviewers: erikd

Subscribers: rwbarton, thomie

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

18 months agoSysTools: Expand occurrences of $topdir anywhere in a Settings path
Ben Gamari [Thu, 23 Nov 2017 18:04:55 +0000 (13:04 -0500)] 
SysTools: Expand occurrences of $topdir anywhere in a Settings path

Subscribers: rwbarton, thomie, Phyx

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

18 months agorts/Printer: add closure name entries for small arrays (Fixes #14513)
Takano Akio [Thu, 23 Nov 2017 17:17:24 +0000 (12:17 -0500)] 
rts/Printer: add closure name entries for small arrays (Fixes #14513)

Test Plan: ./validate

Reviewers: bgamari, erikd, simonmar

Reviewed By: bgamari

Subscribers: rwbarton, thomie

GHC Trac Issues: #14513

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

18 months agoCircleCI: Install lbzip2 and patch
Ben Gamari [Wed, 22 Nov 2017 17:07:29 +0000 (12:07 -0500)] 
CircleCI: Install lbzip2 and patch

tar needs lbzip2 to extract the GMP tarball. Patch is needed to, well, patch.

18 months agocircleci: Build with Hadrian
Ben Gamari [Sat, 18 Nov 2017 19:50:24 +0000 (14:50 -0500)] 
circleci: Build with Hadrian

18 months agoCircleCI: Try validating LLVM as well
Ben Gamari [Sun, 12 Nov 2017 00:04:42 +0000 (19:04 -0500)] 
CircleCI: Try validating LLVM as well

18 months agoCircleCI: Perform nightly validation of unregisterised build
Ben Gamari [Sat, 11 Nov 2017 23:53:56 +0000 (18:53 -0500)] 
CircleCI: Perform nightly validation of unregisterised build

18 months agoFix README
Ben Gamari [Thu, 23 Nov 2017 14:53:30 +0000 (09:53 -0500)] 
Fix README

This was unfortunately overwritten by the Hadrian README in a previous
Hadrian merge.

18 months agoRevert "Add new mbmi and mbmi2 compiler flags"
Ben Gamari [Wed, 22 Nov 2017 19:27:55 +0000 (14:27 -0500)] 
Revert "Add new mbmi and mbmi2 compiler flags"

This broke the 32-bit build.

This reverts commit f5dc8ccc29429d0a1d011f62b6b430f6ae50290c.

18 months agoUpdate Hadrian
Ben Gamari [Wed, 22 Nov 2017 13:50:45 +0000 (08:50 -0500)] 
Update Hadrian

18 months agoSquashed 'hadrian/' changes from fa3771fe6b..4499b294e4
Ben Gamari [Wed, 22 Nov 2017 13:47:55 +0000 (08:47 -0500)] 
Squashed 'hadrian/' changes from fa3771fe6b..4499b294e4

4499b294e4 Follow GHC changes
8fd68186b2 Add ways to build hadrian using nix
e5c7a29c23 Do not depend on the in-tree filepath library
9dd7ad2acc Fix dependencies
497184390e Bring mtl dependency back
6c5f5c9bd9 Minor clean up of Hadrian dependencies
9aff81d424 Fix Windows build
fa95caa8df Unbreak `cabal new-build`

git-subtree-dir: hadrian
git-subtree-split: 4499b294e4a53f71f8808d6eb55a7dd0b341cfb8

18 months agoErrUtils: Ensure timing dumps are always output on one line
Ben Gamari [Wed, 22 Nov 2017 03:59:28 +0000 (22:59 -0500)] 
ErrUtils: Ensure timing dumps are always output on one line

This output is supposed to be machine-readable; having random line-breaks
defeats this.

18 months agoErrUtils: Refactor dump file logic
Ben Gamari [Wed, 22 Nov 2017 03:57:27 +0000 (22:57 -0500)] 
ErrUtils: Refactor dump file logic

This refactors the dump file setup path, separating concerns a bit. It also
fixes an exception-unsafe usage of openFile.

18 months agoBump stm submodule
Ben Gamari [Wed, 22 Nov 2017 04:00:13 +0000 (23:00 -0500)] 
Bump stm submodule

18 months agobase: Remove redundant subtraction in (^) and stimes
Ben Gamari [Wed, 22 Nov 2017 02:15:29 +0000 (21:15 -0500)] 
base: Remove redundant subtraction in (^) and stimes

Subtraction `y - 1` is redundant. The value of y is guaranteed to be
positive and odd, so
```
(y - 1) `quot` 2` = `y `quot` 2
```

Test Plan: validate

Reviewers: hvr, bgamari

Reviewed By: bgamari

Subscribers: rwbarton, thomie

GHC Trac Issues: #14439

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

18 months agocmm: Optimise remainders by powers of two
Ben Gamari [Wed, 22 Nov 2017 02:14:31 +0000 (21:14 -0500)] 
cmm: Optimise remainders by powers of two

Test Plan: validate

Reviewers: bgamari, simonmar

Reviewed By: bgamari

Subscribers: rwbarton, thomie

GHC Trac Issues: #14437

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

18 months agotestsuite: Add test for #14257
Ben Gamari [Tue, 21 Nov 2017 23:30:17 +0000 (18:30 -0500)] 
testsuite: Add test for #14257

Subscribers: rwbarton, thomie, duog

GHC Trac Issues: #14257

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

18 months agoTest Trac #14488
Vladislav Zavialov [Tue, 21 Nov 2017 23:28:21 +0000 (18:28 -0500)] 
Test Trac #14488

Summary:
The refactoring in 3f5673f34a2f761423027bf46f64f7499708725f also fixed a
previously unreported issue in the typechecker that prevented defining a
lens to a record field with a constraint. This patch adds a regression
test.

Test Plan: make test TEST=14488

Reviewers: bgamari

Reviewed By: bgamari

Subscribers: int-e, rwbarton, thomie

GHC Trac Issues: #14488

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

18 months agoRemove hadrian sub-dir from .gitignore
Matthew Pickering [Tue, 21 Nov 2017 23:26:16 +0000 (18:26 -0500)] 
Remove hadrian sub-dir from .gitignore

Reviewers: bgamari

Reviewed By: bgamari

Subscribers: rwbarton, thomie

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

18 months agoUpdate leftover reference to refer to [FunBind vs PatBind]
klebinger.andreas@gmx.at [Tue, 21 Nov 2017 23:25:57 +0000 (18:25 -0500)] 
Update leftover reference to refer to [FunBind vs PatBind]

Reviewers: bgamari, mpickering

Reviewed By: mpickering

Subscribers: rwbarton, thomie, mpickering

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

18 months agoAdd warn-missing-export-lists
Evan Rutledge Borden [Tue, 21 Nov 2017 23:06:01 +0000 (18:06 -0500)] 
Add warn-missing-export-lists

Many industrial users have aligned around the idea that implicit exports
are an anti-pattern. They lead to namespace pollution and byzantine
naming schemes. They also prevent GHC's dead code analysis and create
more obstacles to optimization. This warning allows teams/projects to
warn on or enforce via -Werror explicit export lists.

This warning also serves as a complement to warn-missing-import-lists.

This was originally discussed here:
https://github.com/ghc-proposals/ghc-proposals/pull/93

Test Plan: Three new minimal tests have been added to the type checker.

Reviewers: bgamari

Reviewed By: bgamari

Subscribers: rwbarton, thomie

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

18 months agorts: Fix inconsistencies in how retainer and heap censuses are timed.
Douglas Wilson [Tue, 21 Nov 2017 23:05:22 +0000 (18:05 -0500)] 
rts: Fix inconsistencies in how retainer and heap censuses are timed.

mut_elapsed should deduct retainer profiling and heap censuses, just as
mut_cpu does.

mutator_cpu_ns should not deduct retainer profiling or heap censuses,
since those times are included in stats.gc_cpu_ns.

Reviewers: bgamari, erikd, simonmar

Reviewed By: simonmar

Subscribers: rwbarton, thomie

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

18 months agorts: Move libdwPrintBacktrace to public interface
Ben Gamari [Tue, 21 Nov 2017 23:04:34 +0000 (18:04 -0500)] 
rts: Move libdwPrintBacktrace to public interface

Reviewers: erikd, simonmar

Reviewed By: simonmar

Subscribers: rwbarton, thomie

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

18 months agoUpdate ANNOUNCE
Ben Gamari [Tue, 21 Nov 2017 22:23:49 +0000 (17:23 -0500)] 
Update ANNOUNCE

18 months agoCircleCI: Add webhook for Harbormaster builds
Ben Gamari [Wed, 22 Nov 2017 00:20:49 +0000 (19:20 -0500)] 
CircleCI: Add webhook for Harbormaster builds

18 months agoRevert "trees that grow" work
Ben Gamari [Tue, 21 Nov 2017 19:28:58 +0000 (14:28 -0500)] 
Revert "trees that grow" work

As documented in #14490, the Data instances currently blow up
compilation time by too much to stomach. Alan will continue working on
this in a branch and we will perhaps merge to 8.2 before 8.2.1 to avoid
having to perform painful cherry-picks in 8.2 minor releases.

Reverts haddock submodule.

This reverts commit 47ad6578ea460999b53eb4293c3a3b3017a56d65.
This reverts commit e3ec2e7ae94524ebd111963faf34b84d942265b4.
This reverts commit 438dd1cbba13d35f3452b4dcef3f94ce9a216905.
This reverts commit 0ff152c9e633accca48815e26e59d1af1fe44ceb.

18 months agobase: Document GHC.Stack.CCS internals
Ben Gamari [Tue, 21 Nov 2017 19:27:51 +0000 (14:27 -0500)] 
base: Document GHC.Stack.CCS internals

Reviewers: hvr

Subscribers: rwbarton, thomie

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

18 months agoconfigure: Fix ar probed flags
Ben Gamari [Tue, 21 Nov 2017 19:27:11 +0000 (14:27 -0500)] 
configure: Fix ar probed flags

FP_PROG_AR_ARGS appears to be probing for what flags to use to build an
archive with an index. However, none of the flags that it probed
previously were valid as they all started with `c`, which isn't a mode
character. This went unnoticed until someone attempted to use LLVM ar
since we have a special case for gnu ar.

Additionally, we work around a bug in llvm-ar 5.0 where ar will exit
with code 0 even if it fails to parse the command line. Silliness.

I believe these should rather all be mode `q` however I'll need to test
this on a few platforms to be certain.

Test Plan: Validate on OS X, BSD, and Linux with binutils and llvm ar

Reviewers: hvr

Subscribers: rwbarton, thomie, erikd

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

18 months agoCircleCI: Disable artifact collection on OS X
Ben Gamari [Tue, 21 Nov 2017 19:22:22 +0000 (14:22 -0500)] 
CircleCI: Disable artifact collection on OS X

The storeartifacts step inexplicably hangs on OS X. I am currently be working
with CircleCI support to resolve this.

18 months agorel-notes: Fix up formatting in release notes
Ben Gamari [Mon, 20 Nov 2017 22:14:03 +0000 (17:14 -0500)] 
rel-notes: Fix up formatting in release notes

18 months agoghc-pkg: Add missing newlines to usage message
Ben Gamari [Mon, 20 Nov 2017 22:13:16 +0000 (17:13 -0500)] 
ghc-pkg: Add missing newlines to usage message

18 months agoBump haddock submodule
Ben Gamari [Mon, 20 Nov 2017 13:12:15 +0000 (08:12 -0500)] 
Bump haddock submodule

18 months agoBump hsc2hs submodule
Ben Gamari [Mon, 20 Nov 2017 03:13:07 +0000 (22:13 -0500)] 
Bump hsc2hs submodule

18 months agoStop generating make files when using hadrian.
Moritz Angermann [Mon, 20 Nov 2017 03:12:09 +0000 (22:12 -0500)] 
Stop generating make files when using hadrian.

The boot script generates lots of .mk files
for the make based build system. This change adds
a `--hadrian` flag to `boot`, which skips the `.mk`
file generation.

Reviewers: bgamari

Subscribers: rwbarton, thomie

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

18 months agoRename ghc-version -> ghcversion-file
Moritz Angermann [Mon, 20 Nov 2017 03:11:43 +0000 (22:11 -0500)] 
Rename ghc-version -> ghcversion-file

Reviewers: bgamari

Reviewed By: bgamari

Subscribers: rwbarton, thomie

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

18 months agoFix #elfi -> #elif; unbreak -Werror.
Moritz Angermann [Sun, 19 Nov 2017 23:46:01 +0000 (18:46 -0500)] 
Fix #elfi -> #elif; unbreak -Werror.

Reviewers: bgamari, erikd

Reviewed By: bgamari

Subscribers: rwbarton, thomie

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

18 months agobase: Make documentation of atomically more accurate
Andrew Martin [Sat, 18 Nov 2017 19:43:20 +0000 (14:43 -0500)] 
base: Make documentation of atomically more accurate

18 months agoFix T4437
Bartosz Nitka [Sat, 18 Nov 2017 14:11:38 +0000 (14:11 +0000)] 
Fix T4437

This test tests if the flags are in sync between GHC and
Cabal.
After b0b80e9 'Implement the basics of hex floating point
literals' landed, the Cabal side had to be updated. That
has been done, and 835d8dd 'GHC.Prim use virtual-modules'
brought the Cabal submodule up to date.

19 months agoFix rts.cabal.in
Moritz Angermann [Sat, 18 Nov 2017 07:05:31 +0000 (15:05 +0800)] 
Fix rts.cabal.in

Overlap with commit 2f463873, resulted in `hooks/LongGCSync.c`
missing from the `rts.cabal.in` file.  As the `rts.cabal` file is only
used by hadrian, this did not trigger with the make base build
system which can do globbing.

Also ignore the `rts.cabal` file, as it's generated by configure
from the `rts.cabal.in`.

19 months agoRelocatable GHC
Moritz Angermann [Fri, 17 Nov 2017 07:04:50 +0000 (15:04 +0800)] 
Relocatable GHC

GHC and the binary distribution that's produced is
not relocatable outside of Windows.  This diff tries to
address this for at least Linux and macOS.

Reviewers: austin, hvr, bgamari, erikd, goldfire, Phyx

Reviewed By: bgamari

Subscribers: duog, rwbarton, thomie, erikd

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

19 months agoGHC.Prim use virtual-modules
Moritz Angermann [Thu, 16 Nov 2017 14:54:11 +0000 (22:54 +0800)] 
GHC.Prim use virtual-modules

Stop the GHC.Prim madness with `virtual-module` support from cabal.
Needs https://github.com/haskell/cabal/pull/4875.

Bumps submodule libraries/Cabal to include the necessary logic for `virtual-module`.

Reviewers: bgamari

Reviewed By: bgamari

Subscribers: rwbarton, thomie

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