mirror of
https://github.com/typeable/haskell-stack-trace-plugin.git
synced 2024-11-12 12:34:40 +03:00
commit
0e206588cd
44
.github/workflows/cabal.yml
vendored
44
.github/workflows/cabal.yml
vendored
@ -2,13 +2,9 @@ name: cabal
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
tags-ignore:
|
||||
- '*'
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches:
|
||||
- '*'
|
||||
branches: [ '*' ]
|
||||
schedule:
|
||||
- cron: "00 15 * * *"
|
||||
|
||||
@ -17,40 +13,32 @@ jobs:
|
||||
runs-on: ubuntu-18.04
|
||||
strategy:
|
||||
matrix:
|
||||
ghc: ["8.6.5", "8.8.1", "8.10.4"]
|
||||
cabal: ["3.0"]
|
||||
ghc: ["8.6", "8.8", "8.10", "9.0"]
|
||||
cabal: ["3.2"]
|
||||
cache-version: ["2021-05-21"]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-haskell@v1
|
||||
- uses: haskell/actions/setup@v1
|
||||
with:
|
||||
ghc-version: ${{ matrix.ghc }}
|
||||
cabal-version: ${{ matrix.cabal }}
|
||||
|
||||
- name: Display ghc & cabal version
|
||||
run: |
|
||||
ghc -V
|
||||
cabal -V
|
||||
|
||||
- name: Cache ~/.cabal/store
|
||||
uses: actions/cache@v1.1.0
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.cabal/store
|
||||
key: ${{ matrix.ghc }}-v0-cabal-store-${{ hashFiles('*.cabal') }}
|
||||
|
||||
- name: Cache dist-newstyle
|
||||
uses: actions/cache@v1.1.0
|
||||
with:
|
||||
path: dist-newstyle
|
||||
key: ${{ matrix.ghc }}-v0-cabal-dist-${{ hashFiles('*.cabal') }}
|
||||
path: |
|
||||
~/.cabal/store
|
||||
dist-newstyle
|
||||
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ matrix.cache-version }}-cabal
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
cabal v2-update
|
||||
cabal v2-configure --disable-optimization --enable-tests --write-ghc-environment-files=always -j2
|
||||
cabal v2-build --only-dependencies
|
||||
cabal update
|
||||
cabal configure --disable-optimization --enable-tests --write-ghc-environment-files=always -j2
|
||||
cabal build --only-dependencies
|
||||
|
||||
- name: Build & Test
|
||||
run: |
|
||||
cabal v2-build --flag dev
|
||||
cabal v2-test --flag dev
|
||||
cabal build --flag dev
|
||||
cabal test --flag dev
|
||||
|
3
.gitignore
vendored
3
.gitignore
vendored
@ -3,4 +3,5 @@ dist-*/
|
||||
.ghc.environment.*
|
||||
cabal.project.local
|
||||
|
||||
*~
|
||||
*~
|
||||
tasks.json
|
@ -2,6 +2,11 @@
|
||||
|
||||
## Unreleased changes
|
||||
|
||||
## 0.1.2.0 -- 2021-05-21
|
||||
|
||||
- Added support for GHC 8.10 [#7](https://github.com/waddlaw/haskell-stack-trace-plugin/pull/7) (@etorreborre)
|
||||
- Added support for GHC 9.0 @waddlaw
|
||||
|
||||
## 0.1.1.1 -- 2020-01-18
|
||||
|
||||
- Allow GHC-8.8.1
|
||||
|
2
LICENSE
2
LICENSE
@ -1,4 +1,4 @@
|
||||
Copyright (c) 2018-2020 Shinya Yamaguchi
|
||||
Copyright (c) 2018-2021 Shinya Yamaguchi
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
|
@ -12,15 +12,15 @@ bug-reports:
|
||||
license: MIT
|
||||
license-file: LICENSE
|
||||
author: Shinya Yamaguchi
|
||||
maintainer: ingronze@gmail.com
|
||||
copyright: 2018-2020 Shinya Yamaguchi
|
||||
maintainer: a@wado.dev
|
||||
copyright: 2018-2021 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.1 || ==8.10.4
|
||||
tested-with: GHC ==8.6.5 || ==8.8.4 || ==8.10.4 || ==9.0.1
|
||||
|
||||
source-repository head
|
||||
type: git
|
||||
@ -32,22 +32,20 @@ flag dev
|
||||
default: False
|
||||
|
||||
common common-opts
|
||||
build-depends: base >=4.12 && <4.15
|
||||
build-depends: base >=4.12 && <4.16
|
||||
default-language: Haskell2010
|
||||
|
||||
library
|
||||
import: common-opts
|
||||
hs-source-dirs: src
|
||||
build-depends: ghc ^>=8.6 || ^>=8.8 || ^>=8.10
|
||||
build-depends: ghc ^>=8.6 || ^>=8.8 || ^>=8.10 || ^>=9.0
|
||||
exposed-modules: StackTrace.Plugin
|
||||
|
||||
if flag(dev)
|
||||
ghc-options:
|
||||
-Wall -Werror -Wcompat -Wincomplete-uni-patterns
|
||||
-Wnoncanonical-monad-instances
|
||||
-Wno-missing-home-modules
|
||||
-Wnoncanonical-monad-instances -Wno-missing-home-modules
|
||||
|
||||
-- -Wincomplete-record-updates
|
||||
else
|
||||
ghc-options: -Wall
|
||||
|
||||
@ -57,11 +55,11 @@ test-suite test
|
||||
hs-source-dirs: test
|
||||
type: exitcode-stdio-1.0
|
||||
build-depends:
|
||||
, bytestring ^>=0.10
|
||||
, hspec ^>=2.7
|
||||
, typed-process ^>=0.2.6
|
||||
, bytestring >=0.10 && <0.12
|
||||
, hspec ^>=2.8
|
||||
, typed-process ^>=0.2
|
||||
|
||||
build-tool-depends: hspec-discover:hspec-discover ^>=2.7
|
||||
build-tool-depends: hspec-discover:hspec-discover ^>=2.8
|
||||
other-modules: StackTrace.PluginSpec
|
||||
|
||||
if flag(dev)
|
||||
|
@ -5,7 +5,12 @@ module StackTrace.Plugin (plugin) where
|
||||
|
||||
import Control.Arrow (first)
|
||||
import Data.Monoid (Any(Any, getAny))
|
||||
#if __GLASGOW_HASKELL__ >= 900
|
||||
import GHC.Plugins
|
||||
#else
|
||||
|
||||
import GhcPlugins
|
||||
#endif
|
||||
#if __GLASGOW_HASKELL__ >= 810
|
||||
import GHC.Hs
|
||||
#endif
|
||||
@ -48,7 +53,11 @@ ghcStackImport =
|
||||
(simpleImportDecl $ mkModuleName "GHC.Stack")
|
||||
{ideclQualified = importDeclQualified, ideclAs = Just $ noLoc ghcStackModuleName}
|
||||
|
||||
#if __GLASGOW_HASKELL__ >= 900
|
||||
updateHsModule :: HsModule -> HsModule
|
||||
#else
|
||||
updateHsModule :: HsModule GhcPs -> HsModule GhcPs
|
||||
#endif
|
||||
updateHsModule hsm =
|
||||
hsm {hsmodImports = hsmodImports', hsmodDecls = hsmodDecls'}
|
||||
where
|
||||
@ -90,12 +99,16 @@ updateSig _ sig = pure sig
|
||||
updateLHsSigWsType :: Traversal' (LHsSigWcType GhcPs) (LHsSigType GhcPs)
|
||||
updateLHsSigWsType f lhs@HsWC {} =
|
||||
(\x -> lhs {hswc_body = x}) <$> f (hswc_body lhs)
|
||||
#if __GLASGOW_HASKELL__ < 900
|
||||
updateLHsSigWsType _ lhs = pure lhs
|
||||
#endif
|
||||
|
||||
updateLHsSigType :: Traversal' (LHsSigType GhcPs) (LHsType GhcPs)
|
||||
updateLHsSigType f lhs@HsIB {} =
|
||||
(\x -> lhs {hsib_body = x}) <$> f (hsib_body lhs)
|
||||
#if __GLASGOW_HASKELL__ < 900
|
||||
updateLHsSigType _ lhs = pure lhs
|
||||
#endif
|
||||
|
||||
updateLHsType :: Traversal' (LHsType GhcPs) (HsType GhcPs)
|
||||
updateLHsType = traverse
|
||||
@ -117,6 +130,7 @@ updateHsType ty@HsTupleTy {} =
|
||||
updateHsType ty = pure ty
|
||||
|
||||
#if __GLASGOW_HASKELL__ < 810
|
||||
xQualTy :: NoExt
|
||||
xQualTy = noExt
|
||||
#else
|
||||
xQualTy :: NoExtField
|
||||
|
Loading…
Reference in New Issue
Block a user