From 5ee6e9924a2f5ce31ffa3cd8052de5ae433e7d35 Mon Sep 17 00:00:00 2001 From: Andreas Abel Date: Wed, 27 Aug 2025 11:38:52 +0200 Subject: [PATCH] v0.2.0.1: drop support for GHC 7 --- .github/workflows/haskell-ci.yml | 51 ++++++++++++++++++++++++++++---- changelog.md | 5 ++++ deepseq-generics.cabal | 14 ++++----- test/Suite.hs | 15 ++-------- 4 files changed, 58 insertions(+), 27 deletions(-) diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index b5bffe7..72df7c3 100644 --- a/.github/workflows/haskell-ci.yml +++ b/.github/workflows/haskell-ci.yml @@ -8,9 +8,9 @@ # # For more information, see https://github.com/haskell-CI/haskell-ci # -# version: 0.19.20250506 +# version: 0.19.20250821 # -# REGENDATA ("0.19.20250506",["github","deepseq-generics.cabal"]) +# REGENDATA ("0.19.20250821",["github","deepseq-generics.cabal"]) # name: Haskell-CI on: @@ -32,6 +32,11 @@ jobs: strategy: matrix: include: + - compiler: ghc-9.14.0.20250819 + compilerKind: ghc + compilerVersion: 9.14.0.20250819 + setup-method: ghcup-prerelease + allow-failure: false - compiler: ghc-9.12.2 compilerKind: ghc compilerVersion: 9.12.2 @@ -110,8 +115,8 @@ jobs: chmod a+x "$HOME/.ghcup/bin/ghcup" - name: Install cabal-install run: | - "$HOME/.ghcup/bin/ghcup" install cabal 3.14.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false) - echo "CABAL=$HOME/.ghcup/bin/cabal-3.14.2.0 -vnormal+nowrap" >> "$GITHUB_ENV" + "$HOME/.ghcup/bin/ghcup" install cabal 3.16.0.0 || (cat "$HOME"/.ghcup/logs/*.* && false) + echo "CABAL=$HOME/.ghcup/bin/cabal-3.16.0.0 -vnormal+nowrap" >> "$GITHUB_ENV" - name: Install GHC (GHCup) if: matrix.setup-method == 'ghcup' run: | @@ -126,6 +131,21 @@ jobs: HCKIND: ${{ matrix.compilerKind }} HCNAME: ${{ matrix.compiler }} HCVER: ${{ matrix.compilerVersion }} + - name: Install GHC (GHCup prerelease) + if: matrix.setup-method == 'ghcup-prerelease' + run: | + "$HOME/.ghcup/bin/ghcup" config add-release-channel prereleases + "$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false) + HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER") + HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#') + HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#') + echo "HC=$HC" >> "$GITHUB_ENV" + echo "HCPKG=$HCPKG" >> "$GITHUB_ENV" + echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV" + env: + HCKIND: ${{ matrix.compilerKind }} + HCNAME: ${{ matrix.compiler }} + HCVER: ${{ matrix.compilerVersion }} - name: Set PATH and environment variables run: | echo "$HOME/.cabal/bin" >> $GITHUB_PATH @@ -136,7 +156,7 @@ jobs: echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV" echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV" echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV" - echo "HEADHACKAGE=false" >> "$GITHUB_ENV" + if [ $((HCNUMVER >= 91400)) -ne 0 ] ; then echo "HEADHACKAGE=true" >> "$GITHUB_ENV" ; else echo "HEADHACKAGE=false" >> "$GITHUB_ENV" ; fi echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV" env: HCKIND: ${{ matrix.compilerKind }} @@ -164,6 +184,18 @@ jobs: repository hackage.haskell.org url: http://hackage.haskell.org/ EOF + if $HEADHACKAGE; then + cat >> $CABAL_CONFIG <> $CABAL_CONFIG <> cabal.project if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo "package deepseq-generics" >> cabal.project ; fi - if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi + if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods -Werror=missing-fields" >> cabal.project ; fi + if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then echo "package deepseq-generics" >> cabal.project ; fi + if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then echo " ghc-options: -Werror=unused-packages" >> cabal.project ; fi + if [ $((HCNUMVER >= 90000)) -ne 0 ] ; then echo "package deepseq-generics" >> cabal.project ; fi + if [ $((HCNUMVER >= 90000)) -ne 0 ] ; then echo " ghc-options: -Werror=incomplete-patterns -Werror=incomplete-uni-patterns" >> cabal.project ; fi cat >> cabal.project <> cabal.project + fi $HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(deepseq-generics)$/; }' >> cabal.project.local cat cabal.project cat cabal.project.local diff --git a/changelog.md b/changelog.md index 42e1096..a26e73f 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,8 @@ +## 0.2.0.1 August 2025 + + * Drop support for GHC 7 + * Tested with GHC 8.0 - 9.14 alpha1 + ## 0.2.0.0 January 2016 * Add support for GHC 8.0 diff --git a/deepseq-generics.cabal b/deepseq-generics.cabal index 880576c..d738354 100644 --- a/deepseq-generics.cabal +++ b/deepseq-generics.cabal @@ -1,6 +1,6 @@ +cabal-version: 1.18 name: deepseq-generics -version: 0.2.0.0 -x-revision: 10 +version: 0.2.0.1 synopsis: GHC.Generics-based Control.DeepSeq.rnf implementation homepage: https://github.com/haskell-hvr/deepseq-generics @@ -12,9 +12,9 @@ maintainer: https://github.com/haskell-hvr copyright: 2012, Herbert Valerio Riedel category: Control build-type: Simple -cabal-version: >=1.10 tested-with: + GHC == 9.14.1 GHC == 9.12.2 GHC == 9.10.2 GHC == 9.8.4 @@ -50,7 +50,7 @@ description: for writing code that's also compatible with older @deepseq@ versions not yet providing "GHC.Generics"-support. -extra-source-files: changelog.md +extra-doc-files: changelog.md source-repository head type: git @@ -59,8 +59,7 @@ source-repository head library default-language: Haskell2010 exposed-modules: Control.DeepSeq.Generics - build-depends: base >= 4.5 && < 5 - , ghc-prim >= 0.2 && < 1 + build-depends: base >= 4.9 && < 5 , deepseq >= 1.2.0.1 && < 1.6 other-extensions: BangPatterns, FlexibleContexts, TypeOperators ghc-options: -Wall @@ -70,14 +69,13 @@ test-suite deepseq-generics-tests type: exitcode-stdio-1.0 hs-source-dirs: test main-is: Suite.hs - other-extensions: CPP, DeriveDataTypeable, DeriveGeneric, TupleSections + other-extensions: CPP, DeriveGeneric, TupleSections ghc-options: -Wall build-depends: base , deepseq , deepseq-generics - , ghc-prim -- end of packages with inherited version constraints , test-framework >= 0.6.1 && < 0.9 , test-framework-hunit >= 0.2.2 && < 0.9 diff --git a/test/Suite.hs b/test/Suite.hs index 2ceddfd..e7e6a20 100644 --- a/test/Suite.hs +++ b/test/Suite.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE CPP, TupleSections, DeriveDataTypeable, DeriveGeneric #-} +{-# LANGUAGE CPP, TupleSections, DeriveGeneric #-} module Main (main) where @@ -8,7 +8,6 @@ import Control.Exception import Control.Monad import Data.Bits import Data.IORef -import Data.Typeable import Data.Word import GHC.Generics import System.IO.Unsafe (unsafePerformIO) @@ -21,16 +20,6 @@ import Test.HUnit -- IUT import Control.DeepSeq.Generics --- needed for GHC-7.4 compatibility -#if !MIN_VERSION_base(4,6,0) -atomicModifyIORef' :: IORef a -> (a -> (a,b)) -> IO b -atomicModifyIORef' ref f = do - b <- atomicModifyIORef ref - (\x -> let (a, b) = f x - in (a, a `seq` b)) - b `seq` return b -#endif - ---------------------------------------------------------------------------- -- simple hacky abstraction for testing forced evaluation via `rnf`-like functions @@ -72,7 +61,7 @@ instance NFData SeqSet where {-# NOINLINE rnf #-} -- |Exception to be thrown for testing 'seq'/'rnf' -data RnfEx = RnfEx deriving (Eq, Show, Typeable) +data RnfEx = RnfEx deriving (Eq, Show) instance Exception RnfEx