From e5346f100492f6144d36ec114974e3d75067c285 Mon Sep 17 00:00:00 2001 From: Ryan Scott Date: Sat, 30 Sep 2023 22:13:32 -0400 Subject: [PATCH] CI: Test GHC 9.8 --- .github/workflows/haskell-ci.yml | 64 ++++++++++++++++++--------- README.md | 2 +- cabal.haskell-ci | 1 + github.yml.patch | 13 ++++++ singletons-base/README.md | 2 +- singletons-base/singletons-base.cabal | 4 +- singletons-th/README.md | 2 +- singletons-th/singletons-th.cabal | 4 +- singletons/singletons.cabal | 1 + 9 files changed, 66 insertions(+), 27 deletions(-) create mode 100644 github.yml.patch diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index 15b21774..5bea07c5 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.6 +# version: 0.17.20230929 # -# REGENDATA ("0.16.6",["github","cabal.project"]) +# REGENDATA ("0.17.20230929",["github","cabal.project"]) # name: Haskell-CI on: @@ -33,6 +33,11 @@ jobs: compilerVersion: "8.4" setup-method: hvr-ppa allow-failure: false + - compiler: ghc-9.8.0.20230929 + compilerKind: ghc + compilerVersion: 9.8.0.20230929 + setup-method: ghcup + allow-failure: false - compiler: ghc-9.6.2 compilerKind: ghc compilerVersion: 9.6.2 @@ -104,8 +109,9 @@ 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.19.5/x86_64-linux-ghcup-0.1.19.5 > "$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) else @@ -116,8 +122,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.19.5/x86_64-linux-ghcup-0.1.19.5 > "$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) fi env: @@ -133,10 +140,12 @@ 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 "HCPKG=$HCPKG" >> "$GITHUB_ENV" + echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV" echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.1.0 -vnormal+nowrap" >> "$GITHUB_ENV" else HC=$HCDIR/bin/$HCKIND @@ -150,7 +159,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 [ $((! GHCJSARITH && HCNUMVER >= 90800)) -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 }} @@ -178,6 +187,18 @@ jobs: repository hackage.haskell.org url: http://hackage.haskell.org/ EOF + if $HEADHACKAGE; then + cat >> $CABAL_CONFIG <> $CABAL_CONFIG <> cabal.project - if [ $((! GHCJSARITH && HCNUMVER >= 90600)) -ne 0 ] ; then echo "packages: $GITHUB_WORKSPACE/source/./singletons-th" >> cabal.project ; fi - if [ $((! GHCJSARITH && HCNUMVER >= 90600)) -ne 0 ] ; then echo "packages: $GITHUB_WORKSPACE/source/./singletons-base" >> cabal.project ; fi + if [ $((! GHCJSARITH && HCNUMVER >= 90800)) -ne 0 ] ; then echo "packages: $GITHUB_WORKSPACE/source/./singletons-th" >> cabal.project ; fi + if [ $((! GHCJSARITH && HCNUMVER >= 90800)) -ne 0 ] ; then echo "packages: $GITHUB_WORKSPACE/source/./singletons-base" >> cabal.project ; fi cat cabal.project - name: sdist run: | @@ -233,20 +254,23 @@ jobs: touch cabal.project touch cabal.project.local echo "packages: ${PKGDIR_singletons}" >> cabal.project - if [ $((! GHCJSARITH && HCNUMVER >= 90600)) -ne 0 ] ; then echo "packages: ${PKGDIR_singletons_th}" >> cabal.project ; fi - if [ $((! GHCJSARITH && HCNUMVER >= 90600)) -ne 0 ] ; then echo "packages: ${PKGDIR_singletons_base}" >> cabal.project ; fi + if [ $((! GHCJSARITH && HCNUMVER >= 90800)) -ne 0 ] ; then echo "packages: ${PKGDIR_singletons_th}" >> cabal.project ; fi + if [ $((! GHCJSARITH && HCNUMVER >= 90800)) -ne 0 ] ; then echo "packages: ${PKGDIR_singletons_base}" >> cabal.project ; fi if [ $((GHCJSARITH || ! GHCJSARITH && HCNUMVER >= 80200)) -ne 0 ] ; then echo "package singletons" >> cabal.project ; fi if [ $((GHCJSARITH || ! GHCJSARITH && HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi - if [ $((! GHCJSARITH && HCNUMVER >= 90600)) -ne 0 ] ; then echo "package singletons-th" >> cabal.project ; fi - if [ $((! GHCJSARITH && HCNUMVER >= 90600)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi - if [ $((! GHCJSARITH && HCNUMVER >= 90600)) -ne 0 ] ; then echo "package singletons-base" >> cabal.project ; fi - if [ $((! GHCJSARITH && HCNUMVER >= 90600)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi + if [ $((! GHCJSARITH && HCNUMVER >= 90800)) -ne 0 ] ; then echo "package singletons-th" >> cabal.project ; fi + if [ $((! GHCJSARITH && HCNUMVER >= 90800)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi + if [ $((! GHCJSARITH && HCNUMVER >= 90800)) -ne 0 ] ; then echo "package singletons-base" >> cabal.project ; fi + if [ $((! GHCJSARITH && HCNUMVER >= 90800)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi cat >> cabal.project <> cabal.project + fi $HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(singletons|singletons-base|singletons-th)$/; }' >> cabal.project.local cat cabal.project cat cabal.project.local @@ -274,10 +298,10 @@ jobs: run: | cd ${PKGDIR_singletons} || false ${CABAL} -vnormal check - if [ $((! GHCJSARITH && HCNUMVER >= 90600)) -ne 0 ] ; then cd ${PKGDIR_singletons_th} || false ; fi - if [ $((! GHCJSARITH && HCNUMVER >= 90600)) -ne 0 ] ; then ${CABAL} -vnormal check ; fi - if [ $((! GHCJSARITH && HCNUMVER >= 90600)) -ne 0 ] ; then cd ${PKGDIR_singletons_base} || false ; fi - if [ $((! GHCJSARITH && HCNUMVER >= 90600)) -ne 0 ] ; then ${CABAL} -vnormal check ; fi + if [ $((! GHCJSARITH && HCNUMVER >= 90800)) -ne 0 ] ; then cd ${PKGDIR_singletons_th} || false ; fi + if [ $((! GHCJSARITH && HCNUMVER >= 90800)) -ne 0 ] ; then ${CABAL} -vnormal check ; fi + if [ $((! GHCJSARITH && HCNUMVER >= 90800)) -ne 0 ] ; then cd ${PKGDIR_singletons_base} || false ; fi + if [ $((! GHCJSARITH && HCNUMVER >= 90800)) -ne 0 ] ; then ${CABAL} -vnormal check ; fi - name: haddock run: | if [ $((! GHCJSARITH)) -ne 0 ] ; then $CABAL v2-haddock --disable-documentation $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all ; fi diff --git a/README.md b/README.md index a1d98c94..a9e79478 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,7 @@ windows for requirements on the compiler version needed to build each library: GHC language extensions, even more so than `singletons` itself. As such, it is difficult to maintain support for multiple GHC versions in any given release of either library, so they only support the latest major GHC version - (currently GHC 9.6). + (currently GHC 9.8). Any code that uses the singleton-generation functionality from `singletons-th` or `singletons-base` needs to enable a long list of GHC extensions. This list diff --git a/cabal.haskell-ci b/cabal.haskell-ci index 0f5a9817..9ea3fba6 100644 --- a/cabal.haskell-ci +++ b/cabal.haskell-ci @@ -4,3 +4,4 @@ unconstrained: False jobs-selection: any -- Needed to avoid https://github.com/haskell/cabal/issues/5423 haddock-components: libs +github-patches: github.yml.patch diff --git a/github.yml.patch b/github.yml.patch new file mode 100644 index 00000000..824b8313 --- /dev/null +++ b/github.yml.patch @@ -0,0 +1,13 @@ +diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml +index b7c241e..5bea07c 100644 +--- a/.github/workflows/haskell-ci.yml ++++ b/.github/workflows/haskell-ci.yml +@@ -37,7 +37,7 @@ jobs: + compilerKind: ghc + compilerVersion: 9.8.0.20230929 + setup-method: ghcup +- allow-failure: true ++ allow-failure: false + - compiler: ghc-9.6.2 + compilerKind: ghc + compilerVersion: 9.6.2 diff --git a/singletons-base/README.md b/singletons-base/README.md index 685facc4..fcc1110b 100644 --- a/singletons-base/README.md +++ b/singletons-base/README.md @@ -18,7 +18,7 @@ that code with `singletons-base`. `singletons-base` uses code that relies on bleeding-edge GHC language extensions. As such, `singletons-base` only supports the latest major version -of GHC (currently GHC 9.6). For more information, +of GHC (currently GHC 9.8). For more information, consult the `singletons` [`README`](https://github.com/goldfirere/singletons/blob/master/README.md). diff --git a/singletons-base/singletons-base.cabal b/singletons-base/singletons-base.cabal index c4efdbb2..faac6eda 100644 --- a/singletons-base/singletons-base.cabal +++ b/singletons-base/singletons-base.cabal @@ -8,7 +8,7 @@ author: Richard Eisenberg , Jan Stolarek bug-reports: https://github.com/goldfirere/singletons/issues stability: experimental -tested-with: GHC == 9.6.2 +tested-with: GHC == 9.8.1 extra-source-files: README.md, CHANGES.md, tests/README.md, tests/compile-and-dump/GradingClient/*.hs, tests/compile-and-dump/InsertionSort/*.hs, @@ -38,7 +38,7 @@ description: . @singletons-base@ uses code that relies on bleeding-edge GHC language extensions. As such, @singletons-base@ only supports the latest major version - of GHC (currently GHC 9.6). For more information, + of GHC (currently GHC 9.8). For more information, consult the @singletons@ @@. . diff --git a/singletons-th/README.md b/singletons-th/README.md index 0b832ebb..e3f94127 100644 --- a/singletons-th/README.md +++ b/singletons-th/README.md @@ -14,7 +14,7 @@ which describes how promotion works in greater detail. `singletons-th` generates code that relies on bleeding-edge GHC language extensions. As such, `singletons-th` only supports the latest major version -of GHC (currently GHC 9.6). For more information, +of GHC (currently GHC 9.8). For more information, consult the `singletons` [`README`](https://github.com/goldfirere/singletons/blob/master/README.md). diff --git a/singletons-th/singletons-th.cabal b/singletons-th/singletons-th.cabal index f1cc80ae..8bf6a7f2 100644 --- a/singletons-th/singletons-th.cabal +++ b/singletons-th/singletons-th.cabal @@ -8,7 +8,7 @@ author: Richard Eisenberg , Jan Stolarek bug-reports: https://github.com/goldfirere/singletons/issues stability: experimental -tested-with: GHC == 9.6.2 +tested-with: GHC == 9.8.1 extra-source-files: README.md, CHANGES.md license: BSD3 license-file: LICENSE @@ -26,7 +26,7 @@ description: . @singletons-th@ generates code that relies on bleeding-edge GHC language extensions. As such, @singletons-th@ only supports the latest major version - of GHC (currently GHC 9.6). For more information, + of GHC (currently GHC 9.8). For more information, consult the @singletons@ @@. . diff --git a/singletons/singletons.cabal b/singletons/singletons.cabal index 67341816..7e360c4c 100644 --- a/singletons/singletons.cabal +++ b/singletons/singletons.cabal @@ -18,6 +18,7 @@ tested-with: GHC == 8.0.2 , GHC == 9.2.7 , GHC == 9.4.5 , GHC == 9.6.2 + , GHC == 9.8.1 , GHCJS==8.4 extra-source-files: README.md, CHANGES.md license: BSD3