[Git][ghc/ghc][wip/marge_bot_batch_merge_job] 26 commits: compiler: Turn `FinderCache` into a record of operations so that GHC API clients can

Marge Bot (@marge-bot) gitlab at gitlab.haskell.org
Thu Jul 4 05:43:12 UTC 2024



Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC


Commits:
8c5ff69d by Zubin Duggal at 2024-07-04T01:42:26-04:00
compiler: Turn `FinderCache` into a record of operations so that GHC API clients can
have full control over how its state is managed by overriding `hsc_FC`.

Also removes the `uncacheModule` function as this wasn't being used by anything
since 1893ba12fe1fa2ade35a62c336594afcd569736e

Fixes #23604

- - - - -
11797a4c by Teo Camarasu at 2024-07-04T01:42:27-04:00
Add HasCallStack to T23221

This makes the test a bit easier to debug

- - - - -
a3db151b by Teo Camarasu at 2024-07-04T01:42:27-04:00
rts: use live words to estimate heap size

We use live words rather than live blocks to determine the size of the
heap for determining memory retention.

Most of the time these two metrics align, but they can come apart in
normal usage when using the nonmoving collector.

The nonmoving collector leads to a lot of partially occupied blocks. So,
using live words is more accurate.

They can also come apart when the heap is suffering from high levels
fragmentation caused by small pinned objects, but in this case, the
block size is the more accurate metric. Since this case is best avoided
anyway. It is ok to accept the trade-off that we might try (and
probably) fail to return more memory in this case.

See also the Note [Statistics for retaining memory]

Resolves #23397

- - - - -
ae6bd177 by Oleg Grenrus at 2024-07-04T01:42:29-04:00
Add reflections of GHC.TypeLits/Nats type families

-------------------------
Metric Increase:
    ghc_experimental_dir
    ghc_experimental_so
-------------------------

- - - - -
62b4db4d by Teo Camarasu at 2024-07-04T01:42:30-04:00
Deprecate PrimTyConI

- We produce `TyConI` for types where we used to use `PrimTyConI`.
- We add a deprecation warning to `PrimTyConI`
- We add a test case to ensure we can actually reify primitive types.

Resolves #24031

- - - - -
42ebebae by Adam Gundry at 2024-07-04T01:42:32-04:00
Correct -Wpartial-fields warning to say "Definition" rather than "Use"

Fixes #24710.  The message and documentation for `-Wpartial-fields` were
misleading as (a) the warning occurs at definition sites rather than use
sites, and (b) the warning relates to the definition of a field independently
of the selector function (e.g. because record updates are also partial).

- - - - -
c67bcdeb by Max Ulidtko at 2024-07-04T01:42:34-04:00
GHCi: Support local Prelude

Fixes #10920, an issue where GHCi bails out when started alongside a
file named Prelude.hs or Prelude.lhs (even empty file suffices).

The in-source Note [GHCi and local Preludes] documents core reasoning.

Supplementary changes:

 * add debug traces for module lookups under -ddump-if-trace;
 * drop stale comment in GHC.Iface.Load;
 * reduce noise in -v3 traces from GHC.Utils.TmpFs;
 * new test, which also exercizes HomeModError.

- - - - -
cfa2fe6c by Ryan Scott at 2024-07-04T01:42:34-04:00
Add missing gParPat in cvtp's ViewP case

When converting a `ViewP` using `cvtp`, we need to ensure that the view pattern
is parenthesized so that the resulting code will parse correctly when
roundtripped back through GHC's parser.

Fixes #24894.

- - - - -
c3e3f3e3 by Adam Gundry at 2024-07-04T01:42:35-04:00
Use structured error representation for module cycle errors (see #18516)

This removes the re-export of cyclicModuleErr from the top-level GHC module.

- - - - -
9c8eee76 by Adam Gundry at 2024-07-04T01:42:35-04:00
Use structured error representation when reloading a nonexistent module

- - - - -
13babc80 by sheaf at 2024-07-04T01:42:35-04:00
Use structured errors for a Backpack instantiation error

- - - - -
55a994e9 by sheaf at 2024-07-04T01:42:35-04:00
Move mkFileSrcSpan to GHC.Unit.Module.Location

- - - - -
34fb0770 by Adriaan Leijnse at 2024-07-04T01:42:35-04:00
ttg: Remove SourceText from OverloadedLabel

Progress towards #21592

- - - - -
6760cc17 by Alexander Foremny at 2024-07-04T01:42:35-04:00
AST: GHC.Prelude -> Prelude

Refactor occurrences to GHC.Prelude with Prelude within
Language/Haskell.

Progress towards #21592

- - - - -
0d5055d1 by Alexander Foremny at 2024-07-04T01:42:35-04:00
AST: remove occurrences of GHC.Unit.Module.ModuleName

`GHC.Unit.Module` re-exports `ModuleName` from
`Language.Haskell.Syntax.Module.Name`.

Progress towards #21592

- - - - -
2ee431c9 by Fabian Kirchner at 2024-07-04T01:42:35-04:00
AST: move Data instance definition for ModuleName to GHC.Unit.Types

To remove the dependency on GHC.Utils.Misc inside
Language.Haskell.Syntax.Module.Name, the instance definition is moved
from there into GHC.Unit.Types.

Progress towards #21592

- - - - -
60566ac9 by Fabian Kirchner at 2024-07-04T01:42:36-04:00
AST: move negateOverLitVal into GHC.Hs.Lit

The function negateOverLitVal is not used within Language.Haskell and
therefore can be moved to the respective module inside GHC.Hs.

Progress towards #21592

- - - - -
c798fd05 by Fabian Kirchner at 2024-07-04T01:42:36-04:00
AST: move conDetailsArity into GHC.Rename.Module

The function conDetailsArity is only used inside GHC.Rename.Module.  We
therefore move it there from Language.Haskell.Syntax.Lit.

Progress towards #21592

- - - - -
3ee03a0b by Mauricio at 2024-07-04T01:42:36-04:00
AST: Remove GHC.Utils.Assert from GHC

Simple cleanup.

Progress towards #21592

- - - - -
895d4920 by Fabian Kirchner at 2024-07-04T01:42:36-04:00
ttg: extract Specificity, ForAllTyFlag and helper functions from GHC.Types.Var

Progress towards #21592

Specificity, ForAllTyFlag and its' helper functions are extracted from
GHC.Types.Var and moved into a new module Language.Haskell.Syntax.Specificity.

Note: Eventually (i.e. after Language.Haskell.Syntax.Decls does not depend on
GHC.* anymore) these should be moved into Language.Haskell.Syntax.Decls.
At this point, this would cause cyclic dependencies.

- - - - -
c364eff3 by Adowrath at 2024-07-04T01:42:36-04:00
ttg: Split HsSrcBang, remove ref to DataCon from Syntax.Type

Progress towards #21592

This splits HsSrcBang up, creating the new HsBang within
`Language.Haskell.Syntax.Basic`. `HsBang` holds the unpackedness
and strictness information, while `HsSrcBang` only adds the SourceText
for usage within the compiler directly.

Inside the AST, to preserve the SourceText, it is hidden behind the
pre-existing extension point `XBindTy`. All other occurrences of
`HsSrcBang` were adapted to deconstruct the inner `HsBang`, and when
interacting with the `BindTy` constructor, the hidden `SourceText` is
extracted/inserted into the `XBindTy` extension point.

`GHC.Core.DataCon` exports both `HsSrcBang` and `HsBang` for
convenience. A constructor function `mkHsSrcBang` that takes all
individual components has been added.

Two exceptions has been made though:
- The `Outputable HsSrcBang` instance is replaced by
  `Outputable HsBang`. While being only GHC-internal, the only place
  it's used is in outputting `HsBangTy` constructors -- which already
  have `HsBang`. It wouldn't make sense to reconstruct a `HsSrcBang` just
  to ignore the `SourceText` anyway.
- The error `TcRnUnexpectedAnnotation` did not use the `SourceText`,
  so it too now only holds a `HsBang`.

- - - - -
1ee677bf by Mauricio at 2024-07-04T01:42:36-04:00
AST: Moved definitions that use GHC.Utils.Panic to GHC namespace

Progress towards #21592

- - - - -
d9366dc7 by Mike Pilgrem at 2024-07-04T01:42:41-04:00
Fix #25032 Refer to Cabal's `includes` field, not `include-files`

- - - - -
6028cf2e by Matthew Pickering at 2024-07-04T01:42:41-04:00
ci: Use nixpkgs-20.04-darwin channel for darwin toolchain

We are currently seeing a couple of errors on darwin machines after I
bumped the toolchain commit.

```
       last 10 log lines:
       >     from .extern.jaraco.text import yield_lines
       >   File "/private/tmp/nix-build-python3.11-setuptools-69.5.1.drv-0/source/setuptools/_vendor/jaraco/text/__init__.py", line 12, in <module>
       >     from setuptools.extern.jaraco.context import ExceptionTrap
       >   File "/private/tmp/nix-build-python3.11-setuptools-69.5.1.drv-0/source/setuptools/_vendor/jaraco/context.py", line 11, in <module>
       >     import urllib.request
       >   File "/nix/store/z3ccgikilqsd1kzjf1sr03wbnjyga4hh-python3-minimal-3.11.9/lib/python3.11/urllib/request.py", line 2656, in <module>
       >     from _scproxy import _get_proxy_settings, _get_proxies
       > ModuleNotFoundError: No module named '_scproxy'
       >
       > ERROR Backend 'setuptools.build_meta' is not available.
```

In theory this channel should be tested so it should work?

- - - - -
a80296a4 by Andrew Lelechenko at 2024-07-04T01:42:42-04:00
base: fix more missing changelog entries

- - - - -
2659e326 by Bryan Richter at 2024-07-04T01:42:42-04:00
Add .gitlab/README.md with creds instructions

- - - - -


30 changed files:

- + .gitlab/README.md
- .gitlab/darwin/nix/sources.json
- compiler/GHC.hs
- compiler/GHC/Builtin/Types.hs
- compiler/GHC/Core/DataCon.hs
- compiler/GHC/Core/TyCo/Rep.hs-boot
- compiler/GHC/CoreToIface.hs
- compiler/GHC/Driver/Errors/Ppr.hs
- compiler/GHC/Driver/Errors/Types.hs
- compiler/GHC/Driver/Make.hs
- compiler/GHC/Driver/MakeFile.hs
- compiler/GHC/Hs/Expr.hs
- compiler/GHC/Hs/Lit.hs
- + compiler/GHC/Hs/Specificity.hs
- compiler/GHC/Hs/Syn/Type.hs
- compiler/GHC/Hs/Type.hs
- compiler/GHC/HsToCore.hs
- compiler/GHC/HsToCore/Expr.hs
- compiler/GHC/HsToCore/Quote.hs
- compiler/GHC/Iface/Env.hs
- compiler/GHC/Iface/Load.hs
- compiler/GHC/IfaceToCore.hs
- compiler/GHC/Parser.y
- compiler/GHC/Parser/PostProcess.hs
- compiler/GHC/Rename/Expr.hs
- compiler/GHC/Rename/Module.hs
- compiler/GHC/Tc/Deriv/Generics.hs
- compiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Errors/Types.hs
- compiler/GHC/Tc/Gen/Splice.hs


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/1024576a4c7107d9e8ede89f5849bb85c30025af...2659e32622ec132739606c1f37d3fd897260a09a

-- 
This project does not include diff previews in email notifications.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/1024576a4c7107d9e8ede89f5849bb85c30025af...2659e32622ec132739606c1f37d3fd897260a09a
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/20240704/0f3703cc/attachment-0001.html>


More information about the ghc-commits mailing list