From 516bd3d3e0a2204a265209c70acaf2d5b5b449f3 Mon Sep 17 00:00:00 2001 From: Janus Troelsen Date: Wed, 15 Nov 2023 22:49:35 -0600 Subject: [PATCH 1/2] Allow GHC-9.8, upgrade tested-with, haskell-ci --- .github/workflows/haskell-ci.yml | 37 +++++++++++-------- indexed-profunctors/indexed-profunctors.cabal | 2 +- metametapost/metametapost.cabal | 2 +- optics-core/optics-core.cabal | 2 +- optics-extra/optics-extra.cabal | 6 +-- optics-sop/optics-sop.cabal | 2 +- optics-th/optics-th.cabal | 4 +- optics-vl/optics-vl.cabal | 2 +- optics/optics.cabal | 2 +- .../template-haskell-optics.cabal | 6 +-- 10 files changed, 36 insertions(+), 29 deletions(-) diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index 2fa6576c..cc5c62db 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.16.3 +# version: 0.17.20231110 # -# REGENDATA ("0.16.3",["github","--config=cabal.haskell-ci","cabal.project"]) +# REGENDATA ("0.17.20231110",["github","--config=cabal.haskell-ci","cabal.project"]) # name: Haskell-CI on: @@ -37,14 +37,19 @@ jobs: compilerVersion: "8.4" setup-method: hvr-ppa allow-failure: false - - compiler: ghc-9.6.2 + - compiler: ghc-9.8.1 compilerKind: ghc - compilerVersion: 9.6.2 + compilerVersion: 9.8.1 setup-method: ghcup allow-failure: false - - compiler: ghc-9.4.5 + - compiler: ghc-9.6.3 compilerKind: ghc - compilerVersion: 9.4.5 + compilerVersion: 9.6.3 + setup-method: ghcup + allow-failure: false + - compiler: ghc-9.4.8 + compilerKind: ghc + compilerVersion: 9.4.8 setup-method: ghcup allow-failure: false - compiler: ghc-9.2.8 @@ -103,10 +108,10 @@ jobs: apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5 if [ "${{ matrix.setup-method }}" = ghcup ]; then mkdir -p "$HOME/.ghcup/bin" - curl -sL https://downloads.haskell.org/ghcup/0.1.19.2/x86_64-linux-ghcup-0.1.19.2 > "$HOME/.ghcup/bin/ghcup" + curl -sL https://downloads.haskell.org/ghcup/0.1.20.0/x86_64-linux-ghcup-0.1.20.0 > "$HOME/.ghcup/bin/ghcup" chmod a+x "$HOME/.ghcup/bin/ghcup" "$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false) - "$HOME/.ghcup/bin/ghcup" install cabal 3.10.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false) + "$HOME/.ghcup/bin/ghcup" install cabal 3.10.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false) else apt-add-repository -y 'ppa:hvr/ghc' if [ $((GHCJSARITH)) -ne 0 ] ; then apt-add-repository -y 'ppa:hvr/ghcjs' ; fi @@ -115,9 +120,9 @@ jobs: apt-get update if [ $((GHCJSARITH)) -ne 0 ] ; then apt-get install -y "$HCNAME" ghc-8.4.4 nodejs ; else apt-get install -y "$HCNAME" ; fi mkdir -p "$HOME/.ghcup/bin" - curl -sL https://downloads.haskell.org/ghcup/0.1.19.2/x86_64-linux-ghcup-0.1.19.2 > "$HOME/.ghcup/bin/ghcup" + curl -sL https://downloads.haskell.org/ghcup/0.1.20.0/x86_64-linux-ghcup-0.1.20.0 > "$HOME/.ghcup/bin/ghcup" chmod a+x "$HOME/.ghcup/bin/ghcup" - "$HOME/.ghcup/bin/ghcup" install cabal 3.10.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false) + "$HOME/.ghcup/bin/ghcup" install cabal 3.10.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false) fi env: HCKIND: ${{ matrix.compilerKind }} @@ -132,17 +137,19 @@ jobs: echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV" HCDIR=/opt/$HCKIND/$HCVER if [ "${{ matrix.setup-method }}" = ghcup ]; then - HC=$HOME/.ghcup/bin/$HCKIND-$HCVER + 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=$HOME/.ghcup/bin/$HCKIND-pkg-$HCVER" >> "$GITHUB_ENV" - echo "HADDOCK=$HOME/.ghcup/bin/haddock-$HCVER" >> "$GITHUB_ENV" - echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.1.0 -vnormal+nowrap" >> "$GITHUB_ENV" + echo "HCPKG=$HCPKG" >> "$GITHUB_ENV" + echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV" + echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.2.0 -vnormal+nowrap" >> "$GITHUB_ENV" else HC=$HCDIR/bin/$HCKIND echo "HC=$HC" >> "$GITHUB_ENV" echo "HCPKG=$HCDIR/bin/$HCKIND-pkg" >> "$GITHUB_ENV" echo "HADDOCK=$HCDIR/bin/haddock" >> "$GITHUB_ENV" - echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.1.0 -vnormal+nowrap" >> "$GITHUB_ENV" + echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.2.0 -vnormal+nowrap" >> "$GITHUB_ENV" fi HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))') diff --git a/indexed-profunctors/indexed-profunctors.cabal b/indexed-profunctors/indexed-profunctors.cabal index 259ebe59..b0efc88f 100644 --- a/indexed-profunctors/indexed-profunctors.cabal +++ b/indexed-profunctors/indexed-profunctors.cabal @@ -7,7 +7,7 @@ build-type: Simple maintainer: optics@well-typed.com author: Adam Gundry, Andres Löh, Andrzej Rybczak, Oleg Grenrus tested-with: GHC ==8.2.2 || ==8.4.4 || ==8.6.5 || ==8.8.4 || ==8.10.7 - || ==9.0.2 || ==9.2.8 || ==9.4.5 || ==9.6.2, GHCJS ==8.4 + || ==9.0.2 || ==9.2.8 || ==9.4.8 || ==9.6.3 || ==9.8.1, GHCJS ==8.4 synopsis: Utilities for indexed profunctors category: Data, Optics, Lenses, Profunctors description: diff --git a/metametapost/metametapost.cabal b/metametapost/metametapost.cabal index 5a504cf2..03aa1330 100644 --- a/metametapost/metametapost.cabal +++ b/metametapost/metametapost.cabal @@ -5,7 +5,7 @@ license: BSD-3-Clause license-file: LICENSE build-type: Simple tested-with: GHC ==8.2.2 || ==8.4.4 || ==8.6.5 || ==8.8.4 || ==8.10.7 - || ==9.0.2 || ==9.2.8 || ==9.4.5 || ==9.6.2, GHCJS ==8.4 + || ==9.0.2 || ==9.2.8 || ==9.4.8 || ==9.6.3 || ==9.8.1, GHCJS ==8.4 maintainer: oleg@well-typed.com synopsis: Generate optics documentation diagrams category: Optics, Examples diff --git a/optics-core/optics-core.cabal b/optics-core/optics-core.cabal index 0107a50d..7106d85f 100644 --- a/optics-core/optics-core.cabal +++ b/optics-core/optics-core.cabal @@ -7,7 +7,7 @@ build-type: Simple maintainer: optics@well-typed.com author: Adam Gundry, Andres Löh, Andrzej Rybczak, Oleg Grenrus tested-with: GHC ==8.2.2 || ==8.4.4 || ==8.6.5 || ==8.8.4 || ==8.10.7 - || ==9.0.2 || ==9.2.8 || ==9.4.5 || ==9.6.2, GHCJS ==8.4 + || ==9.0.2 || ==9.2.8 || ==9.4.8 || ==9.6.3 || ==9.8.1, GHCJS ==8.4 synopsis: Optics as an abstract interface: core definitions category: Data, Optics, Lenses description: diff --git a/optics-extra/optics-extra.cabal b/optics-extra/optics-extra.cabal index 00ad2a85..2e31f020 100644 --- a/optics-extra/optics-extra.cabal +++ b/optics-extra/optics-extra.cabal @@ -7,7 +7,7 @@ build-type: Simple maintainer: optics@well-typed.com author: Andrzej Rybczak tested-with: GHC ==8.2.2 || ==8.4.4 || ==8.6.5 || ==8.8.4 || ==8.10.7 - || ==9.0.2 || ==9.2.8 || ==9.4.5 || ==9.6.2, GHCJS ==8.4 + || ==9.0.2 || ==9.2.8 || ==9.4.8 || ==9.6.3 || ==9.8.1, GHCJS ==8.4 synopsis: Extra utilities and instances for optics-core category: Data, Optics, Lenses description: @@ -63,13 +63,13 @@ library build-depends: base >= 4.10 && <5 , array >= 0.5.2.0 && <0.6 - , bytestring >= 0.10.8 && <0.12 + , bytestring >= 0.10.8 && <0.13 , containers >= 0.5.10.2 && <0.7 , hashable >= 1.1.1 && <1.5 , indexed-profunctors >= 0.1 && <0.2 , mtl >= 2.2.2 && <2.4 , optics-core >= 0.4.1 && <0.4.2 - , text >= 1.2 && <1.3 || >=2.0 && <2.1 + , text >= 1.2 && <1.3 || >=2.0 && <2.2 , transformers >= 0.5 && <0.7 , unordered-containers >= 0.2.6 && <0.3 , vector >= 0.11 && <0.14 diff --git a/optics-sop/optics-sop.cabal b/optics-sop/optics-sop.cabal index ab45f5cf..36faa9b5 100644 --- a/optics-sop/optics-sop.cabal +++ b/optics-sop/optics-sop.cabal @@ -7,7 +7,7 @@ build-type: Simple maintainer: optics@well-typed.com author: Adam Gundry, Andres Löh, Andrzej Rybczak tested-with: GHC ==8.2.2 || ==8.4.4 || ==8.6.5 || ==8.8.4 || ==8.10.7 - || ==9.0.2 || ==9.2.8 || ==9.4.5 || ==9.6.2, GHCJS ==8.4 + || ==9.0.2 || ==9.2.8 || ==9.4.8 || ==9.6.3 || ==9.8.1, GHCJS ==8.4 synopsis: Optics for generics-sop, and using generics-sop category: Data, Optics, Lenses, Generics description: diff --git a/optics-th/optics-th.cabal b/optics-th/optics-th.cabal index 838314af..a9941527 100644 --- a/optics-th/optics-th.cabal +++ b/optics-th/optics-th.cabal @@ -7,7 +7,7 @@ build-type: Simple maintainer: optics@well-typed.com author: Andrzej Rybczak tested-with: GHC ==8.2.2 || ==8.4.4 || ==8.6.5 || ==8.8.4 || ==8.10.7 - || ==9.0.2 || ==9.2.8 || ==9.4.5 || ==9.6.2, GHCJS ==8.4 + || ==9.0.2 || ==9.2.8 || ==9.4.8 || ==9.6.3 || ==9.8.1, GHCJS ==8.4 synopsis: Optics construction using TemplateHaskell category: Data, Optics, Lenses description: @@ -64,7 +64,7 @@ library , containers >= 0.5.10.2 && <0.7 , mtl >= 2.2.2 && <2.4 , optics-core >= 0.4.1 && <0.5 - , template-haskell >= 2.12 && <2.21 + , template-haskell >= 2.12 && <2.22 , th-abstraction >= 0.4 && <0.7 , transformers >= 0.5 && <0.7 diff --git a/optics-vl/optics-vl.cabal b/optics-vl/optics-vl.cabal index a2a0036b..8b2f1d3e 100644 --- a/optics-vl/optics-vl.cabal +++ b/optics-vl/optics-vl.cabal @@ -7,7 +7,7 @@ build-type: Simple maintainer: optics@well-typed.com author: Andrzej Rybczak tested-with: GHC ==8.2.2 || ==8.4.4 || ==8.6.5 || ==8.8.4 || ==8.10.7 - || ==9.0.2 || ==9.2.8 || ==9.4.5 || ==9.6.2, GHCJS ==8.4 + || ==9.0.2 || ==9.2.8 || ==9.4.8 || ==9.6.3 || ==9.8.1, GHCJS ==8.4 synopsis: Utilities for compatibility with van Laarhoven optics category: Data, Optics, Lenses description: diff --git a/optics/optics.cabal b/optics/optics.cabal index 37d81af4..2771ff19 100644 --- a/optics/optics.cabal +++ b/optics/optics.cabal @@ -7,7 +7,7 @@ build-type: Simple maintainer: optics@well-typed.com author: Adam Gundry, Andres Löh, Andrzej Rybczak, Oleg Grenrus tested-with: GHC ==8.2.2 || ==8.4.4 || ==8.6.5 || ==8.8.4 || ==8.10.7 - || ==9.0.2 || ==9.2.8 || ==9.4.5 || ==9.6.2, GHCJS ==8.4 + || ==9.0.2 || ==9.2.8 || ==9.4.8 || ==9.6.3 || ==9.8.1, GHCJS ==8.4 synopsis: Optics as an abstract interface category: Data, Optics, Lenses description: diff --git a/template-haskell-optics/template-haskell-optics.cabal b/template-haskell-optics/template-haskell-optics.cabal index 6c8bebcb..1e9c08eb 100644 --- a/template-haskell-optics/template-haskell-optics.cabal +++ b/template-haskell-optics/template-haskell-optics.cabal @@ -7,7 +7,7 @@ maintainer: optics@well-typed.com author: Andrzej Rybczak cabal-version: 1.18 tested-with: GHC ==8.2.2 || ==8.4.4 || ==8.6.5 || ==8.8.4 || ==8.10.7 - || ==9.0.2 || ==9.2.8 || ==9.4.5 || ==9.6.2, GHCJS ==8.4 + || ==9.0.2 || ==9.2.8 || ==9.4.8 || ==9.6.3 || ==9.8.1, GHCJS ==8.4 synopsis: Optics for template-haskell types category: Data, Optics, Lenses description: @@ -32,7 +32,7 @@ library build-depends: base >= 4.10 && <5 , optics-core >= 0.4 && <0.5 , containers >= 0.5.10.2 && <0.7 - , template-haskell >= 2.12 && <2.21 - , th-abstraction >= 0.4 && <0.6 + , template-haskell >= 2.12 && <2.22 + , th-abstraction >= 0.4 && <0.7 exposed-modules: Language.Haskell.TH.Optics From 3ee3632418458cb62831e9b88f0185be9ae76032 Mon Sep 17 00:00:00 2001 From: Janus Troelsen Date: Wed, 15 Nov 2023 23:11:50 -0600 Subject: [PATCH 2/2] Use #ifdef in template-haskell-optics to enable GHC 9.8 --- .../src/Language/Haskell/TH/Optics.hs | 34 ++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/template-haskell-optics/src/Language/Haskell/TH/Optics.hs b/template-haskell-optics/src/Language/Haskell/TH/Optics.hs index 2396c82f..42754837 100644 --- a/template-haskell-optics/src/Language/Haskell/TH/Optics.hs +++ b/template-haskell-optics/src/Language/Haskell/TH/Optics.hs @@ -711,7 +711,11 @@ typeFamilyHeadName = lens g s where g (TypeFamilyHead n _ _ _ ) = n s (TypeFamilyHead _ tvbs rs ia) n = TypeFamilyHead n tvbs rs ia +#if MIN_VERSION_template_haskell(2,21,0) +typeFamilyHeadTyVarBndrs :: Lens' TypeFamilyHead [TyVarBndr BndrVis] +#else typeFamilyHeadTyVarBndrs :: Lens' TypeFamilyHead [TyVarBndrUnit] +#endif typeFamilyHeadTyVarBndrs = lens g s where g (TypeFamilyHead _ tvbs _ _ ) = tvbs s (TypeFamilyHead n _ rs ia) tvbs = TypeFamilyHead n tvbs rs ia @@ -834,7 +838,11 @@ _ValD remitter (ValD x y z) = Just (x, y, z) remitter _ = Nothing +#if MIN_VERSION_template_haskell(2,21,0) +_TySynD :: Prism' Dec (Name, [TyVarBndr BndrVis], Type) +#else _TySynD :: Prism' Dec (Name, [TyVarBndrUnit], Type) +#endif _TySynD = prism' reviewer remitter where @@ -842,7 +850,11 @@ _TySynD remitter (TySynD x y z) = Just (x, y, z) remitter _ = Nothing +#if MIN_VERSION_template_haskell(2,21,0) +_ClassD :: Prism' Dec (Cxt, Name, [TyVarBndr BndrVis], [FunDep], [Dec]) +#else _ClassD :: Prism' Dec (Cxt, Name, [TyVarBndrUnit], [FunDep], [Dec]) +#endif _ClassD = prism' reviewer remitter where @@ -988,7 +1000,15 @@ _ClosedTypeFamilyD -- _DataInstD :: 'Prism'' 'Dec' ('Cxt', 'Maybe' ['TyVarBndrUnit'], 'Type', 'Maybe' 'Kind', ['Con'], ['DerivClause']) -- template-haskell-2.15+ -- _DataInstD :: 'Prism'' 'Dec' ('Cxt', 'Name', ['Type'], 'Maybe' 'Kind', ['Con'], ['DerivClause']) -- Earlier versions -- @ -#if MIN_VERSION_template_haskell(2,15,0) +#if MIN_VERSION_template_haskell(2,21,0) +_DataInstD :: Prism' Dec (Cxt, Maybe [TyVarBndr ()], Type, Maybe Kind, [Con], [DerivClause]) +_DataInstD + = prism' reviewer remitter + where + reviewer (x, y, z, w, u, v) = DataInstD x y z w u v + remitter (DataInstD x y z w u v) = Just (x, y, z, w, u, v) + remitter _ = Nothing +#elif MIN_VERSION_template_haskell(2,15,0) _DataInstD :: Prism' Dec (Cxt, Maybe [TyVarBndrUnit], Type, Maybe Kind, [Con], [DerivClause]) _DataInstD = prism' reviewer remitter @@ -1029,7 +1049,11 @@ _NewtypeInstD remitter _ = Nothing #endif +#if MIN_VERSION_template_haskell(2,21,0) +_DataD :: Prism' Dec (Cxt, Name, [TyVarBndr BndrVis], Maybe Kind, [Con], [DerivClause]) +#else _DataD :: Prism' Dec (Cxt, Name, [TyVarBndrUnit], Maybe Kind, [Con], [DerivClause]) +#endif _DataD = prism' reviewer remitter where @@ -1037,7 +1061,11 @@ _DataD remitter (DataD x y z w u v) = Just (x, y, z, w, u, v) remitter _ = Nothing +#if MIN_VERSION_template_haskell(2,21,0) +_NewtypeD :: Prism' Dec (Cxt, Name, [TyVarBndr BndrVis], Maybe Kind, Con, [DerivClause]) +#else _NewtypeD :: Prism' Dec (Cxt, Name, [TyVarBndrUnit], Maybe Kind, Con, [DerivClause]) +#endif _NewtypeD = prism' reviewer remitter where @@ -1045,7 +1073,11 @@ _NewtypeD remitter (NewtypeD x y z w u v) = Just (x, y, z, w, u, v) remitter _ = Nothing +#if MIN_VERSION_template_haskell(2,21,0) +_DataFamilyD :: Prism' Dec (Name, [TyVarBndr BndrVis], Maybe Kind) +#else _DataFamilyD :: Prism' Dec (Name, [TyVarBndrUnit], Maybe Kind) +#endif _DataFamilyD = prism' reviewer remitter where