ghc.git
5 months agoForgot an argument to test() wip/T16212-fixed
Sebastian Graf [Fri, 1 Feb 2019 09:24:36 +0000 (10:24 +0100)] 
Forgot an argument to test()

5 months agoExpect T16212 to pass
Sebastian Graf [Thu, 31 Jan 2019 14:58:58 +0000 (15:58 +0100)] 
Expect T16212 to pass

5 months agoFix #16219: TemplateHaskell causes indefinite package build error
Edward Z. Yang [Fri, 1 Feb 2019 01:00:50 +0000 (20:00 -0500)] 
Fix #16219: TemplateHaskell causes indefinite package build error

It should work to write an indefinite package using TemplateHaskell,
so long as all of the actual TH code lives outside of the package.
However, cleverness we had to build TH code even when building
with -fno-code meant that we attempted to build object code for
modules in an indefinite package, even when the signatures were
not instantiated.  This patch disables said logic in the event
that an indefinite package is being typechecked.

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

Reviewers: simonpj, bgamari

Reviewed By: bgamari

Subscribers: rwbarton, carter

GHC Trac Issues: #16219

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

5 months agoRevert "Performance tests: recover a baseline from ancestor commits and CI results."
Ben Gamari [Fri, 1 Feb 2019 00:47:53 +0000 (19:47 -0500)] 
Revert "Performance tests: recover a baseline from ancestor commits and CI results."

Unfortunately this has broken all future commits due to spurious(?)
performance changes which I have been unable to work around.

This reverts commit cc2261d42f6a954d88e355aaad41f001f65c95da.

5 months agoHadrian: Fix outdated link.
Andrey Mokhov [Sun, 27 Jan 2019 22:42:23 +0000 (22:42 +0000)] 
Hadrian: Fix outdated link.

5 months agoHadrian: Update instructions for building on Windows
Andrey Mokhov [Sun, 27 Jan 2019 22:34:30 +0000 (22:34 +0000)] 
Hadrian: Update instructions for building on Windows

The `hadrian/doc/windows.md` file has falled out of date. In particular
it still points to the old GitHub repository, and uses incorrect path
to GHC. This patch fixes it.

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

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

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

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

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

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

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

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

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

5 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

5 months agoSmall optimizations to BlockLayout.
klebinger.andreas@gmx.at [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.

5 months agoReplace BlockSequence with OrdList in BlockLayout.hs
klebinger.andreas@gmx.at [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.

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

5 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

Summary:
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:
  ./validate

Reviewers: simonmar, hvr, bgamari

Reviewed By: simonmar

Subscribers: rwbarton, carter

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

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

5 months agoUse O2 on stage1 for faster overall build times with make.
klebinger.andreas@gmx.at [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.

5 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
https://phabricator.haskell.org/D4219.

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

5 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`

5 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

5 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]

5 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

Summary:
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:
stmzm2zi4zi4zi1zmJQn4hNPyYjP5m9AcbI88Ve_ControlziConcurrentziSTMziTMVar_readTMVar_C61n_cc
9b95ffac
```

Reviewers: simonmar, bgamari, erikd

Reviewed By: simonmar, bgamari

Subscribers: rwbarton, carter

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

5 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

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

2.

with

```
DYNAMIC_GHC_PROGRAMS = NO
DYNAMIC_BY_DEFAULT = NO
```

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

3.

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) =
b90282ba
```

and now, everything works fine.

Reviewers: simonmar, bgamari, angerman, erikd

Reviewed By: simonmar

Subscribers: rwbarton, carter

GHC Trac Issues: #15729

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

5 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

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

{P190}

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
`ocAllocateSymbolExtra`.

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: https://phabricator.haskell.org/D5289

5 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
in.

Closes #16212

5 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

5 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).

5 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.

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

5 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

5 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

5 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.
See https://gitlab.com/gitlab-org/gitlab-runner/issues/3856.

5 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.

5 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.

5 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.

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

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

This reverts commit 76c8fd674435a652c75a96c85abbf26f1f221876.

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

5 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

5 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.

5 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.

5 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

5 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.

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

5 months agoFix regDotColor for amd64.
klebinger.andreas@gmx.at [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.

5 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.

5 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: https://phabricator.haskell.org/D4533

5 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

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

5 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

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

5 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.

5 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
way.

5 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

5 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)

5 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

5 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

5 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.

5 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.

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

5 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.

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

5 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

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

[skip ci]

5 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]

5 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.

5 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.

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

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

5 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

[skip-ci]

5 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
shifts).

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.

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

5 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

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

Summary:
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/build.sh
./boot && ./configure --with-gmp-framework-preferred && ./hadrian/build.sh # on macos

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

Subscribers: rwbarton, erikd

GHC Trac Issues: #16001

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

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

5 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.

5 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.

5 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.

5 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: https://phabricator.haskell.org/D5056

5 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

5 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 :-)

5 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
implemented.

Fixes #16214

5 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

5 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

5 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

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

6 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.

6 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("libz.so", RTLD_NOW | RTLD_GLOBAL);
        puts(dlerror());
        return 0;
}
$ gcc -o tmp tmp.c
$ ./tmp
Error loading shared library libz.so: Exec format error
$
```

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

Link: https://phabricator.haskell.org/D5474
6 months agoAdd CODEOWNERS
Ben Gamari [Mon, 21 Jan 2019 19:42:13 +0000 (14:42 -0500)] 
Add CODEOWNERS

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

[skip-ci]

6 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.

[skip-ci]

6 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]

6 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)

6 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.

6 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

Summary:

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