4 weeks agoMaintain separate flags for C++ compiler invocations wip/T16738
Ben Gamari [Mon, 3 Jun 2019 22:51:17 +0000 (18:51 -0400)] 
Maintain separate flags for C++ compiler invocations

Previously we would pass flags intended for the C compiler to the C++
compiler (see #16738). This would cause, for instance, `-std=gnu99` to
be passed to the C++ compiler, causing spurious test failures. Fix this
by maintaining a separate set of flags for C++ compilation invocations.

4 weeks agogitlab-ci: Bump Docker image
Ben Gamari [Wed, 12 Jun 2019 21:52:35 +0000 (17:52 -0400)] 
gitlab-ci: Bump Docker image

Fixes linters.

5 weeks agotestsuite: Don't run tests requiring TH in profasm way when GhcDynamic
Ben Gamari [Tue, 11 Jun 2019 19:56:07 +0000 (15:56 -0400)] 
testsuite: Don't run tests requiring TH in profasm way when GhcDynamic

Since we can't load profiled objects when GhcDynamic==YES. Affects:

* T16737
* T16384
* T16718
* T16619
* T16190

5 weeks agotestsuite: Unbreak galois_raytrace on i386
Ben Gamari [Tue, 11 Jun 2019 17:24:35 +0000 (13:24 -0400)] 
testsuite: Unbreak galois_raytrace on i386

galois_raytrace was previously broken on i386 due to use of x87
arithmethic on that platform. However,
42504f4a575395a35eec5c3fd7c9ef6e2b54e68e removes x87 support; this
resulted in an unexpected pass. Unmark this test as broken.

5 weeks agotestsuite: Skip cgrun078 in ghci way
Ben Gamari [Tue, 11 Jun 2019 05:09:17 +0000 (01:09 -0400)] 
testsuite: Skip cgrun078 in ghci way

This test requires FFI usage.

5 weeks agoprocess: Bump submodule
Ben Gamari [Mon, 10 Jun 2019 13:52:08 +0000 (09:52 -0400)] 
process: Bump submodule

 * Skip process005 in ghci way
 * Mark process002 as fragile in threaded2

5 weeks agoBump unix submodule
Ben Gamari [Sat, 6 Apr 2019 18:45:52 +0000 (14:45 -0400)] 
Bump unix submodule

Marks posix002 as fragile in threaded2 way due to #16550.

5 weeks agoFix uses of #ifdef/#ifndef
Ben Gamari [Sun, 9 Jun 2019 13:50:41 +0000 (09:50 -0400)] 
Fix uses of #ifdef/#ifndef

The linter now enforces our preference for `#if defined()` and
`#if !defined()`.

5 weeks agogitlab-ci: Fetch submodules before running submodule linter
Ben Gamari [Sun, 9 Jun 2019 16:31:32 +0000 (12:31 -0400)] 
gitlab-ci: Fetch submodules before running submodule linter

5 weeks agolinters/check-makefiles: Limit lint to Makefiles
Ben Gamari [Sun, 9 Jun 2019 14:36:58 +0000 (10:36 -0400)] 
linters/check-makefiles: Limit lint to Makefiles

Previously we would apply this rule, which is only intended for
testsuite Makefiles, to all files. This lead to a number of
false-positives in all.T files.

5 weeks agotestsuite: Note intentional typo in T7130
Ben Gamari [Tue, 11 Jun 2019 05:11:58 +0000 (01:11 -0400)] 
testsuite: Note intentional typo in T7130

I earlier accidentally corrected it breaking the test.

5 weeks agotestsuite: Mark T16737 as broken in ghci way due to #16541
Ben Gamari [Sun, 9 Jun 2019 13:32:55 +0000 (09:32 -0400)] 
testsuite: Mark T16737 as broken in ghci way due to #16541

5 weeks agotestsuite: Mark T16449_2 as broken due to #16742
Ben Gamari [Tue, 4 Jun 2019 04:56:47 +0000 (00:56 -0400)] 
testsuite: Mark T16449_2 as broken due to #16742

5 weeks agotestsuite: Skip T493 in ghci way.
Ben Gamari [Tue, 4 Jun 2019 04:53:09 +0000 (00:53 -0400)] 
testsuite: Skip T493 in ghci way.

T493 tests #493, which is an FFI test. FFI tests should be skipped
in ghci way.

5 weeks agotestsuite: Omit profasm way for cc017
Ben Gamari [Tue, 4 Jun 2019 00:59:13 +0000 (20:59 -0400)] 
testsuite: Omit profasm way for cc017

cc017 requires TH but we can't load dynamic profiled objects.

5 weeks agotestsuite: Mark threadstatus-T9333 as fragile in ghci way
Ben Gamari [Mon, 8 Apr 2019 14:35:51 +0000 (10:35 -0400)] 
testsuite: Mark threadstatus-T9333 as fragile in ghci way

As noted in #16555.

5 weeks agotestsuite: Fix omit_ways usage
Ben Gamari [Sun, 7 Apr 2019 01:50:24 +0000 (21:50 -0400)] 
testsuite: Fix omit_ways usage

omit_ways expects a list but this was broken in several cases.

5 weeks agotestsuite: Fix fragile_for test modifier
Ben Gamari [Sat, 6 Apr 2019 13:37:52 +0000 (09:37 -0400)] 
testsuite: Fix fragile_for test modifier

5 weeks agotestsuite: Skip T7919 in ghci way
Ben Gamari [Sat, 6 Apr 2019 16:09:35 +0000 (12:09 -0400)] 
testsuite: Skip T7919 in ghci way

It times out pretty reliably. It's not clear that much is gained by
running this test in the ghci way anyways.

5 weeks agotestsuite: Mark T2783 as fragile in threaded1
Ben Gamari [Sat, 6 Apr 2019 02:22:43 +0000 (22:22 -0400)] 
testsuite: Mark T2783 as fragile in threaded1

It was previously marked as broken but it passes non-deterministically.
See #2783.

5 weeks agotestsuite: Mark Overflow as broken in hpc way
Ben Gamari [Fri, 5 Apr 2019 11:47:31 +0000 (07:47 -0400)] 
testsuite: Mark Overflow as broken in hpc way

As noted in #16543.

5 weeks agotestsuite: Omit tcrun022 in hpc way
Ben Gamari [Fri, 5 Apr 2019 03:01:46 +0000 (23:01 -0400)] 
testsuite: Omit tcrun022 in hpc way

As noted in #16542, the expected rule doesn't fire. However, this
doesn't seem terribly surpring given the circumstances.

5 weeks agotestsuite: Mark T16180 as broken in ghci and ext-interp ways
Ben Gamari [Fri, 5 Apr 2019 02:55:00 +0000 (22:55 -0400)] 
testsuite: Mark T16180 as broken in ghci and ext-interp ways

As noted in #16541.

5 weeks agotestsuite: Mark T14761c as broken in hpc, profasm, and optasm ways
Ben Gamari [Fri, 5 Apr 2019 02:50:00 +0000 (22:50 -0400)] 
testsuite: Mark T14761c as broken in hpc, profasm, and optasm ways

As noted in #16540.

5 weeks agotestsuite: Mark T13910 as broken in optasm
Ben Gamari [Fri, 5 Apr 2019 02:38:06 +0000 (22:38 -0400)] 
testsuite: Mark T13910 as broken in optasm

Due to #16537.

5 weeks agotestsuite: Mark T13167 as fragile in threaded2
Ben Gamari [Fri, 5 Apr 2019 02:25:23 +0000 (22:25 -0400)] 
testsuite: Mark T13167 as fragile in threaded2

As noted in #16536.

5 weeks agotestsuite: Mark hWaitForInput-accurate-stdin as broken in threaded ways
Ben Gamari [Fri, 5 Apr 2019 01:57:05 +0000 (21:57 -0400)] 
testsuite: Mark hWaitForInput-accurate-stdin as broken in threaded ways

As noted in #16535.

5 weeks agogitlab-ci: Test using slowtest in deb9-debug job
Ben Gamari [Thu, 4 Apr 2019 16:12:14 +0000 (12:12 -0400)] 
gitlab-ci: Test using slowtest in deb9-debug job

5 weeks agoBump terminfo to
Ben Gamari [Wed, 5 Jun 2019 00:31:38 +0000 (20:31 -0400)] 
Bump terminfo to

(cherry picked from commit 1134488b4c9cef904ea82f22f1978646eea612df)

5 weeks agoBump time submodule to 1.9.3
Ben Gamari [Wed, 5 Jun 2019 00:34:27 +0000 (20:34 -0400)] 
Bump time submodule to 1.9.3

(cherry picked from commit fdb07571036b1498800589d45b61781e6acdd368)

5 weeks agoBump Cabal submodule
Ben Gamari [Wed, 5 Jun 2019 00:37:31 +0000 (20:37 -0400)] 
Bump Cabal submodule

(cherry picked from commit ff438786613f07df9b2d43eaeac49b13815d849d)

Metric Increase:

5 weeks agoBump binary to
Ben Gamari [Fri, 7 Jun 2019 21:34:16 +0000 (17:34 -0400)] 
Bump binary to

(cherry picked from commit 983ada70a013c7642a751f6e41587ff95b57d0f8)

5 weeks agoUse DeriveFunctor throughout the codebase (#15654)
Krzysztof Gogolewski [Sat, 8 Jun 2019 18:48:07 +0000 (20:48 +0200)] 
Use DeriveFunctor throughout the codebase (#15654)

5 weeks agorts/linker: Only mprotect GOT after it is filled
Ben Gamari [Sat, 8 Jun 2019 17:28:19 +0000 (13:28 -0400)] 
rts/linker: Only mprotect GOT after it is filled

This fixes a regression, introduced by 67c422ca, where we mprotect'd the
global offset table (GOT) region to PROT_READ before we had finished
filling it, resulting in a linker crash.

Fixes #16779.

5 weeks agorts/linker: Make elf_got.c a bit more legible
Ben Gamari [Sat, 8 Jun 2019 17:28:08 +0000 (13:28 -0400)] 
rts/linker: Make elf_got.c a bit more legible

5 weeks agotestsuite: Add haddock perf test output to gitignore
Ben Gamari [Mon, 10 Jun 2019 23:00:57 +0000 (19:00 -0400)] 
testsuite: Add haddock perf test output to gitignore

[skip ci]

5 weeks agollvm-targets: Add armv7l-unknown-linux-gnueabi
Ben Gamari [Tue, 11 Jun 2019 01:59:19 +0000 (21:59 -0400)] 
llvm-targets: Add armv7l-unknown-linux-gnueabi

Fixes #15208.

[skip ci]

5 weeks agotestsuite/mk/ rename 'ghc-config-mk' to 'ghc_config_mk'
Alp Mestanogullari [Mon, 10 Jun 2019 15:38:34 +0000 (17:38 +0200)] 
testsuite/mk/ rename 'ghc-config-mk' to 'ghc_config_mk'

Make/shell variable names which contain dashes can cause problems under
some conditions. The 'ghc-config-mk' variable from testsuite/mk/
that I made overridable (by Hadrian) in ba0aed2e was working as expected when
our Hadrian/Linux job was based off the deb8 Docker image, but broke when
I switched the job to use our deb9-based image, in 3d97bad6. The exact
circumstances/tool versions that trigger this problem are unknown, but
changing the variable's name to 'ghc_config_mk' lets us work around the issue.

This fixes the annth_compunits and annth_make test failures that showed up
when we switched the Hadrian/Linux job to use the deb9 environment.

5 weeks agoFix an error message in CheckUnload.c:searchHeapBlocks
Ömer Sinan Ağacan [Mon, 10 Jun 2019 08:36:49 +0000 (11:36 +0300)] 
Fix an error message in CheckUnload.c:searchHeapBlocks

5 weeks agorts/linker: Use mmapForLinker to map PLT
Ben Gamari [Sat, 8 Jun 2019 19:31:54 +0000 (19:31 +0000)] 
rts/linker: Use mmapForLinker to map PLT

The PLT needs to be located within a close distance of
the code calling it under the small memory model.

Fixes #16784.

5 weeks agorts/linker: Mmap into low memory on AArch64
Ben Gamari [Sat, 8 Jun 2019 19:30:48 +0000 (19:30 +0000)] 
rts/linker: Mmap into low memory on AArch64

This extends mmapForLinker to use the same low-memory mapping
strategy used on x86_64 on AArch64. See #16784.

5 weeks agoHadrian: teach the RTS that PROFILING implies TRACING
Alp Mestanogullari [Wed, 5 Jun 2019 22:40:32 +0000 (00:40 +0200)] 
Hadrian: teach the RTS that PROFILING implies TRACING

As discussed in #16744, both the Make and Hadrian build systems
have special code to always pass -eventlog whenever -prof or -debug
are passed. However, there is some similar logic in the RTS itself only
for defining TRACING when the DEBUG macro is defined, but no such logic
is implemented to define TRACING when the PROFILING macro is defined.
This patch adds such a logic and therefore fixes #16744.

5 weeks agorts/RtsFlags.c: mention that -prof too enables support for +RTS -l
Alp Mestanogullari [Thu, 30 May 2019 12:18:01 +0000 (14:18 +0200)] 
rts/RtsFlags.c: mention that -prof too enables support for +RTS -l

5 weeks agoMake `haddock_testsuite` respect `--test-accept`
Alec Theriault [Wed, 29 May 2019 11:33:35 +0000 (07:33 -0400)] 
Make `haddock_testsuite` respect `--test-accept`

Suppose you've made changes that affect the output of `haddockHtmlTest`
so that the following is failing:

    ./hadrian/ -c --only=haddockHtmlTest test

Then, the following will accept new output for Haddock's test cases.

    ./hadrian/ -c --only=haddockHtmlTest test --test-accept

You still do need to make sure those new changes (which show up in
Haddock's tree) get committed though.

Fixes #16694

5 weeks agoRefine the GHCI macro into HAVE[_{INTERNAL, EXTERNAL}]_INTERPRETER
Alp Mestanogullari [Mon, 6 May 2019 16:49:33 +0000 (18:49 +0200)] 

As discussed in #16331, the GHCI macro, defined through 'ghci' flags
in, and, is supposed to indicate
whether GHC is built with support for an internal interpreter, that runs in
the same process. It is however overloaded in a few places to mean
"there is an interpreter available", regardless of whether it's an internal
or external interpreter.

For the sake of clarity and with the hope of more easily being able to
build stage 1 GHCs with external interpreter support, this patch splits
the previous GHCI macro into 3 different ones:

- HAVE_INTERNAL_INTERPRETER: GHC is built with an internal interpreter
- HAVE_EXTERNAL_INTERPRETER: GHC is built with support for external interpreters

5 weeks agoWarn about unused packages
Yuras Shumovich [Mon, 21 Jan 2019 00:49:56 +0000 (19:49 -0500)] 
Warn about unused packages

Reviewers: bgamari, simonpj

Reviewed By: simonpj

Subscribers: hvr, simonpj, mpickering, rwbarton, carter

GHC Trac Issues: #15838

Differential Revision:

5 weeks agoghc-heap: Add closure_size_noopt test
Ben Gamari [Sun, 9 Jun 2019 14:56:32 +0000 (10:56 -0400)] 
ghc-heap: Add closure_size_noopt test

This adds a new test, only run in the `normal` way, to verify the size
of FUNs and PAPs.

5 weeks agotestsuite: Fix and extend closure_size test
Ben Gamari [Sat, 8 Jun 2019 03:15:45 +0000 (23:15 -0400)] 
testsuite: Fix and extend closure_size test

This was previously broken in several ways. This is fixed and it also
now tests arrays. Unfortunately I was unable to find a way to continue
testing PAP and FUN sizes; these simply depend too much upon the
behavior of the simplifier.

I also tried to extend this to test non-empty arrays as well but
unfortunately this was non-trivial as the array card size constant isn't
readily available from haskell.

Fixes #16531.

5 weeks agoRefactor the rules for .hi and .o into a single rule using `&%>` #16764
David Eichmann [Thu, 6 Jun 2019 11:50:42 +0000 (12:50 +0100)] 
Refactor the rules for .hi and .o into a single rule using `&%>` #16764

Currently the rule for .hi files just triggers (via need) the rule
for the .o file, and .o rule generates both the .o and .hi file.
Likewise for .o-boot and .hi-boot files. This is a bit of an abuse
of Shake, and in fact shake supports rules with multiple output
with the &%> function. This exact use case appears in Neil
Mitchell's paper *Shake Before Building* section 6.3.

5 weeks agoComments only: document newtypes' DataConWrapId
Richard Eisenberg [Fri, 31 May 2019 17:37:56 +0000 (13:37 -0400)] 
Comments only: document newtypes' DataConWrapId

5 weeks agoPrint role annotations in TemplateHaskell brackets (#16718)
Vladislav Zavialov [Sat, 1 Jun 2019 12:08:24 +0000 (15:08 +0300)] 
Print role annotations in TemplateHaskell brackets (#16718)

5 weeks agobase: Mark CPUTime001 as fragile
Ben Gamari [Thu, 30 May 2019 13:29:37 +0000 (09:29 -0400)] 
base: Mark CPUTime001 as fragile

As noted in #16224, CPUTime001 has been quite problematic, reporting
non-monotonic timestamps in CI. Unfortunately I've been unable to
reproduce this locally.

5 weeks agorts: Fix RetainerProfile early return with TREC_CHUNK
Daniel Gröber [Thu, 6 Jun 2019 06:14:19 +0000 (08:14 +0200)] 
rts: Fix RetainerProfile early return with TREC_CHUNK

When pop() returns with `*c == NULL` retainerProfile will immediately
return. All other code paths is pop() continue with the next stackElement
when this happens so it seems weird to me that TREC_CHUNK we would suddenly
abort everything even though the stack might still have elements left to

5 weeks agoRemove CPP ensuring word size is 32 or 64 bits around Addr# <-> int# primops
John Ericson [Tue, 4 Jun 2019 02:56:17 +0000 (22:56 -0400)] 
Remove CPP ensuring word size is 32 or 64 bits around Addr# <-> int# primops

It shouldn't be needed these days, and those primops are "highly
deprecated" anyways.

This fits with my plans because it removes one bit of target-dependence
of the builtin primops, and this is the hardest part of GHC to make

CC @carter

5 weeks agoComments only: document tcdDataCusk better.
Richard Eisenberg [Fri, 31 May 2019 17:28:42 +0000 (13:28 -0400)] 
Comments only: document tcdDataCusk better.

5 weeks agoHadrian: need CPP preprocessor dependencies #16660
David Eichmann [Tue, 16 Apr 2019 14:10:35 +0000 (15:10 +0100)] 
Hadrian: need CPP preprocessor dependencies #16660

Use the new -include-cpp-deps ghc option (#16521)
when generating .dependencies files in hadrian.
This is version gated as -include-cpp-deps is a
relatively new option.

5 weeks agotestsuite: Add test for #16509
Ben Gamari [Tue, 28 May 2019 03:00:16 +0000 (23:00 -0400)] 
testsuite: Add test for #16509

5 weeks agoDo not report error if Name in pragma is unbound
nineonine [Wed, 22 May 2019 04:34:27 +0000 (21:34 -0700)] 
Do not report error if Name in pragma is unbound

5 weeks agorts: Separate population of eventTypes from initial event generation
Ben Gamari [Wed, 15 May 2019 21:49:34 +0000 (17:49 -0400)] 
rts: Separate population of eventTypes from initial event generation

Previously these two orthogonal concerns were both implemented in
postHeaderEvents which made it difficult to send header events after RTS

5 weeks agoAdd disable/enable commands to ghci debugger #2215
Roland Senn [Tue, 14 May 2019 07:45:36 +0000 (09:45 +0200)] 
Add disable/enable commands to ghci debugger #2215

This patch adds two new commands `:enable` and `:disable` to the GHCi debugger.
Opposite to `:set stop <n> :continue` a breakpoint disabled with `:disable` will
not loose its previously set stop command.
A new field breakEnabled is added to the BreakLocation data structure to
track the enable/disable state. When a breakpoint is disabled with a `:disable`
command, the following happens:

The corresponding BreakLocation data element is searched dictionary of the
`breaks` field of the GHCiStateMonad. If the break point is found and not
already in the disabled state, the breakpoint is removed from bytecode.
The BreakLocation data structure is kept in the breaks list and the new
breakEnabled field is set to false.

The `:enable` command works similar.

The breaks field in the GHCiStateMonad was changed from an association list
to int `IntMap`.

5 weeks agoFix #16517 by bumping the TcLevel for method sigs
Richard Eisenberg [Wed, 5 Jun 2019 22:02:13 +0000 (18:02 -0400)] 
Fix #16517 by bumping the TcLevel for method sigs

There were actually two bugs fixed here:

1. candidateQTyVarsOfType needs to be careful that it does not
   try to zap metavariables from an outer scope as "naughty"
   quantification candidates. This commit adds a simple check
   to avoid doing so.

2. We weren't bumping the TcLevel in kcHsKindSig, which was used
   only for class method sigs. This mistake led to the acceptance

     class C a where
       meth :: forall k. Proxy (a :: k) -> ()

   Note that k is *locally* quantified. This patch fixes the
   problem by using tcClassSigType, which correctly bumps the
   level. It's a bit inefficient because tcClassSigType does other
   work, too, but it would be tedious to repeat much of the code
   there with only a few changes. This version works well and is

And, while updating comments, etc., I noticed that tcRnType was
missing a pushTcLevel, leading to #16767, which this patch also
fixes, by bumping the level. In the refactoring here, I also
use solveEqualities. This initially failed ghci/scripts/T15415,
but that was fixed by teaching solveEqualities to respect

This patch also cleans up some Notes around error generation that
came up in conversation.

Test case: typecheck/should_fail/T16517, ghci/scripts/T16767

5 weeks agoHandle trailing path separator in package DB names (#16360)
Kevin Buhr [Fri, 3 May 2019 23:15:44 +0000 (18:15 -0500)] 
Handle trailing path separator in package DB names (#16360)

Package DB directories with trailing separator (provided via
GHC_PACKAGE_PATH or via -package-db) resulted in incorrect calculation of
${pkgroot} substitution variable.  Keep the trailing separator while
resolving as directory or file, but remove it before dropping the last
path component with takeDirectory.

Closes #16360.

5 weeks agoSmall refactorings in ExtractDocs
Simon Jakobi [Sun, 5 May 2019 12:36:02 +0000 (14:36 +0200)] 
Small refactorings in ExtractDocs

5 weeks agotestsuite: Add test for #16514
Ben Gamari [Tue, 2 Apr 2019 15:59:06 +0000 (11:59 -0400)] 
testsuite: Add test for #16514

5 weeks agoIntroduce log1p and expm1 primops
chessai [Fri, 1 Feb 2019 18:01:46 +0000 (13:01 -0500)] 
Introduce log1p and expm1 primops

Previously log and exp were primitives yet log1p and expm1 were FFI
calls. Fix this non-uniformity.

5 weeks agotestsuite: Suppress ticks in T4918 output
Ben Gamari [Mon, 3 Jun 2019 20:51:51 +0000 (16:51 -0400)] 
testsuite: Suppress ticks in T4918 output

As noted in #16741, this test otherwise breaks when `base` is compiled
with `-g`.

5 weeks agohadrian: Properly partition options in sourceArgs
Matthew Pickering [Thu, 30 May 2019 15:20:26 +0000 (16:20 +0100)] 
hadrian: Properly partition options in sourceArgs

Previously if you build the `ghc` package then it would has the default
opts and the library opts. This is different behaviour to make where the
library opts are only reserved for things in the `libraries`
subdirectory (I believe)

Fixes #16716

5 weeks agoExplain that 'mappend' and '(<>)' should be the same [skip ci]
Alexandre Baldé [Thu, 4 Apr 2019 23:48:06 +0000 (00:48 +0100)] 
Explain that 'mappend' and '(<>)' should be the same [skip ci]

5 weeks agogitlab-ci: Ensure that all commits on a branch are submodule-linted
Ben Gamari [Sat, 8 Jun 2019 20:44:55 +0000 (16:44 -0400)] 
gitlab-ci: Ensure that all commits on a branch are submodule-linted

The previous commit reworked things such that the submodule linter would
only run on the head commit. However, the linter only checks the
submodules which are touched by the commits it is asked to lint.
Consequently it would be possible for a bad submodule to sneak through.

Thankfully, we can use the handy CI_COMMIT_BEFORE_SHA attribute to
find the base commit of the push.

5 weeks agogitlab-ci: Fix submodule linting of commits
Ben Gamari [Sat, 8 Jun 2019 18:39:27 +0000 (14:39 -0400)] 
gitlab-ci: Fix submodule linting of commits

There is no notion of a base commit when we aren't checking a merge
request. Just check the HEAD commit.

5 weeks agogitlab-ci: Disable shallow clones
Ben Gamari [Sat, 8 Jun 2019 18:02:02 +0000 (14:02 -0400)] 
gitlab-ci: Disable shallow clones

Previously we were passing `--unshallow` to `git fetch` in the linting
rules to ensure that the base commit which we were linting with respect
to was available. However, this breaks due to GitLab's re-use of
working directories since `git fetch --unshallow` fails on a repository
which is not currently shallow.

Given that `git fetch --unshallow` circumvents the efficiencies provided
by shallow clones anyways, let's just disable them entirely.

There is no documented way to do disable shallow clones but on checking
the GitLab implementation it seems that setting `GIT_DEPTH=0` should do
the trick.

5 weeks agoRemove trailing whitespace
Matthew Pickering [Fri, 7 Jun 2019 13:33:13 +0000 (14:33 +0100)] 
Remove trailing whitespace

[skip ci]

This should really be caught by the linters! (#16711)

5 weeks agogitlab-ci: A few clarifying comments
Ben Gamari [Fri, 7 Jun 2019 15:14:42 +0000 (11:14 -0400)] 
gitlab-ci: A few clarifying comments

5 weeks agogitlab-ci: Fix submodule linter
Ben Gamari [Fri, 7 Jun 2019 15:14:07 +0000 (11:14 -0400)] 
gitlab-ci: Fix submodule linter

The job script didn't even try to compute the base commit to lint with
respect to.

5 weeks agogitlab-ci: Use --unshallow when fetching for linters
Ben Gamari [Fri, 7 Jun 2019 14:55:30 +0000 (10:55 -0400)] 
gitlab-ci: Use --unshallow when fetching for linters

GitLab creates a shallow clone. However, this means that we may not have
the base commit of an MR when linting, causing `git merge-base` to fail.
Fix this by passing `--unshallow` to `git fetch`, ensuring that we have
the entire history.

5 weeks agoFix two lint failures in rts/linker/MachO.c
Matthew Pickering [Thu, 30 May 2019 10:13:31 +0000 (11:13 +0100)] 
Fix two lint failures in rts/linker/MachO.c

5 weeks agogitlab-ci: Don't run two submodule checking jobs on Marge jobs
Matthew Pickering [Thu, 30 May 2019 10:12:12 +0000 (11:12 +0100)] 
gitlab-ci: Don't run two submodule checking jobs on Marge jobs

5 weeks agogitlab-ci: Linters, don't allow to fail
Matthew Pickering [Thu, 30 May 2019 10:11:04 +0000 (11:11 +0100)] 
gitlab-ci: Linters, don't allow to fail

Ben disabled them in cd85f8a71bb56cff332560e1d571b3406789fb71 but didn't
say how or why they were broken.

5 weeks agogitlab-ci: Create index.html in documentation deployment
Ben Gamari [Thu, 6 Jun 2019 18:09:53 +0000 (14:09 -0400)] 
gitlab-ci: Create index.html in documentation deployment

Otherwise navigating to will result
in a 404.

5 weeks agoHadrian: use deb9 Docker images instead of deb8 for CI jobs
Alp Mestanogullari [Wed, 5 Jun 2019 21:40:54 +0000 (23:40 +0200)] 
Hadrian: use deb9 Docker images instead of deb8 for CI jobs

This should fix #16739, where we seem to be getting extra carets in
a test's output because of the gcc that ships with the deb8 image,
whule we're not observing those extra carets in the deb9-based (Make)

5 weeks agobase: Export Finalizers
Ben Gamari [Wed, 5 Jun 2019 03:27:41 +0000 (23:27 -0400)] 
base: Export Finalizers

As requested in #16750.

5 weeks agoPass preprocessor options to C compiler when building foreign C files (#16737)
Zejun Wu [Tue, 4 Jun 2019 22:25:10 +0000 (15:25 -0700)] 
Pass preprocessor options to C compiler when building foreign C files (#16737)

5 weeks agoremove backticks from markup - it doesn't mean what I think it means
code5hot [Thu, 6 Jun 2019 00:34:09 +0000 (20:34 -0400)] 
remove backticks from markup - it doesn't mean what I think it means

5 weeks agoUsed terminology from a paper. Added it as a reference.
code5hot [Wed, 5 Jun 2019 19:17:12 +0000 (15:17 -0400)] 
Used terminology from a paper. Added it as a reference.

5 weeks agoUpdate Traversable.hs with a note about an intuitive law
code5hot [Tue, 4 Jun 2019 22:00:28 +0000 (18:00 -0400)] 
Update Traversable.hs with a note about an intuitive law

5 weeks agollvm-targets: Add x86_64 android layout
Moritz Angermann [Sat, 9 Dec 2017 23:36:20 +0000 (07:36 +0800)] 
llvm-targets: Add x86_64 android layout

5 weeks agoFix isValidNatural: The BigNat in NatJ# must have at least 2 limbs
Simon Jakobi [Tue, 4 Jun 2019 00:54:35 +0000 (02:54 +0200)] 
Fix isValidNatural: The BigNat in NatJ# must have at least 2 limbs

Previously the `integer-gmp` variant of `isValidNatural` would fail to
detect values `<= maxBound::Word` that were incorrectly encoded using
the `NatJ#` constructor.

5 weeks agoHadrian: Delete target symlink in createFileLinkUntracked
Ben Gamari [Mon, 3 Jun 2019 22:24:17 +0000 (18:24 -0400)] 
Hadrian: Delete target symlink in createFileLinkUntracked

Previously createFileLinkUntracked would fail if the symlink already

5 weeks agoPreserve ShadowInfo when rewriting evidence
Simon Peyton Jones [Mon, 3 Jun 2019 13:46:39 +0000 (14:46 +0100)] 
Preserve ShadowInfo when rewriting evidence

When the canonicaliser rewrites evidence of a Wanted, it
should preserve the ShadowInfo (ctev_nosh) field.  That is,
a WDerive should rewrite to WDerive, and WOnly to WOnly.

Previously we were unconditionally making a WDeriv, thereby
rewriting WOnly to WDeriv.  This bit Nick Frisby (issue #16735)
in the context of his plugin, but we don't have a compact test

The fix is simple, but does involve a bit more plumbing,
to pass the old ShadowInfo around, to use when building
the new Wanted.

5 weeks agoFactor out 'getLibDir' / 'getBaseDir' into a new GHC.BaseDir ghc-boot module
John Ericson [Fri, 31 May 2019 01:08:44 +0000 (21:08 -0400)] 
Factor out 'getLibDir' / 'getBaseDir' into a new GHC.BaseDir ghc-boot module

ghc-pkg and ghc already both needed this. I figure it is better to
deduplicate, especially seeing that changes to one (FreeBSD CPP) didn't
make it to the other.

Additionally in !1090 I make ghc-pkg look up the settings file, which
makes it use the top dir a bit more widely. If that lands, any
difference in the way they find the top dir would be more noticable.

That change also means sharing more code between ghc and ghc-package
(namely the settings file parsing code), so I'd think it better to get
off the slipperly slope of duplicating code now.

5 weeks agoFix #16700: Tiny errors in output of GHCi commands :forward and :info
Roland Senn [Wed, 29 May 2019 20:12:41 +0000 (22:12 +0200)] 
Fix #16700: Tiny errors in output of GHCi commands :forward and :info

`:info Coercible` now outputs the correct section number of the GHCi User's guide together with the secion title.

`:forward x` gives the correct syntax hint.

5 weeks agoAdd HEAP_PROF_SAMPLE_END event to mark end of samples
Matthew Pickering [Wed, 29 May 2019 15:56:08 +0000 (16:56 +0100)] 
Add HEAP_PROF_SAMPLE_END event to mark end of samples

This allows a user to observe how long a sampling period lasts so that
the time taken can be removed from the profiling output.

Fixes #16697

5 weeks agoTmOracle: Replace negative term equalities by refutable PmAltCons
Sebastian Graf [Wed, 22 May 2019 16:46:37 +0000 (18:46 +0200)] 
TmOracle: Replace negative term equalities by refutable PmAltCons

The `PmExprEq` business was a huge hack and was at the same time vastly
too powerful and not powerful enough to encode negative term equalities,
i.e. facts of the form "forall y. x ≁ Just y".

This patch introduces the concept of 'refutable shapes': What matters
for the pattern match checker is being able to encode knowledge of the
kind "x can no longer be the literal 5". We encode this knowledge in a
`PmRefutEnv`, mapping a set of newly introduced `PmAltCon`s (which are
just `PmLit`s at the moment) to each variable denoting above

So, say we have `x ≁ 42 ∈ refuts` in the term oracle context and
try to solve an equality like `x ~ 42`. The entry in the refutable
environment will immediately lead to a contradiction.

This machinery renders the whole `PmExprEq` and `ComplexEq` business
unnecessary, getting rid of a lot of (mostly dead) code.

See the Note [Refutable shapes] in TmOracle for a place to start.

Metric Decrease:

5 weeks ago[skip ci] Improve the documentation of the CNF primops. In this context, the term...
Andrew Martin [Thu, 6 Jun 2019 14:42:35 +0000 (10:42 -0400)] 
[skip ci] Improve the documentation of the CNF primops. In this context, the term "size" is ambiguous and is now avoided. Additionally, the distinction between a CNF and the blocks that comprise it has been emphasize. The vocabulary has been made more consistent with the vocabulary in the C source for CNF.

5 weeks agogitlab-ci: Disable darwin hadrian job
Matthew Pickering [Fri, 7 Jun 2019 08:36:32 +0000 (09:36 +0100)] 
gitlab-ci: Disable darwin hadrian job

See #16771

We don't have enough capacity for the two jobs currently.

[skip ci]

6 weeks agoHadrian: profiling and debug enabled ways support -eventlog too
Alp Mestanogullari [Mon, 3 Jun 2019 13:57:02 +0000 (15:57 +0200)] 
Hadrian: profiling and debug enabled ways support -eventlog too

6 weeks agomake: Fix bindist installation
Ben Gamari [Thu, 30 May 2019 15:33:05 +0000 (11:33 -0400)] 
make: Fix bindist installation

This fixes a few vestigial references to `settings` left over from !655.
Fixes #16715.

6 weeks agogitlab-ci: Run bindisttest during CI
Ben Gamari [Wed, 8 May 2019 15:03:45 +0000 (11:03 -0400)] 
gitlab-ci: Run bindisttest during CI

6 weeks agoAdd GHCi :instances command
Xavier Denis [Fri, 19 Oct 2018 23:36:23 +0000 (01:36 +0200)] 
Add GHCi :instances command

This commit adds the `:instances` command to ghci following proosal
number 41.

This makes it possible to query which instances are available to a given

The output of this command is all the possible instances with type
variables and constraints instantiated.

6 weeks agoHadrian: fix OSX build failure and add an OSX/Hadrian CI job
Alp Mestanogullari [Fri, 31 May 2019 09:20:30 +0000 (11:20 +0200)] 
Hadrian: fix OSX build failure and add an OSX/Hadrian CI job

The OSX build failure introduced in 3aa71a22 was due to a change in the
glob we use to collect libffi shared libraries in hadrian/src/Rules/Libffi.hs.
This commit fixes the problem and adds an OSX CI job that builds GHC with
Hadrian, to make sure we don't break it again.