[Git][ghc/ghc][wip/freebsd] 18 commits: hadrian: Allow haddock options to be passed via key-value settings

Ben Gamari (@bgamari) gitlab at gitlab.haskell.org
Mon Nov 18 16:35:23 UTC 2024



Ben Gamari pushed to branch wip/freebsd at Glasgow Haskell Compiler / GHC


Commits:
26e86984 by Ben Gamari at 2024-11-18T04:05:31-05:00
hadrian: Allow haddock options to be passed via key-value settings

- - - - -
6e68b117 by Matthew Pickering at 2024-11-18T04:06:07-05:00
Exception rethrowing

Basic changes:

* Change `catch` function to propagate exceptions using the
  WhileHandling mechanism.
* Introduce `catchNoPropagate`, which does the same as before, but
  passes an exception which can be rethrown.
* Introduce `rethrowIO` combinator, which rethrows an exception with a
  context and doesn't add a new backtrace.
* Introduce `tryWithContext` for a variant of `try` which can rethrow
  the exception with it's original context.
* onException is modified to rethrow the original error rather than
  creating a new callstack.
* Functions which rethrow in GHC.Internal.IO.Handle.FD,
  GHC.Internal.IO.Handle.Internals, GHC.Internal.IO.Handle.Text, and
  GHC.Internal.System.IO.Error are modified to not add a new callstack.

Implements CLC proposal#202 <https://github.com/haskell/core-libraries-committee/issues/202>

- - - - -
a4e0d235 by Rodrigo Mesquita at 2024-11-18T04:06:07-05:00
exceptions: Improve the message layout as per #285

This commit fixes the layout of the additional information included when
displaying an exception, namely the type of the exception.

It also fixes the default handler's heading message to work well
together with the improved display message of SomeException.

CLC proposal#285

- - - - -
284ffab3 by Rodrigo Mesquita at 2024-11-18T04:06:07-05:00
Display type and callstack of exception on handler

This commit changes the Exception instance of SomeException to *simply*
display the underlying exception in `displayException`. The augmented
exception message that included the type and backtrace of the exception
are now only printed on a call to `displayExceptionWithInfo`.

At a surface level, existing programs should behave the same since the
`uncaughtExceptionHandler`, which is responsible for printing out uncaught
exceptions to the user, will use `displayExceptionWithInfo` by default.

However, unlike the instance's `displayException` method, the
`uncaughtExceptionHandler` can be overriden with
`setUncaughtExceptionHandler`. This makes the extra information opt-in
without fixing it the instance, which can be valuable if your program
wants to display uncaught exceptions to users in a user-facing way
(ie without backtraces).

This is what was originally agreed for CLC#231 or CLC#261 with regard to
the type of the exception information.

The call stack also becoming part of the default handler rather than the
Exception instance is an ammendment to CLC#164.

Discussion of the ammendment is part of CLC#285.

- - - - -
36cddd2c by Rodrigo Mesquita at 2024-11-18T04:06:08-05:00
Remove redundant CallStack from exceptions

Before the exception backtraces proposal was implemented, ErrorCall
accumulated its own callstack via HasCallStack constraints, but
ExceptionContext is now accumulated automatically.

The original ErrorCall mechanism is now redundant and we get a duplicate
CallStack

Updates Cabal submodule to fix their usage of ErrorCallWithLocation to ErrorCall

CLC proposal#285

Fixes #25283

- - - - -
7a74330b by Rodrigo Mesquita at 2024-11-18T04:06:08-05:00
Freeze call stack in error throwing functions

CLC proposal#285

- - - - -
3abf31a4 by Rodrigo Mesquita at 2024-11-18T04:06:08-05:00
De-duplicate displayContext and displayExceptionContext

The former was unused except for one module where it was essentially
re-defining displayExceptionContext.

Moreover, this commit extends the fix from
bfe600f5bb3ecd2c8fa71c536c63d3c46984e3f8 to displayExceptionContext too,
which was missing.

- - - - -
c0d783f8 by Rodrigo Mesquita at 2024-11-18T04:06:08-05:00
Re-export NoBacktrace from Control.Exception

This was originally proposed and accepted in section
    "2.7   Capturing Backtraces on Exceptions"
of the CLC proposal for exception backtraces.

However, the implementation missed this re-export, which this commit now
fixes.

- - - - -
802b5c3e by Rodrigo Mesquita at 2024-11-18T04:06:08-05:00
Fix exception backtraces from GHCi

When running the program with `runhaskell`/`runghc` the backtrace should
match the backtrace one would get by compiling and running the program.
But currently, an exception thrown in a program interpreted with
`runhaskell` will:

    * Not include the original exception backtrace at all
    * Include the backtrace from the internal GHCi/ghc rethrowing of the
      original exception

This commit fixes this divergence by not annotating the ghc(i) backtrace
(with NoBacktrace) and making sure that the backtrace of the original
exception is serialized across the boundary and rethrown with the
appropriate context.

Fixes #25116

The !13301 MR (not this commit in particular) improves performance of
MultiLayerModules. Unfortunately, T3294 regresses on aarch64-linux-deb12
by 1% allocations. Since this patch must be merged for 9.12 ASAP, we
will not be able to investigate the slight regression on this platform
in time.

-------------------------
Metric Decrease:
    MultiLayerModulesRecomp
    MultiLayerModulesTH_OneShot
Metric Increase:
    T3294
-------------------------

- - - - -
3e89eb65 by Rodrigo Mesquita at 2024-11-18T04:06:08-05:00
base: Add to changelog.md CLC #285

- - - - -
d9326a48 by Rodrigo Mesquita at 2024-11-18T04:06:08-05:00
Bump array and stm submodules for testsuite

The testsuites of array and stm had to be updated according to !13301.

Updates submodule array and stm.

- - - - -
325fcb5d by Ben Gamari at 2024-11-18T04:06:45-05:00
rts/adjustor: Clean up code style of Nativei386 adjustor

- - - - -
39bb6e58 by Ben Gamari at 2024-11-18T04:06:45-05:00
rts/adjustor: Fix stack overrun error in Nativei386 adjustor

We were reserving the wrong kind of adjustor context (the generic
`AdjustorContext` used by other adjustor implementations, rather than
the i386-specific `CCallContext`) to return the adjustor context while
freeing, resulting in #25485.

Fixes #25485.

- - - - -
952a1243 by Ben Gamari at 2024-11-18T11:02:59-05:00
rts/linker/Elf: Resolve _GLOBAL_OFFSET_TABLE_

- - - - -
a87638b9 by Ben Gamari at 2024-11-18T11:02:59-05:00
testsuite: Unmark T14028 as broken on FreeBSD

This now appears to pass on FreeBSD 14.

Closes #19723.

- - - - -
8b529d99 by Ben Gamari at 2024-11-18T11:02:59-05:00
rts/linker: Fix out-of-bounds mapping logic

Previously the structure of `mmapInRegion` concealed a subtle bug
concerning handling of `mmap` returning mappings below the beginning of
the desired region. Specifically, we would reset `p = result + bytes`
and then again reset `p = region->start` before looping around for
another iteration. This resulted in an infinite loop on FreeBSD.

Fixes #25492.

- - - - -
a44431ac by Ben Gamari at 2024-11-18T11:02:59-05:00
rts/linker: Clarify debug output

- - - - -
c074af30 by Ben Gamari at 2024-11-18T11:33:47-05:00
gitlab-ci: Migrate FreeBSD runner tag to FreeBSD 14

- - - - -


30 changed files:

- .gitlab/generate-ci/gen_ci.hs
- compiler/GHC/Utils/Panic/Plain.hs
- ghc/GHCi/UI/Monad.hs
- hadrian/doc/user-settings.md
- hadrian/src/Flavour.hs
- libraries/array
- libraries/base/changelog.md
- libraries/base/src/Control/Exception.hs
- libraries/base/src/GHC/Exception.hs
- libraries/base/tests/IO/T21336/T21336a.stderr
- libraries/base/tests/IO/T21336/T21336b.stderr
- libraries/base/tests/IO/T4808.stderr
- libraries/base/tests/IO/mkdirExists.stderr
- libraries/base/tests/IO/openFile002.stderr
- libraries/base/tests/IO/openFile002.stderr-mingw32
- libraries/base/tests/IO/withBinaryFile001.stderr
- libraries/base/tests/IO/withBinaryFile002.stderr
- libraries/base/tests/IO/withFile001.stderr
- libraries/base/tests/IO/withFile002.stderr
- libraries/base/tests/IO/withFileBlocking001.stderr
- libraries/base/tests/IO/withFileBlocking002.stderr
- libraries/base/tests/T15349.stderr
- libraries/base/tests/T16111.stderr
- libraries/base/tests/T19288.stderr
- libraries/base/tests/T24807.stderr
- libraries/base/tests/all.T
- libraries/base/tests/assert.stderr
- libraries/base/tests/readFloat.stderr
- − libraries/base/tests/topHandler04.hs
- − libraries/base/tests/topHandler04.stderr


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/e7306479bfd098f454d6379e0c707f869d943931...c074af304ca6d138b8d17b78240cd18f774af61a

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/e7306479bfd098f454d6379e0c707f869d943931...c074af304ca6d138b8d17b78240cd18f774af61a
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/20241118/a1ecac88/attachment-0001.html>


More information about the ghc-commits mailing list