ghc.git
2 months agousers-guide: Document how to disable package environments cherry-pick-36d38047
Ben Gamari [Sun, 31 Mar 2019 20:22:04 +0000 (20:22 +0000)] 
users-guide: Document how to disable package environments

As noted in #16309 this somehow went undocumented.

(cherry picked from commit 36d380475d9056fdf93305985be3def00aaf6cf7)

2 months agogitlab: Remove doc-tarball job
Ben Gamari [Sat, 13 Apr 2019 13:31:41 +0000 (09:31 -0400)] 
gitlab: Remove doc-tarball job

2 months agoAllow unregisterised build to fail
Ben Gamari [Tue, 9 Apr 2019 20:20:08 +0000 (16:20 -0400)] 
Allow unregisterised build to fail

2 months agogitlab-ci: Allow failing build jobs to fail
Ben Gamari [Sun, 7 Apr 2019 01:55:37 +0000 (21:55 -0400)] 
gitlab-ci: Allow failing build jobs to fail

2 months agousers-guide: Add pretty to package list
Ben Gamari [Sat, 6 Apr 2019 16:26:38 +0000 (12:26 -0400)] 
users-guide: Add pretty to package list

2 months agogitlab-ci: Backport from master
Ben Gamari [Thu, 4 Apr 2019 15:14:03 +0000 (11:14 -0400)] 
gitlab-ci: Backport from master

2 months agoHadrian: introduce ways to skip some documentation targets
Alp Mestanogullari [Wed, 27 Feb 2019 16:23:48 +0000 (17:23 +0100)] 
Hadrian: introduce ways to skip some documentation targets

The initial motivation for this is to have a chance to run the binary
distribution rules in our Windows CI without having to install
sphinx-build and xelatex there, while retaining the ability to
generate haddocks. I just ended up extending this idea a little bit so
as to have control over whether we build haddocks, (sphinx) HTML manuals,
(sphinx) PDF manuals and (sphinx) manpages.

(cherry picked from commit 8442103aa575dc1cd25cb3231e729c6365dc1b5c)

2 months agoAdd werror function to Flavour.hs
Matthew Pickering [Thu, 31 Jan 2019 11:01:04 +0000 (11:01 +0000)] 
Add werror function to Flavour.hs

This function makes it easy to turn on `-Werror` in the correct manner
to mimic how CI turns on -Werror.

(cherry picked from commit 8dcd00cef7782c64b5484b106f4fd77c8c87e40a)

2 months agoconfigure: Always use AC_LINK_ELSEIF when testing against assembler
Ben Gamari [Sun, 31 Mar 2019 20:00:34 +0000 (16:00 -0400)] 
configure: Always use AC_LINK_ELSEIF when testing against assembler

This fixes #16440, where the build system incorrectly concluded that the
`.subsections_via_symbols` assembler directive was supported on a Linux
system. This was caused by the fact that gcc was invoked with `-flto`;
when so-configured gcc does not call the assembler but rather simply
serialises its AST for compilation during the final link.

This is described in Note [autoconf assembler checks and -flto].

(cherry picked from commit 7b090b53fea065d2cfd967ea919426af9ba8d737)

2 months agoRestore Xmm registers properly in StgCRun.c
klebinger.andreas@gmx.at [Mon, 1 Apr 2019 14:17:41 +0000 (16:17 +0200)] 
Restore Xmm registers properly in StgCRun.c

This fixes #16514: Xmm6-15 was restored based off rax instead of rsp.
The code was introduced in the fix for #14619.

(cherry picked from commit 9b131500371a07626e33edc56700c12322364560)

3 months agoBump hpc submodule
Ryan Scott [Fri, 5 Apr 2019 15:24:12 +0000 (11:24 -0400)] 
Bump hpc submodule

Currently, the `hpc` submodule is pinned against the `wip/final-mfp`
branch, not against `master`. This pins it back against `master`.

3 months agoUse funPrec, not topPrec, to parenthesize GADT argument types
Ryan Scott [Wed, 3 Apr 2019 16:37:10 +0000 (12:37 -0400)] 
Use funPrec, not topPrec, to parenthesize GADT argument types

A simple oversight. Fixes #16527.

3 months agobase: Remove `Monad(fail)` method and reexport `MonadFail(fail)` instead
Herbert Valerio Riedel [Sat, 10 Nov 2018 00:12:52 +0000 (01:12 +0100)] 
base: Remove `Monad(fail)` method and reexport `MonadFail(fail)` instead

As per https://prime.haskell.org/wiki/Libraries/Proposals/MonadFail

Coauthored-by: Ben Gamari <ben@well-typed.com>
3 months agoUpdate parallel submodule
Herbert Valerio Riedel [Mon, 11 Feb 2019 22:32:38 +0000 (23:32 +0100)] 
Update parallel submodule

3 months agoUpdate directory submodule
Herbert Valerio Riedel [Fri, 1 Feb 2019 21:48:07 +0000 (22:48 +0100)] 
Update directory submodule

3 months agoUpdate filepath submodule
Herbert Valerio Riedel [Fri, 1 Feb 2019 21:48:40 +0000 (22:48 +0100)] 
Update filepath submodule

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

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

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

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

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

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

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

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

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

3 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

3 months agoBump array submodule
Ryan Scott [Tue, 26 Mar 2019 14:55:10 +0000 (10:55 -0400)] 
Bump array submodule

This bumps `array` to version 0.5.4.0 so that we can distinguish
it with `MIN_VERSION_array` (as it introduces some changes to the
`Show` instance for `UArray`).

3 months agoBump transformers to 0.5.6.2
Ben Gamari [Thu, 17 Jan 2019 14:53:23 +0000 (09:53 -0500)] 
Bump transformers to 0.5.6.2

See #16199.

3 months agoCorrect duplicate 4.12.0.0 entry in base's changelog
Ryan Scott [Sun, 24 Mar 2019 14:35:21 +0000 (10:35 -0400)] 
Correct duplicate 4.12.0.0 entry in base's changelog

See #16490.

[ci skip]

3 months agoFix #16219: TemplateHaskell causes indefinite package build error cherry-pick-d6d735c1
Edward Z. Yang [Fri, 1 Feb 2019 01:00:50 +0000 (01:00 +0000)] 
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

(cherry picked from commit d6d735c1114082b9e9cc1ba7da87c49f52891320)

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

Fixes #16210

(cherry picked from commit e7e5f4aebec2f095071a1949bb4595744754ee04)

3 months agoDon't overwrite the set log_action when using --interactive cherry-pick-10faf44d
Matthew Pickering [Mon, 21 Jan 2019 01:58:01 +0000 (01:58 +0000)] 
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

(cherry picked from commit 10faf44d97095b2f8516b6d449d266f6889dcd70)

3 months agoBump Haddock submodule
Alec Theriault [Sun, 3 Mar 2019 17:27:47 +0000 (09:27 -0800)] 
Bump Haddock submodule

There shouldn't be any more features added to the `ghc-8.8` branch of
Haddock after this bump.

3 months agoUser's Guide: forall is a keyword nowadays
Vladislav Zavialov [Fri, 22 Feb 2019 13:51:48 +0000 (16:51 +0300)] 
User's Guide: forall is a keyword nowadays

3 months agoDot/bang operators in export lists (Trac #16339)
Vladislav Zavialov [Tue, 19 Feb 2019 15:27:09 +0000 (18:27 +0300)] 
Dot/bang operators in export lists (Trac #16339)

The dot type operator was handled in the 'tyvarop' parser production, and the
bang type operator in 'tyapp'. However, export lists and role annotations use
'oqtycon', so these type operators could not be exported or assigned roles.

The fix is to handle them in a lower level production, 'tyconsym'.

3 months ago'forall' always a keyword, plus the dot type operator
Vladislav Zavialov [Wed, 13 Feb 2019 21:36:00 +0000 (00:36 +0300)] 
'forall' always a keyword, plus the dot type operator

4 months agoBump version to 8.8
Ben Gamari [Sat, 2 Mar 2019 01:03:56 +0000 (20:03 -0500)] 
Bump version to 8.8

4 months agoMake bkpcabal01 test compatible with new ordering requirements.
Edward Z. Yang [Fri, 8 Mar 2019 04:47:07 +0000 (23:47 -0500)] 
Make bkpcabal01 test compatible with new ordering requirements.

Previously, our test did something like this:

1. Typecheck p
2. Typecheck q (which made use of an instantiated p)
3. Build instantiated p
4. Build instantiated q

Cabal previously permitted this, under the reasoning that during
typechecking there's no harm in using the instantiated p even if we
haven't build it yet; we'll just instantiate it on the fly with p.

However, this is not true!  If q makes use of a Template Haskell
splice from p, we absolutely must have built the instantiated p
before we typecheck q, since this typechecking will need to
run some splices.  Cabal now complains that you haven't done
it correctly, which we indeed have not!

Reordering so that we do this:

1. Typecheck p
3. Build instantiated p
2. Typecheck q (which made use of an instantiated p)
4. Build instantiated q

Fixes the problem.  If Cabal had managed the ordering itself, it would
have gotten it right.

Signed-off-by: Edward Z. Yang <ezyang@fb.com>
(cherry picked from commit 6e3e537e419ba8d02dac306d596fba3c1029f123)

4 months agoCmm: Promote stack arguments to word size
Peter Trommler [Thu, 31 Jan 2019 08:43:08 +0000 (09:43 +0100)] 
Cmm: Promote stack arguments to word size

Smaller than word size integers must be promoted to word size
when passed on the stack. While on little endian systems we can
get away with writing a small integer to a word size stack slot
and read it as a word ignoring the upper bits, on big endian
systems a small integer write ends up in the most significant
bits and a word size read that ignores the upper bits delivers
a random value.

On little endian systems a smaller than word size write to
the stack might be more efficient but that decision is
system specific and should be done as an optimization in the
respective backends.

Fixes #16258

(cherry picked from commit af7b0fdb64ad1c57f5829e8bd89e8e0fa96b11d2)

4 months agoFix checkStackChunk() call in Interepter.c, enable an assertion
Ömer Sinan Ağacan [Mon, 11 Feb 2019 15:17:43 +0000 (18:17 +0300)] 
Fix checkStackChunk() call in Interepter.c, enable an assertion

Fixes #16303

(cherry picked from commit 6b890d76a252259843a6e87043f8f12e6a8a0aae)

4 months agoAPI Annotations: parens anns discarded for `(*)` operator wip/ghc-8.8-az
Alan Zimmerman [Sat, 2 Feb 2019 14:29:05 +0000 (16:29 +0200)] 
API Annotations: parens anns discarded for `(*)` operator

The patch from https://phabricator.haskell.org/D4865 introduces

    go _ (HsParTy _ (dL->L l (HsStarTy _ isUni))) acc ann fix
      = do { warnStarBndr l
           ; let name = mkOccName tcClsName (if isUni then "★" else "*")
           ; return (cL l (Unqual name), acc, fix, ann) }

which discards the parens annotations belonging to the HsParTy.

Updates haddock submodule

Closes #16265

(cherry picked from commit 5e9888bd9c22a1315a703f638591b50e657317c4)

4 months agoAPI Annotations: AnnAt disconnected for TYPEAPP
Alan Zimmerman [Wed, 30 Jan 2019 14:20:52 +0000 (16:20 +0200)] 
API Annotations: AnnAt disconnected for TYPEAPP

For the code

    type family F1 (a :: k) (f :: k -> Type) :: Type where
      F1 @Peano a f = T @Peano f a

the API annotation for the first @ is not attached to a SourceSpan in
the ParsedSource

Closes #16236

(cherry picked from commit cbfc9fcaa33c3b341830962906543dfca1dfedd7)

4 months agoAPI Annotations: more explicit foralls fixup
Alan Zimmerman [Thu, 24 Jan 2019 21:22:59 +0000 (23:22 +0200)] 
API Annotations: more explicit foralls fixup

The AnnForall annotations introduced via Phab:D4894 are not always
attached to the correct SourceSpan.

Closes #16230

(cherry picked from commit be15f7457b98fa0378de7e8146c122757f03c4e9)

4 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

(cherry picked from commit 4bf35da4fccd2a21153a1c19bfa80006e99e02a1)

4 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

(cherry picked from commit 3cf12e6081e7a9f0c3d515de52ffd079186816a5)

4 months agoBump hsc2hs for removed unused match
Sebastian Graf [Fri, 1 Feb 2019 11:43:27 +0000 (12:43 +0100)] 
Bump hsc2hs for removed unused match

4 months agoBump Cabal submodule wip/hie-8.8
Ben Gamari [Tue, 26 Feb 2019 18:05:26 +0000 (13:05 -0500)] 
Bump Cabal submodule

4 months agoLexer: Alternate Layout Rule injects actual not virtual braces
Alan Zimmerman [Sun, 3 Feb 2019 08:27:42 +0000 (10:27 +0200)] 
Lexer: Alternate Layout Rule injects actual not virtual braces

When the alternate layout rule is activated via a pragma, it injects
tokens for { and } to make sure that the source is parsed properly.

But it injects ITocurly and ITccurly, rather than their virtual
counterparts ITvocurly and ITvccurly.

This causes problems for ghc-exactprint, which tries to print these.

Likewise, any injected ITsemi should have a zero-width SrcSpan.

Test case (the existing T13087.hs)

    {-# LANGUAGE AlternativeLayoutRule #-}
    {-# LANGUAGE LambdaCase            #-}

    isOne :: Int -> Bool
    isOne = \case 1 -> True
                  _ -> False

    main = return ()

Closes #16279

(cherry picked from commit c1cf2693d6efddeeeb813cd8995a1be136800d17)
(cherry picked from commit e0375ba980fd5639d23a29575efb00c30d97c743)

4 months agoRevert "Lexer: Alternate Layout Rule injects actual not virtual braces"
Ben Gamari [Tue, 26 Feb 2019 17:57:57 +0000 (12:57 -0500)] 
Revert "Lexer: Alternate Layout Rule injects actual not virtual braces"

This reverts commit e0375ba980fd5639d23a29575efb00c30d97c743.

4 months agoProperly escape character literals in Haddocks
Alec Theriault [Wed, 13 Feb 2019 13:43:35 +0000 (08:43 -0500)] 
Properly escape character literals in Haddocks

Character literals in Haddock should not be written as plain `'\n'` since
single quotes are for linking identifiers. Besides, since we want the
character literal to be monospaced, we really should use `@\'\\n\'@`.

[skip ci]

4 months agotemplate-haskell: Document assembler foreign file support
Ben Gamari [Wed, 20 Feb 2019 19:38:05 +0000 (14:38 -0500)] 
template-haskell: Document assembler foreign file support

See #16180.

4 months agoFix #16188
Richard Eisenberg [Fri, 18 Jan 2019 00:17:02 +0000 (17:17 -0700)] 
Fix #16188

There was an awful lot of zipping going on in
canDecomposableTyConAppOK, and one of the lists being zipped
was too short, causing the result to be too short. Easily
fixed.

Also fixes #16204 and #16225

test case: typecheck/should_compile/T16188
           typecheck/should_compile/T16204[ab]
           typecheck/should_fail/T16204c
           typecheck/should_compile/T16225

(cherry picked from commit 4a4ae70f09009c5d32696445a06eacb273f364b5)

4 months agoAllow resizing the stack for the graph allocator.
klebinger.andreas@gmx.at [Fri, 25 Jan 2019 23:26:02 +0000 (00:26 +0100)] 
Allow resizing the stack for the graph allocator.

The graph allocator now dynamically resizes the number of stack
slots when running into the limit.

This fixes #8657.

Also loop membership of basic blocks is now available
in the register allocator for cost heuristics.

(cherry picked from commit 03b7abc19c8b0ec5c606cc2da208d2d004807fe9)

4 months agoCapture and simplify constraints arising from running typed splices
Matthew Pickering [Sun, 3 Feb 2019 11:46:28 +0000 (11:46 +0000)] 
Capture and simplify constraints arising from running typed splices

This fixes a regression caused by #15471 where splicing in a trivial
program such as `[|| return () ||]` would fail as the dictionary for
`return` would never get bound in the module containing the splice.

Arguably this is symptomatic of a major problem affecting TTH where we
serialise renamed asts and then retype check them. The reference to the
dictionary should be fully determined at the quote site so that splicing
doesn't have to solve any implicits at all. It's a coincidence this
works due to coherence but see #15863 and #15865 for examples where
things do go very wrong.

Fixes #16195

(cherry picked from commit a48753bdbc99cda36890e851950f5b79e1c3b2b2)

4 months agoFix #14729 by making the normaliser homogeneous
Richard Eisenberg [Thu, 24 Jan 2019 15:22:58 +0000 (10:22 -0500)] 
Fix #14729 by making the normaliser homogeneous

This ports the fix to #12919 to the normaliser. (#12919 was about
the flattener.) Because the fix is involved, this is done by
moving the critical piece of code to Coercion, and then calling
this from both the flattener and the normaliser.

The key bit is: simplifying type families in a type is always
a *homogeneous* operation. See #12919 for a discussion of why
this is the Right Way to simplify type families.

Also fixes #15549.

test case: dependent/should_compile/T14729{,kind}
           typecheck/should_compile/T15549[ab]

(cherry picked from commit 2b90356d26b4699227816ad9424e766eccdb6c36)

4 months agoFix #15849 by checking whether there's a do block
nineonine [Sat, 9 Feb 2019 08:20:19 +0000 (00:20 -0800)] 
Fix #15849 by checking whether there's a do block

(cherry picked from commit a08f463bcc9727d91cec4c6e952ad0f5bbc3fbf9)

4 months agotestsuite: Always skip T15897
Ben Gamari [Tue, 5 Feb 2019 03:02:52 +0000 (22:02 -0500)] 
testsuite: Always skip T15897

See #16193.

(cherry picked from commit f53ef1a72fdebeff19d4a4bd5552d25101c85147)

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

(cherry picked from commit b1e569a54085bf1093b4f858f8c7c739e3be769b)

4 months agoReject oversaturated VKAs in type family equations
Ryan Scott [Sat, 2 Feb 2019 00:10:55 +0000 (19:10 -0500)] 
Reject oversaturated VKAs in type family equations

(cherry picked from commit f0cd728fde9bb582930a616cff8d0c5a178c5e14)

4 months agoLexer: Alternate Layout Rule injects actual not virtual braces
Alan Zimmerman [Sun, 3 Feb 2019 08:27:42 +0000 (10:27 +0200)] 
Lexer: Alternate Layout Rule injects actual not virtual braces

When the alternate layout rule is activated via a pragma, it injects
tokens for { and } to make sure that the source is parsed properly.

But it injects ITocurly and ITccurly, rather than their virtual
counterparts ITvocurly and ITvccurly.

This causes problems for ghc-exactprint, which tries to print these.

Likewise, any injected ITsemi should have a zero-width SrcSpan.

Test case (the existing T13087.hs)

    {-# LANGUAGE AlternativeLayoutRule #-}
    {-# LANGUAGE LambdaCase            #-}

    isOne :: Int -> Bool
    isOne = \case 1 -> True
                  _ -> False

    main = return ()

Closes #16279

(cherry picked from commit c1cf2693d6efddeeeb813cd8995a1be136800d17)

4 months agoFix #16287 by checking for more unsaturated synonym arguments
Ryan Scott [Tue, 5 Feb 2019 13:50:59 +0000 (08:50 -0500)] 
Fix #16287 by checking for more unsaturated synonym arguments

Trac #16287 shows that we were checking for unsaturated type synonym
arguments (in `:kind`) when the argument was to a type synonym, but
_not_ when the argument was to some other form of type constructor,
such as a data type. The solution is to use the machinery that
rejects unsaturated type synonym arguments (previously confined to
`check_syn_tc_app`) to `check_arg_type`, which checks these other
forms of arguments. While I was in town, I cleaned up
`check_syn_tc_app` a bit to only invoke `check_arg_type` so as to
minimize the number of different code paths that that function could
go down.

(cherry picked from commit c07e7ecbdfc05429fb6ce84c547c0365d2754db7)

4 months agobase: Document errno behaviour in haddocks.
Niklas Hambüchen [Thu, 14 Feb 2019 21:52:17 +0000 (16:52 -0500)] 
base: Document errno behaviour in haddocks.

Also add an implementation comment for details.

(cherry picked from commit 76ac103f5021cba5cd000293c7cb8c2bd3148e7a)

4 months agoHIE: Save module name and module exports
Matthew Pickering [Fri, 15 Feb 2019 10:14:29 +0000 (10:14 +0000)] 
HIE: Save module name and module exports

(cherry picked from commit 69ebf5cb4592b4c89e268937ef7eb96f7c9d4532)

4 months agorts/ProfilerReportJson: Fix format string
Ben Gamari [Tue, 5 Feb 2019 02:42:41 +0000 (21:42 -0500)] 
rts/ProfilerReportJson: Fix format string

This was warning on i386.

(cherry picked from commit 7ff127f9e455402da183d1bb1808db024d1fa944)

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

(cherry picked from commit 5ed48d25decc9dec29659482644b136cff91606e)

4 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

(cherry picked from commit 4376d8811418d91bb4d19d61801e95a449b98378)

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

(cherry picked from commit f00b35f4ddcc61fb1b1f09854bbbf38934ff0865)

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

(cherry picked from commit cfbd39bd405b4cedd3ee10a6d4a2bdd89b6e2e2d)

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

(cherry picked from commit 6da9f4c8df7a216234ef50104e400cdcbfbc1bd4)

4 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

(cherry picked from commit 79a5afb613235e93bc2c580987595b9c1324db15)

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

(cherry picked from commit b89b6e71c798996724ba99f273f88d8a3637fb8d)

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

(cherry picked from commit 5cb071af5b02b7433b2bb4d06062ac8b6fb387e8)

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

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

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

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

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

4 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

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

[skip ci]

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

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

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

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

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

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

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

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

4 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

4 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

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

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

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

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

4 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

4 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

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

4 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

4 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

4 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

4 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