From 9cd96a7b232fef42ee5b5802e2a6ea6ffaef6053 Mon Sep 17 00:00:00 2001
From: Andreas Abel <andreas.abel@ifi.lmu.de>
Date: Fri, 5 Jan 2024 18:38:48 +0100
Subject: [PATCH] Bump CI to GHCs 9.8.1 and 9.4.8

---
 .github/workflows/haskell-ci.yml              | 109 ++++++++----------
 happy.cabal                                   |   2 +-
 packages/backend-glr/happy-backend-glr.cabal  |   2 +-
 .../backend-lalr/happy-backend-lalr.cabal     |   2 +-
 .../codegen-common/happy-codegen-common.cabal |   2 +-
 packages/frontend/happy-frontend.cabal        |   2 +-
 packages/grammar/happy-grammar.cabal          |   2 +-
 packages/tabular/happy-tabular.cabal          |   2 +-
 8 files changed, 52 insertions(+), 71 deletions(-)

diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml
index e839d97e..4e5ae6ea 100644
--- a/.github/workflows/haskell-ci.yml
+++ b/.github/workflows/haskell-ci.yml
@@ -6,11 +6,11 @@
 #
 #   haskell-ci regenerate
 #
-# For more information, see https://github.com/haskell-CI/haskell-ci
+# For more information, see https://github.com/andreasabel/haskell-ci
 #
-# version: 0.17.20230929
+# version: 0.17.20231112
 #
-# REGENDATA ("0.17.20230929",["github","cabal.project","--config","cabal.haskell-ci","--project"])
+# REGENDATA ("0.17.20231112",["github","cabal.project","--config","cabal.haskell-ci","--project"])
 #
 name: Haskell-CI
 on:
@@ -23,24 +23,24 @@ jobs:
     timeout-minutes:
       60
     container:
-      image: buildpack-deps:bionic
+      image: buildpack-deps:focal
     continue-on-error: ${{ matrix.allow-failure }}
     strategy:
       matrix:
         include:
-          - compiler: ghc-9.8.0.20230929
+          - compiler: ghc-9.8.1
             compilerKind: ghc
-            compilerVersion: 9.8.0.20230929
+            compilerVersion: 9.8.1
             setup-method: ghcup
-            allow-failure: true
+            allow-failure: false
           - compiler: ghc-9.6.3
             compilerKind: ghc
             compilerVersion: 9.6.3
             setup-method: ghcup
             allow-failure: false
-          - compiler: ghc-9.4.7
+          - compiler: ghc-9.4.8
             compilerKind: ghc
-            compilerVersion: 9.4.7
+            compilerVersion: 9.4.8
             setup-method: ghcup
             allow-failure: false
           - compiler: ghc-9.2.8
@@ -61,27 +61,27 @@ jobs:
           - compiler: ghc-8.8.4
             compilerKind: ghc
             compilerVersion: 8.8.4
-            setup-method: hvr-ppa
+            setup-method: ghcup
             allow-failure: false
           - compiler: ghc-8.6.5
             compilerKind: ghc
             compilerVersion: 8.6.5
-            setup-method: hvr-ppa
+            setup-method: ghcup
             allow-failure: false
           - compiler: ghc-8.4.4
             compilerKind: ghc
             compilerVersion: 8.4.4
-            setup-method: hvr-ppa
+            setup-method: ghcup
             allow-failure: false
           - compiler: ghc-8.2.2
             compilerKind: ghc
             compilerVersion: 8.2.2
-            setup-method: hvr-ppa
+            setup-method: ghcup
             allow-failure: false
           - compiler: ghc-8.0.2
             compilerKind: ghc
             compilerVersion: 8.0.2
-            setup-method: hvr-ppa
+            setup-method: ghcup
             allow-failure: false
           - compiler: ghc-7.10.3
             compilerKind: ghc
@@ -113,23 +113,21 @@ jobs:
       - name: apt
         run: |
           apt-get update
-          apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5
+          apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5 libnuma-dev
           if [ "${{ matrix.setup-method }}" = ghcup ]; then
             mkdir -p "$HOME/.ghcup/bin"
-            curl -sL https://downloads.haskell.org/ghcup/0.1.19.5/x86_64-linux-ghcup-0.1.19.5 > "$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" config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.7.yaml;
             "$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'
             apt-get update
             apt-get install -y "$HCNAME"
             mkdir -p "$HOME/.ghcup/bin"
-            curl -sL https://downloads.haskell.org/ghcup/0.1.19.5/x86_64-linux-ghcup-0.1.19.5 > "$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" config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.7.yaml;
-            "$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 }}
@@ -144,27 +142,25 @@ jobs:
           HCDIR=/opt/$HCKIND/$HCVER
           if [ "${{ matrix.setup-method }}" = ghcup ]; then
             HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
-            echo "$HOME/.ghcup/bin" >> "$GITHUB_PATH"
             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"
-            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"
           else
             HC=$HCDIR/bin/$HCKIND
-            echo "$HCDIR/bin" >> "$GITHUB_PATH"
             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))')
           echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV"
           echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV"
           echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV"
-          if [ $((HCNUMVER >= 90800)) -ne 0 ] ; then echo "HEADHACKAGE=true" >> "$GITHUB_ENV" ; else echo "HEADHACKAGE=false" >> "$GITHUB_ENV" ; fi
+          echo "HEADHACKAGE=false" >> "$GITHUB_ENV"
           echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV"
           echo "GHCJSARITH=0" >> "$GITHUB_ENV"
         env:
@@ -193,18 +189,6 @@ jobs:
           repository hackage.haskell.org
             url: http://hackage.haskell.org/
           EOF
-          if $HEADHACKAGE; then
-          cat >> $CABAL_CONFIG <<EOF
-          repository head.hackage.ghc.haskell.org
-             url: https://ghc.gitlab.haskell.org/head.hackage/
-             secure: True
-             root-keys: 7541f32a4ccca4f97aea3b22f5e593ba2c0267546016b992dfadcd2fe944e55d
-                        26021a13b401500c8eb2761ca95c61f2d625bfef951b939a8124ed12ecf07329
-                        f76d08be13e9a61a377a85e2fb63f4c5435d40f8feb3e12eb05905edb8cdea89
-             key-threshold: 3
-          active-repositories: hackage.haskell.org, head.hackage.ghc.haskell.org:override
-          EOF
-          fi
           cat >> $CABAL_CONFIG <<EOF
           program-default-options
             ghc-options: $GHCJOBS +RTS -M3G -RTS
@@ -228,18 +212,18 @@ jobs:
           chmod a+x $HOME/.cabal/bin/cabal-plan
           cabal-plan --version
       - name: checkout
-        uses: actions/checkout@v3
+        uses: actions/checkout@v4
         with:
           path: source
       - name: initial cabal.project for sdist
         run: |
           touch cabal.project
-          echo "packages: $GITHUB_WORKSPACE/source/packages/frontend" >> cabal.project
+          echo "packages: $GITHUB_WORKSPACE/source/packages/backend-lalr" >> cabal.project
+          echo "packages: $GITHUB_WORKSPACE/source/packages/grammar" >> cabal.project
           echo "packages: $GITHUB_WORKSPACE/source/packages/backend-glr" >> cabal.project
+          echo "packages: $GITHUB_WORKSPACE/source/packages/frontend" >> cabal.project
           echo "packages: $GITHUB_WORKSPACE/source/packages/tabular" >> cabal.project
           echo "packages: $GITHUB_WORKSPACE/source/packages/codegen-common" >> cabal.project
-          echo "packages: $GITHUB_WORKSPACE/source/packages/backend-lalr" >> cabal.project
-          echo "packages: $GITHUB_WORKSPACE/source/packages/grammar" >> cabal.project
           echo "packages: $GITHUB_WORKSPACE/source/." >> cabal.project
           cat cabal.project
       - name: sdist
@@ -252,49 +236,46 @@ jobs:
           find sdist -maxdepth 1 -type f -name '*.tar.gz' -exec tar -C $GITHUB_WORKSPACE/unpacked -xzvf {} \;
       - name: generate cabal.project
         run: |
-          PKGDIR_happy_frontend="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/happy-frontend-[0-9.]*')"
-          echo "PKGDIR_happy_frontend=${PKGDIR_happy_frontend}" >> "$GITHUB_ENV"
+          PKGDIR_happy_backend_lalr="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/happy-backend-lalr-[0-9.]*')"
+          echo "PKGDIR_happy_backend_lalr=${PKGDIR_happy_backend_lalr}" >> "$GITHUB_ENV"
+          PKGDIR_happy_grammar="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/happy-grammar-[0-9.]*')"
+          echo "PKGDIR_happy_grammar=${PKGDIR_happy_grammar}" >> "$GITHUB_ENV"
           PKGDIR_happy_backend_glr="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/happy-backend-glr-[0-9.]*')"
           echo "PKGDIR_happy_backend_glr=${PKGDIR_happy_backend_glr}" >> "$GITHUB_ENV"
+          PKGDIR_happy_frontend="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/happy-frontend-[0-9.]*')"
+          echo "PKGDIR_happy_frontend=${PKGDIR_happy_frontend}" >> "$GITHUB_ENV"
           PKGDIR_happy_tabular="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/happy-tabular-[0-9.]*')"
           echo "PKGDIR_happy_tabular=${PKGDIR_happy_tabular}" >> "$GITHUB_ENV"
           PKGDIR_happy_codegen_common="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/happy-codegen-common-[0-9.]*')"
           echo "PKGDIR_happy_codegen_common=${PKGDIR_happy_codegen_common}" >> "$GITHUB_ENV"
-          PKGDIR_happy_backend_lalr="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/happy-backend-lalr-[0-9.]*')"
-          echo "PKGDIR_happy_backend_lalr=${PKGDIR_happy_backend_lalr}" >> "$GITHUB_ENV"
-          PKGDIR_happy_grammar="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/happy-grammar-[0-9.]*')"
-          echo "PKGDIR_happy_grammar=${PKGDIR_happy_grammar}" >> "$GITHUB_ENV"
           PKGDIR_happy="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/happy-[0-9.]*')"
           echo "PKGDIR_happy=${PKGDIR_happy}" >> "$GITHUB_ENV"
           rm -f cabal.project cabal.project.local
           touch cabal.project
           touch cabal.project.local
-          echo "packages: ${PKGDIR_happy_frontend}" >> cabal.project
+          echo "packages: ${PKGDIR_happy_backend_lalr}" >> cabal.project
+          echo "packages: ${PKGDIR_happy_grammar}" >> cabal.project
           echo "packages: ${PKGDIR_happy_backend_glr}" >> cabal.project
+          echo "packages: ${PKGDIR_happy_frontend}" >> cabal.project
           echo "packages: ${PKGDIR_happy_tabular}" >> cabal.project
           echo "packages: ${PKGDIR_happy_codegen_common}" >> cabal.project
-          echo "packages: ${PKGDIR_happy_backend_lalr}" >> cabal.project
-          echo "packages: ${PKGDIR_happy_grammar}" >> cabal.project
           echo "packages: ${PKGDIR_happy}" >> cabal.project
-          if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo "package happy-frontend" >> cabal.project ; fi
+          if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo "package happy-backend-lalr" >> 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 "package happy-grammar" >> 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 "package happy-backend-glr" >> 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 "package happy-frontend" >> 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 "package happy-tabular" >> 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 "package happy-codegen-common" >> 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 "package happy-backend-lalr" >> 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 "package happy-grammar" >> 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 "package happy" >> cabal.project ; fi
           if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo "    ghc-options: -Werror=missing-methods" >> cabal.project ; fi
           cat >> cabal.project <<EOF
           EOF
-          if $HEADHACKAGE; then
-          echo "allow-newer: $($HCPKG list --simple-output | sed -E 's/([a-zA-Z-]+)-[0-9.]+/*:\1,/g')" >> cabal.project
-          fi
           $HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(containers|happy|happy-backend-glr|happy-backend-lalr|happy-codegen-common|happy-frontend|happy-grammar|happy-tabular|mtl|transformers)$/; }' >> cabal.project.local
           cat cabal.project
           cat cabal.project.local
@@ -326,18 +307,18 @@ jobs:
           $CABAL v2-test --flags=-bootstrap $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --test-show-details=direct
       - name: cabal check
         run: |
-          cd ${PKGDIR_happy_frontend} || false
+          cd ${PKGDIR_happy_backend_lalr} || false
+          ${CABAL} -vnormal check
+          cd ${PKGDIR_happy_grammar} || false
           ${CABAL} -vnormal check
           cd ${PKGDIR_happy_backend_glr} || false
           ${CABAL} -vnormal check
+          cd ${PKGDIR_happy_frontend} || false
+          ${CABAL} -vnormal check
           cd ${PKGDIR_happy_tabular} || false
           ${CABAL} -vnormal check
           cd ${PKGDIR_happy_codegen_common} || false
           ${CABAL} -vnormal check
-          cd ${PKGDIR_happy_backend_lalr} || false
-          ${CABAL} -vnormal check
-          cd ${PKGDIR_happy_grammar} || false
-          ${CABAL} -vnormal check
           cd ${PKGDIR_happy} || false
           ${CABAL} -vnormal check
       - name: haddock
diff --git a/happy.cabal b/happy.cabal
index 26e91b50..1293dc24 100644
--- a/happy.cabal
+++ b/happy.cabal
@@ -21,7 +21,7 @@ Description:
 tested-with:
         GHC == 9.8.1
         GHC == 9.6.3
-        GHC == 9.4.7
+        GHC == 9.4.8
         GHC == 9.2.8
         GHC == 9.0.2
         GHC == 8.10.7
diff --git a/packages/backend-glr/happy-backend-glr.cabal b/packages/backend-glr/happy-backend-glr.cabal
index f857199b..9f90a416 100644
--- a/packages/backend-glr/happy-backend-glr.cabal
+++ b/packages/backend-glr/happy-backend-glr.cabal
@@ -22,7 +22,7 @@ Description:
 tested-with:
         GHC == 9.8.1
         GHC == 9.6.3
-        GHC == 9.4.7
+        GHC == 9.4.8
         GHC == 9.2.8
         GHC == 9.0.2
         GHC == 8.10.7
diff --git a/packages/backend-lalr/happy-backend-lalr.cabal b/packages/backend-lalr/happy-backend-lalr.cabal
index cd4b1cbc..30729fd8 100644
--- a/packages/backend-lalr/happy-backend-lalr.cabal
+++ b/packages/backend-lalr/happy-backend-lalr.cabal
@@ -22,7 +22,7 @@ Description:
 tested-with:
         GHC == 9.8.1
         GHC == 9.6.3
-        GHC == 9.4.7
+        GHC == 9.4.8
         GHC == 9.2.8
         GHC == 9.0.2
         GHC == 8.10.7
diff --git a/packages/codegen-common/happy-codegen-common.cabal b/packages/codegen-common/happy-codegen-common.cabal
index 0189bc6a..7142dd7d 100644
--- a/packages/codegen-common/happy-codegen-common.cabal
+++ b/packages/codegen-common/happy-codegen-common.cabal
@@ -21,7 +21,7 @@ Description:
 tested-with:
         GHC == 9.8.1
         GHC == 9.6.3
-        GHC == 9.4.7
+        GHC == 9.4.8
         GHC == 9.2.8
         GHC == 9.0.2
         GHC == 8.10.7
diff --git a/packages/frontend/happy-frontend.cabal b/packages/frontend/happy-frontend.cabal
index 906d706d..517796ac 100644
--- a/packages/frontend/happy-frontend.cabal
+++ b/packages/frontend/happy-frontend.cabal
@@ -23,7 +23,7 @@ Description:
 tested-with:
         GHC == 9.8.1
         GHC == 9.6.3
-        GHC == 9.4.7
+        GHC == 9.4.8
         GHC == 9.2.8
         GHC == 9.0.2
         GHC == 8.10.7
diff --git a/packages/grammar/happy-grammar.cabal b/packages/grammar/happy-grammar.cabal
index 11c2952d..506edf3d 100644
--- a/packages/grammar/happy-grammar.cabal
+++ b/packages/grammar/happy-grammar.cabal
@@ -21,7 +21,7 @@ Description:
 tested-with:
         GHC == 9.8.1
         GHC == 9.6.3
-        GHC == 9.4.7
+        GHC == 9.4.8
         GHC == 9.2.8
         GHC == 9.0.2
         GHC == 8.10.7
diff --git a/packages/tabular/happy-tabular.cabal b/packages/tabular/happy-tabular.cabal
index 6475c880..9bc8d374 100644
--- a/packages/tabular/happy-tabular.cabal
+++ b/packages/tabular/happy-tabular.cabal
@@ -22,7 +22,7 @@ Description:
 tested-with:
         GHC == 9.8.1
         GHC == 9.6.3
-        GHC == 9.4.7
+        GHC == 9.4.8
         GHC == 9.2.8
         GHC == 9.0.2
         GHC == 8.10.7