[Git][ghc/ghc][wip/T24040-ghci-timeout] 48 commits: Only exit ghci in -e mode when :add command fails

Hassan Al-Awwadi (@hassan.awwadi) gitlab at gitlab.haskell.org
Thu Dec 21 21:18:05 UTC 2023



Hassan Al-Awwadi pushed to branch wip/T24040-ghci-timeout at Glasgow Haskell Compiler / GHC


Commits:
07f2b19a by Claudio Bley at 2023-12-21T22:17:43+01:00
Only exit ghci in -e mode when :add command fails

Previously, when running `ghci -e ':add Sample.hs'` the process would
exit with exit code 1 if the file exists and could be loaded.

Fixes #24115

- - - - -
433f0e9e by Vladislav Zavialov at 2023-12-21T22:17:44+01:00
T2T in Patterns (#23739)

This patch implements the T2T (term-to-type) transformation in patterns.
Patterns that are checked against a visible forall can now be written
without the `type` keyword:

	  \(type t) (x :: t) -> ...   -- old
	  \t (x :: t) -> ...          -- new

The `t` binder is parsed and renamed as a term pattern (Pat), but
then undergoes a conversion to a type pattern (HsTyPat).
See the new function pat_to_type_pat in compiler/GHC/Tc/Gen/Pat.hs

- - - - -
5c6a63cd by Sebastian Graf at 2023-12-21T22:17:44+01:00
Pmc: Fix SrcLoc and warning for incomplete irrefutable pats (#24234)

Before, the source location would point at the surrounding function definition,
causing the confusion in #24234.
I also took the opportunity to introduce a new `LazyPatCtx :: HsMatchContext _`
to make the warning message say "irrefutable pattern" instead of "pattern
binding".

- - - - -
33dc95ab by Matthew Pickering at 2023-12-21T22:17:44+01:00
libraries: Bump filepath to 1.4.200.1 and unix to 2.8.4.0

Updates filepath submodule
Updates unix submodule

Fixes #24240

- - - - -
1d548d0f by Matthew Pickering at 2023-12-21T22:17:44+01:00
Submodule linter: Allow references to tags

We modify the submodule linter so that if the bumped commit is a
specific tag then the commit is accepted.

Fixes #24241

- - - - -
a257f339 by Zubin Duggal at 2023-12-21T22:17:44+01:00
hadrian: set -Wno-deprecations for directory and Win32

The filepath bump to 1.4.200.1 introduces a deprecation warning.

See https://gitlab.haskell.org/ghc/ghc/-/issues/24240
    https://github.com/haskell/filepath/pull/206

- - - - -
054cde6a by Sylvain Henry at 2023-12-21T22:17:44+01:00
Zap OccInfo on case binders during StgCse #14895 #24233

StgCse can revive dead binders:

  case foo of dead { Foo x y -> Foo x y; ... }
  ===>
  case foo of dead { Foo x y -> dead; ... } -- dead is no longer dead

So we must zap occurrence information on case binders.

Fix #14895 and #24233

- - - - -
69f5714c by Sebastian Graf at 2023-12-21T22:17:44+01:00
Cpr: Turn an assertion into a check to deal with some dead code (#23862)

See the new `Note [Dead code may contain type confusions]`.

Fixes #23862.

- - - - -
4394ff51 by Zubin Duggal at 2023-12-21T22:17:44+01:00
testsuite: add test for #23944

- - - - -
5950d6ae by Zubin Duggal at 2023-12-21T22:17:44+01:00
driver: Only run a dynamic-too pipeline if object files are going to be generated

Otherwise we run into a panic in hscMaybeWriteIface: "Unexpected DT_Dyn state
when writing simple interface" when dynamic-too is enabled

We could remove the panic and just write the interface even if the state is `DT_Dyn`,
but it seems pointless to run the pipeline twice when `hscMaybeWriteIface` is already
designed to write both `hi` and `dyn_hi` files if dynamic-too is enabled.

Fixes #23944.

- - - - -
96ef225f by Simon Peyton Jones at 2023-12-21T22:17:44+01:00
Improve duplicate elimination in SpecConstr

This partially fixes #24229.

See the new Note [Pattern duplicate elimination] in SpecConstr

- - - - -
51678d12 by Simon Peyton Jones at 2023-12-21T22:17:44+01:00
Make SpecConstr deal with casts better

This patch does two things, to fix #23209:

* It improves SpecConstr so that it no longer quantifies over
  coercion variables.  See Note [SpecConstr and casts]

* It improves the rule matcher to deal nicely with the case where
  the rule does not quantify over coercion variables, but the the
  template has a cast in it.  See Note [Casts in the template]

- - - - -
375e5fb0 by Zubin Duggal at 2023-12-21T22:17:44+01:00
driver: Don't lose track of nodes when we fail to resolve cycles

The nodes that take part in a cycle should include both hs-boot and hs files,
but when we fail to resolve a cycle, we were only counting the nodes from the
graph without boot files.

Fixes #24196

- - - - -
1bf7ce0e by Zubin Duggal at 2023-12-21T22:17:44+01:00
testsuite: Skip MultiLayerModulesTH_OneShot on darwin

See #24177

- - - - -
0cdf9ad0 by Wendao Lee at 2023-12-21T22:17:44+01:00
docs(Data.Char):Add more detailed descriptions for some functions

Related changed function's docs:

-GHC.Unicode.isAlpha
-GHC.Unicode.isPrint
-GHC.Unicode.isAlphaNum

Add more details for what the function will return.

Co-authored-by: Bodigrim <andrew.lelechenko at gmail.com>

- - - - -
a298a035 by Malik Ammar Faisal at 2023-12-21T22:17:44+01:00
Fix float parsing in GHC Cmm Lexer

Add test case for bug #24224

- - - - -
6e245657 by Simon Peyton Jones at 2023-12-21T22:17:44+01:00
Take care when simplifying unfoldings

This MR fixes a very subtle bug exposed by #24242.

See Note [Environment for simplLetUnfolding].

I also updated a bunch of Notes on shadowing

- - - - -
5c43dbca by Simon Peyton Jones at 2023-12-21T22:17:44+01:00
Comments only in FloatIn

Relevant to #3458

- - - - -
5d72e6d6 by Simon Peyton Jones at 2023-12-21T22:17:44+01:00
Comments only in SpecConstr

- - - - -
2f7c1015 by Simon Peyton Jones at 2023-12-21T22:17:44+01:00
Add test for #22238

- - - - -
19c37ec8 by Vladislav Zavialov at 2023-12-21T22:17:44+01:00
Make forall a keyword (#23719)

Before this change, GHC used to accept `forall` as a term-level
identifier:

	-- from constraints-0.13
	forall :: forall p. (forall a. Dict (p a)) -> Dict (Forall p)
	forall d = ...

Now it is a parse error.

The -Wforall-identifier warning has served its purpose and is now
a deprecated no-op.

- - - - -
ca5203dc by Zubin Duggal at 2023-12-21T22:17:44+01:00
driver: Ensure we actually clear the interactive context before reloading

Previously we called discardIC, but immediately after set the session
back to an old HscEnv that still contained the IC

Partially addresses #24107
Fixes #23405

- - - - -
8a11c5b9 by Zubin Duggal at 2023-12-21T22:17:44+01:00
driver: Ensure we force the lookup of old build artifacts before returning the build plan

This prevents us from retaining all previous build artifacts in memory until a
recompile finishes, instead only retaining the exact artifacts we need.

Fixes #24118

- - - - -
bd2b6b55 by Zubin Duggal at 2023-12-21T22:17:44+01:00
testsuite: add test for #24118 and #24107

MultiLayerModulesDefsGhci was not able to catch the leak because it uses
:l which discards the previous environment.

Using :r catches both of these leaks

- - - - -
fdf0288b by Zubin Duggal at 2023-12-21T22:17:44+01:00
compiler: Add some strictness annotations to ImportSpec and related constructors
This prevents us from retaining entire HscEnvs.

Force these ImportSpecs when forcing the GlobalRdrEltX

Adds an NFData instance for Bag

Fixes #24107

- - - - -
c1acf592 by Zubin Duggal at 2023-12-21T22:17:44+01:00
compiler: Force IfGlobalRdrEnv in NFData instance.

- - - - -
0d828c2c by Arnaud Spiwack at 2023-12-21T22:17:44+01:00
LinearTypes => MonoLocalBinds

- - - - -
62e84961 by Arnaud Spiwack at 2023-12-21T22:17:44+01:00
Linear let and where bindings

For expediency, the initial implementation of linear types in GHC
made it so that let and where binders would always be considered
unrestricted. This was rather unpleasant, and probably a big obstacle
to adoption. At any rate, this was not how the proposal was designed.

This patch fixes this infelicity. It was surprisingly difficult to
build, which explains, in part, why it took so long to materialise.

As of this patch, let or where bindings marked with %1 will be
linear (respectively %p for an arbitrary multiplicity p). Unmarked let
will infer their multiplicity.

Here is a prototypical example of program that used to be rejected and
is accepted with this patch:

```haskell
f :: A %1 -> B
g :: B %1 -> C

h :: A %1 -> C
h x = g y
  where
    y = f x
```

Exceptions:
- Recursive let are unrestricted, as there isn't a clear semantics of
  what a linear recursive binding would be.
- Destructive lets with lazy bindings are unrestricted, as their
  desugaring isn't linear (see also #23461).
- (Strict) destructive lets with inferred polymorphic type are
  unrestricted. Because the desugaring isn't linear (See #18461
  down-thread).

Closes #18461 and #18739

Co-authored-by: @jackohughes

- - - - -
21f67232 by Matthew Craven at 2023-12-21T22:17:44+01:00
Introduce `dataToTagSmall#` primop (closes #21710)

...and use it to generate slightly better code when dataToTag#
is used at a "small data type" where there is no need to mess
with "is_too_big_tag" or potentially look at an info table.

Metric Decrease:
    T18304

- - - - -
e368bfea by Matthew Craven at 2023-12-21T22:17:44+01:00
Fix formatting of Note [alg-alt heap check]

- - - - -
70bc307f by Oleg Grenrus at 2023-12-21T22:17:44+01:00
Allow untyped brackets in typed splices and vice versa.

Resolves #24190

Apparently the check was essentially always (as far as I can trace back: d0d47ba76f8f0501cf3c4966bc83966ab38cac27),
and while it does catch some mismatches, the type-checker will catch
them too. OTOH, it prevents writing completely reasonable programs.

- - - - -
f63e3435 by Moritz Angermann at 2023-12-21T22:17:45+01:00
Drop hard Xcode dependency

XCODE_VERSION calls out to `xcodebuild`, which is only available
when having `Xcode` installed. The CommandLineTools are not
sufficient. To install Xcode, you must have an apple id to download
the Xcode.xip from apple.

We do not use xcodebuild anywhere in our build explicilty. At best
it appears to be a proxy for checking the linker or the compiler.
These should rather be done with
```
xcrun ld -version
```
or similar, and not by proxy through Xcode. The CLR should be
sufficient for building software on macOS.

- - - - -
ffea783f by Vladislav Zavialov at 2023-12-21T22:17:45+01:00
docs: update information on RequiredTypeArguments

Update the User's Guide and Release Notes to account for the recent
progress in the implementation of RequiredTypeArguments.

- - - - -
66486b0b by Ben Gamari at 2023-12-21T22:17:45+01:00
rts/eventlog: Fix off-by-one in assertion

Previously we failed to account for the NULL terminator `postString`
asserted that there is enough room in the buffer for the string.

- - - - -
cecb6914 by Ben Gamari at 2023-12-21T22:17:45+01:00
rts/eventlog: Honor result of ensureRoomForVariableEvent is

Previously we would keep plugging along, even if isn't enough room for
the event.

- - - - -
3457b84c by Ben Gamari at 2023-12-21T22:17:45+01:00
rts/eventlog: Avoid truncating event sizes

Previously ensureRoomForVariableEvent would truncate the desired size to
16-bits, resulting in #24197.

Fixes #24197.

- - - - -
b00ae990 by Artin Ghasivand at 2023-12-21T22:17:45+01:00
Remove the "Derived Constraint" argument of TcPluginSolver, docs

- - - - -
73c01041 by Vladislav Zavialov at 2023-12-21T22:17:45+01:00
EPA: Move tokens into GhcPs extension fields (#23447)

Summary of changes

* Remove Language.Haskell.Syntax.Concrete
* Move all tokens into GhcPs extension fields (LHsToken -> EpToken)
* Create new TTG extension fields as needed
* Drop the MultAnn wrapper

Updates the haddock submodule.

Co-authored-by: Alan Zimmerman <alan.zimm at gmail.com>

- - - - -
1ff1b75b by Zubin Duggal at 2023-12-21T22:17:45+01:00
testsuite: use copy_files in T23405

This prevents the tree from being dirtied when the file is modified.

- - - - -
689f2b6d by Bryan Richter at 2023-12-21T22:17:45+01:00
Document ghc package's PVP-noncompliance

This changes nothing, it just makes the status quo explicit.

- - - - -
3784927c by Luite Stegeman at 2023-12-21T22:17:45+01:00
JS: Mark spurious CI failures js_fragile(24259)

This marks the spurious test failures on the JS platform as
js_fragile(24259), so we don't hold up merge requests while
fixing the underlying issues.

See #24259

- - - - -
fd80605e by Finley McIlwaine at 2023-12-21T22:17:45+01:00
Late plugins

- - - - -
0c9cd19c by Finley McIlwaine at 2023-12-21T22:17:45+01:00
withTiming on LateCCs and late plugins

- - - - -
3d20d9e6 by Finley McIlwaine at 2023-12-21T22:17:45+01:00
add test for late plugins

- - - - -
b9d2be76 by Finley McIlwaine at 2023-12-21T22:17:45+01:00
Document late plugins

- - - - -
81e9d5be by Ben Gamari at 2023-12-21T22:17:45+01:00
Fix thunk update ordering

Previously we attempted to ensure soundness of concurrent thunk update
by synchronizing on the access of the thunk's info table pointer field.
This was believed to be sufficient since the indirectee (which may
expose a closure allocated by another core) would not be examined
until the info table pointer update is complete.

However, it turns out that this can result in data races in the presence
of multiple threads racing a update a single thunk. For instance,
consider this interleaving under the old scheme:

            Thread A                             Thread B
            ---------                            ---------
    t=0     Enter t
      1     Push update frame
      2     Begin evaluation

      4     Pause thread
      5     t.indirectee=tso
      6     Release t.info=BLACKHOLE

      7     ... (e.g. GC)

      8     Resume thread
      9     Finish evaluation
      10    Relaxed t.indirectee=x

      11                                         Load t.info
      12                                         Acquire fence
      13                                         Inspect t.indirectee

      14    Release t.info=BLACKHOLE

Here Thread A enters thunk `t` but is soon paused, resulting in `t`
being lazily blackholed at t=6. Then, at t=10 Thread A finishes
evaluation and updates `t.indirectee` with a relaxed store.

Meanwhile, Thread B enters the blackhole. Under the old scheme this
would introduce an acquire-fence but this would only synchronize with
Thread A at t=6. Consequently, the result of the evaluation, `x`, is not
visible to Thread B, introducing a data race.

We fix this by treating the `indirectee` field as we do all other
mutable fields. This means we must always access this field with
acquire-loads and release-stores.

See #23185.

- - - - -
fa61854a by Vladislav Zavialov at 2023-12-21T22:17:45+01:00
docs: Fix link to 051-ghc-base-libraries.rst

The proposal is no longer available at the previous URL.

- - - - -
006aa43b by Hassan Al-Awwadi at 2023-12-21T22:17:45+01:00
comment

- - - - -


30 changed files:

- compiler/GHC/Builtin/PrimOps.hs
- compiler/GHC/Builtin/primops.txt.pp
- compiler/GHC/Cmm/Lexer.x
- compiler/GHC/Core.hs
- compiler/GHC/Core/LateCC.hs
- compiler/GHC/Core/Lint.hs
- compiler/GHC/Core/Opt/CSE.hs
- compiler/GHC/Core/Opt/ConstantFold.hs
- compiler/GHC/Core/Opt/CprAnal.hs
- compiler/GHC/Core/Opt/FloatIn.hs
- compiler/GHC/Core/Opt/Pipeline.hs
- compiler/GHC/Core/Opt/Simplify/Env.hs
- compiler/GHC/Core/Opt/Simplify/Iteration.hs
- compiler/GHC/Core/Opt/Simplify/Utils.hs
- compiler/GHC/Core/Opt/SpecConstr.hs
- compiler/GHC/Core/Rules.hs
- compiler/GHC/Core/SimpleOpt.hs
- compiler/GHC/Core/Subst.hs
- compiler/GHC/Core/TyCo/Subst.hs
- compiler/GHC/Core/Type.hs
- compiler/GHC/Core/Unify.hs
- compiler/GHC/Data/Bag.hs
- compiler/GHC/Driver/Backpack.hs
- compiler/GHC/Driver/Flags.hs
- compiler/GHC/Driver/Main.hs
- compiler/GHC/Driver/Make.hs
- compiler/GHC/Driver/Pipeline.hs
- compiler/GHC/Driver/Plugins.hs
- compiler/GHC/Driver/Session.hs
- compiler/GHC/Hs.hs


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/3ce8637e92cb4f7185a382fa4d72b54533003afa...006aa43b0b3d86e80266bc33776557e9bb23ae69

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/3ce8637e92cb4f7185a382fa4d72b54533003afa...006aa43b0b3d86e80266bc33776557e9bb23ae69
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/20231221/4a88ac75/attachment-0001.html>


More information about the ghc-commits mailing list