[Git][ghc/ghc][wip/romes/exceptions-propagate] 27 commits: Add regression test for #16234
Rodrigo Mesquita (@alt-romes)
gitlab at gitlab.haskell.org
Fri Nov 15 15:40:55 UTC 2024
Rodrigo Mesquita pushed to branch wip/romes/exceptions-propagate at Glasgow Haskell Compiler / GHC
Commits:
fa66fa64 by Ryan Scott at 2024-11-14T19:05:00-05:00
Add regression test for #16234
Issue #16234 was likely fixed by !9765. This adds a regression test to ensure
that it remains fixed.
Fixes #16234.
- - - - -
bfe64df8 by Matthew Pickering at 2024-11-14T19:05:36-05:00
ghc-internal: Update to Unicode 16
This patch updates the automatically generated code for querying unicode
properties to unicode 16.
Fixes #25402
- - - - -
1fd83f86 by Ben Gamari at 2024-11-14T19:06:13-05:00
configure: Accept happy-2.1.2
happy-2.1 was released in late Oct 2024. I have confirmed that master
bootstraps with it. Here we teach configure to accept this tool.
Fixes #25438.
- - - - -
aa58fc5b by Ben Gamari at 2024-11-14T19:06:49-05:00
rts: Tighten up invariants of PACK
- - - - -
8aa4c10a by Ben Gamari at 2024-11-14T19:06:49-05:00
testsuite: Fix badly escaped literals
Use raw string literals to ensure that `\s` is correctly interpreted as
a character class.
- - - - -
0e084029 by Ben Gamari at 2024-11-14T19:06:49-05:00
rts: Improve documentation of SLIDE bytecode instruction
- - - - -
9bf3663b by Ben Gamari at 2024-11-14T19:06:49-05:00
rts/Interpreter: Assert that TEST*_P discriminators are valid
- - - - -
1f668511 by Ben Gamari at 2024-11-14T19:06:49-05:00
rts/Interpreter: Improve documentation of TEST*_P instructions
- - - - -
59e0a770 by Cheng Shao at 2024-11-14T19:07:25-05:00
misc: improve clangd compile_flags.txt flags
This patch improves the compile_flags.txt config used to power clangd
for the rts C codebase. The flags in the file are sampled & deduped
from a real stage1 build with clang-19 and vastly improves the IDE
accuracy when hacking the rts.
For maximum code coverage under the default settings,
compile_flags.txt defaults to threaded+profiled+dynamic+debug way.
This does not mean profdyn needs to be actually built in _build/stage1
for IDE to work. To activate IDE for other RTS ways, simply remove one
of the -D flags at the end of compile_flags.txt and restart clangd.
- - - - -
c2c562e0 by Ben Gamari at 2024-11-14T19:08:01-05:00
testsuite: Don't consider untracked files in dirtiness check
Considering trees containing untracked files as dirty is a bridge too
far. The chance of an untracked file significantly affecting measured
performanced metrics is quite small whereas not collecting measurements
is quite inconvenient for some workflows. We now ignore untracked files
in the dirtiness check.
Fixes #25471.
- - - - -
ed2ed6c5 by Cheng Shao at 2024-11-14T19:08:37-05:00
testsuite: add regression test T25473
This commit adds regression test T25473 marked as broken due to #25473.
It will be fixed in the subsequent commit.
- - - - -
bd0a8b7e by Cheng Shao at 2024-11-14T19:08:37-05:00
wasm: fix foreign import javascript "wrapper" in TH/ghci
This patch fixes foreign import javascript "wrapper" in wasm backend's
TH/ghci by fixing the handling of dyld/finalization_registry magic
variables. Fixes T25473 and closes #25473.
- - - - -
f1b0bc32 by Ben Gamari at 2024-11-14T19:09:13-05:00
rts/linker: Make FreeBSD declarations proper prototypes
The iconv declarations for FreeBSD were previously not prototypes,
leading to warnings.
- - - - -
086cbbc1 by Ben Gamari at 2024-11-14T19:09:13-05:00
base: Drop redundant import in FreeBSD ExecutablePath implementation
- - - - -
79ecd199 by Ben Gamari at 2024-11-14T19:09:13-05:00
compiler: Fix partial selector warnings in GHC.Runtime.Heap.Inspect
- - - - -
1acb73bf by Andrew Lelechenko at 2024-11-15T06:10:47-05:00
gitlab: mention CLC in MR template
- - - - -
8f2e0832 by Ben Gamari at 2024-11-15T06:11:24-05:00
rts: Allow use of GNU-stack notes on FreeBSD
Previously we gated use of GNU-style non-executable stack notes to only
apply on Linux. However, these are also supported by FreeBSD, which also
uses ELF. Fix this.
Fixes #25475.
- - - - -
eafc5693 by Matthew Pickering at 2024-11-15T11:50:41+00: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>
- - - - -
9e9d84d7 by Rodrigo Mesquita at 2024-11-15T11:50:41+00: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
- - - - -
27f026eb by Rodrigo Mesquita at 2024-11-15T11:50:41+00: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.
- - - - -
7377abb3 by Rodrigo Mesquita at 2024-11-15T11:50:41+00: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
- - - - -
d6fe906f by Rodrigo Mesquita at 2024-11-15T11:50:41+00:00
Freeze call stack in error throwing functions
CLC proposal#285
- - - - -
9769c661 by Rodrigo Mesquita at 2024-11-15T11:50:42+00: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.
- - - - -
306943c0 by Rodrigo Mesquita at 2024-11-15T11:50:42+00: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.
- - - - -
2e42f3a5 by Rodrigo Mesquita at 2024-11-15T15:40:13+00: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.
-------------------------
Metric Decrease:
MultiLayerModulesRecomp
MultiLayerModulesTH_OneShot
-------------------------
- - - - -
a6f5a400 by Rodrigo Mesquita at 2024-11-15T15:40:13+00:00
base: Add to changelog.md CLC #285
- - - - -
27e03dfd by Rodrigo Mesquita at 2024-11-15T15:40:13+00: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.
- - - - -
30 changed files:
- .gitlab/merge_request_templates/Default.md
- compile_flags.txt
- compiler/GHC/ByteCode/Instr.hs
- compiler/GHC/Runtime/Heap/Inspect.hs
- compiler/GHC/Utils/Panic/Plain.hs
- ghc/GHCi/UI/Monad.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
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/b90841fb2d8e9a00394db75e762440194d3549e8...27e03dfd2f6c5c9442a1518ce8c1ed1a78daa833
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/b90841fb2d8e9a00394db75e762440194d3549e8...27e03dfd2f6c5c9442a1518ce8c1ed1a78daa833
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/20241115/c78488bb/attachment-0001.html>
More information about the ghc-commits
mailing list