diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4de79065..00049581 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - ghc: ['9.12', '9.10', '9.8', '9.6', '9.4', '9.2', '9.0', '8.10', '8.8'] + ghc: ['9.14', '9.12', '9.10', '9.8', '9.6', '9.4', '9.2', '9.0', '8.10', '8.8'] include: - os: windows-latest - os: macOS-latest diff --git a/CHANGES.txt b/CHANGES.txt index c83d769f..9c37a3d9 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,5 +1,6 @@ Changelog for Shake (* = breaking change) + Test with GHC 9.14, preserving exception call stacks on GHC 9.12 and later 0.19.9, released 2026-01-19 Test with GHC 9.12, improving some errors 0.19.8, released 2024-01-14 diff --git a/shake.cabal b/shake.cabal index 4d686e78..9ade8d19 100644 --- a/shake.cabal +++ b/shake.cabal @@ -30,7 +30,7 @@ description: (e.g. compiler version). homepage: https://shakebuild.com bug-reports: https://github.com/ndmitchell/shake/issues -tested-with: GHC==9.12, GHC==9.10, GHC==9.8, GHC==9.6, GHC==9.4, GHC==9.2, GHC==9.0, GHC==8.10, GHC==8.8 +tested-with: GHC==9.14, GHC==9.12, GHC==9.10, GHC==9.8, GHC==9.6, GHC==9.4, GHC==9.2, GHC==9.0, GHC==8.10, GHC==8.8 extra-doc-files: CHANGES.txt README.md diff --git a/src/General/Extra.hs b/src/General/Extra.hs index 9b511f82..0854d666 100644 --- a/src/General/Extra.hs +++ b/src/General/Extra.hs @@ -27,6 +27,10 @@ module General.Extra( ) where import Control.Exception.Extra +#if __GLASGOW_HASKELL__ >= 912 +import Control.Exception.Backtrace +import Control.Exception.Context +#endif import Data.Char import Data.List.Extra import System.Environment @@ -287,10 +291,16 @@ parseCallStack = reverse . map trimStart . drop1 . lines callStackFull = parseCallStack $ prettyCallStack $ popCallStack callStack -#if __GLASGOW_HASKELL__ < 912 +#if __GLASGOW_HASKELL__ >= 912 +-- GHC 9.12 moved call stacks from ErrorCall into exception annotations. +callStackFromException e = (concatMap parseBacktraces $ getExceptionAnnotations $ someExceptionContext e, e) + where + parseBacktraces = reverse . map trimStart . takeWhile (" " `isPrefixOf`) . drop1 . + dropWhile (/= "HasCallStack backtrace:") . lines . displayBacktraces +#else callStackFromException e | Just (ErrorCallWithLocation msg loc) <- fromException e = (parseCallStack loc, toException $ ErrorCall msg) -#endif callStackFromException e = ([], e) +#endif ---------------------------------------------------------------------