Skip to content

Commit

Permalink
Require GHC 9.10.1
Browse files Browse the repository at this point in the history
  • Loading branch information
sol committed Oct 23, 2024
1 parent 47727a1 commit 79e3989
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 30 deletions.
17 changes: 8 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,10 @@ jobs:
matrix:
os:
- ubuntu-latest
- macos-12
ghc:
- '9.4'
- '9.6'
- '9.8'
- '9.10'
include:
- os: macos-12
ghc: system

steps:
- uses: actions/checkout@v3
- uses: hspec/setup-haskell@v1
Expand All @@ -54,9 +50,12 @@ jobs:
run: cabal build all

- shell: bash
run: $(cabal list-bin spec) --times --print-slow
env:
HSPEC_OPTIONS: --color
run: |
for GHC in 9.4 9.6 9.8 9.10
do
ghcup install ghc $GHC --no-set
SENSEI_GHC=ghc-$GHC $(cabal list-bin spec)
done
success:
needs: build
Expand Down
2 changes: 2 additions & 0 deletions cabal.project
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
with-compiler: ghc-9.10.1

packages:
sensei.cabal

Expand Down
2 changes: 1 addition & 1 deletion package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ dependencies:
- async
- containers
- transformers
- mtl
- mtl >= 2.3.1
- aeson
- yaml
- casing
Expand Down
8 changes: 4 additions & 4 deletions sensei.cabal

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions src/Trigger.hs
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,8 @@ module Trigger (

import Imports

#if MIN_VERSION_mtl(2,3,1)
import Control.Monad.Trans.Writer.CPS (runWriterT)
import Control.Monad.Writer.CPS hiding (pass)
#else
import Control.Monad.Writer.Strict hiding (pass)
#endif

import Control.Monad.Except

Expand Down
26 changes: 14 additions & 12 deletions test/TriggerSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ module TriggerSpec (spec) where

import Helper

import qualified Data.Text as Text

import qualified Session
import Session (Session)
import Language.Haskell.GhciWrapper (Config(..))
Expand All @@ -11,7 +13,7 @@ import Trigger hiding (trigger, triggerAll)
import qualified Trigger

normalize :: String -> [String]
normalize = normalizeTiming . lines
normalize = normalizeTiming . lines . forGhc9dot4
where
normalizeTiming :: [String] -> [String]
normalizeTiming = normalizeLine "Finished in "
Expand All @@ -23,6 +25,11 @@ normalize = normalizeTiming . lines
| message `isPrefixOf` line = message ++ "..."
| otherwise = line

forGhc9dot4 :: String -> String
forGhc9dot4 = Text.unpack
. Text.replace " error: Variable not in scope: " " error: [GHC-88464] Variable not in scope: "
. Text.pack

withSession :: FilePath -> [String] -> (Session -> IO a) -> IO a
withSession specPath args = do
Session.withSession ghciConfig {configWorkingDirectory = Just dir} $
Expand Down Expand Up @@ -147,19 +154,14 @@ spec = do
it "stops after reloading" $ \ name -> do
withSession name [] $ \ session -> do
writeFile name (passingSpec ++ "foo = bar")
(trigger session >> trigger session) `shouldReturn` (Failure, [

let
fitterNotNull :: [String] -> [String]
fitterNotNull = filter (not . null)

(fmap fitterNotNull <$> (trigger session >> trigger session)) `shouldReturn` (Failure, [
"[1 of 1] Compiling Spec"
#if __GLASGOW_HASKELL__ < 910
, ""
#endif
#if __GLASGOW_HASKELL__ >= 906
, "Spec.hs:9:7: error: [GHC-88464] Variable not in scope: bar"
#else
, "Spec.hs:9:7: error: Variable not in scope: bar"
#endif
#if __GLASGOW_HASKELL__ >= 910
, ""
#endif
, withColor Red "RELOADING FAILED"
])

Expand Down

0 comments on commit 79e3989

Please sign in to comment.