[Git][ghc/ghc][wip/gc/aligned-block-allocation] 208 commits: Be more careful when naming TyCon binders

Ömer Sinan Ağacan gitlab at gitlab.haskell.org
Wed Apr 10 07:46:33 UTC 2019



Ömer Sinan Ağacan pushed to branch wip/gc/aligned-block-allocation at Glasgow Haskell Compiler / GHC


Commits:
80dfcee6 by Simon Peyton Jones at 2019-03-05T08:09:41Z
Be more careful when naming TyCon binders

This patch fixes two rather gnarly test cases:
  * Trac #16342 (mutual recursion)
    See Note [Tricky scoping in generaliseTcTyCon]

  * Trac #16221 (shadowing)
    See Note [Unification variables need fresh Names]

The main changes are:

* Substantial reworking of TcTyClsDecls.generaliseTcTyCon
  This is the big change, and involves the rather tricky
  function TcHsSyn.zonkRecTyVarBndrs.

  See Note [Inferring kinds for type declarations] and
  Note [Tricky scoping in generaliseTcTyCon] for the details.

* bindExplicitTKBndrs_Tv and bindImplicitTKBndrs_Tv both now
  allocate /freshly-named/ unification variables. Indeed, more
  generally, unification variables are always fresh; see
  Note [Unification variables need fresh Names] in TcMType

* Clarify the role of tcTyConScopedTyVars.
  See Note [Scoped tyvars in a TcTyCon] in TyCon

As usual, this dragged in some more refactoring:

* Renamed TcMType.zonkTyCoVarBndr to zonkAndSkolemise

* I renamed checkValidTelescope to checkTyConTelescope;
  it's only used on TyCons, and indeed takes a TyCon as argument.

* I folded the slightly-mysterious reportFloatingKvs into
  checkTyConTelescope. (Previously all its calls immediately
  followed a call to checkTyConTelescope.)  It makes much more
  sense there.

* I inlined some called-once functions to simplify
  checkValidTyFamEqn. It's less spaghetti-like now.

* This patch also fixes Trac #16251.  I'm not quite sure why #16251
  went wrong in the first place, nor how this patch fixes it, but
  hey, it's good, and life is short.

- - - - -
6c4e45b0 by David Eichmann at 2019-03-05T08:15:47Z
Test Runner: don't show missing baseline warning for performance tests with expected changes on the current commit.

Trac #16359

- - - - -
646b6dfb by Krzysztof Gogolewski at 2019-03-05T08:21:53Z
Fix map/coerce rule for newtypes with wrappers

This addresses Trac #16208 by marking newtype wrapper
unfoldings as compulsory.

Furthermore, we can remove the special case for newtypes
in exprIsConApp_maybe (introduced in 7833cf407d1f).

- - - - -
37f257af by Ben Gamari at 2019-03-06T03:22:40Z
Rip out object splitting

The splitter is an evil Perl script that processes assembler code.
Its job can be done better by the linker's --gc-sections flag. GHC
passes this flag to the linker whenever -split-sections is passed on
the command line.

This is based on @DemiMarie's D2768.

Fixes Trac #11315
Fixes Trac #9832
Fixes Trac #8964
Fixes Trac #8685
Fixes Trac #8629

- - - - -
23342e1f by Ömer Sinan Ağacan at 2019-03-06T03:28:45Z
rts/Printer: Introduce a few more printing utilities

These include printLargeAndPinnedObjects, printWeakLists, and
printStaticObjects. These are generally useful things to have.

- - - - -
c19a401d by Ömer Sinan Ağacan at 2019-03-06T03:28:45Z
rts/Printer: Print forwarding pointers

- - - - -
db039a4a by Ryan Scott at 2019-03-06T03:40:54Z
Add regression test for #15918

The test case in #15918 no longer triggers an `ASSERT` failure on
GHC HEAD, likely due to commit
682783828275cca5fd8bf5be5b52054c75e0e22c (`Make a smart mkAppTyM`).
This patch adds a regression test for #15918 to finally put it to
rest.

- - - - -
2ff77b98 by P.C. Shyamshankar at 2019-03-06T14:17:22Z
Handle absolute paths to build roots in Hadrian.

Fixes #16187.

This patch fixes various path concatenation issues to allow functioning
builds with hadrian when the build root location is specified with an
absolute path.

Remarks:

- The path concatenation operator (-/-) now handles absolute second operands
  appropriately. Its behavior should match that of POSIX (</>) in this
  regard.

- The `getDirectoryFiles*` family of functions only searches for matches
  under the directory tree rooted by its first argument; all of the
  results are also relative to this root. If the first argument is the
  empty string, the current working directory is used.

  This patch passes the appropriate directory (almost always either `top`
  or `root`), and subsequently attaches that directory prefix so that
  the paths refer to the appropriate files.

- Windows `tar` does not like colons (':') in paths to archive files, it
  tries to resolve them as remote paths. The `--force-local` option
  remedies this, and is applied on windows builds.

- - - - -
5aab1d9c by Ömer Sinan Ağacan at 2019-03-06T20:53:32Z
rts: Unglobalize dead_weak_ptr_list and resurrected_threads

In the concurrent nonmoving collector we will need the ability to call
`traverseWeakPtrList` concurrently with minor generation collections.
This global state stands in the way of this. However, refactoring it
away is straightforward since this list only persists the length of a
single GC.

- - - - -
a4944d8d by Ben Gamari at 2019-03-06T20:53:32Z
Fix it

- - - - -
78dd04f9 by Ryan Scott at 2019-03-06T21:05:45Z
Fix #16385 by appending _maybe to a use of lookupGlobalOcc

`instance forall c. c` claimed that `c` was out of scope because the
renamer was invoking `lookupGlobalOcc` on `c` (in
`RnNames.getLocalNonValBinders`) without binding `c` first. To avoid
this, this patch changes GHC to invoke `lookupGlobalOcc_maybe` on `c`
instead, and if that returns `Nothing`, then bail out, resulting
in a better error message.

- - - - -
3caeb443 by Zejun Wu at 2019-03-06T21:11:52Z
Move reifyGHCi function into GhciMonad type class

This was the suggested change in !176 but missed the batch merge (!263).

- - - - -
4ca271d1 by Ben Gamari at 2019-03-07T02:48:10Z
testsuite: Introduce fragile modifier

Now since we have been a bit more stringent in testsuite cleanliness we
have been marking a lot of tests as fragile using the `skip` modifier.
However, this unfortunately means that we lose the association with the
ticket number documenting the fragility.

Here we introduce `fragile` and `fragile_for` to retain this
information.

- - - - -
910185a3 by Ben Gamari at 2019-03-07T02:48:10Z
testsuite: Mark heapprof001 as fragile on i386

- - - - -
a65bcbe7 by Ben Gamari at 2019-03-07T02:48:10Z
testsuite: Use fragile modifier for more tests

- - - - -
f624dc15 by Ben Gamari at 2019-03-07T02:48:10Z
gitlab-ci: Don't allow i386-deb9 to fail

Also account for testsuite metric drift.

Metric Increase:
    haddock.Cabal
    haddock.base
    T14683

- - - - -
07f378ce by Simon Peyton Jones at 2019-03-07T02:54:17Z
Add tests for Trac #16221 and #16342

- - - - -
25c3dd39 by Simon Peyton Jones at 2019-03-07T02:54:17Z
Test Trac #16263

- - - - -
7a68254a by Phuong Trinh at 2019-03-07T19:01:42Z
Fix #16392: revertCAFs in external interpreter when necessary

We revert CAFs when loading/adding modules in ghci (presumably to refresh
execution states and to allow for object code to be unloaded from the runtime).
However, with `-fexternal-interpreter` enabled, we are only doing it in the
ghci process instead of the external interpreter process where the cafs are
allocated and computed. This makes sure that revertCAFs is done in the
appropriate process no matter if that flag is present or not.

- - - - -
068b7e98 by Ryan Scott at 2019-03-07T19:07:49Z
Fix #16391 by using occCheckExpand in TcValidity

The type-variables-escaping-their-scope-via-kinds check in
`TcValidity` was failing to properly expand type synonyms, which led
to #16391. This is easily fixed by using `occCheckExpand` before
performing the validity check.

Along the way, I refactored this check out into its own function,
and sprinkled references to Notes to better explain all of the moving
parts. Many thanks to @simonpj for the suggestions.

Bumps the haddock submodule.

- - - - -
1675d40a by Sebastian Graf at 2019-03-08T01:44:08Z
Always do the worker/wrapper split for NOINLINEs

Trac #10069 revealed that small NOINLINE functions didn't get split
into worker and wrapper. This was due to `certainlyWillInline`
saying that any unfoldings with a guidance of `UnfWhen` inline
unconditionally. That isn't the case for NOINLINE functions, so we
catch this case earlier now.

Nofib results:

--------------------------------------------------------------------------------
        Program         Allocs    Instrs
--------------------------------------------------------------------------------
 fannkuch-redux          -0.3%      0.0%
             gg          +0.0%     +0.1%
       maillist          -0.2%     -0.2%
        minimax           0.0%     -0.8%
--------------------------------------------------------------------------------
            Min          -0.3%     -0.8%
            Max          +0.0%     +0.1%
 Geometric Mean          -0.0%     -0.0%

Fixes #10069.

-------------------------
Metric Increase:
    T9233
-------------------------

- - - - -
48927a9a by Alp Mestanogullari at 2019-03-08T10:50:26Z
Hadrian: various improvements around the 'test' rule

- introduce a -k/--keep-test-files flag to prevent cleanup
- add -dstg-lint to the options that are always passed to tests
- infer library ways from the compiler to be tested instead of getting them
  from the flavour (like make)
- likewise for figuring out whether the compiler to be tested is "debugged"
- specify config.exeext
- correctly specify config.in_tree_compiler, instead of always passing True
- fix formatting of how we pass a few test options
- add (potential) extensions to check-* program names
- build check-* programs with the compiler to be tested
- set TEST_HC_OPTS_INTERACTIVE and PYTHON env vars when running tests

- - - - -
5d744143 by Andrey Mokhov at 2019-03-08T10:56:32Z
Hadrian: Drop remaining symlink traversal code from build scripts

This partly resolves #16325 (https://ghc.haskell.org/trac/ghc/ticket/16325).

As previously discussed in https://github.com/snowleopard/hadrian/issues/667,
we do not need the symlink traversal code in build scripts. However, it
appears we forgot to delete this code from our Stack-based build scripts,
which led to placing all build artefacts in an unexpected location when
using Hadrian in combination with symlink trees. This commit fixes this.

- - - - -
82628254 by Vladislav Zavialov at 2019-03-08T11:02:37Z
Testsuite: use 'fragile' instead of 'skip' for T3424, T14697

Also, replace some tabs with spaces to avoid a "mixed indent" warning that vim
gives me.

- - - - -
5be7ad78 by Simon Peyton Jones at 2019-03-08T11:08:41Z
Use captureTopConstraints in TcRnDriver calls

Trac #16376 showed the danger of failing to report an error
that exists only in the unsolved constraints, if an exception
is raised (via failM).

Well, the commit 5c1f268e (Fail fast in solveLocalEqualities)
did just that -- i.e. it found errors in the constraints, and
called failM to avoid a misleading cascade.

So we need to be sure to call captureTopConstraints to report
those insolubles.  This was wrong in TcRnDriver.tcRnExpr and
in TcRnDriver.tcRnType.

As a result the error messages from test T13466 improved slightly,
a happy outcome.

- - - - -
224a6b86 by Sylvain Henry at 2019-03-08T19:05:10Z
TH: support raw bytes literals (#14741)

GHC represents String literals as ByteString internally for efficiency
reasons. However, until now it wasn't possible to efficiently create
large string literals with TH (e.g. to embed a file in a binary, cf #14741):
TH code had to unpack the bytes into a [Word8] that GHC then had to re-pack
into a ByteString.

This patch adds the possibility to efficiently create a "string" literal
from raw bytes. We get the following compile times for different sizes
of TH created literals:

|| Size || Before || After  || Gain ||
|| 30K  || 2.307s || 2.299  || 0%   ||
|| 3M   || 3.073s || 2.400s || 21%  ||
|| 30M  || 8.517s || 3.390s || 60%  ||

Ticket #14741 can be fixed if the original code uses this new TH feature.

- - - - -
2762f94d by Roland Senn at 2019-03-08T19:11:19Z
Fix #13839: GHCi warnings do not respect the default module header

- - - - -
1f5cc9dc by Simon Peyton Jones at 2019-03-09T07:07:53Z
Stop inferring over-polymorphic kinds

Before this patch GHC was trying to be too clever
(Trac #16344); it succeeded in kind-checking this
polymorphic-recursive declaration

    data T ka (a::ka) b
      = MkT (T Type           Int   Bool)
            (T (Type -> Type) Maybe Bool)

As Note [No polymorphic recursion] discusses, the "solution" was
horribly fragile.  So this patch deletes the key lines in
TcHsType, and a wodge of supporting stuff in the renamer.

There were two regressions, both the same: a closed type family
decl like this (T12785b) does not have a CUSK:
  type family Payload (n :: Peano) (s :: HTree n x) where
    Payload Z (Point a) = a
    Payload (S n) (a `Branch` stru) = a

To kind-check the equations we need a dependent kind for
Payload, and we don't get that any more.  Solution: make it
a CUSK by giving the result kind -- probably a good thing anyway.

The other case (T12442) was very similar: a close type family
declaration without a CUSK.

- - - - -
cfbedf17 by Niklas Hambüchen at 2019-03-09T07:14:13Z
compiler: Write .o files atomically. See #14533

This issue was reproduced with, and the fix confirmed with,
the `hatrace` tool for syscall-based fault injection:

    https://github.com/nh2/hatrace

The concrete test case for GHC is at

    https://github.com/nh2/hatrace/blob/e23d35a2d2c79e8bf49e9e2266b3ff7094267f29/test/HatraceSpec.hs#L185

A previous, nondeterministic reproducer for the issue was provided by
Alexey Kuleshevich in

    https://github.com/lehins/exec-kill-loop

Signed-off-by: Niklas Hambüchen <niklas at fpcomplete.com>
Reviewed-by: Alexey Kuleshevich <alexey at fpcomplete.com>

- - - - -
08ad38a9 by Niklas Hambüchen at 2019-03-09T07:14:13Z
compiler: Refactor: extract `withAtomicRename`

- - - - -
e76ee675 by Ben Gamari at 2019-03-09T12:30:17Z
rts: Factor out large bitmap walking

This will be needed by the mark phase of the non-moving collector
so let's factor it out.

- - - - -
6e3e537e by Edward Z. Yang at 2019-03-09T12:36:26Z
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 at fb.com>

- - - - -
6b2f0991 by Sylvain Henry at 2019-03-09T12:42:34Z
NCG: correctly escape path strings on Windows (#16389)

GHC native code generator generates .incbin and .file directives. We
need to escape those strings correctly on Windows (see #16389).

- - - - -
b760269c by Ben Gamari at 2019-03-09T12:48:38Z
Rip out perl dependency

The object splitter was the last major user of perl. There remain a few
uses in nofib but we can just rely on the system's perl for this since
it's not critical to the build.

- - - - -
0cd98957 by Ben Gamari at 2019-03-09T12:48:38Z
Drop utils/count_lines

This doesn't appear to be used anywhere in the build system and it
relies on perl. Drop it.

- - - - -
bcb6769c by Alec Theriault at 2019-03-11T22:11:59Z
Ignore more version numbers in the testsuite

Prevents some tests from failing just due to mismatched version numbers.

These version numbers shouldn't cause tests to fail, especially since
we *expect* them to be regularly incremented. The motivation for this
particular set of changes came from the changes that came along with
the `base` version bump in 8f19ecc95fbaf2cc977531d721085d8441dc09b7.

- - - - -
60b03ade by Krzysztof Gogolewski at 2019-03-11T22:18:06Z
Change the warning in substTy back to an assertion

We'd like to enforce the substitution invariant (Trac #11371).
In a492af06d326453 the assertion was downgraded to a warning;
I'm restoring the assertion and making the calls that
don't maintain the invariant as unchecked.

- - - - -
2f453414 by Krzysztof Gogolewski at 2019-03-11T22:18:06Z
Add a test for Trac #13951

It no longer gives a warning.

- - - - -
b2322310 by Matthew Pickering at 2019-03-12T13:04:52Z
Hadrian: Allow passing CABFLAGS into build.cabal.sh

Setting `CABFLAGS=args` will pass the additional arguments to cabal
when it is invoked.

- - - - -
61264556 by Matthew Pickering at 2019-03-12T13:04:52Z
Hadrian: Make libsuf and distDir stage aware

The version suffix needs to be the version of the stage 0 compiler
when building shared libraries with the stage 0 compiler.

- - - - -
705fa21d by Matthew Pickering at 2019-03-12T13:04:52Z
Hadrian: Make makeRelativeNoSysLink total

makeRelativeNoSysLink would previously crash for no reason if the first
argument as `./` due to the call to `head`. This refactoring keeps the
behaviour the same but doesn't crash in this corner case.

- - - - -
4cf2160a by Matthew Pickering at 2019-03-12T13:04:52Z
Hadrian: Fix rpath so shared objects work after being copied

After being copied all the shared objects end up in the same directory.
Therefore the correct rpath is `$ORIGIN` rather than the computed
path which is relative to the directory where it is built.

- - - - -
2d7dd028 by Matthew Pickering at 2019-03-12T13:04:52Z
Hadrian: Add ./hadrian/ghci.sh script for fast development feedback

Running the `./hadrian/ghci` target will load the main compiler into
a ghci session. This is intended for fast development feedback, modules are only
typechecked so it isn't possible to run any functions in the repl.

You can also use this target with `ghcid`.

The first time this command is run hadrian will need to compile a few dependencies
which will take 1-2 minutes. Loading GHC into GHCi itself takes about 30 seconds.

Internally this works by calling a new hadrian target called `tool-args`.
This target prints out the package and include flags which are necessary
to load files into ghci. The same target is intended to be used by other
tooling which uses the GHC API in order to set up the correct GHC API
session. For example, using this target it is also possible to use HIE
when developing on GHC.

- - - - -
bb684e65 by Matthew Pickering at 2019-03-12T13:04:52Z
Remove training whitespace

- - - - -
72c455a4 by Matthew Pickering at 2019-03-12T13:04:52Z
CI: Add ghc-in-ghci build job

This is a separate build job to the other hadrian jobs as it only takes
about 2-3 minutes to run from cold. The CI tests that the
`./hadrian/ghci` script loads `ghc/Main.hs` successfully.

- - - - -
5165378d by Matthew Pickering at 2019-03-12T13:04:52Z
Remove trailing whitespace

- - - - -
50249a9f by Simon Peyton Jones at 2019-03-12T13:13:28Z
Use transSuperClasses in TcErrors

Code in TcErrors was recursively using immSuperClasses,
which loops in the presence of UndecidableSuperClasses.

Better to use transSuperClasses instead, which has a loop-breaker
mechanism built in.

Fixes issue #16414.

- - - - -
62db9295 by Ömer Sinan Ağacan at 2019-03-12T13:19:29Z
Remove duplicate functions in StgCmmUtils, use functions from CgUtils

Also remove unused arg from get_Regtable_addr_from_offset

- - - - -
4db9bdd9 by Ryan Scott at 2019-03-12T13:25:39Z
Add regression test for #16347

Commit 1f5cc9dc8aeeafa439d6d12c3c4565ada524b926 ended up
fixing #16347. Let's add a regression test to ensure that it stays
fixed.

- - - - -
02ddf947 by Matthew Pickering at 2019-03-12T13:42:53Z
CI: Update ci-images commit
- - - - -
a0cab873 by Matthew Pickering at 2019-03-12T13:44:45Z
Revert: Update ci-images commit
- - - - -
23fc6156 by Ben Gamari at 2019-03-13T19:03:53Z
testsuite: Mark heapprof001 as fragile on all platforms

See #15382.

- - - - -
cb17c2da by Alp Mestanogullari at 2019-03-13T19:10:01Z
Hadrian: build (and retrieve) binary distributions in CI

With all the recent fixes to the binary-dist rule in Hadrian, we can now run
that rule in CI and keep the bindists around in gitlab as artifacts, just like
we do for the make CI jobs.

To get 'autoreconf' to work in the Windows CI, we have to run it through the
shell interpreter, so this commit does that along the way.

- - - - -
36546a43 by Ryan Scott at 2019-03-13T19:16:08Z
Fix #16411 by making dataConCannotMatch aware of (~~)

The `dataConCannotMatch` function (which powers the
`-Wpartial-fields` warning, among other things) had special reasoning
for explicit equality constraints of the form `a ~ b`, but it did
not extend that reasoning to `a ~~ b` constraints, leading to #16411.
Easily fixed.

- - - - -
10a97120 by Ben Gamari at 2019-03-14T16:20:50Z
testsuite: Add testcase for #16394

- - - - -
8162eab2 by Ryan Scott at 2019-03-15T13:59:30Z
Remove the GHCi debugger's panicking isUnliftedType check

The GHCi debugger has never been that robust in the face of
higher-rank types, or even types that are _interally_ higher-rank,
such as the types of many class methods (e.g., `fmap`). In GHC 8.2,
however, things became even worse, as the debugger would start to
_panic_ when a user tries passing the name of a higher-rank thing
to `:print`. This all ties back to a strange `isUnliftedType` check
in `Debugger` that was mysteriously added 11 years ago
(in commit 4d71f5ee6dbbfedb4a55767e4375f4c0aadf70bb) with no
explanation whatsoever.

After some experimentation, no one is quite sure what this
`isUnliftedType` check is actually accomplishing. The test suite
still passes if it's removed, and I am unable to observe any
differences in debugger before even with data types that _do_ have
fields of unlifted types (e.g., `data T = MkT Int#`). Given that
this is actively causing problems (see #14828), the prudent thing
to do seems to be just removing this `isUnliftedType` check, and
waiting to see if anyone shouts about it. This patch accomplishes
just that.

Note that this patch fix the underlying issues behind #14828, as the
debugger will still print unhelpful info if you try this:

```
λ> f :: (forall a. a -> a) -> b -> b; f g x = g x
λ> :print f
f = (_t1::t1)
```

But fixing this will require much more work, so let's start with the
simple stuff for now.

- - - - -
d10e2368 by David Eichmann at 2019-03-15T14:05:38Z
Hadrian: remove unneeded imports.

- - - - -
4df75772 by David Eichmann at 2019-03-15T14:05:38Z
Hadrian: remove unneeded rpaths.

Issue #12770

- - - - -
afc80730 by David Eichmann at 2019-03-15T14:11:47Z
Git ignore .hadrian_ghci (generated by the ./hadrian/ghci.sh)

[skip ci]

- - - - -
610ec224 by Ryan Scott at 2019-03-15T14:17:54Z
Update Trac ticket URLs to point to GitLab

This moves all URL references to Trac tickets to their corresponding
GitLab counterparts.

- - - - -
97032ed9 by Simon Peyton Jones at 2019-03-15T14:24:01Z
Report better suggestion for GADT data constructor

This addresses issue #16427. An easy fix.

- - - - -
83e09d3c by Peter Trommler at 2019-03-15T14:30:08Z
PPC NCG: Use liveness information in CmmCall

We make liveness information for global registers
available on `JMP` and `BCTR`, which were the last instructions
missing. With complete liveness information we do not need to
reserve global registers in `freeReg` anymore. Moreover we
assign R9 and R10 to callee saves registers.

Cleanup by removing `Reg_Su`, which was unused, from `freeReg`
and removing unused register definitions.

The calculation of the number of floating point registers is too
conservative. Just follow X86 and specify the constants directly.

Overall on PowerPC this results in 0.3 % smaller code size in nofib
while runtime is slightly better in some tests.

- - - - -
57201beb by Simon Peyton Jones at 2019-03-15T14:36:14Z
Add flavours link
- - - - -
4927117c by Simon Peyton Jones at 2019-03-16T12:08:25Z
Improve error recovery in the typechecker

Issue #16418 showed that we were carrying on too eagerly after a bogus
type signature was identified (a bad telescope in fact), leading to a
subsequent crash.

This led me in to a maze of twisty little passages in the typechecker's
error recovery, and I ended up doing some refactoring in TcRnMonad.
Some specfifics

* TcRnMonad.try_m is now called attemptM.

* I switched the order of the result pair in tryTc,
  to make it consistent with other similar functions.

* The actual exception used in the Tc monad is irrelevant so,
  to avoid polluting type signatures, I made tcTryM, a simple
  wrapper around tryM, and used it.

The more important changes are in

* TcSimplify.captureTopConstraints, where we should have been calling
  simplifyTop rather than reportUnsolved, so that levity defaulting
  takes place properly.

* TcUnify.emitResidualTvConstraint, where we need to set the correct
  status for a new implication constraint.  (Previously we ended up
  with an Insoluble constraint wrapped in an Unsolved implication,
  which meant that insolubleWC gave the wrong answer.

- - - - -
600a1ac3 by Simon Peyton Jones at 2019-03-16T12:08:25Z
Add location to the extra-constraints wildcard

The extra-constraints wildcard had lost its location
(issue #16431).

Happily this is easy to fix.  Lots of error improvements.

- - - - -
1c1b63d6 by Ben Gamari at 2019-03-16T23:13:36Z
compiler: Disable atomic renaming on Windows

As discussed in #16450, this feature regresses CI on Windows, causing
non-deterministic failures due to missing files.

- - - - -
6764da43 by Ben Gamari at 2019-03-16T23:16:56Z
gitlab-ci: Explicitly set bindist tarball name

- - - - -
ad79ccd9 by Ben Gamari at 2019-03-16T23:17:46Z
gitlab-ci: Generate documentation tarball

- - - - -
3f2291e4 by Ben Gamari at 2019-03-16T23:17:46Z
gitlab-ci: Generate source tarballs

- - - - -
cb61371e by Ben Gamari at 2019-03-17T09:05:10Z
ghc-heap: Introduce closureSize

This function allows the user to compute the (non-transitive) size of a
heap object in words. The "closure" in the name is admittedly confusing
but we are stuck with this nomenclature at this point.

- - - - -
c01d5af3 by Michael Sloan at 2019-03-18T02:23:19Z
Extract out use of UnboxedTuples from GHCi.Leak

See #13101 + #15454 for motivation.  This change reduces the number of
modules that need to be compiled to object code when loading GHC into
GHCi.

- - - - -
6113d0d4 by Radosław Rowicki at 2019-03-18T02:29:25Z
Update bug tracker link to point to gitlab instead of deprecated trac
- - - - -
b8326897 by Ben Gamari at 2019-03-18T03:16:12Z
gitlab-ci: Always build fedora27

This ends up being much easier to use than Debian 9 under NixOS.

- - - - -
acf2129d by Ben Gamari at 2019-03-18T03:17:36Z
gitlab-ci: Implement head.hackage jobs

- - - - -
71648c35 by Ben Gamari at 2019-03-20T03:04:18Z
gitlab-ci: Implement support for i386/Windows bindists

- - - - -
d94ca74f by Tamar Christina at 2019-03-20T03:10:23Z
err: clean up error handler

- - - - -
398f2cbc by Ben Gamari at 2019-03-20T03:16:32Z
Bump Cabal submodule to 3.0

Metric Increase:
    haddock.Cabal

- - - - -
89a201e8 by Takenobu Tani at 2019-03-20T03:22:36Z
users-guide: Update Wiki URLs to point to GitLab

The user's guide uses the `ghc-wiki` macro, and substitution rules
are complicated. So I manually edited `.rst` files without sed.

I changed `Commentary/Latedmd` only to a different page.
It is more appropriate as an example.

[ci skip]

- - - - -
98ff1a56 by Krzysztof Gogolewski at 2019-03-20T03:28:42Z
Replace nOfThem by replicate

- - - - -
6a47414f by Krzysztof Gogolewski at 2019-03-20T03:28:42Z
Fix typos

- - - - -
1e26e60d by Krzysztof Gogolewski at 2019-03-20T03:28:42Z
Simplify monadic code

- - - - -
c045bd7c by Krzysztof Gogolewski at 2019-03-20T03:28:42Z
Remove deprecated reinitializeGlobals

- - - - -
6d19ad72 by Ben Gamari at 2019-03-20T03:34:49Z
gitlab-ci: Bump docker images

To install lndir and un-break the source distribution job.

- - - - -
c7a84a60 by Matthew Pickering at 2019-03-20T03:34:50Z
Update .gitlab-ci.yml
- - - - -
db136237 by Ben Gamari at 2019-03-20T22:41:32Z
testsuite: Mark T16219 and cabal09 as broken on Windows

See #16386.

- - - - -
7cd8e330 by Ben Gamari at 2019-03-20T22:41:32Z
testsuite: Fix expected output on Windows for various ghci tests

Broke as -Wimplicit-kind-vars no longer exists. Specifically ghci024,
ghci057 and T9293.

- - - - -
23b639fd by Ben Gamari at 2019-03-20T22:41:32Z
testsuite: Mark T5836 as broken on Windows

See #16387.

- - - - -
a1bda08d by Ben Gamari at 2019-03-20T22:41:32Z
testsuite: Mark T15904 as broken on Windows

It seems to look for some sort of manifest file. See #16388.

- - - - -
b7f5d552 by Ben Gamari at 2019-03-20T22:41:32Z
testsuite: Mark T16190 as broken on Windows

There seems to be some filepath funniness due to TH embedding going on
here. See #16389.

- - - - -
a0c31f78 by Ben Gamari at 2019-03-20T22:41:32Z
testsuite/plugins: Add multi_cpu_race modifier on Windows

A few tests previously failed with various failure modes. For instance,
  `plugin-recomp-change` fails with:

```
Wrong exit code for plugin-recomp-change()(expected 0 , actual 2 )
Stderr ( plugin-recomp-change ):
Simple Plugin Passes Queried
Got options:
Simple Plugin Pass Run
C://GitLabRunner//builds//8fc0e283//0//ghc//ghc//inplace//mingw//bin/ld.exe: cannot find -lHSplugin-recompilation-0.1-CPeObcGoBuvHdwBnpK9jQq
collect2.exe: error: ld returned 1 exit status
`gcc.exe' failed in phase `Linker'. (Exit code: 1)
make[2]: *** [Makefile:112: plugin-recomp-change] Error 1
*** unexpected failure for plugin-recomp-change(normal)
```

It's unclear whether the ghc-pkg concurrency issue mentioned in all.T is
the culprit but the set of tests that fail overlaps strongly with the
set of tests that lack the `multi_cpu_race` modifier. Let's see if
adding it fixes them.

- - - - -
88a6e9a4 by Ben Gamari at 2019-03-20T22:41:32Z
testsuite: Mark T10672 as broken

This test, which is only run on Windows, seems to be reliably timing
out.

See #16390.

- - - - -
f4d3aaaf by Ben Gamari at 2019-03-20T22:41:32Z
testsuite/plugins: Increase compile timeout on Windows

I think the linker is routinely eating through the timeout,
leading to many spurious failures.

- - - - -
ae382245 by Ben Gamari at 2019-03-20T22:41:32Z
rts/RtsSymbols: Drop __mingw_vsnwprintf

As described in #16387, this is already defined by mingw and
consequently defining it in the RTS as well leads to multiple definition
errors from the RTS linker at runtime.

- - - - -
f79f93e4 by Ben Gamari at 2019-03-20T22:41:32Z
Don't mark cabal09 as broken

It doesn't fail reliably.

- - - - -
d98cb763 by Ben Gamari at 2019-03-20T22:41:32Z
testsuite: Don't mark T5836 as broken

I believe removing __mingw_vsnwprintf from RtsSymbols fixed #16387.

- - - - -
8c1a2743 by Ben Gamari at 2019-03-20T22:41:32Z
Try again

- - - - -
3394a7cd by Ben Gamari at 2019-03-20T22:41:32Z
testsuite: Display observed exit code on failure due to bad exit code

- - - - -
36818759 by Artem Pyanykh at 2019-03-20T23:52:39Z
Adjust section placement and relocation logic for Mach-O

1. Place each section on a separate page to ensure required
alignment (wastes lots ot space, needs to be improved).
2. Unwire relocation logic from macho sections (the most fiddly part
is adjusting internal relocations).

Other todos:
0. Add a test for section alignment.
1. Investigate 32bit relocations!
2. Fix memory leak in ZEROPAGE section allocation.
3. Fix creating redundant jump islands for GOT.
4. Investigate more compact section placement.

- - - - -
78c61acf by Artem Pyanykh at 2019-03-20T23:52:39Z
Use segments for section layout

- - - - -
7bbfb789 by Artem Pyanykh at 2019-03-20T23:52:39Z
Address some todos and fixmes

- - - - -
3cdcc0b5 by Artem Pyanykh at 2019-03-20T23:52:39Z
Add a linker test re: section alignment

- - - - -
cb745c84 by Artem Pyanykh at 2019-03-20T23:52:39Z
Add missing levels to SegmentProt enum

- - - - -
d950f11e by Artem Pyanykh at 2019-03-20T23:52:39Z
Directly test section alignment, fix internal reloc probing length

- - - - -
3fb10fcf by Artem Pyanykh at 2019-03-20T23:52:39Z
Gracefully handle error condition in Mach-O relocateSection

- - - - -
dc713c71 by Ben Gamari at 2019-03-20T23:58:49Z
ci: Move validate-x86_64-linux-deb9 to full-build stage

The `build` stage is meant to be a minimal smoke test to weed out broken
commits. The `validate-x86_64-linux-deb9` build will generally catch a
subset of issues caught by `validate-x86_64-linux-deb9-debug` so only
the latter should be in `build`.

- - - - -
505c5ab2 by Ben Gamari at 2019-03-20T23:58:49Z
ci: Add some descriptions of the stages

- - - - -
646e3dc2 by Sebastian Graf at 2019-03-21T00:04:49Z
Add a bench flavour to Hadrian

- - - - -
8d18a873 by Ryan Scott at 2019-03-21T00:10:57Z
Reject nested predicates in impredicativity checking

When GHC attempts to unify a metavariable with a type containing
foralls, it will be rejected as an occurrence of impredicativity.
GHC was /not/ extending the same treatment to predicate types, such
as in the following (erroneous) example from #11514:

```haskell
foo :: forall a. (Show a => a -> a) -> ()
foo = undefined
```

This will attempt to instantiate `undefined` at
`(Show a => a -> a) -> ()`, which is impredicative. This patch
catches impredicativity arising from predicates in this fashion.

Since GHC is pickier about impredicative instantiations, some test
cases needed to be updated to be updated so as not to fall afoul of
the new validity check. (There were a surprising number of
impredicative uses of `undefined`!) Moreover, the `T14828` test case
now has slightly less informative types shown with `:print`. This is
due to a a much deeper issue with the GHCi debugger (see #14828).

Fixes #11514.

- - - - -
7b213b8d by Ömer Sinan Ağacan at 2019-03-21T00:17:05Z
Print test suite results ("unexpected failures" etc.) in sorted order

Fixes #16425

- - - - -
f199a843 by Simon Jakobi at 2019-03-21T00:23:15Z
Check.hs: Fix a few typos

- - - - -
07d44ed1 by Ben Gamari at 2019-03-21T00:29:20Z
base: Depend upon shlwapi on Windows

As noted in #16466, `System.Environment.getExecutablePath` depends upon
`PathFileExistsW` which is defined by `shlwapi`.

Fixes #16466.

- - - - -
1382d09e by Ryan Scott at 2019-03-21T00:35:28Z
Remove unused XArrApp and XArrForm extension points

!301 removed the `HsArrApp` and `HsArrForm` constructors, which
renders the corresponding extension points `XArrApp` and `XArrForm`
useless. This patch finally rips them out.

- - - - -
3423664b by Peter Trommler at 2019-03-21T00:41:35Z
Fix specification of load_load_barrier [skip-ci]

- - - - -
84c77a67 by Alexandre Esteves at 2019-03-21T21:43:03Z
Fix typo [skip ci]
- - - - -
7092b2de by Matthew Pickering at 2019-03-22T03:38:58Z
Only run check-makefiles.py linter in testsuite dir

- - - - -
322239de by Matthew Pickering at 2019-03-22T03:38:58Z
Run linters on merge requests

It seems that it has failed to execute at all since it was implemented.

We now run the linters on merge requests.

- - - - -
8f8d532c by Ben Gamari at 2019-03-22T03:45:03Z
gitlab-ci: Do full `perf` build when building Windows releases

- - - - -
2ef72d3f by Ben Gamari at 2019-03-22T03:45:03Z
gitlab-ci: Pass --target explicitly to configure on Windows

Otherwise configure fails in the 32-bit case with
```
This GHC (c:/GitLabRunner/builds/8fc0e283/0/ghc/ghc/toolchain/bin/ghc) does not generate code for the build platform
   GHC target platform    : x86_64-unknown-mingw32
   Desired build platform : i386-unknown-mingw32
```

- - - - -
8b14f536 by Ben Gamari at 2019-03-22T03:51:08Z
Bump cabal submodule

Due to https://github.com/haskell/cabal/issues/5953.

- - - - -
dbe4557f by Matthew Pickering at 2019-03-22T14:02:32Z
CI: Allow failure in packaging step

This depends on the windows build which is still allowed to fail. If
that job fails then the packaging job will also fail.

- - - - -
366f1c68 by Ben Gamari at 2019-03-22T14:08:38Z
gitlab: Deploy documentation snapshot via GitLab Pages

- - - - -
d608d543 by Tamar Christina at 2019-03-22T14:14:45Z
Force LF line ending for md5sum [skip-ci]

- - - - -
cd07086a by Ben Gamari at 2019-03-22T14:34:51Z
gitlab-ci: Fix linters

- - - - -
ab51bee4 by Herbert Valerio Riedel at 2019-03-22T14:34:51Z
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 at well-typed.com>

- - - - -
266b49ca by Ben Gamari at 2019-03-22T22:33:20Z
gitlab-ci: Clean up linter

I'm not sure why these steps were done but they seem counterproductive
and unnecessary.

- - - - -
44b08ede by Ben Gamari at 2019-03-22T22:38:11Z
gitlab-ci: Fix YAML syntax

- - - - -
971f4530 by Ben Gamari at 2019-03-22T22:49:34Z
gitlab-ci: Compute merge base against remote tracking branch

Previously we would use the local branch with the name
`$CI_MERGE_REQUEST_TARGET_BRANCH_NAME` to compute the merge base when
linting. However, this branch isn't necessarily up-to-date. We should
rather use `origin/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME`.

- - - - -
8d01b572 by Ben Gamari at 2019-03-23T16:37:56Z
gitlab-ci: Explicitly fetch target branch

`git fetch`, which we used previously, doesn't update the remote
tracking branches.

- - - - -
cd85f8a7 by Ben Gamari at 2019-03-24T12:46:13Z
gitlab-ci: Allow linters to fail for now

They are broken and I don't have time to fix them at the moment.
- - - - -
d763b2e7 by Haskell-mouse at 2019-03-25T18:02:22Z
User's Guide: extensions compatibility

Adds the mention that extensions "AllowAmbiguousTypes" and "RankNTypes"
are not always compatible with each other.
Specifies the conditions and causes of failing in resolving
of ambiguity.

- - - - -
200d65ef by Matthew Pickering at 2019-03-25T18:02:25Z
Check hadrian/ghci.sh script output to determine pass/fail

ghci always exits with exit code 0 so you have to check the output
to see if the modules loaded succesfully.

- - - - -
8e07368f by Matthew Pickering at 2019-03-25T18:02:27Z
Refactor ./hadrian/ghci.sh for better error messages

By separating these two lines, if the first command fails then `ghci` is
not loaded. Before it would still load ghci but display lots of errors
about not being able to find modules.

- - - - -
3769e3a8 by Takenobu Tani at 2019-03-25T18:02:29Z
Update Wiki URLs to point to GitLab

This moves all URL references to Trac Wiki to their corresponding
GitLab counterparts.

This substitution is classified as follows:

1. Automated substitution using sed with Ben's mapping rule [1]
    Old: ghc.haskell.org/trac/ghc/wiki/XxxYyy...
    New: gitlab.haskell.org/ghc/ghc/wikis/xxx-yyy...

2. Manual substitution for URLs containing `#` index
    Old: ghc.haskell.org/trac/ghc/wiki/XxxYyy...#Zzz
    New: gitlab.haskell.org/ghc/ghc/wikis/xxx-yyy...#zzz

3. Manual substitution for strings starting with `Commentary`
    Old: Commentary/XxxYyy...
    New: commentary/xxx-yyy...

See also !539

[1]: https://gitlab.haskell.org/bgamari/gitlab-migration/blob/master/wiki-mapping.json

- - - - -
b9da2868 by Ryan Scott at 2019-03-25T18:02:33Z
Correct duplicate 4.12.0.0 entry in base's changelog

See #16490.

[ci skip]

- - - - -
ab41c1b4 by Andrey Mokhov at 2019-03-27T11:20:03Z
Hadrian: Bump Shake to 0.17.6

The new release of Shake comes with these relevant features:

* use symlinks for --shared
* add --compact for a Bazel/Buck style output

- - - - -
646f2e79 by Andrey Mokhov at 2019-03-27T11:20:03Z
Hadrian: trace the execution of expensive Cabal calls

We use Cabal to parse, configure, register and copy packages, which are
expensive operations that are currently not visible to Shake's profiling
infrastructure. By using `traced` we tell Shake to add these IO actions
to the profiling report, helping us to identify performance bottlenecks.

We use short tracing keys, as recommended in Shake docs: the name of the
current target is already available in the rest of the profiling
information.

- - - - -
fb12f53c by Alp Mestanogullari at 2019-03-27T11:20:05Z
Hadrian: introduce an easy way for users to build with -split-sections

Any user can now trivially build any number of Haskell packages with
`-split-sections` by using `splitSections`/`splitSectionsIf` on any
existing or new flavour:

    -- build all packages but the ghc library with -split-sections
    splitSections :: Flavour -> Flavour

    -- build all packages that satisfy the given predicate
    -- with --split-sections
    splitSectionsIf :: (Package -> Bool) -> Flavour -> Flavour

See the new section in `doc/user-settings.md`.

- - - - -
3dec527a by David Eichmann at 2019-03-27T11:20:09Z
Hadrian: don't use -zorigin on darwin.

- - - - -
5730f863 by Ömer Sinan Ağacan at 2019-03-27T11:20:10Z
Minor refactoring in copy array primops:

- `emitCopySmallArray` now checks size before generating code and
  doesn't generate any code when size is 0. `emitCopyArray` already does
  this so this makes small/large array cases the same in argument
  checking.

- In both `emitCopySmallArray` and `emitCopyArray` read the `dflags`
  after checking the argument.

- - - - -
4acdb769 by Chaitanya Koparkar at 2019-03-27T11:20:11Z
Fix a few broken Trac links [skip ci]

This patch only attempts to fix links that don't automatically re-direct to the correct URL.

- - - - -
97ad5cfb by Artem Pelenitsyn at 2019-03-29T18:18:12Z
Add some tips to the Troubleshooting section of README

- - - - -
8a20bfc2 by Michael Peyton Jones at 2019-03-29T18:18:14Z
Visibility: handle multiple units with the same name

Fixes #16228. The included test case is adapted from the reproduction in
the issue, and fails without this patch.

------

We compute an initial visilibity mapping for units based on what is
present in the package databases. To seed this, we compute a set of all
the package configs to add visibilities for.

However, this set was keyed off the unit's *package name*. This is
correct, since we compare packages across databases by version. However,
we would only ever consider a single, most-preferable unit from the
database in which it was found.

The effect of this was that only one of the libraries in a Cabal package
would be added to this initial set. This would cause attempts to use
modules from the omitted libraries to fail, claiming that the package
was hidden (even though `ghc-pkg` would correctly show it as visible).

A solution is to do the selection of the most preferable packages
separately, and then be sure to consider exposing all units in the
same package in the same package db. We can do this by picking a
most-preferable unit for each package name, and then considering
exposing all units that are equi-preferable with that unit.

------

Why wasn't this bug apparent to all people trying to use sub-libraries
in Cabal? The answer is that Cabal explicitly passes `-package` and
`-package-id` flags for all the packages it wants to use, rather than
relying on the state of the package database. So this bug only really
affects people who are trying to use package databases produced by Cabal
outside of Cabal itself.

One particular example of this is the way that the
Nixpkgs Haskell infrastructure provides wrapped GHCs: typically these
are equipped with a package database containing all the needed
package dependencies, and the user is not expected to pass
`-package` flags explicitly.

- - - - -
754b5455 by Artem Pelenitsyn at 2019-03-29T18:18:20Z
docs: make nfib compute the Fibonacci sequence [skipci]
- - - - -
1a567133 by Ben Gamari at 2019-03-29T18:18:20Z
ci: Check that changelogs don't contain "TBA"

This ensures that the release dates in the library changelogs are
properly set.

- - - - -
6e15ca54 by Ben Gamari at 2019-03-29T18:18:22Z
Bump transformers to 0.5.6.2

See #16199.

- - - - -
6f7115df by Ben Gamari at 2019-03-30T11:42:38Z
ci: Ensure index.html is preserved in documentation tarball

- - - - -
33173a51 by Alexandre at 2019-04-01T07:32:28Z
    Add support for bitreverse primop

    This commit includes the necessary changes in code and
    documentation to support a primop that reverses a word's
    bits. It also includes a test.

- - - - -
a3971b4e by Alexandre at 2019-04-01T07:32:28Z
Bump ghc-prim's version where needed

- - - - -
061276ea by Michael Sloan at 2019-04-01T07:32:30Z
Remove unnecessary uses of UnboxedTuples pragma (see #13101 / #15454)

Also removes a couple unnecessary MagicHash pragmas

- - - - -
e468c613 by David Eichmann at 2019-04-01T07:32:34Z
Support Shake's --lint-fsatrace feature.

Using this feature requires fsatrace (e.g. https://github.com/jacereda/fsatrace).
Simply use the `--lint-fsatrace` option when running hadrian.
Shake version >= 0.17.7 is required to support linting out of tree build dirs.

- - - - -
1e9e4197 by Ben Gamari at 2019-04-01T07:32:34Z
gitlab: Add merge request template for backports for 8.8

- - - - -
55650d14 by Ben Gamari at 2019-04-01T07:32:34Z
gitlab: Add some simply issue templates

- - - - -
27b99ed8 by Takenobu Tani at 2019-04-01T07:32:36Z
Clean up URLs to point to GitLab

This moves URL references to old Trac to their corresponding
GitLab counterparts.

This patch does not update the submodule library, such as
libraries/Cabal.

See also !539, !606, !618

[ci skip]

- - - - -
18d1555d by Adam Sandberg Eriksson at 2019-04-01T07:32:38Z
configure: document the use of the LD variable

- - - - -
10352efa by Ben Gamari at 2019-04-01T22:22:34Z
gitlab: Add feature request MR template

- - - - -
1e52054b by Ben Gamari at 2019-04-01T23:16:21Z
gitlab: Move feature request template to issue_templates

Whoops.

- - - - -
e5c21ca9 by Ben Gamari at 2019-04-01T23:16:25Z
gitlab: Mention ~"user facing" label

- - - - -
39282422 by Ryan Scott at 2019-04-02T00:01:38Z
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`).

- - - - -
7cf5ba3d by Michal Terepeta at 2019-04-02T00:07:49Z
Improve performance of newSmallArray#

This:
- Hoists part of the condition outside of the initialization loop in
  `stg_newSmallArrayzh`.
- Annotates one of the unlikely branches as unlikely, also in
  `stg_newSmallArrayzh`.
- Adds a couple of annotations to `allocateMightFail` indicating which
  branches are likely to be taken.

Together this gives about 5% improvement.

Signed-off-by: Michal Terepeta <michal.terepeta at gmail.com>

- - - - -
dd9c82ef by David Eichmann at 2019-04-02T00:13:55Z
Hadrian: correct deps for ghc builder.

Previously, when needing ghc as a builder, the ghcDeps (Files
the GHC binary depends on) for the current stage were needed.
This is incorrect as the previous stage's ghc is used for building.
This commit fixes the issue, needing the previous stage's ghcDeps.

- - - - -
345306d3 by Alexandre Baldé at 2019-04-02T16:34:30Z
Fix formatting issue in ghc-prim's changelog [skip ci]

- - - - -
f54b5124 by David Eichmann at 2019-04-02T16:40:39Z
Hadrian: traceAllow deep dependencies when compilling haskell object files.

- - - - -
d132b30a by David Eichmann at 2019-04-02T16:40:39Z
Hadrian: lint ignore autom4te and ghc-pkg cache files.

- - - - -
bf734195 by Simon Marlow at 2019-04-02T16:46:46Z
Add myself to libraries/ghci
- - - - -
5a75ccd0 by klebinger.andreas at gmx.at at 2019-04-03T04:34:57Z
Fix faulty substitutions in StgCse (#11532).

`substBndr` should rename bindings which shadow existing ids.
However while it was renaming the bindings it was not adding proper substitutions
for renamed bindings.
Instead of adding a substitution of the form `old -> new` for renamed
bindings it mistakenly added `old -> old` if no replacement had taken
place while adding none if `old` had been renamed.

As a byproduct this should improve performance, as we no longer add
useless substitutions for unshadowed bindings.

- - - - -
2ec749b5 by Nathan Collins at 2019-04-03T04:41:05Z
users-guide: Fix typo

- - - - -
ea192a09 by Andrew Martin at 2019-04-03T04:41:05Z
base: Add documentation that liftA2 used to not be a typeclass method

- - - - -
733f1b52 by Frank Steffahn at 2019-04-03T04:41:05Z
users-guide: Typo in Users Guide, Glasgow Exts

- - - - -
3364def0 by Ben Gamari at 2019-04-03T04:41:05Z
integer-gmp: Write friendlier documentation for Integer

- - - - -
dd3a3d08 by Ben Gamari at 2019-04-03T04:41:05Z
integer-simple: Add documentation for Integer type

- - - - -
722fdddf by Chris Martin at 2019-04-03T04:41:05Z
Correct two misspellings of "separately"

- - - - -
bf6dbe3d by Chris Martin at 2019-04-03T04:41:05Z
Inline the definition of 'ap' in the Monad laws

The law as it is currently written is meaningless, because nowhere have
we defined the implementation of 'ap'. The reader of the Control.Monad
documentation is provided with only a type signature,

> ap :: Monad m => m (a -> b) -> m a -> m b

an informal description,

> In many situations, the liftM operations can be replaced by uses of
> ap, which promotes function application.

and a relationship between 'ap' and the 'liftM' functions

> return f `ap` x1 `ap` ... `ap` xn
> is equivalent to
> liftMn f x1 x2 ... xn

Without knowing how 'ap' is defined, a law involving 'ap' cannot
provide any guidance for how to write a lawful Monad instance, nor can
we conclude anything from the law.

I suspect that a reader equipped with the understanding that 'ap' was
defined prior to the invention of the Applicative class could deduce
that 'ap' must be defined in terms of (>>=), but nowhere as far as I can
tell have we written this down explicitly for readers without the
benefit of historical context.

If the law is meant to express a relationship among (<*>), (>>=), and
'return', it seems that it is better off making this statement directly,
sidestepping 'ap' altogether.

- - - - -
7b090b53 by Ben Gamari at 2019-04-03T07:57:40Z
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].

- - - - -
4626cf21 by Sebastian Graf at 2019-04-03T08:03:47Z
Fix Uncovered set of literal patterns

Issues #16289 and #15713 are proof that the pattern match checker did
an unsound job of estimating the value set abstraction corresponding to
the uncovered set.

The reason is that the fix from #11303 introducing `NLit` was
incomplete: The `LitCon` case desugared to `Var` rather than `LitVar`,
which would have done the necessary case splitting analogous to the
`ConVar` case.

This patch rectifies that by introducing the fresh unification variable
in `LitCon` in value abstraction position rather than pattern postition,
recording a constraint equating it to the constructor expression rather
than the literal. Fixes #16289 and #15713.

- - - - -
6f13e7b1 by Ben Gamari at 2019-04-03T12:12:26Z
gitlab-ci: Build hyperlinked sources for releases

Fixes #16445.

- - - - -
895394c2 by Ben Gamari at 2019-04-03T12:15:06Z
gitlab: Fix label names in issue templates

- - - - -
75abaaea by Yuriy Syrovetskiy at 2019-04-04T08:23:19Z
Replace git.haskell.org with gitlab.haskell.org (#16196)

- - - - -
25c02ea1 by Ryan Scott at 2019-04-04T08:29:29Z
Fix #16518 with some more kind-splitting smarts

This patch corrects two simple oversights that led to #16518:

1. `HsUtils.typeToLHsType` was taking visibility into account in the
   `TyConApp` case, but not the `AppTy` case. I've factored out the
   visibility-related logic into its own `go_app` function and now
   invoke `go_app` from both the `TyConApp` and `AppTy` cases.
2. `Type.fun_kind_arg_flags` did not properly split kinds with
   nested `forall`s, such as
   `(forall k. k -> Type) -> (forall k. k -> Type)`. This was simply
   because `fun_kind_arg_flags`'s `FunTy` case always bailed out and
   assumed all subsequent arguments were `Required`, which clearly
   isn't the case for nested `forall`s. I tweaked the `FunTy` case
   to recur on the result kind.

- - - - -
51fd3571 by Ryan Scott at 2019-04-04T08:35:39Z
Use funPrec, not topPrec, to parenthesize GADT argument types

A simple oversight. Fixes #16527.

- - - - -
6c0dd085 by Ben Gamari at 2019-04-04T12:12:24Z
testsuite: Add testcase for #16111

- - - - -
cbb88865 by klebinger.andreas at gmx.at at 2019-04-04T12:12:25Z
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.

- - - - -
33b0a291 by Ryan Scott at 2019-04-04T12:12:28Z
Tweak error messages for narrowly-kinded assoc default decls

This program, from #13971, currently has a rather confusing error
message:

```hs
class C a where
  type T a :: k
  type T a = Int
```
```
    • Kind mis-match on LHS of default declaration for ‘T’
    • In the default type instance declaration for ‘T’
      In the class declaration for ‘C’
```

It's not at all obvious why GHC is complaining about the LHS until
you realize that the default, when printed with
`-fprint-explicit-kinds`, is actually `type T @{k} @* a = Int`.
That is to say, the kind of `a` is being instantiated to `Type`,
whereas it ought to be a kind variable. The primary thrust of this
patch is to weak the error message to make this connection
more obvious:

```
    • Illegal argument ‘*’ in:
        ‘type T @{k} @* a = Int’
        The arguments to ‘T’ must all be type variables
    • In the default type instance declaration for ‘T’
      In the class declaration for ‘C’
```

Along the way, I performed some code cleanup suggested by @rae in
https://gitlab.haskell.org/ghc/ghc/issues/13971#note_191287. Before,
we were creating a substitution from the default declaration's type
variables to the type family tycon's type variables by way of
`tcMatchTys`. But this is overkill, since we already know (from the
aforementioned validity checking) that all the arguments in a default
declaration must be type variables anyway. Therefore, creating the
substitution is as simple as using `zipTvSubst`. I took the
opportunity to perform this refactoring while I was in town.

Fixes #13971.

- - - - -
3a38ea44 by Eric Crockett at 2019-04-07T19:21:59Z
Fix #16282.

Previously, -W(all-)missed-specs was created with 'NoReason',
so no information about the flag was printed along with the warning.
Now, -Wall-missed-specs is listed as the Reason if it was set,
otherwise -Wmissed-specs is listed as the reason.

- - - - -
63b7d5fb by Michal Terepeta at 2019-04-08T18:29:34Z
Generate straightline code for inline array allocation

GHC has an optimization for allocating arrays when the size is
statically known -- it'll generate the code allocating and initializing
the array inline (instead of a call to a procedure from
`rts/PrimOps.cmm`).

However, the generated code uses a loop to do the initialization. Since
we already check that the requested size is small (we check against
`maxInlineAllocSize`), we can generate faster straightline code instead.
This brings about 15% improvement for `newSmallArray#` in my testing and
slightly simplifies the code in GHC.

Signed-off-by: Michal Terepeta <michal.terepeta at gmail.com>

- - - - -
2b3f4718 by Phuong Trinh at 2019-04-08T18:35:43Z
Fix #16500: look for interface files in -hidir flag in OneShot mode

We are currently ignoring options set in the hiDir field of hsc_dflags
when looking for interface files while compiling in OneShot mode. This
is inconsistent with the behaviour of other directory redirecting fields
(such as objectDir or hieDir). It is also inconsistent with the
behaviour of compilation in CompManager mode (a.k.a `ghc --make`) which
looks for interface files in the directory set in hidir flag. This
changes Finder.hs so that we use the value of hiDir while looking for
interface in OneShot mode.

- - - - -
97502be8 by Yuriy Syrovetskiy at 2019-04-08T18:41:51Z
Add `-optcxx` option (#16477)

- - - - -
97d3d546 by Ben Gamari at 2019-04-08T18:47:54Z
testsuite: Unmark T16190 as broken

Was broken via #16389 yet strangely it has started passing despite the
fact that the suggested root cause has not changed.

- - - - -
a42d206a by Yuriy Syrovetskiy at 2019-04-08T18:54:02Z
Fix whitespace style

- - - - -
4dda2270 by Matthew Pickering at 2019-04-08T19:00:08Z
Use ./hadrian/ghci.sh in .ghcid

- - - - -
d236d9d0 by Sebastian Graf at 2019-04-08T19:06:15Z
Make `singleConstructor` cope with pattern synonyms

Previously, `singleConstructor` didn't handle singleton `COMPLETE` sets
of a single pattern synonym, resulting in incomplete pattern warnings
in #15753.

This is fixed by making `singleConstructor` (now named
`singleMatchConstructor`) query `allCompleteMatches`, necessarily making
it effectful. As a result, most of this patch is concerned with
threading the side-effect through to `singleMatchConstructor`.

Unfortunately, this is not enough to completely fix the original
reproduction from #15753 and #15884, which are related to function
applications in pattern guards being translated too conservatively.

- - - - -
1085090e by Ömer Sinan Ağacan at 2019-04-08T19:12:22Z
Skip test ArithInt16 and ArithWord16 in GHCi way

These tests use unboxed tuples, which GHCi doesn't support

- - - - -
7287bb9e by Ömer Sinan Ağacan at 2019-04-08T19:18:33Z
testsuite: Show exit code of GHCi tests on failure

- - - - -
f5604d37 by John Ericson at 2019-04-08T19:24:43Z
settings.in: Reformat

We're might be about to switch to generating it in Hadrian/Make. This
reformat makes it easier to programmingmatically generate and end up
with the exact same thing, which is good for diffing to ensure no
regressions.

I had this as part of !712, but given the difficulty of satisfying CI, I
figured I should break things up even further.

- - - - -
cf9e1837 by Ryan Scott at 2019-04-08T19:30:51Z
Bump hpc submodule

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

- - - - -
36d38047 by Ben Gamari at 2019-04-09T14:23:47Z
users-guide: Document how to disable package environments

As noted in #16309 this somehow went undocumented.

- - - - -
af4cea7f by Artem Pyanykh at 2019-04-09T14:30:13Z
codegen: fix memset unroll for small bytearrays, add 64-bit sets

Fixes #16052

When the offset in `setByteArray#` is statically known, we can provide
better alignment guarantees then just 1 byte.

Also, memset can now do 64-bit wide sets.

The current memset intrinsic is not optimal however and can be
improved for the case when we know that we deal with

(baseAddress at known alignment) + offset

For instance, on 64-bit

`setByteArray# s 1# 23# 0#`

given that bytearray is 8 bytes aligned could be unrolled into
`movb, movw, movl, movq, movq`; but currently it is
`movb x23` since alignment of 1 is all we can embed into MO_Memset op.

- - - - -
bd2de4f0 by Artem Pyanykh at 2019-04-09T14:30:13Z
codegen: use newtype for Alignment in BasicTypes

- - - - -
14a78707 by Artem Pyanykh at 2019-04-09T14:30:13Z
docs: add a note about changes in memset unrolling to 8.10.1-notes

- - - - -
fe40ddd9 by Sylvain Henry at 2019-04-09T16:50:15Z
Hadrian: fix library install paths in bindist Makefile (#16498)

GHC now works out-of-the-box (i.e. without any wrapper script) by
assuming that @bin@ and @lib@ directories sit next to each other. In
particular, its RUNPATH uses $ORIGIN-based relative path to find the
libraries.

However, to be good citizens we want to support the case where @bin@ and
@lib@ directories (respectively BINDIR and LIBDIR) don't sit next to
each other or are renamed. To do that the install script simply creates
GHC specific @bin@ and @lib@ siblings directories into:

   LIBDIR/ghc-VERSION/{bin,lib}

Then it installs wrapper scripts into BINDIR that call the appropriate
programs into LIBDIR/ghc-VERSION/bin/.

The issue fixed by this patch is that libraries were not installed into
LIBDIR/ghc-VERSION/lib but directly into LIBDIR.

- - - - -
9acdc4c0 by Ben Gamari at 2019-04-09T16:56:38Z
gitlab: Bump cabal-install version used by Windows builds to 2.4

Hopefully fixes Windows Hadrian build.

- - - - -
fc3f421b by Joachim Breitner at 2019-04-10T03:17:37Z
GHC no longer ever defines TABLES_NEXT_TO_CODE on its own

It should be entirely the responsibility of make/Hadrian to ensure that
everything that needs this flag gets it. GHC shouldn't be hardcoded to
assist with bootstrapping since it builds other things besides itself.

Reviewers:

Subscribers: TerrorJack, rwbarton, carter

GHC Trac Issues: #15548 -- progress towards but not fix

Differential Revision: https://phabricator.haskell.org/D5082 -- extract
from that

- - - - -
be0dde8e by Ryan Scott at 2019-04-10T03:23:50Z
Use ghc-prim < 0.7, not <= 0.6.1, as upper version bounds

Using `ghc-prim <= 0.6.1` is somewhat dodgy from a PVP point of view,
as it makes it awkward to support new minor releases of `ghc-prim`.
Let's instead use `< 0.7`, which is the idiomatic way of expressing
PVP-compliant upper version bounds.

- - - - -
1930de8f by Ömer Sinan Ağacan at 2019-04-10T07:46:08Z
rts/BlockAlloc: Allow aligned allocation requests

This implements support for block group allocations which are aligned to
an integral number of blocks.

This will be used by the nonmoving garbage collector, which uses the
block allocator to allocate the segments which back its heap. These
segments are a fixed number of blocks in size, with each segment being
aligned to the segment size boundary. This allows us to easily find the
segment metadata stored at the beginning of the segment.

- - - - -
6fd24a46 by Ben Gamari at 2019-04-10T07:46:08Z
testsuite/testblockalloc: A bit of refactoring

- - - - -
5519e0ac by Ben Gamari at 2019-04-10T07:46:08Z
testsuite/testblockalloc: Test aligned block group allocation

- - - - -
380088bb by Ben Gamari at 2019-04-10T07:46:08Z
rts/BlockAlloc: Wibbles

- - - - -
7b0d21b3 by Ben Gamari at 2019-04-10T07:46:08Z
rts/BlockAlloc: Use allocLargeChunk in aligned block allocation

- - - - -
5fbe5f0d by Ömer Sinan Ağacan at 2019-04-10T07:46:08Z
Disallow allocating megablocks, update tests

- - - - -


30 changed files:

- .circleci/config.yml
- .ghcid
- + .gitattributes
- .gitignore
- .gitlab-ci.yml
- + .gitlab/issue_templates/bug.md
- + .gitlab/issue_templates/feature_request.md
- .gitlab/linters/check-makefiles.py
- + .gitlab/merge_request_templates/backport-for-8.8.md
- .gitlab/merge_request_templates/merge-request.md
- + .gitlab/start-head.hackage.sh
- .gitlab/win32-init.sh
- .mailmap
- ANNOUNCE
- CODEOWNERS
- HACKING.md
- INSTALL.md
- MAKEHELP.md
- Makefile
- README.md
- aclocal.m4
- bindisttest/Makefile
- bindisttest/ghc.mk
- boot
- compiler/Makefile
- compiler/basicTypes/BasicTypes.hs
- compiler/basicTypes/DataCon.hs
- compiler/basicTypes/Demand.hs
- compiler/basicTypes/Id.hs
- compiler/basicTypes/Lexeme.hs


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/compare/b2e2fa647e5a005c83a50fae71777a3187583c23...5fbe5f0dacd5c0c10919815470f41ffbd2cb2727

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/compare/b2e2fa647e5a005c83a50fae71777a3187583c23...5fbe5f0dacd5c0c10919815470f41ffbd2cb2727
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20190410/3ba9b068/attachment-0001.html>


More information about the ghc-commits mailing list