[Git][ghc/ghc][wip/krzysztof-cleanups] 458 commits: gitlab-ci: Bump docker images

Krzysztof Gogolewski gitlab at gitlab.haskell.org
Fri Jun 14 18:20:51 UTC 2019



Krzysztof Gogolewski pushed to branch wip/krzysztof-cleanups at Glasgow Haskell Compiler / GHC


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

- - - - -
54095bbd by Takenobu Tani at 2019-05-21T20:54:00Z
users-guide: Fix directive errors on 8.10

The following sections are not displayed due to a directive error:

  * -Wunused-record-wildcards
  * -Wredundant-record-wildcards

I changed the location of the `since` directive.

[skip ci]

- - - - -
8fc654c3 by David Eichmann at 2019-05-21T20:57:37Z
Include CPP preprocessor dependencies in -M output

Issue #16521

- - - - -
0af519ac by David Eichmann at 2019-05-21T21:01:16Z
Refactor Libffi and RTS rules

This removes a hack that copies libffi files to the rts
build directory. This was done in a libffi rule, but now
an rts rule correctly needs and copies the relevant
files from the libffi build dir to the rts build dir.

Issues: #16272 #16304

- - - - -
9342b1fa by Kirill Elagin at 2019-05-21T21:04:54Z
users-guide: Fix -rtsopts default
- - - - -
d0142f21 by Javran Cheng at 2019-05-21T21:08:29Z
Fix doc for Data.Function.fix.

Doc-only change.

- - - - -
ddd905b4 by Shayne Fletcher at 2019-05-21T21:12:07Z
Update resolver for for happy 1.19.10

- - - - -
e32c30ca by Alp Mestanogullari at 2019-05-21T21:15:45Z
distrib/configure.ac.in: remove mention to 'settings', since settings.in is gone

Otherwise, when `./configure`ing a GHC bindist, produced by either Make or
Hadrian, we would try to generate the `settings` file from the `settings.in`
template that we used to have around but which has been gone since d37d91e9.
That commit generates the settings file using the build systems instead, but
forgot to remove this mention to the `settings` file.

- - - - -
4a6c8436 by Ryan Scott at 2019-05-21T21:19:22Z
Fix #16666 by parenthesizing contexts in Convert

Most places where we convert contexts in `Convert` are actually in
positions that are to the left of some `=>`, such as in superclasses
and instance contexts. Accordingly, these contexts need to be
parenthesized at `funPrec`. To accomplish this, this patch changes
`cvtContext` to require a precedence argument for the purposes of
calling `parenthesizeHsContext` and adjusts all `cvtContext` call
sites accordingly.

- - - - -
c32f64e5 by Ben Gamari at 2019-05-21T21:23:01Z
gitlab-ci: Allow Windows Hadrian build to fail

Due to #16574.
- - - - -
412a1f39 by Ben Gamari at 2019-05-21T21:23:01Z
Update .gitlab-ci.yml
- - - - -
0dc79856 by Julian Leviston at 2019-05-22T00:55:44Z
Allow for multiple linker instances. Fixes Haskell portion of #3372.

- - - - -
21272670 by Michael Sloan at 2019-05-22T20:37:57Z
Have GHCi use object code for UnboxedTuples modules #15454

The idea is to automatically enable -fobject-code for modules that use
UnboxedTuples, along with all the modules they depend on. When looking
into how to solve this, I was pleased to find that there was already
highly similar logic for enabling code generation when -fno-code is
specified but TemplateHaskell is used.

The state before this patch was that if you used unboxed tuples then you
had to enable `-fobject-code` globally rather than on a per module
basis.

- - - - -
ddae344e by Michael Sloan at 2019-05-22T20:41:31Z
Use datatype for unboxed returns when loading ghc into ghci

See #13101 and #15454

- - - - -
78c3f330 by Kevin Buhr at 2019-05-22T20:45:08Z
Add regression test for old Word32 arithmetic issue (#497)

- - - - -
ecc9366a by Alec Theriault at 2019-05-22T20:48:45Z
RTS: Fix restrictive cast

Commit e75a9afd2989e0460f9b49fa07c1667299d93ee9 added an `unsigned` cast
to account for OSes that have signed `rlim_t` signed. Unfortunately,
the `unsigned` cast has the unintended effect of narrowing `rlim_t` to
only 4 bytes. This leads to some spurious out of memory crashes
(in particular: Haddock crashes with OOM whenn building docs of
`ghc`-the-library).

In this case, `W_` is a better type to cast to: we know it will be
unsigned too and it has the same type as `*len` (so we don't suffer from
accidental narrowing).

- - - - -
2c15b85e by Alp Mestanogullari at 2019-05-22T20:52:22Z
Hadrian: add --test-root-dirs, to only run specific directories of tests

We can specify several of those, by using the flag multiple times or
just once but combining the directories with ':'.

Along the way, this patch also fixes the testsuite-related --only flag,
so that we can use it many times instead of being force to specify a
space-separated list of test in a single --only flag.

- - - - -
6efe04de by Ryan Scott at 2019-05-22T20:56:01Z
Use HsTyPats in associated type family defaults

Associated type family default declarations behave strangely in a
couple of ways:

1. If one tries to bind the type variables with an explicit `forall`,
   the `forall`'d part will simply be ignored. (#16110)
2. One cannot use visible kind application syntax on the left-hand
   sides of associated default equations, unlike every other form
   of type family equation. (#16356)

Both of these issues have a common solution. Instead of using
`LHsQTyVars` to represent the left-hand side arguments of an
associated default equation, we instead use `HsTyPats`, which is what
other forms of type family equations use. In particular, here are
some highlights of this patch:

* `FamEqn` is no longer parameterized by a `pats` type variable, as
  the `feqn_pats` field is now always `HsTyPats`.
* The new design for `FamEqn` in chronicled in
  `Note [Type family instance declarations in HsSyn]`.
* `TyFamDefltEqn` now becomes the same thing as `TyFamInstEqn`. This
  means that many of `TyFamDefltEqn`'s code paths can now reuse the
  code paths for `TyFamInstEqn`, resulting in substantial
  simplifications to various parts of the code dealing with
  associated type family defaults.

Fixes #16110 and #16356.

- - - - -
4ba73e00 by Luite Stegeman at 2019-05-22T20:59:39Z
fix Template Haskell cross compilation on 64 bit compiler with 32 bit target

- - - - -
535a26c9 by David Eichmann at 2019-05-23T17:26:37Z
Revert "Add Generic tuple instances up to 15-tuple" #16688

This reverts commit 5eb9445444c4099fc9ee0803ba45db390900a80f.
It has caused an increase in variance of performance test T9630,
causing CI to fail.

- - - - -
04b4b984 by Alp Mestanogullari at 2019-05-24T02:32:15Z
add an --hadrian mode to ./validate

When the '--hadrian' flag is passed to the validate script, we use hadrian
to build GHC, package it up in a binary distribution and later on run GHC's
testsuite against the said bindist, which gets installed locally in the process.

Along the way, this commit fixes a typo, an omission (build iserv binaries
before producing the bindist archive) and moves the Makefile that enables
'make install' on those bindists from being a list of strings in the code to
an actual file (it was becoming increasingly annoying to work with).

Finally, the Settings.Builders.Ghc part of this patch is necessary for being
able to use the installed binary distribution, in 'validate'.

- - - - -
0b449d34 by Ömer Sinan Ağacan at 2019-05-24T02:35:54Z
Add a test for #16597

- - - - -
59f4cb6f by Iavor Diatchki at 2019-05-24T02:39:35Z
Add a `NOINLINE` pragma on `someNatVal` (#16586)

This fixes #16586, see `Note [NOINLINE someNatVal]` for details.

- - - - -
6eedbd83 by Ryan Scott at 2019-05-24T02:43:12Z
Some forall-related cleanup in deriving code

* Tweak the parser to allow `deriving` clauses to mention explicit
  `forall`s or kind signatures without gratuitous parentheses.
  (This fixes #14332 as a consequence.)
* Allow Haddock comments on `deriving` clauses with explicit
  `forall`s. This requires corresponding changes in Haddock.

- - - - -
c931f256 by David Eichmann at 2019-05-24T10:22:29Z
Allow metric change after reverting "Add Generic tuple instances up to 15-tuple" #16688

Metrics increased on commit 5eb9445444c4099fc9ee0803ba45db390900a80f and
decreased on revert commit 535a26c90f458801aeb1e941a3f541200d171e8f.

Metric Decrease:
    T9630
    haddock.base

- - - - -
d9dfbde3 by Michael Sloan at 2019-05-24T15:55:07Z
Add PlainPanic for throwing exceptions without depending on pprint

This commit splits out a subset of GhcException which do not depend on
pretty printing (SDoc), as a new datatype called
PlainGhcException. These exceptions can be caught as GhcException,
because 'fromException' will convert them.

The motivation for this change is that that the Panic module
transitively depends on many modules, primarily due to pretty printing
code.  It's on the order of about 130 modules.  This large set of
dependencies has a few implications:

1. To avoid cycles / use of boot files, these dependencies cannot
throw GhcException.

2. There are some utility modules that use UnboxedTuples and also use
`panic`. This means that when loading GHC into GHCi, about 130
additional modules would need to be compiled instead of
interpreted. Splitting the non-pprint exception throwing into a new
module resolves this issue. See #13101

- - - - -
70c24471 by Moritz Angermann at 2019-05-25T21:51:30Z
Add `keepCAFs` to RtsSymbols

- - - - -
9be1749d by David Eichmann at 2019-05-25T21:55:05Z
Hadrian: Add Mising Libffi Dependencies #16653

Libffi is ultimately built from a single archive file (e.g.
libffi-tarballs/libffi-3.99999+git20171002+77e130c.tar.gz).
The file can be seen as the shallow dependency for the whole
libffi build. Hence, in all libffi rules, the archive is
`need`ed and the build directory is `trackAllow`ed.

- - - - -
2d0cf625 by Sandy Maguire at 2019-05-26T12:57:20Z
Let the specialiser work on dicts under lambdas

Following the discussion under #16473, this change allows the
specializer to work on any dicts in a lambda, not just those that occur
at the beginning.

For example, if you use data types which contain dictionaries and
higher-rank functions then once these are erased by the optimiser you
end up with functions such as:

```
  go_s4K9
  Int#
  -> forall (m :: * -> *).
     Monad m =>
     (forall x. Union '[State (Sum Int)] x -> m x) -> m ()
```

The dictionary argument is after the Int# value argument, this patch
allows `go` to be specialised.

- - - - -
4b228768 by Moritz Angermann at 2019-05-27T05:19:49Z
Lowercase windows imports

While windows and macOS are currently on case-insensitive file
systems, this poses no issue on those.  When cross compiling from
linux with a case sensitive file system and mingw providing only
lowercase headers, this in fact produces an issue.  As such we just
lowercase the import headers, which should still work fine on a
case insensitive file system and also enable mingw's headers to
be usable porperly.

- - - - -
01f8e390 by Alp Mestanogullari at 2019-05-27T14:06:26Z
Hadrian: Fix problem with unlit path in settings file

e529c65e introduced a problem in the logic for generating the
path to the unlit command in the settings file, and this patches
fixes it.

This fixes many tests, the simplest of which is:

> _build/stage1/bin/ghc testsuite/tests/parser/should_fail/T8430.lhs

which failed because of a wrong path for unlit, and now fails for the right
reason, with the error message expected for this test.

This addresses #16659.

- - - - -
dcd843ac by mizunashi_mana at 2019-05-27T14:06:27Z
Fix typo of primop format
- - - - -
3f6e5b97 by Joshua Price at 2019-05-27T14:06:28Z
Correct the large tuples section in user's guide

Fixes #16644.

- - - - -
1f51aad6 by Krzysztof Gogolewski at 2019-05-27T14:06:28Z
Fix tcfail158 (#15899)

As described in #15899, this test was broken, but now it's back
to normal.

- - - - -
723216e3 by Sebastian Graf at 2019-05-27T14:06:29Z
Add a pprTraceWith function

- - - - -
6d188dd5 by Simon Jakobi at 2019-05-27T14:06:31Z
base: Include (<$) in all exports of Functor

Previously the haddocks for Control.Monad and Data.Functor gave
the impression that `fmap` was the only Functor method.

Fixes #16681.

- - - - -
95b79173 by Jasper Van der Jeugt at 2019-05-27T14:06:32Z
Fix padding of entries in .prof files

When the number of entries of a cost centre reaches 11 digits, it takes
up the whole space reserved for it and the prof file ends up looking
like:

    ... no.        entries  %time %alloc   %time %alloc

        ...
    ... 120918     978250    0.0    0.0     0.0    0.0
    ... 118891          0    0.0    0.0    73.3   80.8
    ... 11890229702412351    8.9   13.5    73.3   80.8
    ... 118903  153799689    0.0    0.1     0.0    0.1
        ...

This results in tooling not being able to parse the .prof file.  I
realise we have the JSON output as well now, but still it'd be good to
fix this little weirdness.

Original bug report and full prof file can be seen here:
<https://github.com/jaspervdj/profiteur/issues/28>.

- - - - -
f80d3afd by John Ericson at 2019-05-27T14:06:33Z
hadrian: Fix generation of settings

I jumbled some lines in e529c65eacf595006dd5358491d28c202d673732,
messing up the leading underscores and rts ways settings. This broke at
least stage1 linking on macOS, but probably loads of other things too.

Should fix #16685 and #16658.

- - - - -
db8e3275 by Ömer Sinan Ağacan at 2019-05-27T14:06:37Z
Add missing opening braces in Cmm dumps

Previously -ddump-cmm was generating code with unbalanced curly braces:

     stg_atomically_entry() //  [R1]
             { info_tbls: [(cfl,
                            label: stg_atomically_info
                            rep: tag:16 HeapRep 1 ptrs { Thunk }
                            srt: Nothing)]
               stack_info: arg_space: 8 updfr_space: Just 8
             }
         {offset
           cfl: // cfk
               unwind Sp = Just Sp + 0;
               _cfk::P64 = R1;
               //tick src<rts/PrimOps.cmm:(1243,1)-(1245,1)>
               R1 = I64[_cfk::P64 + 8 + 8 + 0 * 8];
               call stg_atomicallyzh(R1) args: 8, res: 0, upd: 8;
         }
     }, <---- OPENING BRACE MISSING

After this patch:

     stg_atomically_entry() { //  [R1] <---- MISSING OPENING BRACE HERE
             { info_tbls: [(cfl,
                            label: stg_atomically_info
                            rep: tag:16 HeapRep 1 ptrs { Thunk }
                            srt: Nothing)]
               stack_info: arg_space: 8 updfr_space: Just 8
             }
         {offset
           cfl: // cfk
               unwind Sp = Just Sp + 0;
               _cfk::P64 = R1;
               //tick src<rts/PrimOps.cmm:(1243,1)-(1245,1)>
               R1 = I64[_cfk::P64 + 8 + 8 + 0 * 8];
               call stg_atomicallyzh(R1) args: 8, res: 0, upd: 8;
         }
     },

- - - - -
9334467f by Richard Eisenberg at 2019-05-28T04:24:50Z
Improve comments around injectivity checks

- - - - -
c8380a4a by Krzysztof Gogolewski at 2019-05-29T14:35:50Z
Handle hs-boot files in -Wmissing-home-modules (#16551)

- - - - -
7a75a094 by Alp Mestanogullari at 2019-05-29T14:36:35Z
testsuite: introduce 'static_stats' tests

They are a particular type of perf tests. This patch introduces a
'stats_files_dir' configuration field in the testsuite driver where all
haddock timing files (and possibly others in the future) are assumed to live.
We also change both the Make and Hadrian build systems to pass respectively
$(TOP)/testsuite/tests/perf/haddock/ and
<build root>/stage1/haddock-timing-files/ as the value of that new
configuration field, and to generate the timing files in those directories
in the first place while generating documentation with haddock.

This new test type can be seen as one dedicated to examining stats files that
are generated while building a GHC distribution. This also lets us get rid of
the 'extra_files' directives in the all.T entries for haddock.base,
haddock.Cabal and haddock.compiler.

- - - - -
32acecc2 by P.C. Shyamshankar at 2019-05-29T14:37:16Z
Minor spelling fixes to users guide.

- - - - -
b58b389b by Oleg Grenrus at 2019-05-29T14:37:54Z
Remove stale 8.2.1-notes

- - - - -
5bfd28f5 by Oleg Grenrus at 2019-05-29T14:37:54Z
Fix some warnings in users_guide (incl #16640)

- short underline
- :ghc-flag:, not :ghc-flags:
- :since: have to be separate
- newline before code block
- workaround anchor generation so

    - pragma:SPECIALISE
    - pragma:SPECIALIZE-INLINE
    - pragma:SPECIALIZE-inline

  are different anchors, not all the same `pragma:SPECIALIZE`

- - - - -
a5b14ad4 by Kevin Buhr at 2019-05-29T14:38:30Z
Add test for old issue displaying unboxed tuples in error messages (#502)

- - - - -
f9d61ebb by Krzysztof Gogolewski at 2019-05-29T14:39:05Z
In hole fits, don't show VTA for inferred variables (#16456)

We fetch the ArgFlag for every argument by using splitForAllVarBndrs
instead of splitForAllTys in unwrapTypeVars.

- - - - -
69b16331 by Krzysztof Gogolewski at 2019-05-29T14:39:43Z
Fix missing unboxed tuple RuntimeReps (#16565)

Unboxed tuples and sums take extra RuntimeRep arguments,
which must be manually passed in a few places.
This was not done in deSugar/Check.

This error was hidden because zipping functions in TyCoRep
ignored lists with mismatching length. This is now fixed;
the lengths are now checked by calling zipEqual.

As suggested in #16565, I moved checking for isTyVar and
isCoVar to zipTyEnv and zipCoEnv.

- - - - -
9062b625 by Nathan Collins at 2019-05-29T14:40:21Z
Don't lose parentheses in show SomeAsyncException
- - - - -
cc0d05a7 by Daniel Gröber at 2019-05-29T14:41:02Z
Add hPutStringBuffer utility

- - - - -
5b90e0a1 by Daniel Gröber at 2019-05-29T14:41:02Z
Allow using tagetContents for modules needing preprocessing

This allows GHC API clients, most notably tooling such as
Haskell-IDE-Engine, to pass unsaved files to GHC more easily.

Currently when targetContents is used but the module requires preprocessing
'preprocessFile' simply throws an error because the pipeline does not
support passing a buffer.

This change extends `runPipeline` to allow passing the input buffer into
the pipeline. Before proceeding with the actual pipeline loop the input
buffer is immediately written out to a new tempfile.

I briefly considered refactoring the pipeline at large to pass around
in-memory buffers instead of files, but this seems needlessly complicated
since no pipeline stages other than Hsc could really support this at the
moment.

- - - - -
fb26d467 by Daniel Gröber at 2019-05-29T14:41:02Z
downsweep: Allow TargetFile not to exist when a buffer is given

Currently 'getRootSummary' will fail with an exception if a 'TargetFile' is
given but it does not exist even if an input buffer is passed along for
this target.

In this case it is not necessary for the file to exist since the buffer
will be used as input for the compilation pipeline instead of the file
anyways.

- - - - -
4d51e0d8 by Ömer Sinan Ağacan at 2019-05-29T14:41:44Z
CNF.c: Move debug functions behind ifdef

- - - - -
ae968d41 by Vladislav Zavialov at 2019-05-29T14:42:20Z
tcMatchesFun s/rho/sigma #16692

- - - - -
2d2aa203 by Josh Meredith at 2019-05-29T14:43:03Z
Provide details in `plusSimplCount` errors

- - - - -
ace2e335 by John Ericson at 2019-05-29T20:06:45Z
Break up `Settings` into smaller structs

As far as I can tell, the fields within `Settings` aren't *intrinsicly*
related. They just happen to be initialized the same way (in particular
prior to the rest of `DynFlags`), and that is why they are grouped
together.

Within `Settings`, however, there are groups of settings that clearly do
share something in common, regardless of how they anything is
initialized.

In the spirit of GHC being a library, where the end cosumer may choose
to initialize this configuration in arbitrary ways, I made some new data
types for thoses groups internal to `Settings`, and used them to define
`Settings` instead. Hopefully this is a baby step towards a general
decoupling of the stateful and stateless parts of GHC.

- - - - -
bfccd832 by John Ericson at 2019-05-29T20:06:45Z
Inline `Settings` into `DynFlags`

After the previous commit, `Settings` is just a thin wrapper around
other groups of settings. While `Settings` is used by GHC-the-executable
to initalize `DynFlags`, in principle another consumer of
GHC-the-library could initialize `DynFlags` a different way. It
therefore doesn't make sense for `DynFlags` itself (library code) to
separate the settings that typically come from `Settings` from the
settings that typically don't.

- - - - -
a1bf3413 by David Eichmann at 2019-05-29T20:07:24Z
Hadrian: Add note about Libffi's Indicating Inputs #16653

[skip ci]

- - - - -
3aa71a22 by Alp Mestanogullari at 2019-05-30T11:28:32Z
Hadrian: always generate the libffi dynlibs manifest with globbing

Instead of trying to deduce which dynlibs are expected to be found (and then
copied to the RTS's build dir) in libffi's build directory, with some OS
specific logic, we now always just use `getDirectoryFilesIO` to look for
those dynlibs and record their names in the manifest. The previous logic
ended up causing problems on Windows, where we don't build dynlibs at all
for now but the manifest file's logic didn't take that into account because
it was only partially reproducing the criterions that determine whether or not
we will be building shared libraries.

This patch also re-enables the Hadrian/Windows CI job, which was failing to
build GHC precisely because of libffi shared libraries and the aforementionned
duplicated logic.

- - - - -
ade53ce2 by Ben Gamari at 2019-05-30T11:29:10Z
CODEOWNERS: Use correct username for Richard Eisenberg

In !980 Richard noted that he could not approve the MR.
This mis-spelling was the reason.

[skip ci]

- - - - -
4ad37a32 by Ben Gamari at 2019-05-30T11:29:47Z
rts: Handle zero-sized mappings in MachO linker

As noted in #16701, it is possible that we will find that an object has
no segments needing to be mapped. Previously this would result in mmap
being called for a zero-length mapping, which would fail. We now simply
skip the mmap call in this case; the rest of the logic just works.

- - - - -
f81f3964 by Phuong Trinh at 2019-05-30T20:43:31Z
Use binary search to speedup checkUnload

We are iterating through all object code for each heap objects when
checking whether object code can be unloaded. For large projects in
GHCi, this can be very expensive due to the large number of object code
that needs to be loaded/unloaded. To speed it up, this arrangess all
mapped sections of unloaded object code in a sorted array and use binary
search to check if an address location fall on them.

- - - - -
42129180 by Trịnh Tuấn Phương at 2019-05-30T20:43:31Z
Apply suggestion to rts/CheckUnload.c
- - - - -
8e42e98e by Trịnh Tuấn Phương at 2019-05-30T20:43:31Z
Apply suggestion to rts/CheckUnload.c
- - - - -
70afa539 by Daniel Gröber at 2019-05-30T20:44:08Z
Export GhcMake.downsweep

This is to enable #10887 as well as to make it possible to test downsweep
on its own in the testsuite.

- - - - -
a8de5c5a by Daniel Gröber at 2019-05-30T20:44:08Z
Add failing test for #10887

- - - - -
8906bd66 by Daniel Gröber at 2019-05-30T20:44:08Z
Refactor downsweep to allow returning multiple errors per module

- - - - -
8e85ebf7 by Daniel Gröber at 2019-05-30T20:44:08Z
Refactor summarise{File,Module} to reduce code duplication

- - - - -
76c86fca by Daniel Gröber at 2019-05-30T20:44:08Z
Refactor summarise{File,Module} to extract checkSummaryTimestamp

This introduces a slight change of behaviour in the interrest of keeping
the code simple: Previously summariseModule would not call
addHomeModuleToFinder for summaries that are being re-used but now we do.

We're forced to to do this in summariseFile because the file being
summarised might not even be on the regular search path! So if GHC is to
find it at all we have to pre-populate the cache with its location. For
modules however the finder cache is really just a cache so we don't have to
pre-populate it with the module's location.

As straightforward as that seems I did almost manage to introduce a bug (or
so I thought) because the call to addHomeModuleToFinder I copied from
summariseFile used to use `ms_location old_summary` instead of the
`location` argument to checkSummaryTimestamp. If this call were to
overwrite the existing entry in the cache that would have resulted in us
using the old location of any module even if it was, say, moved to a
different directory between calls to 'depanal'.

However it turns out the cache just ignores the location if the module is
already in the cache. Since summariseModule has to search for the module,
which has the side effect of populating the cache, everything would have
been fine either way.

Well I'm adding a test for this anyways: tests/depanal/OldModLocation.hs.

- - - - -
18d3f01d by Daniel Gröber at 2019-05-30T20:44:08Z
Make downsweep return all errors per-module instead of throwing some

This enables API clients to handle such errors instead of immideately
crashing in the face of some kinds of user errors, which is arguably quite
bad UX.

Fixes #10887

- - - - -
99e72769 by Daniel Gröber at 2019-05-30T20:44:08Z
Catch preprocessor errors in downsweep

This changes the way preprocessor failures are presented to the
user. Previously the user would simply get an unlocated message on stderr
such as:

    `gcc' failed in phase `C pre-processor'. (Exit code: 1)

Now at the problematic source file is mentioned:

    A.hs:1:1: error:
        `gcc' failed in phase `C pre-processor'. (Exit code: 1)

This also makes live easier for GHC API clients as the preprocessor error
is now thrown as a SourceError exception.

- - - - -
b7ca94fd by Daniel Gröber at 2019-05-30T20:44:08Z
PartialDownsweep: Add test for import errors

- - - - -
98e39818 by Daniel Gröber at 2019-05-30T20:44:08Z
Add depanalPartial to make getting a partial modgraph easier

As per @mpickering's suggestion on IRC this is to make the partial
module-graph more easily accessible for API clients which don't intend to
re-implementing depanal.

- - - - -
d2784771 by Daniel Gröber at 2019-05-30T20:44:08Z
Improve targetContents code docs

- - - - -
424e85b2 by Ben Gamari at 2019-05-30T20:44:43Z
testsuite: Compile T9630 with +RTS -G1

For the reasons described in Note [residency] we run programs with -G1
when we care about the max_bytes_used metric.

- - - - -
4879d7af by Matthew Pickering at 2019-05-31T05:56:16Z
Eventlog: Document the fact timestamps are nanoseconds

[skip ci]

- - - - -
0b01a354 by Takenobu Tani at 2019-05-31T05:56:54Z
Update `$(TOP)/*.md` documents

I updated the top documents to the latest status:

  - HACKING.md:
    - Modify Phabricator to GitLab infomation
    - Remove old Trac information
    - Add link to GitLab activity

  - MAKEHELP.md:
    - Add link to hadrian wiki
    - Fix markdown format

  - INSTALL.md:
    - Modify boot command to remove python3
    - Fix markdown format

  - README.md:
    - Modify tarball file suffix
    - Fix markdown format

I checked the page display on the GitHub and GitLab web.

[skip ci]

- - - - -
973077ac by Sergei Trofimovich at 2019-05-31T05:57:31Z
powerpc32: fix 64-bit comparison (#16465)

On powerpc32 64-bit comparison code generated dangling
target labels. This caused ghc build failure as:

    $ ./configure --target=powerpc-unknown-linux-gnu && make
    ...
    SCCs aren't in reverse dependent order
    bad blockId n3U

This happened because condIntCode' in PPC codegen generated
label name but did not place the label into `cmp_lo` code block.

The change adds the `cmp_lo` label into the case of negative
comparison.

Signed-off-by: Sergei Trofimovich <slyfox at gentoo.org>

- - - - -
bb2ee86a by Sergei Trofimovich at 2019-05-31T05:57:31Z
powerpc32: fix stack allocation code generation

When ghc was built for powerpc32 built failed as:

It's a fallout of commit 3f46cffcc2850e68405a1
("PPC NCG: Refactor stack allocation code") where
word size used to be
    II32/II64
and changed to
    II8/panic "no width for given number of bytes"
    widthFromBytes ((platformWordSize platform) `quot` 8)

The change restores initial behaviour by removing extra division.

Signed-off-by: Sergei Trofimovich <slyfox at gentoo.org>

- - - - -
08b4c813 by Matthew Pickering at 2019-05-31T05:58:08Z
Use types already in AST when making .hie file

These were meant to be added in !214 but for some reason wasn't included
in the patch.

Update Haddock submodule for new Types.hs hyperlinker output

- - - - -
284cca51 by David Hewson at 2019-05-31T05:58:47Z
support small arrays and CONSTR_NOCAF in ghc-heap

- - - - -
f071576c by Neil Mitchell at 2019-05-31T05:59:24Z
Expose doCpp
- - - - -
c70d039e by Ömer Sinan Ağacan at 2019-05-31T06:00:02Z
Remove unused RTS function 'unmark'

- - - - -
bb929009 by Ömer Sinan Ağacan at 2019-05-31T06:00:40Z
Fix arity type of coerced types in CoreArity

Previously if we had

    f |> co

where `f` had arity type `ABot N` and `co` had arity M and M < N,
`arityType` would return `ABot M` which is wrong, because `f` is only
known to diverge when applied to `N` args, as described in Note
[ArityType]:

    If at = ABot n, then (f x1..xn) definitely diverges. Partial
    applications to fewer than n args may *or may not* diverge.

This caused incorrect eta expansion in the simplifier, causing #16066.

We now return `ATop M` for the same expression so the simplifier can't
assume partial applications of `f |> co` is divergent.

A regression test T16066 is also added.

- - - - -
e32786df by Ryan Scott at 2019-05-31T06:01:18Z
Put COMPLETE sigs into ModDetails with -fno-code (#16682)

`mkBootModDetailsTc`, which creates a special `ModDetails` when
`-fno-code` is enabled, was not properly filling in the `COMPLETE`
signatures from the `TcGblEnv`, resulting in incorrect pattern-match
coverage warnings. Easily fixed.

Fixes #16682.

- - - - -
0c6f7f7e by Simon Jakobi at 2019-05-31T06:01:55Z
Implement (Functor.<$) for Array

- - - - -
495a65cb by Simon Jakobi at 2019-05-31T06:02:33Z
Implement (Functor.<$) for Data.Functor.{Compose,Product,Sum}

This allows us to make use of the (<$) implementations of the
underlying functors.

- - - - -
0e0d87da by Zubin Duggal at 2019-05-31T06:34:57Z
Fix and enforce validation of header for .hie files

Implements #16686

The files version is automatically generated from the current GHC
version in the same manner as normal interface files.

This means that clients can first read the version and then decide how
to read the rest of the file.

- - - - -
1d43d4a3 by Nathan Collins at 2019-06-01T03:55:49Z
Improve ThreadId Show instance

By making it include parens when a derived instance would. For example, this changes the (hypothetical) code `show (Just (ThreadId 3))` to produce `"Just (ThreadId 3)"` instead of the current `"Just ThreadId 3"`.

- - - - -
45f88494 by Ryan Scott at 2019-06-01T03:56:27Z
Reject nested foralls in foreign imports (#16702)

This replaces a panic observed in #16702 with a simple error message
stating that nested `forall`s simply aren't allowed in the type
signature of a `foreign import` (at least, not at present).

Fixes #16702.

- - - - -
76e58890 by Ryan Scott at 2019-06-01T03:57:05Z
Fix space leaks in dynLoadObjs (#16708)

When running the test suite on a GHC built with the `quick` build
flavour, `-fghci-leak-check` noticed some space leaks. Careful
investigation led to `Linker.dynLoadObjs` being the culprit.
Pattern-matching on `PeristentLinkerState` and a dash of `$!` were
sufficient to fix the issue. (ht to mpickering for his suggestions,
which were crucial to discovering a fix)

Fixes #16708.

- - - - -
1503da32 by Ömer Sinan Ağacan at 2019-06-01T15:18:57Z
Fix rewriting invalid shifts to errors

Fixes #16449.

5341edf3 removed a code in rewrite rules for bit shifts, which broke the
"silly shift guard", causing generating invalid bit shifts or heap
overflow in compile time while trying to evaluate those invalid bit
shifts.

The "guard" is explained in Note [Guarding against silly shifts] in
PrelRules.hs.

More specifically, this was the breaking change:

    --- a/compiler/prelude/PrelRules.hs
    +++ b/compiler/prelude/PrelRules.hs
    @@ -474,12 +474,11 @@ shiftRule shift_op
            ; case e1 of
                _ | shift_len == 0
                  -> return e1
    -             | shift_len < 0 || wordSizeInBits dflags < shift_len
    -             -> return (mkRuntimeErrorApp rUNTIME_ERROR_ID wordPrimTy
    -                                        ("Bad shift length" ++ show shift_len))

This patch reverts this change.

Two new tests added:

- T16449_1: The original reproducer in #16449. This was previously
  casing a heap overflow in compile time when CmmOpt tries to evaluate
  the large (invalid) bit shift in compile time, using `Integer` as the
  result type. Now it builds as expected. We now generate an error for
  the shift as expected.

- T16449_2: Tests code generator for large (invalid) bit shifts.

- - - - -
2e297b36 by Ömer Sinan Ağacan at 2019-06-01T15:19:35Z
rts: Remove unused decls from CNF.h

- - - - -
33e37d06 by Takenobu Tani at 2019-06-03T02:54:43Z
Add `-haddock` option under ci condition to fix #16415

In order to use the `:doc` command in ghci, it is necessary
to compile for core libraries with `-haddock` option.

Especially, the `-haddock` option is essential for release building.

Note:
  * The `-haddock` option may affect compile time and binary size.
  * But hadrian has already set `-haddock` as the default.
  * This patch affects the make-based building.

This patch has been split from !532.

- - - - -
43a39c3c by Takenobu Tani at 2019-06-03T02:54:43Z
Add `-haddock` to perf.mk rather than prepare-system.sh

To cover ci conditions from ghc8.6 to 8.9, I add `-haddock` option
to `mk/flavours/perf.mk` rather than `.circleci/prepare-system.sh`.

Because in windows condition of ghc-8.9, `mk/flavours/*` is included
after `prepare-system.sh`.

In addition, in linux condition of ghc-8.6, `mk/flavors/perf.mk` is used.

- - - - -
c4f94320 by Takenobu Tani at 2019-06-03T02:54:43Z
Add `-haddock` to prepare-system.sh and .gitlab-ci.yml

To cover ci conditions from ghc8.6 to 8.9, I add `-haddock` option
to `.circleci/prepare-system.sh` and .gitlab-ci.yml.
after including `mk/flavours/*`.

- - - - -
799b1d26 by Ben Gamari at 2019-06-03T02:55:18Z
gitlab-ci: Use GHC 8.6.5 for Windows CI builds

- - - - -
286827be by David Eichmann at 2019-06-04T05:09:05Z
TestRunner: Added --chart to display a chart of performance tests

This uses the Chart.js javascript library.
Everything is put into a standalone .html file and opened with the
default browser.
I also simplified the text output to use the same data as the chart.
You can now use a commit range with git's ".." syntax.
The --ci option will use results from CI (you'll need to fetch them
first):

  $ git fetch https://gitlab.haskell.org/ghc/ghc-performance-notes.git refs/notes/perf:refs/notes/ci/perf
  $ python3 testsuite/driver/perf_notes.py --ci --chart --test-env x86_64-darwin --test-name T9630 master~500..master

- - - - -
db78ac6f by Andrew Martin at 2019-06-04T05:09:43Z
Use a better strategy for determining the offset applied to foreign function arguments that have an unlifted boxed type. We used to use the type of the argument. We now use the type of the foreign function. Add a test to confirm that the roundtrip conversion between an unlifted boxed type and Any is sound in the presence of a foreign function call.

- - - - -
114b014f by Alp Mestanogullari at 2019-06-04T05:10:20Z
Hadrian: fix OSX build failure and add an OSX/Hadrian CI job

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

- - - - -
002594b7 by Xavier Denis at 2019-06-04T18:41:29Z
Add GHCi :instances command

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

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

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

- - - - -
3ecc03df by Ben Gamari at 2019-06-04T18:42:04Z
gitlab-ci: Run bindisttest during CI

- - - - -
c16f3297 by Ben Gamari at 2019-06-04T18:42:04Z
make: Fix bindist installation

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

- - - - -
ba4e3934 by Alp Mestanogullari at 2019-06-04T18:43:17Z
Hadrian: profiling and debug enabled ways support -eventlog too

- - - - -
567894b4 by Matthew Pickering at 2019-06-07T08:36:32Z
gitlab-ci: Disable darwin hadrian job

See #16771

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

[skip ci]

- - - - -
d3915b30 by Andrew Martin at 2019-06-07T14:20:42Z
[skip ci] Improve the documentation of the CNF primops. In this context, the term "size" is ambiguous and is now avoided. Additionally, the distinction between a CNF and the blocks that comprise it has been emphasize. The vocabulary has been made more consistent with the vocabulary in the C source for CNF.

- - - - -
e963beb5 by Sebastian Graf at 2019-06-07T14:21:21Z
TmOracle: Replace negative term equalities by refutable PmAltCons

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

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

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

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

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

Metric Decrease:
    T11195

- - - - -
0b7372f6 by Matthew Pickering at 2019-06-07T14:21:57Z
Add HEAP_PROF_SAMPLE_END event to mark end of samples

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

Fixes #16697

- - - - -
d1dc0ed7 by Roland Senn at 2019-06-07T14:22:47Z
Fix #16700: Tiny errors in output of GHCi commands :forward and :info

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

`:forward x` gives the correct syntax hint.

- - - - -
387050d0 by John Ericson at 2019-06-07T14:23:23Z
Factor out 'getLibDir' / 'getBaseDir' into a new GHC.BaseDir ghc-boot module

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

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

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

- - - - -
da26ffe7 by Simon Peyton Jones at 2019-06-07T14:24:00Z
Preserve ShadowInfo when rewriting evidence

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

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

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

- - - - -
9bb58799 by Ben Gamari at 2019-06-07T14:24:38Z
Hadrian: Delete target symlink in createFileLinkUntracked

Previously createFileLinkUntracked would fail if the symlink already
existed.

- - - - -
be63d299 by Simon Jakobi at 2019-06-07T14:25:16Z
Fix isValidNatural: The BigNat in NatJ# must have at least 2 limbs

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

- - - - -
e87b9f87 by Moritz Angermann at 2019-06-07T14:26:04Z
llvm-targets: Add x86_64 android layout

- - - - -
60db142b by code5hot at 2019-06-07T14:26:46Z
Update Traversable.hs with a note about an intuitive law
- - - - -
f11aca52 by code5hot at 2019-06-07T14:26:46Z
Used terminology from a paper. Added it as a reference.
- - - - -
13b3d45d by code5hot at 2019-06-07T14:26:46Z
remove backticks from markup - it doesn't mean what I think it means
- - - - -
cfd3e0f1 by Zejun Wu at 2019-06-07T14:27:34Z
Pass preprocessor options to C compiler when building foreign C files (#16737)

- - - - -
5991d877 by Ben Gamari at 2019-06-07T14:28:09Z
base: Export Finalizers

As requested in #16750.

- - - - -
3d97bad6 by Alp Mestanogullari at 2019-06-07T14:28:47Z
Hadrian: use deb9 Docker images instead of deb8 for CI jobs

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

- - - - -
1afb4995 by Ben Gamari at 2019-06-07T14:29:23Z
gitlab-ci: Create index.html in documentation deployment

Otherwise navigating to https://ghc.gitlab.haskell.org/ghc will result
in a 404.

- - - - -
07dc79c3 by Matthew Pickering at 2019-06-08T17:34:18Z
gitlab-ci: Linters, don't allow to fail

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

- - - - -
fd840b64 by Matthew Pickering at 2019-06-08T17:34:18Z
gitlab-ci: Don't run two submodule checking jobs on Marge jobs

- - - - -
310d0c4c by Matthew Pickering at 2019-06-08T17:34:18Z
Fix two lint failures in rts/linker/MachO.c

- - - - -
fe965316 by Ben Gamari at 2019-06-08T17:34:18Z
gitlab-ci: Use --unshallow when fetching for linters

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

- - - - -
f58234ea by Ben Gamari at 2019-06-08T17:34:18Z
gitlab-ci: Fix submodule linter

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

- - - - -
c392f987 by Ben Gamari at 2019-06-08T17:34:18Z
gitlab-ci: A few clarifying comments

- - - - -
709290b0 by Matthew Pickering at 2019-06-08T17:38:15Z
Remove trailing whitespace

[skip ci]

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

- - - - -
b2f106f5 by Ben Gamari at 2019-06-08T18:02:02Z
gitlab-ci: Disable shallow clones

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

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

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

- - - - -
4a72259d by Ben Gamari at 2019-06-08T18:40:55Z
gitlab-ci: Fix submodule linting of commits

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

- - - - -
87540029 by Ben Gamari at 2019-06-08T20:44:55Z
gitlab-ci: Ensure that all commits on a branch are submodule-linted

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

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

- - - - -
0462b0e0 by Alexandre Baldé at 2019-06-09T15:48:34Z
Explain that 'mappend' and '(<>)' should be the same [skip ci]

- - - - -
970e4802 by Matthew Pickering at 2019-06-09T15:49:09Z
hadrian: Properly partition options in sourceArgs

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

Fixes #16716

- - - - -
a018c3a8 by Ben Gamari at 2019-06-09T15:49:44Z
testsuite: Suppress ticks in T4918 output

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

- - - - -
f7370333 by chessai at 2019-06-09T22:41:02Z
Introduce log1p and expm1 primops

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

- - - - -
41bf4045 by Ben Gamari at 2019-06-09T22:41:38Z
testsuite: Add test for #16514

- - - - -
b9fe91fc by Simon Jakobi at 2019-06-09T22:42:21Z
Small refactorings in ExtractDocs

- - - - -
9d238791 by Kevin Buhr at 2019-06-09T22:42:57Z
Handle trailing path separator in package DB names (#16360)

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

Closes #16360.

- - - - -
a22e51ea by Richard Eisenberg at 2019-06-09T22:43:38Z
Fix #16517 by bumping the TcLevel for method sigs

There were actually two bugs fixed here:

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

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

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

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

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

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

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

- - - - -
10452959 by Roland Senn at 2019-06-09T22:44:18Z
Add disable/enable commands to ghci debugger #2215

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

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

The `:enable` command works similar.

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

- - - - -
13572480 by Ben Gamari at 2019-06-09T22:44:54Z
rts: Separate population of eventTypes from initial event generation

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

- - - - -
ed20412a by nineonine at 2019-06-09T22:45:31Z
Do not report error if Name in pragma is unbound

- - - - -
8a48a8a4 by Ben Gamari at 2019-06-09T22:46:08Z
testsuite: Add test for #16509

- - - - -
69c58f8a by David Eichmann at 2019-06-09T22:46:46Z
Hadrian: need CPP preprocessor dependencies #16660

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

- - - - -
1c7bb03d by Richard Eisenberg at 2019-06-09T22:47:24Z
Comments only: document tcdDataCusk better.

- - - - -
5023adce by John Ericson at 2019-06-09T22:47:59Z
Remove CPP ensuring word size is 32 or 64 bits around Addr# <-> int# primops

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

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

CC @carter

- - - - -
8e60e3f0 by Daniel Gröber at 2019-06-09T22:48:38Z
rts: Fix RetainerProfile early return with TREC_CHUNK

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

- - - - -
1a3420ca by Ben Gamari at 2019-06-10T11:59:41Z
base: Mark CPUTime001 as fragile

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

- - - - -
9bc10993 by Vladislav Zavialov at 2019-06-10T12:00:16Z
Print role annotations in TemplateHaskell brackets (#16718)

- - - - -
0345b1b0 by Richard Eisenberg at 2019-06-11T03:52:10Z
Comments only: document newtypes' DataConWrapId

- - - - -
58a5d728 by David Eichmann at 2019-06-11T03:52:50Z
Refactor the rules for .hi and .o into a single rule using `&%>` #16764

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

- - - - -
2f945086 by Ben Gamari at 2019-06-11T03:53:25Z
testsuite: Fix and extend closure_size test

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

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

Fixes #16531.

- - - - -
e5d275f4 by Ben Gamari at 2019-06-11T03:53:25Z
ghc-heap: Add closure_size_noopt test

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

- - - - -
fe7e7e4a by Yuras Shumovich at 2019-06-11T22:39:58Z
Warn about unused packages

Reviewers: bgamari, simonpj

Reviewed By: simonpj

Subscribers: hvr, simonpj, mpickering, rwbarton, carter

GHC Trac Issues: #15838

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

- - - - -
39f50bff by Alp Mestanogullari at 2019-06-11T22:40:37Z
Refine the GHCI macro into HAVE[_{INTERNAL, EXTERNAL}]_INTERPRETER

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

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

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

- - - - -
45616133 by Alec Theriault at 2019-06-11T22:41:14Z
Make `haddock_testsuite` respect `--test-accept`

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

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

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

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

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

Fixes #16694

- - - - -
762098bf by Alp Mestanogullari at 2019-06-11T22:41:52Z
rts/RtsFlags.c: mention that -prof too enables support for +RTS -l

- - - - -
457fe789 by Alp Mestanogullari at 2019-06-11T22:42:30Z
Hadrian: teach the RTS that PROFILING implies TRACING

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

- - - - -
cf7f36ae by Ben Gamari at 2019-06-11T22:43:05Z
rts/linker: Mmap into low memory on AArch64

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

- - - - -
0b7f81f5 by Ben Gamari at 2019-06-11T22:43:05Z
rts/linker: Use mmapForLinker to map PLT

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

Fixes #16784.

- - - - -
1389b2cc by Ömer Sinan Ağacan at 2019-06-11T22:43:43Z
Fix an error message in CheckUnload.c:searchHeapBlocks

- - - - -
aad6115a by Alp Mestanogullari at 2019-06-11T22:44:20Z
testsuite/mk/boilerplate.mk: rename 'ghc-config-mk' to 'ghc_config_mk'

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

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

- - - - -
9b4ff57d by Ben Gamari at 2019-06-12T11:35:25Z
llvm-targets: Add armv7l-unknown-linux-gnueabi

Fixes #15208.

[skip ci]

- - - - -
c05ca251 by Ben Gamari at 2019-06-12T11:36:01Z
testsuite: Add haddock perf test output to gitignore

[skip ci]

- - - - -
bbc752c5 by Ben Gamari at 2019-06-12T11:36:36Z
rts/linker: Make elf_got.c a bit more legible

- - - - -
217e6db4 by Ben Gamari at 2019-06-12T11:36:36Z
rts/linker: Only mprotect GOT after it is filled

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

Fixes #16779.

- - - - -
1219f8e8 by Krzysztof Gogolewski at 2019-06-12T11:37:12Z
Use DeriveFunctor throughout the codebase (#15654)

- - - - -
bd2d13ff by Ben Gamari at 2019-06-12T12:19:59Z
Bump binary to 0.8.7.0

(cherry picked from commit 983ada70a013c7642a751f6e41587ff95b57d0f8)

- - - - -
381c3ae3 by Ben Gamari at 2019-06-12T12:19:59Z
Bump Cabal submodule

(cherry picked from commit ff438786613f07df9b2d43eaeac49b13815d849d)

Metric Increase:
    haddock.Cabal

- - - - -
0354c7de by Ben Gamari at 2019-06-12T12:19:59Z
Bump time submodule to 1.9.3

(cherry picked from commit fdb07571036b1498800589d45b61781e6acdd368)

- - - - -
e0b16eaa by Ben Gamari at 2019-06-12T12:19:59Z
Bump terminfo to 0.4.1.4

(cherry picked from commit 1134488b4c9cef904ea82f22f1978646eea612df)

- - - - -
2ce320b0 by Ben Gamari at 2019-06-12T12:19:59Z
gitlab-ci: Test using slowtest in deb9-debug job

- - - - -
90e7c450 by Ben Gamari at 2019-06-12T12:19:59Z
testsuite: Mark hWaitForInput-accurate-stdin as broken in threaded ways

As noted in #16535.

- - - - -
488187f8 by Ben Gamari at 2019-06-12T12:19:59Z
testsuite: Mark T13167 as fragile in threaded2

As noted in #16536.

- - - - -
9b583320 by Ben Gamari at 2019-06-12T12:19:59Z
testsuite: Mark T13910 as broken in optasm

Due to #16537.

- - - - -
eb644865 by Ben Gamari at 2019-06-12T12:19:59Z
testsuite: Mark T14761c as broken in hpc, profasm, and optasm ways

As noted in #16540.

- - - - -
1a204e07 by Ben Gamari at 2019-06-12T12:19:59Z
testsuite: Mark T16180 as broken in ghci and ext-interp ways

As noted in #16541.

- - - - -
8d482e45 by Ben Gamari at 2019-06-12T12:19:59Z
testsuite: Omit tcrun022 in hpc way

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

- - - - -
68cfdfdb by Ben Gamari at 2019-06-12T12:20:25Z
testsuite: Mark Overflow as broken in hpc way

As noted in #16543.

- - - - -
a3929a4f by Ben Gamari at 2019-06-12T12:20:25Z
testsuite: Mark T2783 as fragile in threaded1

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

- - - - -
bb7ed32f by Ben Gamari at 2019-06-12T12:20:25Z
testsuite: Skip T7919 in ghci way

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

- - - - -
329dcd7a by Ben Gamari at 2019-06-12T12:20:25Z
testsuite: Fix fragile_for test modifier

- - - - -
55b5bb14 by Ben Gamari at 2019-06-12T12:20:25Z
testsuite: Fix omit_ways usage

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

- - - - -
264ad286 by Ben Gamari at 2019-06-12T12:20:25Z
testsuite: Mark threadstatus-T9333 as fragile in ghci way

As noted in #16555.

- - - - -
587bef66 by Ben Gamari at 2019-06-12T12:20:25Z
testsuite: Omit profasm way for cc017

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

- - - - -
dc5a37fd by Ben Gamari at 2019-06-12T12:20:25Z
testsuite: Skip T493 in ghci way.

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

- - - - -
e3f71d0e by Ben Gamari at 2019-06-12T12:20:25Z
testsuite: Mark T16449_2 as broken due to #16742

- - - - -
b5a13a1e by Ben Gamari at 2019-06-12T12:20:25Z
testsuite: Mark T16737 as broken in ghci way due to #16541

- - - - -
b09374a4 by Ben Gamari at 2019-06-12T12:20:25Z
testsuite: Note intentional typo in T7130

I earlier accidentally corrected it breaking the test.

- - - - -
a798c130 by Ben Gamari at 2019-06-12T12:20:25Z
linters/check-makefiles: Limit lint to Makefiles

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

- - - - -
0782141e by Ben Gamari at 2019-06-12T12:20:25Z
gitlab-ci: Fetch submodules before running submodule linter

- - - - -
898f7e92 by Ben Gamari at 2019-06-12T12:20:25Z
Fix uses of #ifdef/#ifndef

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

- - - - -
0a13a04c by Ben Gamari at 2019-06-12T12:20:25Z
Bump unix submodule

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

- - - - -
a8579e5b by Ben Gamari at 2019-06-12T12:27:25Z
process: Bump submodule

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

- - - - -
3f1022c5 by Ben Gamari at 2019-06-12T12:27:25Z
testsuite: Skip cgrun078 in ghci way

This test requires FFI usage.

- - - - -
1cbfef47 by Ben Gamari at 2019-06-12T12:27:25Z
testsuite: Unbreak galois_raytrace on i386

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

- - - - -
20160f1a by Ben Gamari at 2019-06-12T12:27:25Z
testsuite: Don't run tests requiring TH in profasm way when GhcDynamic

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

* T16737
* T16384
* T16718
* T16619
* T16190

- - - - -
7b751ed8 by Ben Gamari at 2019-06-12T21:52:35Z
gitlab-ci: Bump Docker image

Fixes linters.

- - - - -
5ffc266e by Ben Gamari at 2019-06-13T06:48:13Z
Add a few missing llvm-targets

This should finally fix #14261.

[skip ci]

- - - - -
fc6b23be by Phuong Trinh at 2019-06-13T06:48:50Z
Fix #16525: ObjectCode freed wrongly because of lack of info header check

`checkUnload` currently doesn't check the info header of static objects.
Thus, it may free an `ObjectCode` struct wrongly even if there's still a
live static object whose info header lies in a mapped section of that
`ObjectCode`. This fixes the issue by adding an appropriate check.

- - - - -
a657543c by Ben Gamari at 2019-06-13T06:49:25Z
PrelRules: Ensure that string unpack/append rule fires with source notes

Previously the presence of source notes could hide nested applications
of `unpackFoldrCString#` from our constant folding logic. For instance,
consider the expression:

```haskell
unpackFoldrCString# "foo" c (unpackFoldrCString# "baz" c n)
```

Specifically, ticks appearing in two places can defeat the rule:

  a. Surrounding the inner application of `unpackFoldrCString#`
  b. Surrounding the fold function, `c`

The latter caused the `str_rules` testcase to fail when `base` was built
with `-g3`.

Fixes #16740.

- - - - -
e98d32a6 by David Eichmann at 2019-06-13T06:50:00Z
Hadrian: Track RTS library symlink targets

This requires creating RTS library symlinks when registering, outside
of the rule for the registered library file.

- - - - -
35113117 by Alp Mestanogullari at 2019-06-13T06:50:37Z
Hadrian: Do not allow the Linux jobs to fail anymore

MR !1151 makes the Hadrian/Linux job pass by fixing the last two test failures,
so we can now be stricter and not allow those jobs to fail anymore, easily
letting us see when patches introduce test failures.

- - - - -
70b5eefe by Ben Gamari at 2019-06-13T06:51:13Z
users-guide: Fix a few markup issues

Strangely these were only causing the build to fail in the aarch64-linux
job, despite Sphinx throwing errors in all jobs I checked.

Also changes some `#ifdef`s to `#if defined` to satisfy the linter.

- - - - -
9721b40d by Ben Gamari at 2019-06-13T06:51:13Z
gitlab-ci: Don't build PDF user's guide on AArch64

For reasons I don't understand sphinx seems to fail to produce a .idx
file for makeindex.

- - - - -
d550b771 by Ben Gamari at 2019-06-13T06:51:50Z
Clean up .circleci

Move prepare-system.sh to .gitlab and remove everything else.

- - - - -
733a69cc by Krzysztof Gogolewski at 2019-06-13T13:14:01Z
Remove dead code

- - - - -


30 changed files:

- − .circleci/config.yml
- − .circleci/fetch-submodules.sh
- − .circleci/push-test-metrics.sh
- .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/linters/linter.py
- + .gitlab/merge_request_templates/backport-for-8.8.md
- .gitlab/merge_request_templates/merge-request.md
- .circleci/prepare-system.sh → .gitlab/prepare-system.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/backpack/DriverBkp.hs


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/compare/c045bd7cfaef2f4b6753e5a19637a658dce9e58d...733a69cc8cc539506a73a71ee2a918bbe8827a5f

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/compare/c045bd7cfaef2f4b6753e5a19637a658dce9e58d...733a69cc8cc539506a73a71ee2a918bbe8827a5f
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/20190614/bfbb2f19/attachment-0001.html>


More information about the ghc-commits mailing list