[Git][ghc/ghc][wip/D5373] 303 commits: Hadrian: Allow passing CABFLAGS into build.cabal.sh

Matthías Páll Gissurarson gitlab at gitlab.haskell.org
Fri May 31 17:19:31 UTC 2019



Matthías Páll Gissurarson pushed to branch wip/D5373 at Glasgow Haskell Compiler / GHC


Commits:
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.

- - - - -
42504f4a by Carter Schonwald at 2019-04-11T00:28:41Z
removing x87 register support from native code gen

* simplifies registers to have GPR, Float and Double, by removing the SSE2 and X87 Constructors
* makes -msse2 assumed/default for x86 platforms, fixing a long standing nondeterminism in rounding
behavior in 32bit haskell code
* removes the 80bit floating point representation from the supported float sizes
* theres still 1 tiny bit of x87 support needed,
for handling float and double return values in FFI calls  wrt the C ABI on x86_32,
but this one piece does not leak into the rest of NCG.
* Lots of code thats not been touched in a long time got deleted as a
consequence of all of this

all in all, this change paves the way towards a lot of future further
improvements in how GHC handles floating point computations, along with
making the native code gen more accessible to a larger pool of contributors.

- - - - -
c401f8a4 by Sylvain Henry at 2019-04-11T23:51:24Z
Hadrian: fix binary-dir with --docs=none

Hadrian's "binary-dist" target must check that the "docs" directory
exists (it may not since we can disable docs generation).

- - - - -
091195a4 by Ömer Sinan Ağacan at 2019-04-11T23:57:38Z
Remove unused remilestoning script

- - - - -
fa0ccbb8 by Ömer Sinan Ağacan at 2019-04-11T23:57:38Z
Update a panic message

Point users to the right URL

- - - - -
beaa07d2 by Sylvain Henry at 2019-04-12T17:17:21Z
Hadrian: fix ghci wrapper script generation (#16508)

- - - - -
e05df3e1 by Ben Gamari at 2019-04-12T17:23:30Z
gitlab-ci: Ensure that version number has three components

- - - - -
885d2e04 by klebinger.andreas at gmx.at at 2019-04-12T18:40:04Z
Add -ddump-stg-final to dump stg as it is used for codegen.

Intermediate STG does not contain free variables which can be useful
sometimes. So adding a flag to dump that info.

- - - - -
3c759ced by Alp Mestanogullari at 2019-04-12T18:46:54Z
Hadrian: add a --test-accept/-a flag, to mimic 'make accept'

When -a or --test-accept is passed, and if one runs the 'test' target, then
any test failing because of mismatching output and which is not expected to
fail will have its expected output adjusted by the test driver, effectively
considering the new output correct from now on.

When this flag is passed, hadrian's 'test' target becomes sensitive to the
PLATFORM and OS environment variable, just like the Make build system:
- when the PLATFORM env var is set to "YES", when accepting a result, accept it
  for the current platform;
- when the OS env var is set to "YES", when accepting a result, accept it
  for all wordsizes of the current operating system.

This can all be combined with `--only="..."` and `TEST="..." to only accept
the new output of a subset of tests.

- - - - -
f4b5a6c0 by Alp Mestanogullari at 2019-04-12T18:46:54Z
Hadrian: document -a/--test-accept

- - - - -
30a0988d by Ben Gamari at 2019-04-12T19:41:07Z
gitlab: Disable windows-hadrian job

Not only is it reliably failing due to #16574 but all of the quickly
failing builds also causes the Windows runners to run out of disk space.

- - - - -
8870a51b by Ben Gamari at 2019-04-12T19:41:07Z
gitlab: Don't run lint-submods job on Marge branches

This broke Marge by creating a second pipeline (consisting of only the
`lint-submods` job). Marge then looked at this pipeline and concluded
that CI for her merge branch passed. However, this is ignores the fact
that the majority of the CI jobs are triggered on `merge_request` and
are therefore in another pipeline.

- - - - -
7876d088 by Ben Gamari at 2019-04-13T13:51:59Z
linters: Fix check-version-number

This should have used `grep -E`, not `grep -e`
- - - - -
2e7b2e55 by Ara Adkins at 2019-04-13T14:00:02Z
[skip ci] Update CI badge in readme

This trivial MR updates the CI badge in the readme to point to the
new CI on gitlab, rather than the very out-of-date badge from
Travis.

- - - - -
40848a43 by Ben Gamari at 2019-04-13T14:02:36Z
base: Better document implementation implications of Data.Timeout

As noted in #16546 timeout uses asynchronous exceptions internally, an
implementation detail which can leak out in surprising ways.  Note this
fact.

Also expose the `Timeout` tycon.

[skip ci]

- - - - -
5f183081 by David Eichmann at 2019-04-14T05:08:15Z
Hadrian: add rts shared library symlinks for backwards compatability

Fixes test T3807 when building with Hadrian.

Trac #16370

- - - - -
9b142c53 by Sylvain Henry at 2019-04-14T05:14:23Z
Hadrian: add binary-dist-dir target

This patch adds an Hadrian target "binary-dist-dir". Compared to
"binary-dist", it only builds a binary distribution directory without
creating the Tar archive. It makes the use/test of the bindist
installation script easier.

- - - - -
6febc444 by Krzysztof Gogolewski at 2019-04-14T05:20:29Z
Fix assertion failures reported in #16533

- - - - -
edcef7b3 by Artem Pyanykh at 2019-04-14T05:26:35Z
codegen: unroll memcpy calls for small bytearrays

- - - - -
6094d43f by Artem Pyanykh at 2019-04-14T05:26:35Z
docs: mention memcpy optimization for ByteArrays in 8.10.1-notes

- - - - -
d2271fe4 by Simon Jakobi at 2019-04-14T12:43:17Z
Ord docs: Add explanation on 'min' and 'max' operator interactions

[ci skip]

- - - - -
e7cad16c by Krzysztof Gogolewski at 2019-04-14T12:49:23Z
Add a safeguard to Core Lint

Lint returns a pair (Maybe a, WarnsAndErrs). The Maybe monad
allows to handle an unrecoverable failure.
In case of such a failure, the error should be added to the second
component of the pair. If this is not done, Lint will silently
accept bad programs. This situation actually happened during
development of linear types. This adds a safeguard.

- - - - -
c54a093f by Ben Gamari at 2019-04-14T12:55:29Z
CODEOWNERS: Add simonmar as owner of rts/linker

I suspect this is why @simonmar wasn't notified of !706.

[skip ci]

- - - - -
1825f50d by Alp Mestanogullari at 2019-04-14T13:01:38Z
Hadrian: don't accept p_dyn for executables, to fix --flavour=prof

- - - - -
b024e289 by Giles Anderson at 2019-04-15T10:20:29Z
Document how -O3 is handled by GHC

    -O2 is the highest value of optimization.
    -O3 will be reverted to -O2.

- - - - -
4b1ef06d by Giles Anderson at 2019-04-15T10:20:29Z
Apply suggestion to docs/users_guide/using-optimisation.rst
- - - - -
71cf94db by Fraser Tweedale at 2019-04-15T10:26:37Z
GHCi: fix load order of .ghci files

Directives in .ghci files in the current directory ("local .ghci")
can be overridden by global files.  Change the order in which the
configs are loaded: global and $HOME/.ghci first, then local.

Also introduce a new field to GHCiState to control whether local
.ghci gets sourced or ignored.  This commit does not add a way to
set this value (a subsequent commit will add this), but the .ghci
sourcing routine respects its value.

Fixes: https://gitlab.haskell.org/ghc/ghc/issues/14689
Related: https://gitlab.haskell.org/ghc/ghc/issues/6017
Related: https://gitlab.haskell.org/ghc/ghc/issues/14250

- - - - -
5c06b60d by Fraser Tweedale at 2019-04-15T10:26:38Z
users-guide: update startup script order

Update users guide to match the new startup script order.  Also
clarify that -ignore-dot-ghci does not apply to scripts specified
via the -ghci-script option.

Part of: https://gitlab.haskell.org/ghc/ghc/issues/14689

- - - - -
aa490b35 by Fraser Tweedale at 2019-04-15T10:26:38Z
GHCi: add 'local-config' setting

Add the ':set local-config { source | ignore }' setting to control
whether .ghci file in current directory will be sourced or not.  The
directive can be set in global config or $HOME/.ghci, which are
processed before local .ghci files.

The default is "source", preserving current behaviour.

Related: https://gitlab.haskell.org/ghc/ghc/issues/6017
Related: https://gitlab.haskell.org/ghc/ghc/issues/14250

- - - - -
ed94d345 by Fraser Tweedale at 2019-04-15T10:26:38Z
users-guide: document :set local-config

Document the ':set local-config' command and add a warning about
sourcing untrusted local .ghci scripts.

Related: https://gitlab.haskell.org/ghc/ghc/issues/6017
Related: https://gitlab.haskell.org/ghc/ghc/issues/14250

- - - - -
be05bd81 by Gabor Greif at 2019-04-15T21:19:03Z
asm-emit-time IND_STATIC elimination

When a new closure identifier is being established to a
local or exported closure already emitted into the same
module, refrain from adding an IND_STATIC closure, and
instead emit an assembly-language alias.

Inter-module IND_STATIC objects still remain, and need to be
addressed by other measures.

Binary-size savings on nofib are around 0.1%.

- - - - -
57eb5bc6 by erthalion at 2019-04-16T19:40:36Z
Show dynamic object files (#16062)

Closes #16062. When -dynamic-too is specified, reflect that in the
progress message, like:

$ ghc Main.hs -dynamic-too
[1 of 1] Compiling Lib              ( Main.hs, Main.o, Main.dyn_o )

instead of:

$ ghc Main.hs -dynamic-too
[1 of 1] Compiling Lib              ( Main.hs, Main.o )

- - - - -
894ec447 by Andrey Mokhov at 2019-04-16T19:46:44Z
Hadrian: Generate GHC wrapper scripts

This is a temporary workaround for #16534. We generate wrapper scripts
<build-root>/ghc-stage1 and <build-root>/ghc-stage2 that can be used to
run Stage1 and Stage2 GHCs with the right arguments.

See https://gitlab.haskell.org/ghc/ghc/issues/16534.

- - - - -
e142ec99 by Sven Tennie at 2019-04-18T03:19:00Z
Typeset Big-O complexities with Tex-style notation (#16090)

E.g. use `\(\mathcal{O}(n^2)\)` instead of `/O(n^2)/`.

- - - - -
f0f495f0 by klebinger.andreas at gmx.at at 2019-04-18T03:25:10Z
Add an Outputable instance for SDoc with ppr = id.

When printf debugging this can be helpful.

- - - - -
e28706ea by Sylvain Henry at 2019-04-18T12:12:07Z
Gitlab: allow execution of CI pipeline from the web interface
[skip ci]

- - - - -
4c8a67a4 by Alp Mestanogullari at 2019-04-18T12:18:18Z
Hadrian: fix ghcDebugged and document it

- - - - -
5988f17a by Alp Mestanogullari at 2019-04-19T02:46:12Z
Hadrian: fix the value we pass to the test driver for config.compiler_debugged

We used to pass YES/NO, while that particular field is set to True/False. This
happens to fix an unexpected pass, T9208.

- - - - -
57cf1133 by Alec Theriault at 2019-04-19T02:52:25Z
TH: make `Lift` and `TExp` levity-polymorphic

Besides the obvious benefits of being able to manipulate `TExp`'s of
unboxed types, this also simplified `-XDeriveLift` all while making
it more capable.

  * `ghc-prim` is explicitly depended upon by `template-haskell`

  * The following TH things are parametrized over `RuntimeRep`:

      - `TExp(..)`
      - `unTypeQ`
      - `unsafeTExpCoerce`
      - `Lift(..)`

  * The following instances have been added to `Lift`:

      - `Int#`, `Word#`, `Float#`, `Double#`, `Char#`, `Addr#`
      - unboxed tuples of lifted types up to arity 7
      - unboxed sums of lifted types up to arity 7

    Ideally we would have levity-polymorphic _instances_ of unboxed
    tuples and sums.

  * The code generated by `-XDeriveLift` uses expression quotes
    instead of generating large amounts of TH code and having
    special hard-coded cases for some unboxed types.

- - - - -
fdfd9731 by Alec Theriault at 2019-04-19T02:52:25Z
Add test case for #16384

Now that `TExp` accepts unlifted types, #16384 is fixed. Since the real
issue there was GHC letting through an ill-kinded type which
`-dcore-lint` rightly rejected, a reasonable regression test is that
the program from #16384 can now be accepted without `-dcore-lint`
complaining.

- - - - -
eb2a4df8 by Michal Terepeta at 2019-04-20T03:32:08Z
StgCmmPrim: remove an unnecessary instruction in doNewArrayOp

Previously we would generate a local variable pointing after the array
header and use it to initialize the array elements. But we already use
stores with offset, so it's easy to just add the header to those offsets
during compilation and avoid generating the local variable (which would
become a LEA instruction when using native codegen; LLVM already
optimizes it away).

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

- - - - -
fcef26b6 by klebinger.andreas at gmx.at at 2019-04-20T03:38:16Z
Don't indent single alternative case expressions for STG.

Makes the width of STG dumps slightly saner.
Especially for things like unboxing.

Fixes #16580

- - - - -
e7280c93 by Vladislav Zavialov at 2019-04-20T03:44:24Z
Tagless final encoding of ExpCmdI in the parser

Before this change, we used a roundabout encoding:

1. a GADT (ExpCmdG)
2. a class to pass it around (ExpCmdI)
3. helpers to match on it (ecHsApp, ecHsIf, ecHsCase, ...)

It is more straightforward to turn these helpers into class methods,
removing the need for a GADT.

- - - - -
99dd5d6b by Alec Theriault at 2019-04-20T03:50:29Z
Haddock: support strict GADT args with docs

Rather than massaging the output of the parser to re-arrange docs and
bangs, it is simpler to patch the two places in which the strictness
info is needed (to accept that the `HsBangTy` may be inside an
`HsDocTy`).

Fixes #16585.

- - - - -
10776562 by Andrey Mokhov at 2019-04-20T03:56:38Z
Hadrian: Drop old/unused CI scripts

- - - - -
37b1a6da by Ben Gamari at 2019-04-20T15:55:20Z
gitlab-ci: Improve error message on failure of doc-tarball job

Previously the failure was quite nondescript.

- - - - -
e3fe2601 by Ben Gamari at 2019-04-20T15:55:35Z
gitlab-ci: Allow doc-tarball job to fail

Due to allowed failure of Windows job.

- - - - -
bd3872df by Ben Gamari at 2019-04-20T15:55:38Z
gitlab-ci: Only run release notes lint on release tags

- - - - -
2145b738 by Ben Gamari at 2019-04-20T15:55:38Z
gitlab-ci: Add centos7 release job

- - - - -
983c53c3 by Ben Gamari at 2019-04-20T15:55:38Z
gitlab-ci: Do not build profiled libraries on 32-bit Windows

Due to #15934.

- - - - -
5cf771f3 by Ben Gamari at 2019-04-21T13:07:13Z
users-guide: Add pretty to package list

- - - - -
6ac5da78 by Ben Gamari at 2019-04-21T13:07:13Z
users-guide: Add libraries section to 8.10.1 release notes

- - - - -
3e963de3 by Andrew Martin at 2019-04-21T13:13:20Z
improve docs for casArray and casSmallArray

- - - - -
98bffb07 by Andrew Martin at 2019-04-21T13:13:20Z
[skip ci] say "machine words" instead of "Int units" in the primops docs

- - - - -
3aefc14a by Andrew Martin at 2019-04-21T13:13:20Z
[skip ci] correct formatting of casArray# in docs for casSmallArray#

- - - - -
0e96d120 by Andrew Martin at 2019-04-21T13:13:20Z
[skip ci] correct the docs for casArray a little more. clarify that the returned element may be two different things

- - - - -
687152f2 by Artem Pyanykh at 2019-04-21T13:19:29Z
testsuite: move tests related to linker under tests/rts/linker

- - - - -
36e51406 by Artem Pyanykh at 2019-04-21T13:19:29Z
testsuite: fix ifdef lint errors under tests/rts/linker

- - - - -
1a7a329b by Matthew Pickering at 2019-04-22T18:37:30Z
Correct off by one error in ghci +c

Fixes #16569

- - - - -
51655fd8 by Alp Mestanogullari at 2019-04-22T18:44:11Z
Hadrian: use the testsuite driver's config.haddock arg more correctly

4 haddock tests assume that .haddock files have been produced, by using the
'req_haddock' modifier. The testsuite driver assumes that this condition is
satisfied if 'config.haddock' is non-empty, but before this patch Hadrian was
always passing the path to where the haddock executable should be, regardless
of whether it is actually there or not.

Instead, we now pass an empty config.haddock when we can't find all of
<build root>/docs/html/libraries/<pkg>/<pkg>.haddock>, where <pkg> ranges over
array, base, ghc-prim, process and template-haskell, and pass the path
to haddock when all those file exists. This has the (desired) effect of skipping
the 4 tests (marked as 'missing library') when the docs haven't been built,
and running the haddock tests when they have.

- - - - -
1959bad3 by Vladislav Zavialov at 2019-04-22T18:50:18Z
Stop misusing EWildPat in pattern match coverage checking

EWildPat is a constructor of HsExpr used in the parser to represent
wildcards in ambiguous positions:

* in expression context, EWildPat is turned into hsHoleExpr (see rnExpr)
* in pattern context, EWildPat is turned into WildPat (see checkPattern)

Since EWildPat exists solely for the needs of the parser, we could
remove it by improving the parser.

However, EWildPat has also been used for a different purpose since
8a50610: to represent patterns that the coverage checker cannot handle.
Not only this is a misuse of EWildPat, it also stymies the removal of
EWildPat.

- - - - -
6a491726 by Fraser Tweedale at 2019-04-23T13:27:30Z
osReserveHeapMemory: handle signed rlim_t

rlim_t is a signed type on FreeBSD, and the build fails with a
sign-compare error.  Add explicit (unsigned) cast to handle this
case.

- - - - -
ab9b3ace by Alexandre Baldé at 2019-04-23T13:33:37Z
Fix error message for './configure' regarding '--with-ghc' [skip ci]

- - - - -
465f8f48 by Ben Gamari at 2019-04-24T16:19:24Z
gitlab-ci: source-tarball job should have no dependencies

- - - - -
0fc69416 by Vladislav Zavialov at 2019-04-25T18:28:56Z
Introduce MonadP, make PV a newtype

Previously we defined   type PV = P,
this had the downside that if we wanted to change PV,
we would have to modify P as well.

Now PV is free to evolve independently from P.

The common operations addError, addFatalError, getBit, addAnnsAt,
were abstracted into a class called MonadP.

- - - - -
f85efdec by Vladislav Zavialov at 2019-04-25T18:28:56Z
checkPattern error hint is PV context

There is a hint added to error messages reported in checkPattern.
Instead of passing it manually, we put it in a ReaderT environment inside PV.

- - - - -
4e228267 by Ömer Sinan Ağacan at 2019-04-25T18:35:09Z
Minor RTS refactoring:

- Remove redundant casting in evacuate_static_object
- Remove redundant parens in STATIC_LINK
- Fix a typo in GC.c

- - - - -
faa94d47 by Ben Gamari at 2019-04-25T21:16:21Z
update-autoconf: Initial commit

- - - - -
4811cd39 by Ben Gamari at 2019-04-25T21:16:21Z
Update autoconf scripts

Scripts taken from autoconf a8d79c3130da83c7cacd6fee31b9acc53799c406

- - - - -
0040af59 by Ben Gamari at 2019-04-25T21:16:21Z
gitlab-ci: Reintroduce DWARF-enabled bindists

It seems that this was inadvertently dropped in
1285d6b95fbae7858abbc4722bc2301d7fe40425.

- - - - -
2c115085 by Wojciech Baranowski at 2019-04-30T01:02:38Z
rename: hadle type signatures with typos

When encountering type signatures for unknown names, suggest similar
alternatives.

This fixes issue #16504

- - - - -
fb9408dd by Wojciech Baranowski at 2019-04-30T01:02:38Z
Print suggestions in a single message

- - - - -
e8bf8834 by Wojciech Baranowski at 2019-04-30T01:02:38Z
osa1's patch: consistent suggestion message

- - - - -
1deb2bb0 by Wojciech Baranowski at 2019-04-30T01:02:38Z
Comment on 'candidates' function

- - - - -
8ee47432 by Wojciech Baranowski at 2019-04-30T01:02:38Z
Suggest only local candidates from global env

- - - - -
e23f78ba by Wojciech Baranowski at 2019-04-30T01:02:38Z
Use pp_item

- - - - -
1abb76ab by Ben Gamari at 2019-04-30T01:08:45Z
ghci: Ensure that system libffi include path is searched

Previously hsc2hs failed when building against a system FFI.

- - - - -
014ed644 by Sebastian Graf at 2019-05-01T00:23:21Z
Compute demand signatures assuming idArity

This does four things:

1. Look at `idArity` instead of manifest lambdas to decide whether to use LetUp
2. Compute the strictness signature in LetDown assuming at least `idArity`
   incoming arguments
3. Remove the special case for trivial RHSs, which is subsumed by 2
4. Don't perform the W/W split when doing so would eta expand a binding.
   Otherwise we would eta expand PAPs, causing unnecessary churn in the
   Simplifier.

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%
         pretty           0.0%     -0.1%
        reptile          -0.0%     -1.2%
--------------------------------------------------------------------------------
            Min          -0.0%     -1.2%
            Max          +0.3%     +0.8%
 Geometric Mean          +0.0%     -0.0%

- - - - -
d37d91e9 by John Ericson at 2019-05-01T00:29:31Z
Generate settings by make/hadrian instead of configure

This allows it to eventually become stage-specific

- - - - -
53d1cd96 by John Ericson at 2019-05-01T00:29:31Z
Remove settings.in

It is no longer needed

- - - - -
2988ef5e by John Ericson at 2019-05-01T00:29:31Z
Move cGHC_UNLIT_PGM to be "unlit command" in settings

The bulk of the work was done in #712, making settings be make/Hadrian
controlled. This commit then just moves the unlit command rules in
make/Hadrian from the `Config.hs` generator to the `settings` generator
in each build system.

I think this is a good change because the crucial benefit is *settings*
don't affect the build: ghc gets one baby step closer to being a regular
cabal executable, and make/Hadrian just maintains settings as part of
bootstrapping.

- - - - -
37a4fd97 by Alp Mestanogullari at 2019-05-01T00:35:35Z
Build Hadrian with -Werror in the 'ghc-in-ghci' CI job

- - - - -
1bef62c3 by Ben Gamari at 2019-05-01T00:41:42Z
ErrUtils: Emit progress messages to eventlog

- - - - -
ebfa3528 by Ben Gamari at 2019-05-01T00:41:42Z
Emit GHC timing events to eventlog

- - - - -
4186b410 by Sven Tennie at 2019-05-03T17:40:36Z
Typeset Big-O complexities with Tex-style notation (#16090)

Use `\min` instead of `min` to typeset it as an operator.

- - - - -
9047f184 by Shayne Fletcher at 2019-05-03T18:54:50Z
Make Extension derive Bounded

- - - - -
0dde64f2 by Ben Gamari at 2019-05-03T18:54:50Z
testsuite: Mark concprog001 as fragile

Due to #16604.
- - - - -
8f929388 by Alp Mestanogullari at 2019-05-03T18:54:50Z
Hadrian: generate JUnit testsuite report in Linux CI job

We also keep it as an artifact, like we do for non-Hadrian jobs, and list it
as a junit report, so that the test results are reported in the GitLab UI for
merge requests.

- - - - -
52fc2719 by Vladislav Zavialov at 2019-05-03T18:54:50Z
Pattern/expression ambiguity resolution

This patch removes 'EWildPat', 'EAsPat', 'EViewPat', and 'ELazyPat'
from 'HsExpr' by using the ambiguity resolution system introduced
earlier for the command/expression ambiguity.

Problem: there are places in the grammar where we do not know whether we
are parsing an expression or a pattern, for example:

	do { Con a b <- x } -- 'Con a b' is a pattern
	do { Con a b }      -- 'Con a b' is an expression

Until we encounter binding syntax (<-) we don't know whether to parse
'Con a b' as an expression or a pattern.

The old solution was to parse as HsExpr always, and rejig later:

	checkPattern :: LHsExpr GhcPs -> P (LPat GhcPs)

This meant polluting 'HsExpr' with pattern-related constructors. In
other words, limitations of the parser were affecting the AST, and all
other code (the renamer, the typechecker) had to deal with these extra
constructors.

We fix this abstraction leak by parsing into an overloaded
representation:

	class DisambECP b where ...
	newtype ECP = ECP { runECP_PV :: forall b. DisambECP b => PV (Located b) }

See Note [Ambiguous syntactic categories] for details.

Now the intricacies of parsing have no effect on the hsSyn AST when it
comes to the expression/pattern ambiguity.

- - - - -
9b59e126 by Ningning Xie at 2019-05-03T18:54:50Z
Only skip decls with CUSKs with PolyKinds on (fix #16609)

- - - - -
87bc954a by Ömer Sinan Ağacan at 2019-05-03T18:54:50Z
Fix interface version number printing in --show-iface

Before

    Version: Wanted [8, 0, 9, 0, 2, 0, 1, 9, 0, 4, 2, 5],
             got    [8, 0, 9, 0, 2, 0, 1, 9, 0, 4, 2, 5]

After

    Version: Wanted 809020190425,
             got    809020190425

- - - - -
cc495d57 by Ryan Scott at 2019-05-03T18:54:50Z
Make equality constraints in kinds invisible

Issues #12102 and #15872 revealed something strange about the way GHC
handles equality constraints in kinds: it treats them as _visible_
arguments! This causes a litany of strange effects, from strange
error messages
(https://gitlab.haskell.org/ghc/ghc/issues/12102#note_169035)
to bizarre `Eq#`-related things leaking through to GHCi output, even
without any special flags enabled.

This patch is an attempt to contain some of this strangeness.
In particular:

* In `TcHsType.etaExpandAlgTyCon`, we propagate through the
  `AnonArgFlag`s of any `Anon` binders. Previously, we were always
  hard-coding them to `VisArg`, which meant that invisible binders
  (like those whose kinds were equality constraint) would mistakenly
  get flagged as visible.
* In `ToIface.toIfaceAppArgsX`, we previously assumed that the
  argument to a `FunTy` always corresponding to a `Required`
  argument. We now dispatch on the `FunTy`'s `AnonArgFlag` and map
  `VisArg` to `Required` and `InvisArg` to `Inferred`. As a
  consequence, the iface pretty-printer correctly recognizes that
  equality coercions are inferred arguments, and as a result,
  only displays them in `-fprint-explicit-kinds` is enabled.
* Speaking of iface pretty-printing, `Anon InvisArg` binders were
  previously being pretty-printed like `T (a :: b ~ c)`, as if they
  were required. This seemed inconsistent with other invisible
  arguments (that are printed like `T @{d}`), so I decided to switch
  this to `T @{a :: b ~ c}`.

Along the way, I also cleaned up a minor inaccuracy in the users'
guide section for constraints in kinds that was spotted in
https://gitlab.haskell.org/ghc/ghc/issues/12102#note_136220.

Fixes #12102 and #15872.

- - - - -
f862963b by Ömer Sinan Ağacan at 2019-05-04T00:50:03Z
rts: Properly free the RTSSummaryStats structure

`stat_exit` always allocates a `RTSSummaryStats` but only sometimes
frees it, which casues leaks. With this patch we unconditionally free
the structure, fixing the leak.

Fixes #16584

- - - - -
0af93d16 by Ömer Sinan Ağacan at 2019-05-04T00:56:18Z
StgCmmMonad: remove emitProc_, don't export emitProc

- - - - -
0a3e4db3 by Ömer Sinan Ağacan at 2019-05-04T00:56:18Z
PrimOps.cmm: remove unused stuff

- - - - -
63150b9e by iustin at 2019-05-04T21:54:23Z
Fix typo in 8.8.1 notes related to traceBinaryEvent

- fixes double mention of `traceBinaryEvent#` (the second one should be `traceEvent#`, I think)
- fixes note about `traceEvent#` taking a `String` - the docs say it takes a zero-terminated ByteString.
- - - - -
dc8a5868 by gallais at 2019-05-04T22:00:30Z
[ typo ] 'castFloatToWord32' -> 'castFloatToWord64'

Probably due to a copy/paste gone wrong.
- - - - -
615b4be6 by Chaitanya Koparkar at 2019-05-05T14:39:24Z
Fix #16593 by having only one definition of -fprint-explicit-runtime-reps

[skip ci]

- - - - -
ead3f835 by Vladislav Zavialov at 2019-05-05T14:39:24Z
'warnSpaceAfterBang' only in patterns (#16619)

- - - - -
27941064 by John Ericson at 2019-05-06T18:59:29Z
Remove cGhcEnableTablesNextToCode

Get "Tables next to code" from the settings file instead.

- - - - -
821fa9e8 by Takenobu Tani at 2019-05-06T19:05:36Z
Remove `$(TOP)/ANNOUNCE` file

Remove `$(TOP)/ANNOUNCE` because maintaining this file is expensive
for each release.

Currently, release announcements of ghc are made on ghc blogs and wikis.

[skip ci]

- - - - -
e172a6d1 by Alp Mestanogullari at 2019-05-06T19:11:43Z
Enable external interpreter when TH is requested but no internal interpreter is available

- - - - -
ba0aed2e by Alp Mestanogullari at 2019-05-06T21:32:56Z
Hadrian: override $(ghc-config-mk), to prevent redundant config generation

This required making the 'ghc-config-mk' variable overridable in
testsuite/mk/boilerplate.mk, and then making use of this in hadrian
to point to '<build root>/test/ghcconfig' instead, which is where we
always put the test config.

Previously, we would build ghc-config and run it against the
GHC to be tested, a second time, while we're running the tests, because some
include testsuite/mk/boilerplate.mk. This was causing unexpected output
failures.

- - - - -
96197961 by Ryan Scott at 2019-05-07T10:35:58Z
Add /includes/dist to .gitignore

As of commit d37d91e9a444a7822eef1558198d21511558515e, the GHC build
now autogenerates a `includes/dist/build/settings` file. To avoid
dirtying the current `git` status, this adds `includes/dist` to
`.gitignore`.

[ci skip]

- - - - -
78a5c4ce by Ryan Scott at 2019-05-07T21:03:04Z
Check for duplicate variables in associated default equations

A follow-up to !696's, which attempted to clean up the error messages
for ill formed associated type family default equations. The previous
attempt, !696, forgot to account for the possibility of duplicate
kind variable arguments, as in the following example:

```hs
class C (a :: j) where
  type T (a :: j) (b :: k)
  type T (a :: k) (b :: k) = k
```

This patch addresses this shortcoming by adding an additional check
for this. Fixes #13971 (hopefully for good this time).

- - - - -
f58ea556 by Kevin Buhr at 2019-05-07T21:09:13Z
Add regression test for old typechecking issue #505

- - - - -
786e665b by Ryan Scott at 2019-05-08T05:55:45Z
Fix #16603 by documenting some important changes in changelogs

This addresses some glaring omissions from
`libraries/base/changelog.md` and
`docs/users_guide/8.8.1-notes.rst`, fixing #16603 in the process.

- - - - -
0eeb4cfa by Ryan Scott at 2019-05-08T06:01:54Z
Fix #16632 by using the correct SrcSpan in checkTyClHdr

`checkTyClHdr`'s case for `HsTyVar` was grabbing the wrong `SrcSpan`,
which lead to error messages pointing to the wrong location. Easily
fixed.

- - - - -
ed5f858b by Shayne Fletcher at 2019-05-08T19:29:01Z
Implement ImportQualifiedPost

- - - - -
d9bdff60 by Kevin Buhr at 2019-05-08T19:35:13Z
stg_floatToWord32zh: zero-extend the Word32 (#16617)

The primop stgFloatToWord32 was sign-extending the 32-bit word, resulting
in weird negative Word32s.  Zero-extend them instead.

Closes #16617.

- - - - -
9a3acac9 by Ömer Sinan Ağacan at 2019-05-08T19:41:17Z
Print PAP object address in stg_PAP_info entry code

Continuation to ce23451c

- - - - -
4c86187c by Richard Eisenberg at 2019-05-08T19:47:33Z
Regression test for #16627.

test: typecheck/should_fail/T16627

- - - - -
93f34bbd by John Ericson at 2019-05-08T19:53:40Z
Purge TargetPlatform_NAME and cTargetPlatformString

- - - - -
9d9af0ee by Kevin Buhr at 2019-05-08T19:59:46Z
Add regression test for old issue #507

- - - - -
396e01b4 by Vladislav Zavialov at 2019-05-08T20:05:52Z
Add a regression test for #14548

- - - - -
5eb94454 by Oleg Grenrus at 2019-05-10T20:26:28Z
Add Generic tuple instances up to 15-tuple

Why 15? Because we have Eq instances up to 15.

Metric Increase:
    T9630
    haddock.base

- - - - -
c7913f71 by Roland Senn at 2019-05-10T20:32:38Z
Fix bugs and documentation for #13456

- - - - -
bfcd986d by David Eichmann at 2019-05-10T20:38:57Z
Hadrian: programs need registered ghc-pkg libraries

In Hadrian, building programs (e.g. `ghc` or `haddock`) requires libraries located in the ghc-pkg package database i.e.

    _build/stage1/lib/x86_64-linux-ghc-8.9.0.20190430/libHSdeepseq-1.4.4.0-ghc8.9.0.20190430.so

Add the corresponding `need`s for these library files and the subsequent rules.

- - - - -
10f579ad by Ben Gamari at 2019-05-10T20:45:05Z
gitlab-ci: Disable cleanup job on Windows

As discussed in the Note, we now have a cron job to handle this and the
cleanup job itself is quite fragile.

[skip ci]

- - - - -
6f07f828 by Kevin Buhr at 2019-05-10T20:51:11Z
Add regression test case for old issue #493

- - - - -
4e25bf46 by Giles Anderson at 2019-05-13T23:01:52Z
Change GHC.hs to Packages.hs in Hadrian user-settings.md

... "all packages that are currently built as part of the GHC are
defined in src/Packages.hs"

- - - - -
357be128 by Kevin Buhr at 2019-05-14T20:41:19Z
Add regression test for old parser issue #504

- - - - -
015a21b8 by John Ericson at 2019-05-14T20:41:19Z
hadrian: Make settings stage specific

- - - - -
f9e4ea40 by John Ericson at 2019-05-14T20:41:19Z
Dont refer to `cLeadingUnderscore` in test

Can't use this config entry because it's about to go away

- - - - -
e529c65e by John Ericson at 2019-05-14T20:41:19Z
Remove all target-specific portions of Config.hs

1. If GHC is to be multi-target, these cannot be baked in at compile
   time.

2. Compile-time flags have a higher maintenance than run-time flags.

3. The old way makes build system implementation (various bootstrapping
   details) with the thing being built. E.g. GHC doesn't need to care
   about which integer library *will* be used---this is purely a crutch
   so the build system doesn't need to pass flags later when using that
   library.

4. Experience with cross compilation in Nixpkgs has shown things work
   nicer when compiler's can *optionally* delegate the bootstrapping the
   package manager. The package manager knows the entire end-goal build
   plan, and thus can make top-down decisions on bootstrapping. GHC can
   just worry about GHC, not even core library like base and ghc-prim!

- - - - -
5cf8032e by Oleg Grenrus at 2019-05-14T20:41:19Z
Update terminal title while running test-suite

Useful progress indicator even when `make test VERBOSE=1`,
and when you do something else, but have terminal title visible.

- - - - -
c72c369b by Vladislav Zavialov at 2019-05-14T20:41:19Z
Add a minimized regression test for #12928

- - - - -
a5fdd185 by Vladislav Zavialov at 2019-05-14T20:41:19Z
Guard CUSKs behind a language pragma

GHC Proposal #36 describes a transition plan away from CUSKs and to
top-level kind signatures:

1. Introduce a new extension, -XCUSKs, on by default, that detects CUSKs
   as they currently exist.
2. We turn off the -XCUSKs extension in a few releases and remove it
   sometime thereafter.

This patch implements phase 1 of this plan, introducing a new language
extension to control whether CUSKs are enabled. When top-level kind
signatures are implemented, we can transition to phase 2.

- - - - -
684dc290 by Vladislav Zavialov at 2019-05-14T20:41:19Z
Restore the --coerce option in 'happy' configuration

happy-1.19.10 has been released with a fix for --coerce in the presence
of higher rank types. This should result in about 10% performance
improvement in the parser.

- - - - -
a416ae26 by Alp Mestanogullari at 2019-05-14T20:41:20Z
Hadrian: 'need' source files for various docs in Rules.Documentation

Previously, changing one of the .rst files from the user guide would not cause
the user guide to be rebuilt. This patch take a first stab at declaring the
documentation source files that our documentation rules depend on, focusing
on the .rst files only for now.

We eventually might want to rebuild docs when we, say, change the haddock style
file, but this level of tracking isn't really necessary for now.

This fixes #16645.

- - - - -
7105fb66 by Ben Gamari at 2019-05-16T16:47:59Z
rts: Explicit state that CONSTR tag field is zero-based

This was a bit unclear as we use both one-based and zero-based
tags in GHC.

[skip ci]
- - - - -
5bb80cf2 by David Eichmann at 2019-05-20T14:41:55Z
Improve test runner logging when calculating performance metric baseline #16662

We attempt to get 75 commit hashes via `git log`, but this only gave 10
hashes in a CI run (see #16662). Better logging may help solve this
error if it occurs again in the future.

- - - - -
b46efa2b by David Eichmann at 2019-05-20T18:45:56Z
Recalculate Performance Test Baseline T9630 #16680

Metric Decrease:
    T9630

- - - - -
6419b94a by Matthías Páll Gissurarson at 2019-05-31T17:15:26Z
Add HoleFitPlugins and RawHoleFits

This patch adds a new kind of plugin, Hole Fit Plugins. These plugins
can change what candidates are considered when looking for valid hole
fits, and add hole fits of their own. The type of a plugin is relatively
simple,

``` type FitPlugin = TypedHole -> [HoleFit] -> TcM [HoleFit] type
CandPlugin = TypedHole -> [HoleFitCandidate] -> TcM [HoleFitCandidate]
data HoleFitPlugin = HoleFitPlugin { candPlugin :: CandPlugin ,
fitPlugin :: FitPlugin }

data TypedHole = TyH { relevantCts :: Cts -- ^ Any relevant Cts to the
hole , implics :: [Implication] -- ^ The nested implications of the hole
with the --   innermost implication first.  , holeCt :: Maybe Ct -- ^
The hole constraint itself, if available.  } ```

This allows users and plugin writers to interact with the candidates and
fits as they wish, even going as far as to allow them to reimplement the
current functionality (since `TypedHole` contains all the relevant
information).

As an example, consider the following plugin:

```
module HolePlugin where

import GhcPlugins

import TcHoleErrors

import Data.List (intersect, stripPrefix)
import RdrName (importSpecModule)

import TcRnTypes

import System.Process

plugin :: Plugin
plugin = defaultPlugin { holeFitPlugin = hfp, pluginRecompile = purePlugin }

hfp :: [CommandLineOption] -> Maybe HoleFitPlugin
hfp opts = Just (HoleFitPlugin (candP opts) (fp opts))

toFilter :: Maybe String -> Maybe String
toFilter = flip (>>=) (stripPrefix "_module_")

replace :: Eq a => a -> a -> [a] -> [a]
replace match repl str = replace' [] str
  where
    replace' sofar (x:xs) | x == match = replace' (repl:sofar) xs
    replace' sofar (x:xs) = replace' (x:sofar) xs
    replace' sofar [] = reverse sofar

-- | This candidate plugin filters the candidates by module,
--   using the name of the hole as module to search in
candP :: [CommandLineOption] -> CandPlugin
candP _ hole cands =
  do let he = case holeCt hole of
                Just (CHoleCan _ h) -> Just (occNameString $ holeOcc h)
                _ -> Nothing
     case toFilter he of
        Just undscModName -> do let replaced = replace '_' '.' undscModName
                                let res = filter (greNotInOpts [replaced]) cands
                                return $ res
        _ -> return cands
  where greNotInOpts opts (GreHFCand gre)  = not $ null $ intersect (inScopeVia gre) opts
        greNotInOpts _ _ = True
        inScopeVia = map (moduleNameString . importSpecModule) . gre_imp

-- Yes, it's pretty hacky, but it is just an example :)
searchHoogle :: String -> IO [String]
searchHoogle ty = lines <$> (readProcess "hoogle" [(show ty)] [])

fp :: [CommandLineOption] -> FitPlugin
fp ("hoogle":[]) hole hfs =
    do dflags <- getDynFlags
       let tyString = showSDoc dflags . ppr . ctPred <$> holeCt hole
       res <- case tyString of
                Just ty -> liftIO $ searchHoogle ty
                _ -> return []
       return $ (take 2 $ map (RawHoleFit . text .("Hoogle says: " ++)) res) ++ hfs
fp _ _ hfs = return hfs

```

with this plugin available, you can compile the following file

```
{-# OPTIONS -fplugin=HolePlugin -fplugin-opt=HolePlugin:hoogle #-}
module Main where

import Prelude hiding (head, last)

import Data.List (head, last)

t :: [Int] -> Int
t = _module_Prelude

g :: [Int] -> Int
g = _module_Data_List

main :: IO ()
main = print $ t [1,2,3]
```

and get the following output:

```
Main.hs:14:5: error:
    • Found hole: _module_Prelude :: [Int] -> Int
      Or perhaps ‘_module_Prelude’ is mis-spelled, or not in scope
    • In the expression: _module_Prelude
      In an equation for ‘t’: t = _module_Prelude
    • Relevant bindings include
        t :: [Int] -> Int (bound at Main.hs:14:1)
      Valid hole fits include
        Hoogle says: GHC.List length :: [a] -> Int
        Hoogle says: GHC.OldList length :: [a] -> Int
        t :: [Int] -> Int (bound at Main.hs:14:1)
        g :: [Int] -> Int (bound at Main.hs:17:1)
        length :: forall (t :: * -> *) a. Foldable t => t a -> Int
          with length @[] @Int
          (imported from ‘Prelude’ at Main.hs:5:1-34
           (and originally defined in ‘Data.Foldable’))
        maximum :: forall (t :: * -> *) a. (Foldable t, Ord a) => t a -> a
          with maximum @[] @Int
          (imported from ‘Prelude’ at Main.hs:5:1-34
           (and originally defined in ‘Data.Foldable’))
        (Some hole fits suppressed; use -fmax-valid-hole-fits=N or -fno-max-valid-hole-fits)
   |
14 | t = _module_Prelude
   |     ^^^^^^^^^^^^^^^

Main.hs:17:5: error:
    • Found hole: _module_Data_List :: [Int] -> Int
      Or perhaps ‘_module_Data_List’ is mis-spelled, or not in scope
    • In the expression: _module_Data_List
      In an equation for ‘g’: g = _module_Data_List
    • Relevant bindings include
        g :: [Int] -> Int (bound at Main.hs:17:1)
      Valid hole fits include
        Hoogle says: GHC.List length :: [a] -> Int
        Hoogle says: GHC.OldList length :: [a] -> Int
        g :: [Int] -> Int (bound at Main.hs:17:1)
        head :: forall a. [a] -> a
          with head @Int
          (imported from ‘Data.List’ at Main.hs:7:19-22
           (and originally defined in ‘GHC.List’))
        last :: forall a. [a] -> a
          with last @Int
          (imported from ‘Data.List’ at Main.hs:7:25-28
           (and originally defined in ‘GHC.List’))
   |
17 | g = _module_Data_List

```

This relatively simple plugin has two functions, as an example of what
is possible to do with hole fit plugins. The candidate plugin starts by
filtering the candidates considered by module, indicated by the name of
the hole (`_module_Data_List`). The second function is in the fit
plugin, where the plugin invokes a local hoogle instance to search by
the type of the hole.

By adding the `RawHoleFit` type, we can also allow these completely free
suggestions, used in the plugin above to display fits found by Hoogle.

Of course, the syntax here is up for debate, but hole fit plugins allow
us to experiment relatively easily with ways to interact with
typed-holes without having to dig deep into GHC.

Reviewers: bgamari

Subscribers: rwbarton, carter

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

- - - - -
7d27636a by Matthías Páll Gissurarson at 2019-05-31T17:15:26Z
Add TcRef to allow internal state of plugin

- - - - -
ec71e30e by Matthías Páll Gissurarson at 2019-05-31T17:15:26Z
Move HoleFitPlugin definitions and instances to TcRnTypes

- - - - -
2eb46a77 by Matthías Páll Gissurarson at 2019-05-31T17:15:26Z
Add NamedThing instance to HoleFitCandidates, remove hfName

- - - - -
ad044888 by Matthías Páll Gissurarson at 2019-05-31T17:15:26Z
Fix warning

- - - - -
58332389 by Matthías Páll Gissurarson at 2019-05-31T17:18:03Z
Incorporate changes from master

- - - - -
ee2902c1 by Matthías Páll Gissurarson at 2019-05-31T17:19:21Z
Merge branch 'wip/D5373' of gitlab.haskell.org:ghc/ghc into wip/D5373

- - - - -


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/linters/check-version-number.sh
- + .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


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/compare/e39d3d3acaceade1c06aa7d09b83692f275d0fcb...ee2902c196a64a577800586b02294aee506287fe

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/compare/e39d3d3acaceade1c06aa7d09b83692f275d0fcb...ee2902c196a64a577800586b02294aee506287fe
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/20190531/1af76408/attachment-0001.html>


More information about the ghc-commits mailing list