Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC
Commits:
-
a18fa3c1
by Cheng Shao at 2026-03-14T05:12:14-04:00
-
3774086e
by Matthew Pickering at 2026-03-14T05:13:00-04:00
-
63ae8eb3
by Andreas Klebinger at 2026-03-14T05:13:43-04:00
-
213d2c0e
by Cheng Shao at 2026-03-14T05:14:28-04:00
-
fc2b083f
by Andreas Klebinger at 2026-03-14T05:15:14-04:00
-
033185be
by Cheng Shao at 2026-03-14T12:27:32-04:00
-
8d578fdd
by Matthew Pickering at 2026-03-14T12:27:33-04:00
16 changed files:
- .gitlab-ci.yml
- .gitlab/generate-ci/gen_ci.hs
- configure.ac
- distrib/configure.ac.in
- hadrian/build-cabal
- libraries/base/changelog.md
- libraries/base/src/GHC/Weak/Finalize.hs
- libraries/ghc-internal/src/GHC/Internal/Control/Exception/Base.hs
- libraries/ghc-internal/src/GHC/Internal/IO.hs
- rts/StgMiscClosures.cmm
- + testsuite/tests/exceptions/T26759.hs
- + testsuite/tests/exceptions/T26759.stderr
- + testsuite/tests/exceptions/T26759a.hs
- + testsuite/tests/exceptions/T26759a.stderr
- + testsuite/tests/exceptions/T26759a.stdout
- testsuite/tests/exceptions/all.T
Changes:
| ... | ... | @@ -11,7 +11,7 @@ variables: |
| 11 | 11 | GIT_SSL_NO_VERIFY: "1"
|
| 12 | 12 | |
| 13 | 13 | # Commit of ghc/ci-images repository from which to pull Docker images
|
| 14 | - DOCKER_REV: 4c3454a524436623df71b5faabd24e30b0f816d5
|
|
| 14 | + DOCKER_REV: 5df428b97c501f61f57587048d4bd15eba53e364
|
|
| 15 | 15 | |
| 16 | 16 | # Sequential version number of all cached things.
|
| 17 | 17 | # Bump to invalidate GitLab CI cache.
|
| ... | ... | @@ -173,7 +173,7 @@ configureArgsStr :: BuildConfig -> String |
| 173 | 173 | configureArgsStr bc = unwords $
|
| 174 | 174 | ["--enable-unregisterised"| unregisterised bc ]
|
| 175 | 175 | ++ ["--disable-tables-next-to-code" | not (tablesNextToCode bc) ]
|
| 176 | - ++ ["--with-intree-gmp" | Just _ <- pure (crossTarget bc) ]
|
|
| 176 | + ++ ["--with-intree-gmp" | Just _ <- [crossTarget bc] ]
|
|
| 177 | 177 | ++ ["--with-system-libffi" | crossTarget bc == Just "wasm32-wasi" ]
|
| 178 | 178 | ++ ["--enable-ipe-data-compression" | withZstd bc ]
|
| 179 | 179 | ++ ["--enable-strict-ghc-toolchain-check"]
|
| ... | ... | @@ -542,9 +542,17 @@ FIND_LLVM_PROG([OPT], [opt], [$LlvmMinVersion], [$LlvmMaxVersion]) |
| 542 | 542 | OptCmd="$OPT"
|
| 543 | 543 | AC_SUBST([OptCmd])
|
| 544 | 544 | |
| 545 | +dnl ** look to see if we have a C compiler using an llvm back end.
|
|
| 546 | +dnl
|
|
| 547 | +FP_CC_LLVM_BACKEND
|
|
| 548 | +AC_SUBST(CcLlvmBackend)
|
|
| 549 | + |
|
| 545 | 550 | dnl ** Which LLVM assembler to use?
|
| 546 | 551 | dnl --------------------------------------------------------------
|
| 547 | 552 | AC_ARG_VAR(LLVMAS,[Use as the path to LLVM's assembler (typically clang) [default=autodetect]])
|
| 553 | +if test "x$CcLlvmBackend" = "xYES" && test -z "$LLVMAS"; then
|
|
| 554 | + LLVMAS="$CC"
|
|
| 555 | +fi
|
|
| 548 | 556 | FIND_LLVM_PROG([LLVMAS], [clang], [$LlvmMinVersion], [$LlvmMaxVersion])
|
| 549 | 557 | LlvmAsCmd="$LLVMAS"
|
| 550 | 558 | AC_SUBST([LlvmAsCmd])
|
| ... | ... | @@ -622,11 +630,6 @@ else |
| 622 | 630 | AC_SUBST([NeedLibatomic],[NO])
|
| 623 | 631 | fi
|
| 624 | 632 | |
| 625 | -dnl ** look to see if we have a C compiler using an llvm back end.
|
|
| 626 | -dnl
|
|
| 627 | -FP_CC_LLVM_BACKEND
|
|
| 628 | -AC_SUBST(CcLlvmBackend)
|
|
| 629 | - |
|
| 630 | 633 | FPTOOLS_SET_C_LD_FLAGS([target],[CFLAGS],[LDFLAGS],[IGNORE_LINKER_LD_FLAGS],[CPPFLAGS])
|
| 631 | 634 | FPTOOLS_SET_C_LD_FLAGS([build],[CONF_CC_OPTS_STAGE0],[CONF_GCC_LINKER_OPTS_STAGE0],[CONF_LD_LINKER_OPTS_STAGE0],[CONF_CPP_OPTS_STAGE0])
|
| 632 | 635 | FPTOOLS_SET_C_LD_FLAGS([target],[CONF_CC_OPTS_STAGE1],[CONF_GCC_LINKER_OPTS_STAGE1],[CONF_LD_LINKER_OPTS_STAGE1],[CONF_CPP_OPTS_STAGE1])
|
| ... | ... | @@ -203,9 +203,17 @@ FIND_LLVM_PROG([OPT], [opt], [$LlvmMinVersion], [$LlvmMaxVersion]) |
| 203 | 203 | OptCmd="$OPT"
|
| 204 | 204 | AC_SUBST([OptCmd])
|
| 205 | 205 | |
| 206 | +dnl ** look to see if we have a C compiler using an llvm back end.
|
|
| 207 | +dnl
|
|
| 208 | +FP_CC_LLVM_BACKEND
|
|
| 209 | +AC_SUBST(CcLlvmBackend)
|
|
| 210 | + |
|
| 206 | 211 | dnl ** Which LLVM assembler to use?
|
| 207 | 212 | dnl --------------------------------------------------------------
|
| 208 | 213 | AC_ARG_VAR(LLVMAS,[Use as the path to LLVM's assembler (typically clang) [default=autodetect]])
|
| 214 | +if test "x$CcLlvmBackend" = "xYES" && test -z "$LLVMAS"; then
|
|
| 215 | + LLVMAS="$CC"
|
|
| 216 | +fi
|
|
| 209 | 217 | FIND_LLVM_PROG([LLVMAS], [clang], [$LlvmMinVersion], [$LlvmMaxVersion])
|
| 210 | 218 | LlvmAsCmd="$LLVMAS"
|
| 211 | 219 | AC_SUBST([LlvmAsCmd])
|
| ... | ... | @@ -23,52 +23,9 @@ fi |
| 23 | 23 | CABVERSTR=$("$CABAL" --numeric-version)
|
| 24 | 24 | CABVER=( ${CABVERSTR//./ } )
|
| 25 | 25 | |
| 26 | -THREADS="-j1"
|
|
| 27 | -GC_THREADS=""
|
|
| 28 | -SEMAPHORE=""
|
|
| 29 | - |
|
| 30 | -echo "$@"
|
|
| 31 | - |
|
| 32 | -# Try building hadrian in parallel. We check for -j<n>.
|
|
| 33 | -# If threads > 1 we pass --semaphore to allow ghc to build more than one module in parallel
|
|
| 34 | -# If threads > 4 we pass -qn as higher parallel gc thread counts can lead to slow downs
|
|
| 35 | -# We only do any of thise for cabal >= 3.14, because I don't trust older versions to handle --semaphore right
|
|
| 36 | -if [ "${CABVER[0]}" -gt 3 ] || [ "${CABVER[0]}" -eq 3 -a "${CABVER[1]}" -ge 14 ];
|
|
| 37 | -then
|
|
| 38 | - |
|
| 39 | - for arg in "$@"; do
|
|
| 40 | - case "$arg" in
|
|
| 41 | - -j)
|
|
| 42 | - GC_THREADS="-qn4"
|
|
| 43 | - SEMAPHORE="--semaphore"
|
|
| 44 | - THREADS="-j"
|
|
| 45 | - ;;
|
|
| 46 | - -j[0-9]*)
|
|
| 47 | - threads="${arg#-j}"
|
|
| 48 | - if [[ "$threads" =~ ^[0-9]+$ ]] && [ "$threads" -ne 0 ]; then
|
|
| 49 | - THREADS="-j${threads}"
|
|
| 50 | - if [ $threads -ge 4 ]; then
|
|
| 51 | - GC_THREADS="-qn4"
|
|
| 52 | - fi
|
|
| 53 | - if [ $threads -gt 1 ]; then
|
|
| 54 | - SEMAPHORE="--semaphore"
|
|
| 55 | - fi
|
|
| 56 | - fi
|
|
| 57 | - ;;
|
|
| 58 | - esac
|
|
| 59 | - |
|
| 60 | - done
|
|
| 61 | - |
|
| 62 | -fi
|
|
| 63 | - |
|
| 64 | -if [ "$(uname -s)" = "FreeBSD" ]; then
|
|
| 65 | - # Can't rely on posix semaphore support in free bsd.
|
|
| 66 | - SEMAPHORE=""
|
|
| 67 | -fi
|
|
| 68 | - |
|
| 69 | 26 | if [ "${CABVER[0]}" -gt 2 -o "${CABVER[0]}" -eq 2 -a "${CABVER[1]}" -ge 2 ];
|
| 70 | 27 | then
|
| 71 | - "$CABAL" --project-file="$PROJ" new-build "${CABFLAGS[@]}" ${THREADS} ${SEMAPHORE} --ghc-options="+RTS ${GC_THREADS} -RTS" exe:hadrian
|
|
| 28 | + "$CABAL" --project-file="$PROJ" new-build "${CABFLAGS[@]}" -j exe:hadrian
|
|
| 72 | 29 | # use new-exec instead of new-run to make sure that the build-tools (alex & happy) are in PATH
|
| 73 | 30 | "$CABAL" --project-file="$PROJ" new-exec "${CABFLAGS[@]}" hadrian -- \
|
| 74 | 31 | --directory "$PWD" \
|
| ... | ... | @@ -27,6 +27,7 @@ |
| 27 | 27 | * Evaluate backtraces for "error" exceptions at the moment they are thrown. ([CLC proposal #383](https://github.com/haskell/core-libraries-committee/issues/383))
|
| 28 | 28 | * Hide implementation details when throwing exceptions in throw and throwSTM. ([CLC proposal #387](https://github.com/haskell/core-libraries-committee/issues/387))
|
| 29 | 29 | * Change `hIsReadable` and `hIsWritable` such that they always throw a respective exception when encountering a closed or semi-closed handle, not just in the case of a file handle. ([CLC proposal #371](github.com/haskell/core-libraries-committee/issues/371))
|
| 30 | + * Annotate `onException` continuation with `WhileHandling`. ([CLC Proposal #397](https://github.com/haskell/core-libraries-committee/issues/397))
|
|
| 30 | 31 | |
| 31 | 32 | ## 4.22.0.0 *TBA*
|
| 32 | 33 | * Shipped with GHC 9.14.1
|
| ... | ... | @@ -16,12 +16,9 @@ import GHC.Internal.Weak.Finalize |
| 16 | 16 | |
| 17 | 17 | import GHC.Internal.Base
|
| 18 | 18 | import GHC.Internal.Exception
|
| 19 | -import GHC.Internal.IORef
|
|
| 20 | -import GHC.Internal.Conc.Sync (labelThreadByteArray#, myThreadId)
|
|
| 21 | -import GHC.Internal.IO (catchException, unsafePerformIO)
|
|
| 19 | +import GHC.Internal.IO (catchException)
|
|
| 22 | 20 | import GHC.Internal.IO.Handle.Types (Handle)
|
| 23 | 21 | import GHC.Internal.IO.Handle.Text (hPutStrLn)
|
| 24 | -import GHC.Internal.Encoding.UTF8 (utf8EncodeByteArray#)
|
|
| 25 | 22 | |
| 26 | 23 | |
| 27 | 24 | {-# DEPRECATED runFinalizerBatch
|
| ... | ... | @@ -203,7 +203,7 @@ tryJust p a = catchJust p (Right `fmap` a) (return . Left) |
| 203 | 203 | -- exception raised by the computation.
|
| 204 | 204 | onException :: IO a -> IO b -> IO a
|
| 205 | 205 | onException io what = io `catchNoPropagate` \e -> do
|
| 206 | - _ <- what
|
|
| 206 | + _ <- annotateIO (whileHandling e) what
|
|
| 207 | 207 | rethrowIO (e :: ExceptionWithContext SomeException)
|
| 208 | 208 | |
| 209 | 209 | -----------------------------------------------------------------------------
|
| ... | ... | @@ -52,7 +52,7 @@ module GHC.Internal.IO ( |
| 52 | 52 | import GHC.Internal.Base
|
| 53 | 53 | import GHC.Internal.ST
|
| 54 | 54 | import GHC.Internal.Exception
|
| 55 | -import GHC.Internal.Exception.Type (NoBacktrace(..), WhileHandling(..), HasExceptionContext, ExceptionWithContext(..))
|
|
| 55 | +import GHC.Internal.Exception.Type (NoBacktrace(..), whileHandling, WhileHandling(..), HasExceptionContext, ExceptionWithContext(..))
|
|
| 56 | 56 | import GHC.Internal.Show
|
| 57 | 57 | import GHC.Internal.IO.Unsafe
|
| 58 | 58 | import GHC.Internal.Unsafe.Coerce ( unsafeCoerce )
|
| ... | ... | @@ -363,7 +363,7 @@ getMaskingState = IO $ \s -> |
| 363 | 363 | |
| 364 | 364 | onException :: IO a -> IO b -> IO a
|
| 365 | 365 | onException io what = io `catchExceptionNoPropagate` \e -> do
|
| 366 | - _ <- what
|
|
| 366 | + _ <- annotateIO (whileHandling e) what
|
|
| 367 | 367 | rethrowIO (e :: ExceptionWithContext SomeException)
|
| 368 | 368 | |
| 369 | 369 | -- | Executes an IO computation with asynchronous
|
| ... | ... | @@ -47,6 +47,7 @@ import CLOSURE stg_ret_v_info; |
| 47 | 47 | /* See Note [Original thunk info table frames] in GHC.StgToCmm.Bind. */
|
| 48 | 48 | INFO_TABLE_RET (stg_orig_thunk_info_frame, RET_SMALL,
|
| 49 | 49 | W_ info_ptr,
|
| 50 | + PROF_HDR_FIELDS(W_, p1, p2)
|
|
| 50 | 51 | W_ thunk_info_ptr)
|
| 51 | 52 | /* no args => explicit stack */
|
| 52 | 53 | {
|
| 1 | +import Control.Exception
|
|
| 2 | + |
|
| 3 | +run :: IO ()
|
|
| 4 | +run = failingAction `onException` failingCleanup
|
|
| 5 | + where
|
|
| 6 | + failingAction = throwIO (ErrorCall "outer failure")
|
|
| 7 | + failingCleanup = throwIO (ErrorCall "cleanup failure")
|
|
| 8 | + |
|
| 9 | +main :: IO ()
|
|
| 10 | +main = run |
| 1 | +T26759: Uncaught exception ghc-internal:GHC.Internal.Exception.ErrorCall:
|
|
| 2 | + |
|
| 3 | +cleanup failure
|
|
| 4 | + |
|
| 5 | +While handling outer failure
|
|
| 6 | + |
|
| 7 | +HasCallStack backtrace:
|
|
| 8 | + throwIO, called at T26759.hs:7:22 in main:Main
|
|
| 9 | + |
| 1 | +import Control.Exception
|
|
| 2 | + |
|
| 3 | +run :: IO ()
|
|
| 4 | +run = failingAction `onException` cleanup
|
|
| 5 | + where
|
|
| 6 | + failingAction = throwIO (ErrorCall "outer failure")
|
|
| 7 | + cleanup = putStrLn "cleanup"
|
|
| 8 | + |
|
| 9 | +main :: IO ()
|
|
| 10 | +main = run |
| 1 | +T26759a: Uncaught exception ghc-internal:GHC.Internal.Exception.ErrorCall:
|
|
| 2 | + |
|
| 3 | +outer failure
|
|
| 4 | + |
|
| 5 | +HasCallStack backtrace:
|
|
| 6 | + throwIO, called at T26759a.hs:6:21 in main:Main
|
|
| 7 | + |
| 1 | +cleanup |
| 1 | 1 | test('T25052', normal, compile_and_run, [''])
|
| 2 | - |
|
| 2 | +test('T26759', exit_code(1), compile_and_run, [''])
|
|
| 3 | +test('T26759a', exit_code(1), compile_and_run, ['']) |