[Git][ghc/ghc][wip/T22194-flags] 25 commits: ci: make lint-ci-config job fast again

Simon Peyton Jones (@simonpj) gitlab at gitlab.haskell.org
Sat Apr 1 22:43:12 UTC 2023



Simon Peyton Jones pushed to branch wip/T22194-flags at Glasgow Haskell Compiler / GHC


Commits:
6d6a37a8 by Cheng Shao at 2023-03-30T18:42:56+00:00
ci: make lint-ci-config job fast again

We don't pin our nixpkgs revision and tracks the default
nixpkgs-unstable channel anyway. Instead of using
haskell.packages.ghc924, we should be using haskell.packages.ghc92 to
maximize the binary cache hit rate and make lint-ci-config job fast
again. Also bumps the nix docker image to the latest revision.

- - - - -
ef1548c4 by Cheng Shao at 2023-03-30T18:42:56+00:00
ci: ensure that all non-i386 pipelines do parallel xz compression

We can safely enable parallel xz compression for non-i386 pipelines.
However, previously we didn't export XZ_OPT, so the xz process won't
see it if XZ_OPT hasn't already been set in the current job.

- - - - -
20432d16 by Cheng Shao at 2023-03-30T18:42:56+00:00
ci: unset CROSS_EMULATOR for js job

- - - - -
4a24dbbe by Cheng Shao at 2023-03-30T18:42:56+00:00
ci: fix lint-testsuite job

The list_broken make target will transitively depend on the
calibrate.out target, which used STAGE1_GHC instead of TEST_HC. It
really should be TEST_HC since that's what get passed in the gitlab CI
config.

- - - - -
cea56ccc by Cheng Shao at 2023-03-30T18:42:56+00:00
ci: use alpine3_17-wasm image for wasm jobs

Bump the ci-images dependency and use the new alpine3_17-wasm docker
image for wasm jobs.

- - - - -
79d0cb32 by Ben Gamari at 2023-03-30T18:43:53+00:00
testsuite/driver: Add basic support for testing cross-compilers

- - - - -
e7392b4e by Ben Gamari at 2023-03-30T18:43:53+00:00
testsuite/driver: Normalize away differences in ghc executable name

- - - - -
ee160d06 by Ben Gamari at 2023-03-30T18:43:53+00:00
hadrian: Pass CROSS_EMULATOR to runtests.py

- - - - -
30c84511 by Cheng Shao at 2023-03-30T18:43:53+00:00
testsuite: don't add optllvm way for wasm32

- - - - -
f1beee36 by Cheng Shao at 2023-03-30T18:43:53+00:00
testsuite: normalize the .wasm extension

- - - - -
a984a103 by Cheng Shao at 2023-03-30T18:43:53+00:00
testsuite: strip the cross ghc prefix in output and error message

- - - - -
f7478d95 by Cheng Shao at 2023-03-30T18:43:53+00:00
testsuite: handle target executable extension

- - - - -
8fe8b653 by Cheng Shao at 2023-03-30T18:43:53+00:00
testsuite: mypy typing error fixes

This patch fixes some mypy typing errors which weren't caught in
previous linting jobs.

- - - - -
0149f32f by Cheng Shao at 2023-03-30T18:43:53+00:00
testsuite: use context variable instead of thread-local variable

This patch changes a thread-local variable to context variable
instead, which works as intended when the testsuite transitions to use
asyncio & coroutines instead of multi-threading to concurrently run
test cases. Note that this also raises the minimum Python version to
3.7.

- - - - -
ea853ff0 by Cheng Shao at 2023-03-30T18:43:53+00:00
testsuite: asyncify the testsuite driver

This patch refactors the testsuite driver, gets rid of multi-threading
logic for running test cases concurrently, and uses asyncio &
coroutines instead. This is not yak shaving for its own sake; the
previous multi-threading logic is prone to livelock/deadlock
conditions for some reason, even if the total number of threads is
bounded to a thread pool's capacity.

The asyncify change is an internal implementation detail of the
testsuite driver and does not impact most GHC maintainers out there.
The patch does not touch the .T files, test cases can be
added/modified the exact same way as before.

- - - - -
0077cb22 by Matthew Pickering at 2023-03-31T21:28:28-04:00
Add test for T23184

There was an outright bug, which Simon fixed in July 2021, as a little side-fix on a complicated patch:

```
commit 6656f0165a30fc2a22208532ba384fc8e2f11b46
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Fri Jul 23 23:57:01 2021 +0100

    A bunch of changes related to eta reduction

    This is a large collection of changes all relating to eta
    reduction, originally triggered by #18993, but there followed
    a long saga.

    Specifics:

...lots of lines omitted...

    Other incidental changes

    * Fix a fairly long-standing outright bug in the ApplyToVal case of
      GHC.Core.Opt.Simplify.mkDupableContWithDmds. I was failing to take the
      tail of 'dmds' in the recursive call, which meant the demands were All
      Wrong.  I have no idea why this has not caused problems before now.
```

Note this "Fix a fairly longstanding outright bug".   This is the specific fix
```
@@ -3552,8 +3556,8 @@ mkDupableContWithDmds env dmds
         --              let a = ...arg...
         --              in [...hole...] a
         -- NB: sc_dup /= OkToDup; that is caught earlier by contIsDupable
-    do  { let (dmd:_) = dmds   -- Never fails
-        ; (floats1, cont') <- mkDupableContWithDmds env dmds cont
+    do  { let (dmd:cont_dmds) = dmds   -- Never fails
+        ; (floats1, cont') <- mkDupableContWithDmds env cont_dmds cont
         ; let env' = env `setInScopeFromF` floats1
         ; (_, se', arg') <- simplArg env' dup se arg
         ; (let_floats2, arg'') <- makeTrivial env NotTopLevel dmd (fsLit "karg") arg'
```
Ticket #23184 is a report of the bug that this diff fixes.

- - - - -
62d25071 by mangoiv at 2023-04-01T04:20:01-04:00
[feat] make ($) representation polymorphic
- this change was approved by the CLC in [1] following a CLC proposal [2]
- make ($) representation polymorphic (adjust the type signature)
- change ($) implementation to allow additional polymorphism
- adjust the haddock of ($) to reflect these changes
- add additional documentation to document these changes
- add changelog entry
- adjust tests (move now succeeding tests and adjust stdout of some
  tests)

[1] https://github.com/haskell/core-libraries-committee/issues/132#issuecomment-1487456854
[2] https://github.com/haskell/core-libraries-committee/issues/132

- - - - -
77c33fb9 by Artem Pelenitsyn at 2023-04-01T04:20:41-04:00
User Guide: update copyright year: 2020->2023

- - - - -
3b5be05a by doyougnu at 2023-04-01T09:42:31-04:00
driver: Unit State Data.Map -> GHC.Unique.UniqMap

In pursuit of #22426. The driver and unit state are major contributors.

This commit also bumps the haddock submodule to reflect the API changes in
UniqMap.

-------------------------
Metric Decrease:
    MultiComponentModules
    MultiComponentModulesRecomp
    T10421
    T10547
    T12150
    T12234
    T12425
    T13035
    T16875
    T18140
    T18304
    T18698a
    T18698b
    T18923
    T20049
    T5837
    T6048
    T9198
-------------------------

- - - - -
a84fba6e by Torsten Schmits at 2023-04-01T09:43:12-04:00
Add structured error messages for GHC.Tc.TyCl

Tracking ticket: #20117

MR: !10183

This converts uses of `mkTcRnUnknownMessage` to newly added constructors
of `TcRnMessage`.

- - - - -
6e2eb275 by doyougnu at 2023-04-01T18:27:56-04:00
JS: Linker: use saturated JExpr

Follow on to MR!10142 in pursuit of #22736

- - - - -
3da69346 by sheaf at 2023-04-01T18:28:37-04:00
Improve haddocks of template-haskell Con datatype

This adds a bit more information, in particular about the lists of
constructors in the GadtC and RecGadtC cases.

- - - - -
3b7bbb39 by sheaf at 2023-04-01T18:28:37-04:00
TH: revert changes to GadtC & RecGadtC

Commit 3f374399 included a breaking-change to the template-haskell
library when it made the GadtC and RecGadtC constructors take non-empty
lists of names. As this has the potential to break many users' packages,
we decided to revert these changes for now.

- - - - -
b316045a by Simon Peyton Jones at 2023-04-01T23:44:40+01:00
Major refactor in the handling of equality constraints

This MR substantially refactors the way in which the constraint
solver deals with equality constraints.  The big thing is:

* Intead of a pipeline in which we /first/ canonicalise and /then/
  interact (the latter including performing unification) the two steps
  are more closely integreated into one.  That avoids the current
  rather indirect communication between the two steps.

The proximate cause for this refactoring is fixing #22194, which involve
solving   [W] alpha[2] ~ Maybe (F beta[4])
by doing this:
          alpha[2] := Maybe delta[2]
          [W] delta[2] ~ F beta[4]
That is, we don't promote beta[4]!  This is very like introducing a cycle
breaker, and was very awkward to do before, but now it is all nice.
See GHC.Tc.Utils.Unify Note [Promotion and level-checking] and
Note [Family applications in canonical constraints].

The big change is this:

* Several canonicalisation checks (occurs-check, cycle-breaking,
  checking for concreteness) are combined into one new function:
     GHC.Tc.Utils.Unify.checkTyEqRhs

  This function is controlled by `TyEqFlags`, which says what to do
  for foralls, type families etc.

* `canEqCanLHSFinish` now sees if unification is possible, and if so,
  actually does it: see `canEqCanLHSFinish_try_unification`.

There are loads of smaller changes:

* The on-the-fly unifier `GHC.Tc.Utils.Unify.unifyType` has a
  cheap-and-cheerful version of `checkTyEqRhs`, called
  `simpleUnifyCheck`.  If `simpleUnifyCheck` succeeds, it can unify,
  otherwise it defers by emitting a constraint. This is simpler than
  before.

* I simplified the swapping code in `GHC.Tc.Solver.Equality.canEqCanLHS`.
  Especially the nasty stuff involving `swap_for_occurs` and
  `canEqTyVarFunEq`.  Much nicer now.  See
      Note [Orienting TyVarLHS/TyFamLHS]
      Note [Orienting TyFamLHS/TyFamLHS]

* Added `cteSkolemOccurs`, `cteConcrete`, and `cteCoercionHole` to the
  problems that can be discovered by `checkTyEqRhs`.

* I fixed #23199 `pickQuantifiablePreds`, which actually allows GHC to
  to accept both cases in #22194 rather than rejecting both.

Yet smaller:

* Added a `synIsConcrete` flag to `SynonymTyCon` (alongside `synIsFamFree`)
  to reduce the need for synonym expansion when checking concreteness.
  Use it in `isConcreteType`.

* Renamed `isConcrete` to `isConcreteType`

* Defined `GHC.Core.TyCo.FVs.isInjectiveInType` as a more efficient
  way to find if a particular type variable is used injectively than
  finding all the injective variables.  It is called in
  `GHC.Tc.Utils.Unify.definitely_poly`, which in turn is used quite a
  lot.

* Moved `rewriterView` to `GHC.Core.Type`, so we can use it from the
  constraint solver.

Fixes #22194, #23199

Compile times decrease by an average of 0.1%; but there is a 7.4%
drop in compiler allocation on T15703.

Metric Decrease:
    T15703

- - - - -
0feb6809 by Simon Peyton Jones at 2023-04-01T23:44:40+01:00
Add some documentation about redundant constraints

- - - - -


30 changed files:

- .gitlab-ci.yml
- .gitlab/ci.sh
- .gitlab/gen_ci.hs
- .gitlab/generate_job_metadata
- .gitlab/generate_jobs
- .gitlab/jobs.yaml
- compiler/GHC/CmmToAsm/Wasm/Utils.hs
- compiler/GHC/Core/Opt/Simplify/Iteration.hs
- compiler/GHC/Core/TyCo/FVs.hs
- compiler/GHC/Core/TyCo/Rep.hs
- compiler/GHC/Core/TyCon.hs
- compiler/GHC/Core/Type.hs
- compiler/GHC/Core/Type.hs-boot
- compiler/GHC/Data/Bag.hs
- compiler/GHC/Data/Maybe.hs
- compiler/GHC/Driver/Make.hs
- compiler/GHC/Hs/Doc.hs
- compiler/GHC/Hs/Expr.hs
- compiler/GHC/HsToCore/Quote.hs
- compiler/GHC/Iface/Recomp.hs
- compiler/GHC/JS/Ppr.hs
- compiler/GHC/JS/Transform.hs
- compiler/GHC/Rename/Env.hs
- compiler/GHC/Rename/HsType.hs
- compiler/GHC/StgToJS/Linker/Linker.hs
- compiler/GHC/StgToJS/Object.hs
- compiler/GHC/StgToJS/Printer.hs
- compiler/GHC/Tc/Errors.hs
- compiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Errors/Types.hs


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/dd615d937a0db7747ef40562f5b3239df79356ed...0feb6809c2c50cfd099c3b5e4b1a2a4d0b24bdb2

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/dd615d937a0db7747ef40562f5b3239df79356ed...0feb6809c2c50cfd099c3b5e4b1a2a4d0b24bdb2
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/20230401/8ecac66c/attachment-0001.html>


More information about the ghc-commits mailing list