10 months agoUpdate haskeline submodule
Herbert Valerio Riedel [Sun, 27 Jan 2019 21:35:36 +0000 (22:35 +0100)] 
Update haskeline submodule

10 months agoUpdate deepseq submodule
Herbert Valerio Riedel [Sun, 27 Jan 2019 21:35:36 +0000 (22:35 +0100)] 
Update deepseq submodule

10 months agoUpdate unix submodule
Herbert Valerio Riedel [Sun, 27 Jan 2019 21:35:35 +0000 (22:35 +0100)] 
Update unix submodule

10 months agoUpdate text submodule
Herbert Valerio Riedel [Sun, 27 Jan 2019 21:35:35 +0000 (22:35 +0100)] 
Update text submodule

10 months agoUpdate hsc2hs submodule
Herbert Valerio Riedel [Sun, 27 Jan 2019 14:33:22 +0000 (15:33 +0100)] 
Update hsc2hs submodule

10 months agoPPC NCG: Promote integers to word size in C calls
Peter Trommler [Wed, 23 Jan 2019 22:13:57 +0000 (23:13 +0100)] 
PPC NCG: Promote integers to word size in C calls

Fixes #16222

10 months agoSmall optimizations to BlockLayout. [Thu, 24 Jan 2019 23:08:21 +0000 (00:08 +0100)] 
Small optimizations to BlockLayout.

* Remove `takeL/R 1` occurences by lastOL/headOL.

* Make BlockChain a OrdList newtype by removing the set of blocks.

Initially BlockChain contained both, a set for membership test
and a ordered list of blocks. The set is not used for any
performance sensitive lookups so we get rid of it.

10 months agoReplace BlockSequence with OrdList in BlockLayout.hs [Thu, 24 Jan 2019 22:02:51 +0000 (23:02 +0100)] 
Replace BlockSequence with OrdList in BlockLayout.hs

OrdList does the same thing and more so there is no reason
to have both.

10 months agotestsuite: Add test for #14828
Ben Gamari [Tue, 22 Jan 2019 21:58:04 +0000 (16:58 -0500)] 
testsuite: Add test for #14828

10 months agoIntroduce GhciMonad and generalize types of functions in GHCi.UI
Zejun Wu [Tue, 22 Jan 2019 00:28:01 +0000 (16:28 -0800)] 
Introduce GhciMonad and generalize types of functions in GHCi.UI

Introduce `GhciMonad`, which is bascially `GhcMonad` + `HasGhciState`.
Generalize the commands and help functions defined in `GHCi.UI` so they
can be used as both `GHCi a` and `InputT GHCi a`.

The long term plan is to move reusable bits to ghci library and make it
easier to build a customized interactive ui which carries customized state
and provides customized commands.

Most changes are trivial in this diff by relaxing the type constraint or
add/remove lift as necessary. The non-trivial changes are:

* Change `HasGhciState` to `GhciMonad` and expose it.
* Implementation of `reifyGHCi`.

Test Plan:

Reviewers: simonmar, hvr, bgamari

Reviewed By: simonmar

Subscribers: rwbarton, carter

Differential Revision:

10 months agoAdd O2 to hsCompiler on stage0 for most hadrian flavours. [Fri, 25 Jan 2019 00:27:05 +0000 (01:27 +0100)] 
Add O2 to hsCompiler on stage0 for most hadrian flavours.

10 months agoUse O2 on stage1 for faster overall build times with make. [Thu, 24 Jan 2019 19:20:39 +0000 (20:20 +0100)] 
Use O2 on stage1 for faster overall build times with make.

Build times when using the quick flavour:

stage1 opt | time (wall) | time (user)
     -O1   |        13m  |        53m
     -O2   |        13m  |        51m
So even when we compile stage2 with -O0 (quick)
using -O2 on stage1 is already faster.

The difference is even bigger when freezing
stage1 and doing multiple builds or compiling
stage2 with optimizations.

10 months agoAdd -fdefer-diagnostics to defer and group diagnostic messages in make-mode
Zejun Wu [Fri, 28 Dec 2018 08:10:22 +0000 (00:10 -0800)] 
Add -fdefer-diagnostics to defer and group diagnostic messages in make-mode

When loading many modules in parallel there can a lot of warnings and
errors get mixed up with regular output. When the compilation fails,
the relevant error message can be thousands of lines backward and is
hard to find. When the compilation successes, warning message is likely
to be ignored as it is not seen. We can address this by deferring the
warning and error message after the compilation. We also put errors
after warnings so it is more visible.

This idea was originally proposed by Bartosz Nitka in

10 months agohWaitForInput-accurate-stdin test
Ben Gamari [Thu, 31 Jan 2019 04:36:17 +0000 (23:36 -0500)] 
hWaitForInput-accurate-stdin test

10 months agoOptimize pprASCII
Sylvain Henry [Thu, 17 Jan 2019 23:01:45 +0000 (00:01 +0100)] 
Optimize pprASCII

* Use `ByteString.foldr` instead of `(List.foldr . BS.unpack)`
* Avoid calling `chr` and its test that checks for invalid Unicode
codepoints: we stay in the ASCII range so we know we're ok
* Avoid calling `isPrint` (unsafe FFI call): we can check the ASCII
printable range directly
* Use bit operations (`unsafeShiftR`, `.&.`) instead of `div` and `mod`

10 months agoUse ByteString to represent Cmm string literals (#16198)
Sylvain Henry [Thu, 17 Jan 2019 12:34:32 +0000 (13:34 +0100)] 
Use ByteString to represent Cmm string literals (#16198)

Also used ByteString in some other relevant places

10 months agoFix syntax in CODEOWNERS file
Matthew Pickering [Wed, 30 Jan 2019 12:28:08 +0000 (07:28 -0500)] 
Fix syntax in CODEOWNERS file

[skip ci]

10 months agoDon't use X86_64_ELF_NONPIC_HACK for +RTS -xp
Zejun Wu [Sat, 29 Dec 2018 04:48:31 +0000 (20:48 -0800)] 
Don't use X86_64_ELF_NONPIC_HACK for +RTS -xp

When `+RTS -xp` is passed, when don't need the X86_64_ELF_NONPIC_HACK,
becasue the relocation offset should only be out of range if

* the object file was not compiled with `-fPIC -fexternal-dynamic-refs`;
* ghc generates non-pic code while it should (e.g. #15723)

In either case, we should print an error message rather that silently
attempt to use a hacky workaround that may not work.

This could have made debugging #15723 and #15729 much easier.

Test Plan:
Run this in a case where ghci used to crash becasue of T15723. Now we
see helpful message like:

ghc-iserv-prof: R_X86_64_PC32 relocation out of range:

Reviewers: simonmar, bgamari, erikd

Reviewed By: simonmar, bgamari

Subscribers: rwbarton, carter

Differential Revision:

10 months agoAllocate bss section within proper range of other sections
Zejun Wu [Sat, 29 Dec 2018 04:47:33 +0000 (20:47 -0800)] 
Allocate bss section within proper range of other sections

This re-applies {D5195} and {D5235}, they were reverted as part of diff
stack to unbreak i386. The proper fix is done in {D5289}.

Allocate bss section within proper range of other sections:

* when `+RTS -xp` is passed, allocate it contiguously as we did for
  jump islands
* when we mmap the code to lower 2Gb, we should allocate bss section
  there too

Test Plan:
1. `./validate`




`TEST="T15729" make test` passed in both linux (both i386 and x86_64) and macos.


Also test in a use case where we used to encouter error like:

ghc-iserv-prof: R_X86_64_PC32 relocation out of range: (noname) =

and now, everything works fine.

Reviewers: simonmar, bgamari, angerman, erikd

Reviewed By: simonmar

Subscribers: rwbarton, carter

GHC Trac Issues: #15729

Differential Revision:

10 months agoAdd a RTS option -xp to load PIC object anywhere in address space
Zejun Wu [Sat, 29 Dec 2018 04:37:13 +0000 (20:37 -0800)] 
Add a RTS option -xp to load PIC object anywhere in address space

This re-applies {D5195} with fixes for i386:
* Fix unused label warnings, see {D5230} or {D5273}
* Fix a silly bug introduced by moving `#if`


Add a RTS option -xp to load PIC object anywhere in address space. We do
this by relaxing the requirement of <0x80000000 result of
`mmapForLinker` and implying USE_CONTIGUOUS_MMAP.

We also need to change calls to `ocInit` and `ocGetNames` to avoid
dangling pointers when the address of `oc->image` is changed by

Test Plan:
See {D5195}, also test under i386:

$ uname -a
Linux watashi-arch32 4.18.5-arch1-1.0-ARCH #1 SMP PREEMPT Tue Aug 28
20:45:30 CEST 2018 i686 GNU/Linux
$ cd testsuite/tests/th/ && make test

will run `./validate` on stacked diff.

Reviewers: simonmar, bgamari, alpmestan, trommler, hvr, erikd

Reviewed By: simonmar

Subscribers: rwbarton, carter

Differential Revision:

10 months agoAPI Annotations: Parens not attached correctly for ClassDecl
Alan Zimmerman [Thu, 24 Jan 2019 08:14:55 +0000 (10:14 +0200)] 
API Annotations: Parens not attached correctly for ClassDecl

The parens around the kinded tyvars should be attached to the class
declaration as a whole, they are attached to the tyvar instead,
outside the span.

An annotation must always be within or after the span it is contained

Closes #16212

10 months agoOnly build vanilla way in devel2 flavour
Matthew Pickering [Fri, 25 Jan 2019 15:48:54 +0000 (15:48 +0000)] 
Only build vanilla way in devel2 flavour

Fixes #16210

10 months agoInclude type info for only some exprs in HIE files
Alec Theriault [Fri, 25 Jan 2019 01:33:52 +0000 (17:33 -0800)] 
Include type info for only some exprs in HIE files

This commit relinquishes some some type information in `.hie` files in
exchange for better performance. See #16233 for more on this.

Using `.hie` files to generate hyperlinked sources is a crucial milestone
towards Hi Haddock (the initiative to move Haddock to work over `.hi`
files and embed docstrings in those). Unfortunately, even after much
optimization on the Haddock side, the `.hie` based solution is still
considerably slower and more memory hungry than the existing implementation
- and the @.hie@ code is to blame.

This changes `.hie` file generation to track type information for only
a limited subset of expressions (specifically, those that might eventually
turn into hyperlinks in the Haddock's hyperlinker backend).

10 months agoUse `NameEnv Id` instead of `Map Name Id`
Alec Theriault [Thu, 24 Jan 2019 21:59:18 +0000 (13:59 -0800)] 
Use `NameEnv Id` instead of `Map Name Id`

This is more consistent with the rest of the GHC codebase.

10 months agomake ghc-pkg shut up
Moritz Angermann [Wed, 23 Jan 2019 02:59:38 +0000 (10:59 +0800)] 
make ghc-pkg shut up

10 months agoAvoid compiling Hadrian dependencies with profiling on Cabal/Linux
Neil Mitchell [Wed, 16 Jan 2019 16:21:00 +0000 (11:21 -0500)] 
Avoid compiling Hadrian dependencies with profiling on Cabal/Linux

10 months agoAvoid compiling Hadrian dependencies with profiling on Cabal/Windows
Neil Mitchell [Wed, 16 Jan 2019 16:20:27 +0000 (11:20 -0500)] 
Avoid compiling Hadrian dependencies with profiling on Cabal/Windows

10 months agogitlab-ci: Use build cleanup logic on Darwin as well
Ben Gamari [Mon, 21 Jan 2019 15:55:48 +0000 (10:55 -0500)] 
gitlab-ci: Use build cleanup logic on Darwin as well

We use the shell executor on Darwin as well as Windows.

10 months agoCompile count{Leading,Trailing}Zeros to corresponding x86_64 instructions under ...
Dmitry Ivanov [Sat, 8 Dec 2018 15:45:02 +0000 (16:45 +0100)] 
Compile count{Leading,Trailing}Zeros to corresponding x86_64 instructions under -mbmi2

This works similarly to existing implementation for popCount.
Trac ticket: #16086.

10 months agoPerformance tests: recover a baseline from ancestor commits and CI results.
David Eichmann [Tue, 22 Jan 2019 14:57:23 +0000 (09:57 -0500)] 
Performance tests: recover a baseline from ancestor commits and CI results.

gitlab-ci: push performance metrics as git notes to the "GHC Performance Notes" repository.

10 months agotestsuite: Use makefile_test
Ben Gamari [Mon, 21 Jan 2019 04:46:13 +0000 (23:46 -0500)] 
testsuite: Use makefile_test

This eliminates most uses of run_command in the testsuite in favor of the more
structured makefile_test.

10 months agotestsuite: Introduce makefile_test
Ben Gamari [Mon, 21 Jan 2019 03:54:48 +0000 (22:54 -0500)] 
testsuite: Introduce makefile_test

10 months agoRevert "Batch merge"
Ben Gamari [Wed, 30 Jan 2019 15:05:19 +0000 (10:05 -0500)] 
Revert "Batch merge"

This reverts commit 76c8fd674435a652c75a96c85abbf26f1f221876.

10 months agoBatch merge
Ben Gamari [Wed, 30 Jan 2019 06:06:12 +0000 (01:06 -0500)] 
Batch merge

10 months agoFix #12509: ghci -XSafe fails in an inscrutable way
Roland Senn [Mon, 28 Jan 2019 09:53:50 +0000 (10:53 +0100)] 
Fix #12509: ghci -XSafe fails in an inscrutable way

10 months agoUse sigPrec in more places in Convert and HsUtils
Ryan Scott [Tue, 15 Jan 2019 02:45:17 +0000 (21:45 -0500)] 
Use sigPrec in more places in Convert and HsUtils

Trac #16183 was caused by TH conversion (in `Convert`) not properly
inserting parentheses around occurrences of explicit signatures where
appropriate, such as in applications, function types, and type family
equations. Solution: use `parenthesizeHsType sigPrec` in these
places. While I was in town, I also updated `nlHsFunTy` to do the
same thing.

10 months agoSome refactoring in tcInferApps
Richard Eisenberg [Fri, 11 Jan 2019 22:38:01 +0000 (17:38 -0500)] 
Some refactoring in tcInferApps

Should be no change in behavior, but this makes the control
flow a little more apparent.

10 months agoTest that hsc2hs works with promoted data constructors
Andrew Martin [Mon, 21 Jan 2019 21:04:30 +0000 (16:04 -0500)] 
Test that hsc2hs works with promoted data constructors

10 months agogitlab-ci: Fix Windows cleanup command line
Ben Gamari [Wed, 23 Jan 2019 15:09:49 +0000 (10:09 -0500)] 
gitlab-ci: Fix Windows cleanup command line

Why is it so hard to delete a directory's contents without deleting the
directory itself in Windows? This will forever remain a mystery.

10 months agoUpdate CODEOWNERS files with utils
Tamar Christina [Sun, 27 Jan 2019 22:20:38 +0000 (22:20 +0000)] 
Update CODEOWNERS files with utils

10 months agoFix regDotColor for amd64. [Fri, 25 Jan 2019 22:05:05 +0000 (23:05 +0100)] 
Fix regDotColor for amd64.

Add missing color mappings to regDotColor for amd64.
Also set fakeRegs to red instead of xmm regs.

10 months agoFix incorrectly named configure options
Alec Theriault [Sun, 27 Jan 2019 02:07:48 +0000 (18:07 -0800)] 
Fix incorrectly named configure options

Although we should use 'AC_ARG_ENABLE' for boolean flags, it also
means options get named '--enable-*', not '--with-*'. This should
unbreak the --with-intree-gmp option.

10 months agoDon't overwrite the set log_action when using --interactive
Matthew Pickering [Mon, 21 Jan 2019 01:58:01 +0000 (20:58 -0500)] 
Don't overwrite the set log_action when using --interactive

-ddump-json didn't work with --interactive as --interactive overwrote
the log_action in terms of defaultLogAction.

Reviewers: bgamari

Subscribers: rwbarton, thomie, carter

GHC Trac Issues: #14078

Differential Revision:

10 months agoAdd @simonmar to various things in CODEOWNERS
Simon Marlow [Tue, 22 Jan 2019 16:23:08 +0000 (11:23 -0500)] 
Add @simonmar to various things in CODEOWNERS

10 months agoUpdate CODEOWNERS
Moritz Angermann [Tue, 22 Jan 2019 15:51:46 +0000 (10:51 -0500)] 

10 months agoAdd myself to a few more places
Ömer Sinan Ağacan [Tue, 22 Jan 2019 15:48:37 +0000 (18:48 +0300)] 
Add myself to a few more places

10 months agotestsuite: Add tests from #11982
Ben Gamari [Tue, 22 Jan 2019 16:27:30 +0000 (11:27 -0500)] 
testsuite: Add tests from #11982

10 months agotestsuite: Skip foreignInterruptible in unregisterised way
Ben Gamari [Thu, 24 Jan 2019 02:32:47 +0000 (21:32 -0500)] 
testsuite: Skip foreignInterruptible in unregisterised way

See #15467.

10 months agotestsuite: Skip T1288_ghci in unregisterised
Ben Gamari [Tue, 22 Jan 2019 17:13:28 +0000 (12:13 -0500)] 
testsuite: Skip T1288_ghci in unregisterised

As pointed out in #16085, these ghci tests are fragile in the unregisterised

10 months agocheck-api-annotations checks for annotation preceding its span
Alan Zimmerman [Tue, 22 Jan 2019 21:29:25 +0000 (23:29 +0200)] 
check-api-annotations checks for annotation preceding its span

For an API annotation to be useful, it must not occur before the span
it is enclosed in.

So, for check-api-annotation output, a line such as

((Test16212.hs:3:22-36,AnnOpenP), [Test16212.hs:3:21]),

should be flagged as an error, as the AnnOpenP location of 3:21
precedes its enclosing span of 3:22-26.

This patch does this.

Closes #16217

10 months agohadrian: use new-exec to make sure alex & happy are in PATH (#16120)
Adam Sandberg Eriksson [Wed, 2 Jan 2019 21:08:49 +0000 (22:08 +0100)] 
hadrian: use new-exec to make sure alex & happy are in PATH (#16120)

10 months agoUpdate Cabal submodule to latest master branch tip
Herbert Valerio Riedel [Wed, 23 Jan 2019 00:01:15 +0000 (01:01 +0100)] 
Update Cabal submodule to latest master branch tip

10 months agoUpdate binary submodule to latest master branch tip
Herbert Valerio Riedel [Wed, 23 Jan 2019 22:26:49 +0000 (23:26 +0100)] 
Update binary submodule to latest master branch tip

10 months agotestsuite: Mark hWaitForInput-accurate-socket as requiring unix
Ben Gamari [Wed, 23 Jan 2019 18:06:45 +0000 (13:06 -0500)] 
testsuite: Mark hWaitForInput-accurate-socket as requiring unix

It imports System.Posix.IO.

10 months agotestsuite: Remove directories that already exist when seeding extra_files
Ben Gamari [Mon, 21 Jan 2019 03:36:22 +0000 (22:36 -0500)] 
testsuite: Remove directories that already exist when seeding extra_files

Otherwise the testsuite driver crashes when run multiple times with CLEANUP=NO
on a test containing such extra_files.

10 months agotestsuite: Normalise style
Ben Gamari [Mon, 21 Jan 2019 03:32:09 +0000 (22:32 -0500)] 
testsuite: Normalise style

10 months agoGhcPlugins: Fix lookup of TH names
Ben Gamari [Sat, 19 Jan 2019 18:59:18 +0000 (13:59 -0500)] 
GhcPlugins: Fix lookup of TH names

Previously `thNameToGhcName` was calling `lookupOrigNameCache` directly, which
failed to handle the case that the name wasn't already in the name cache. This
happens, for instance, when the name was in scope in a plugin being used during
compilation but not in scope in the module being compiled. In this case we the
interface file containing the name won't be loaded and `lookupOrigNameCache`
fails. This was the cause of #16104.

The solution is simple: use the nicely packaged `lookupOrigIO` instead.

10 months agotestsuite: Add test for #16104
Ben Gamari [Tue, 15 Jan 2019 16:48:59 +0000 (11:48 -0500)] 
testsuite: Add test for #16104

10 months agotestsuite: Add predicate for CPU feature availability
Ben Gamari [Thu, 27 Dec 2018 19:41:01 +0000 (14:41 -0500)] 
testsuite: Add predicate for CPU feature availability

Previously testing code-generation for ISA extensions was nearly impossible
since we had no ability to determine whether the host supports the needed
extension. Here we fix this by introducing a simple /proc/cpuinfo-based
testsuite predicate. We really ought to

10 months agoAdd @sgraf to CODEOWNERS
Sebastian Graf [Sat, 26 Jan 2019 17:44:23 +0000 (12:44 -0500)] 
Add @sgraf to CODEOWNERS

[skip ci]

10 months agoAdd Simon and Richard as more CODEOWNERS
Richard Eisenberg [Fri, 25 Jan 2019 03:27:00 +0000 (22:27 -0500)] 
Add Simon and Richard as more CODEOWNERS

[skip ci]

10 months agogitlab-ci: Explicitly clear dependencies of all jobs
Ben Gamari [Tue, 22 Jan 2019 19:21:31 +0000 (14:21 -0500)] 
gitlab-ci: Explicitly clear dependencies of all jobs

Apparently GitLab CI defaults to declaring all jobs of the previous
stage as dependencies of a job. This meant that we would end up
downloading all of our binary distributions during the `cleanup` stage,
eating up a truly remarkable amount of S3 tranfers.

10 months agotestsuite: Skip ghcilink002 when unregisterised
Ben Gamari [Tue, 22 Jan 2019 23:40:36 +0000 (18:40 -0500)] 
testsuite: Skip ghcilink002 when unregisterised

See #16085.

10 months agoMinor refactor [ci skip]
Gabor Greif [Tue, 22 Jan 2019 11:13:28 +0000 (12:13 +0100)] 
Minor refactor [ci skip]

10 months agoA few typofixes
Gabor Greif [Tue, 22 Jan 2019 11:07:47 +0000 (12:07 +0100)] 
A few typofixes

10 months agogitlab-ci: Drop CircleCI jobs
Ben Gamari [Tue, 22 Jan 2019 19:25:05 +0000 (14:25 -0500)] 
gitlab-ci: Drop CircleCI jobs

It's pretty unlikely we will be going back to circleci at this point


10 months agoError out of invalid Int/Word bit shifts
Alec Theriault [Fri, 11 Jan 2019 07:44:04 +0000 (23:44 -0800)] 
Error out of invalid Int/Word bit shifts

Although the Haddock's for `shiftL` and `shiftR` do require the number
of bits to be non-negative, we should still check this before calling
out to primitives (which also have undefined behaviour for negative bit

If a user _really_ wants to bypass checks that the number of bits is
sensible, they already have the aptly-named `unsafeShiftL`/`unsafeShiftR`
at their disposal.

See #16111.

10 months agogitlab: Collect artifacts on Windows
Ben Gamari [Wed, 16 Jan 2019 04:21:39 +0000 (23:21 -0500)] 
gitlab: Collect artifacts on Windows

10 months agoUpdate Darwin CI to use new toplevel --with-intree-gmp configure flag
Alec Theriault [Tue, 22 Jan 2019 03:25:29 +0000 (19:25 -0800)] 
Update Darwin CI to use new toplevel --with-intree-gmp configure flag

10 months agoHadrian: support in-tree GMP
Alec Theriault [Thu, 6 Dec 2018 04:46:21 +0000 (20:46 -0800)] 
Hadrian: support in-tree GMP

This adds top-level configure flags '--with-intree-gmp' and
'--with-framework-preferred', both of which are especially relevant
on MacOS.

Besides gaining two new flags, Hadrian also had to be taught what to
do with the 'framework' in .cabal files.

Test Plan:
./boot && ./configure --with-intree-gmp && ./hadrian/
./boot && ./configure --with-gmp-framework-preferred && ./hadrian/ # on macos

Reviewers: carter, snowleopard, alpmestan, hvr, goldfire, bgamari

Subscribers: rwbarton, erikd

GHC Trac Issues: #16001

Differential Revision:

10 months agogitlab-ci: Disallow failure
Ben Gamari [Thu, 17 Jan 2019 18:56:00 +0000 (13:56 -0500)] 
gitlab-ci: Disallow failure

10 months agotestsuite: Mark T16180 as broken on Darwin
Ben Gamari [Wed, 23 Jan 2019 00:08:07 +0000 (19:08 -0500)] 
testsuite: Mark T16180 as broken on Darwin

See #16218.

10 months agotestsuite: Mark ghci063 as broken on Darwin
Ben Gamari [Thu, 17 Jan 2019 18:55:00 +0000 (13:55 -0500)] 
testsuite: Mark ghci063 as broken on Darwin

This is the last failing test on Darwin preventing us from disallowing CI
failures. See #16201.

10 months agoHadrian: install patches 'haddock-{html,interface}'
Alec Theriault [Sat, 19 Jan 2019 09:06:00 +0000 (01:06 -0800)] 
Hadrian: install patches 'haddock-{html,interface}'

Since the `$(docdir)` can be picked independently from the `$(libdir)`,
we need to make sure that that the `haddock-html` and `haddock-interface`
fields in the package DB (which is in the `$(libdir)`) get updated to
point to the appropriate places in the `$(docdir)`.

NB: in the make system, `ghc-cabal` would cover this sort of thing by
re-running `configure` on installation, but here we get away with a
couple lines of `sed` and a call to `ghc-pkg recache`.

Fixes #16202.

10 months agotestsuite: Ensure that config.{msys,cygwin} are initialized
Ben Gamari [Mon, 21 Jan 2019 01:45:34 +0000 (20:45 -0500)] 
testsuite: Ensure that config.{msys,cygwin} are initialized

Reviewers: monoidal

Reviewed By: monoidal

Subscribers: monoidal, rwbarton, carter

Differential Revision:

10 months agoAdd myself to CODEOWNERS for a few files
Joachim Breitner [Tue, 22 Jan 2019 09:57:52 +0000 (10:57 +0100)] 
Add myself to CODEOWNERS for a few files

10 months agoMinor typo in docs for KProxy
Joachim Breitner [Tue, 22 Jan 2019 10:17:57 +0000 (11:17 +0100)] 
Minor typo in docs for KProxy

really minor, but it annoyed me when reading it :-)

10 months agoFix hadrian prof flavour so that it builds a profiled version of GHC
Matthew Pickering [Tue, 22 Jan 2019 11:33:18 +0000 (11:33 +0000)] 
Fix hadrian prof flavour so that it builds a profiled version of GHC

In Alp's refactoring of `getProgramContexts` he removed a call to
`getProgramContext` which was where the logic for this used to be

Fixes #16214

10 months agousers guide: fix typesetting of pragmas
Ben Price [Tue, 22 Jan 2019 00:16:14 +0000 (00:16 +0000)] 
users guide: fix typesetting of pragmas

10 months agousers guide: consistent spelling of inlinable
Ben Price [Tue, 22 Jan 2019 00:15:05 +0000 (00:15 +0000)] 
users guide: consistent spelling of inlinable

10 months agogitlab-ci: Reenable Hadrian build on Windows
Ben Gamari [Mon, 21 Jan 2019 20:55:05 +0000 (15:55 -0500)] 
gitlab-ci: Reenable Hadrian build on Windows

10 months agoUpdate transformers module
Herbert Valerio Riedel [Tue, 22 Jan 2019 00:00:10 +0000 (01:00 +0100)] 
Update transformers module

10 months agoFix bogus worker for newtypes
Simon Peyton Jones [Wed, 16 Jan 2019 16:34:24 +0000 (16:34 +0000)] 
Fix bogus worker for newtypes

The "worker" for a newtype is actually a function
with a small (compulsory) unfolding, namely a cast.

But the construction of this function was plain wrong
for newtype /instances/; it cast the arguemnt to the
family type rather than the representation type.

This never actually bit us because, in the case of a
family instance, we immediately cast the result to
the family type.  So we get
   \x. (x |> co1) |> co2

where the compositio of co1 and co2 is ill-kinded.
However the optimiser (even the simple optimiser)
just collapsed those casts, ignoring the mis-match
in the middle, so we never saw the problem.

Trac #16191 is indeed a dup of #16141; but the resaon
these tickets produce Lint errors is not the unnecessary
forcing; it's because of the ill-typed casts.

This patch fixes the ill-typed casts, properly.  I can't
see a way to trigger an actual failure prior to this
patch, but it's still wrong wrong wrong to have ill-typed
casts, so better to get rid of them.

10 months agoExtend linker-script workaround to work with musl libc
Samuel Holland [Mon, 21 Jan 2019 02:20:16 +0000 (20:20 -0600)] 
Extend linker-script workaround to work with musl libc

GHC has code to handle unsuffixed .so files that are linker scripts
pointing to the real shared library. The detection is done by parsing
the result of `dlerror()` after calling `dlopen()` and looking for
certain error strings. On musl libc, the error message is "Exec format
error", which happens to be `strerror(ENOEXEC)`:

$ cat tmp.c
#include <dlfcn.h>
#include <stdio.h>

int main(void) {
        dlopen("", RTLD_NOW | RTLD_GLOBAL);
        return 0;
$ gcc -o tmp tmp.c
$ ./tmp
Error loading shared library Exec format error

This change fixes the workaround to also work on musl libc.

10 months agoAdd CODEOWNERS
Ben Gamari [Mon, 21 Jan 2019 19:42:13 +0000 (14:42 -0500)] 

GitLab uses this file to suggest reviewers based upon the files that a Merge
Request touches.


10 months agogitlab: Add merge request template
Ben Gamari [Sat, 19 Jan 2019 20:47:33 +0000 (15:47 -0500)] 
gitlab: Add merge request template

This begins to define our expectations of contributions.


10 months agoFix typo in TcRnTypes.hs [skip ci]
Matthew Pickering [Mon, 21 Jan 2019 17:17:20 +0000 (12:17 -0500)] 
Fix typo in TcRnTypes.hs [skip ci]

10 months agoAdd support for ASM foreign files (.s) in TH (#16180)
Sylvain Henry [Tue, 15 Jan 2019 12:14:45 +0000 (13:14 +0100)] 
Add support for ASM foreign files (.s) in TH (#16180)

10 months agoRemove TODO in HsExpr
Matthew Pickering [Fri, 18 Jan 2019 16:36:12 +0000 (11:36 -0500)] 
Remove TODO in HsExpr

It is correct to be `GhcTc` as the data type is for expressions which are inside splices
so they can be delayed until desugaring.

10 months agoMention DerivingStrategies in the warning when DAC and GND are both enabled
Chaitanya Koparkar [Mon, 14 Jan 2019 19:36:29 +0000 (14:36 -0500)] 
Mention DerivingStrategies in the warning when DAC and GND are both enabled


When DeriveAnyClass and GeneralizedNewtypeDeriving are both enabled,
GHC prints out a warning that specifies the strategy it used to
derive a class. This patch updates the warning to mention that users
may pick a particular strategy by using DerivingStrategies.

Test plan: make test TEST=T16179

10 months ago[T16199] Adds a verify-packages script
Moritz Angermann [Sun, 20 Jan 2019 10:24:21 +0000 (05:24 -0500)] 
[T16199] Adds a verify-packages script

10 months agoPrepare source-tree for base-4.13 MFP bump
Herbert Valerio Riedel [Tue, 18 Dec 2018 22:36:29 +0000 (23:36 +0100)] 
Prepare source-tree for base-4.13 MFP bump

10 months agoFix typo in DsExpr
Matthew Pickering [Fri, 18 Jan 2019 13:35:08 +0000 (08:35 -0500)] 
Fix typo in DsExpr

10 months agoComments in stranal test declarations
Ömer Sinan Ağacan [Fri, 18 Jan 2019 08:51:59 +0000 (11:51 +0300)] 
Comments in stranal test declarations

10 months agoSmall refactor
Simon Peyton Jones [Thu, 10 Jan 2019 12:08:47 +0000 (12:08 +0000)] 
Small refactor use the same error message rather than duplicating it

10 months agoRemove export of checkValidFamPats, never used
Simon Peyton Jones [Thu, 10 Jan 2019 12:08:15 +0000 (12:08 +0000)] 
Remove export of checkValidFamPats, never used

10 months agoComments about data constructor wrappers
Simon Peyton Jones [Thu, 10 Jan 2019 12:07:57 +0000 (12:07 +0000)] 
Comments about data constructor wrappers

10 months ago'DynFlag'-free version of 'mkParserFlags'
Alec Theriault [Tue, 8 Jan 2019 20:07:07 +0000 (12:07 -0800)] 
'DynFlag'-free version of 'mkParserFlags'

This is a fixed version of the reverted d2fbc33c4ff3074126ab71654af8bbf8a46e4e11
and  5aa29231ab7603537284eff5e4caff3a73dba6d2.

Obtaining a `DynFlags` is difficult, making using the lexer/parser
for pure parsing/lexing unreasonably difficult, even with `mkPStatePure`.
This is despite the fact that we only really need

    * language extension flags
    * warning flags
    * a handful of boolean options

The new `mkParserFlags'` function makes is easier to directly construct a
`ParserFlags`. Furthermore, since `pExtsBitmap` is just a footgun, I've gone
ahead and made `ParserFlags` an abstract type.

Also, we now export `ExtBits` and `getBit` instead of defining/exporting a
bunch of boilerplate functions that test for a particular 'ExtBits'.
In the process, I also

  * cleaned up an unneeded special case for `ITstatic`
  * made `UsePosPrags` another variant of `ExtBits`
  * made the logic in `reservedSymsFM` match that of `reservedWordsFM`

Test Plan: make test

Reviewers: bgamari, alanz, tdammers

Subscribers: sjakobi, tdammers, rwbarton, mpickering, carter

GHC Trac Issues: #11301

Differential Revision:

10 months agoPPC NCG: Rename constructors
Peter Trommler [Thu, 3 Jan 2019 13:04:37 +0000 (14:04 +0100)] 
PPC NCG: Rename constructors

Rename constructors in calling convention data type to reflect the
fact that they represent an ELF ABI not only a Linux ABI.

10 months agoFix tab and improve whitespace
Peter Trommler [Sat, 29 Dec 2018 10:29:02 +0000 (11:29 +0100)] 
Fix tab and improve whitespace