diff --git a/.github/workflows/cabal.yml b/.github/workflows/cabal.yml index 77b32dc..247a8a5 100644 --- a/.github/workflows/cabal.yml +++ b/.github/workflows/cabal.yml @@ -2,30 +2,29 @@ name: cabal on: push: - branches: [ master ] + branches: [ main ] pull_request: branches: [ '*' ] - schedule: - - cron: "00 15 * * *" jobs: build: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 strategy: + fail-fast: false matrix: - ghc: ["8.6", "8.8", "8.10", "9.0"] - cabal: ["3.2"] - cache-version: ["2021-05-21"] + ghc: ["8.6", "8.8", "8.10", "9.0", "9.2", "9.4"] + cabal: ["3.6"] + cache-version: ["2022-10-25"] steps: - uses: actions/checkout@v2 - - uses: haskell/actions/setup@v1 + - uses: haskell/actions/setup@v2 with: ghc-version: ${{ matrix.ghc }} cabal-version: ${{ matrix.cabal }} - name: Cache ~/.cabal/store - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: | ~/.cabal/store diff --git a/haskell-stack-trace-plugin.cabal b/haskell-stack-trace-plugin.cabal index e45fb22..9cb1d0c 100644 --- a/haskell-stack-trace-plugin.cabal +++ b/haskell-stack-trace-plugin.cabal @@ -13,14 +13,14 @@ license: MIT license-file: LICENSE author: Shinya Yamaguchi maintainer: a@wado.dev -copyright: 2018-2021 Shinya Yamaguchi +copyright: 2018-2022 Shinya Yamaguchi category: Compiler Plugin, Development, Debug build-type: Simple extra-source-files: CHANGELOG.md Readme.md -tested-with: GHC ==8.6.5 || ==8.8.4 || ==8.10.4 || ==9.0.1 +tested-with: GHC ==8.6.5 || ==8.8.4 || ==8.10.7 || ==9.0.2 || ==9.2.4 || ==9.4.2 source-repository head type: git @@ -32,13 +32,13 @@ flag dev default: False common common-opts - build-depends: base >=4.12 && <4.16 + build-depends: base >=4.12 && <4.17 default-language: Haskell2010 library import: common-opts hs-source-dirs: src - build-depends: ghc ^>=8.6 || ^>=8.8 || ^>=8.10 || ^>=9.0 + build-depends: ghc ^>=8.6 || ^>=8.8 || ^>=8.10 || ^>=9.0 || ^>=9.2 || ^>=9.4 exposed-modules: StackTrace.Plugin if flag(dev) diff --git a/src/StackTrace/Plugin.hs b/src/StackTrace/Plugin.hs index 8801047..4a360cd 100644 --- a/src/StackTrace/Plugin.hs +++ b/src/StackTrace/Plugin.hs @@ -5,16 +5,17 @@ module StackTrace.Plugin (plugin) where import Control.Arrow (first) import Data.Monoid (Any(Any, getAny)) -import GHC.Types.SrcLoc + #if __GLASGOW_HASKELL__ >= 900 import GHC.Plugins #else - import GhcPlugins #endif + #if __GLASGOW_HASKELL__ >= 810 import GHC.Hs #endif + #if __GLASGOW_HASKELL__ < 810 import HsSyn #endif @@ -57,7 +58,11 @@ ghcStackImport = -- This is for GHC-9 related problems. @noLoc@ causes GHC to throw warnings -- about unused imports. Even if the import is used -- See: https://github.com/waddlaw/haskell-stack-trace-plugin/issues/16 +#if __GLASGOW_HASKELL__ >= 900 srcSpan = RealSrcSpan (realSrcLocSpan $ mkRealSrcLoc "haskell-stack-trace-plugin:very-unique-file-name-to-avoid-collision" 1 1) Nothing +#else + srcSpan = RealSrcSpan (realSrcLocSpan $ mkRealSrcLoc "haskell-stack-trace-plugin:very-unique-file-name-to-avoid-collision" 1 1) +#endif #if __GLASGOW_HASKELL__ >= 900 updateHsModule :: HsModule -> HsModule