From ba2b7b4376487959d246ab17193e33cce0a3d170 Mon Sep 17 00:00:00 2001 From: Ryan Scott Date: Wed, 1 May 2024 18:35:13 -0400 Subject: [PATCH] Regenerate CI to use Jammy Jellyfish, test GHC 9.10.1 This requires a more recent version of `haskell-ci` that supports GHC 9.10.1. Another change that this more recent version of `haskell-ci` introduces is that it drops support for pre-20.04 versions of Ubuntu, so we must also upgrade to a more recent version of Ubuntu (I chose Ubuntu 22.04, or Jammy Jellyfish). Unfortunately, `haskell-ci`'s GHCJS support no longer works with recent versions of Ubuntu (see https://github.com/haskell-CI/haskell-ci/issues/723), so I had to remove the GHCJS configuration from the CI. This does not mean that `singletons` is dropping JavaScript support, however, as we still plan to support building the `singletons` library with GHC's JavaScript backend (the modern successor to GHCJS). There is currently no way to set up a GHC JavaScript backend CI job using `haskell-ci`, and the amount of setup required to manually create one is such that I'm putting it off for now. If someone asks for it, we can add one later. --- .github/workflows/haskell-ci.yml | 142 ++++++++++---------------- README.md | 8 +- cabal.haskell-ci | 7 +- singletons-base/singletons-base.cabal | 2 +- singletons-th/singletons-th.cabal | 2 +- singletons/singletons.cabal | 8 +- 6 files changed, 65 insertions(+), 104 deletions(-) diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index 7ce302b0..7b5357ea 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.18.1 +# version: 0.19.20240512 # -# REGENDATA ("0.18.1",["github","cabal.project"]) +# REGENDATA ("0.19.20240512",["github","cabal.project"]) # name: Haskell-CI on: @@ -23,29 +23,29 @@ jobs: timeout-minutes: 60 container: - image: buildpack-deps:bionic + image: buildpack-deps:jammy continue-on-error: ${{ matrix.allow-failure }} strategy: matrix: include: - - compiler: ghcjs-8.4 - compilerKind: ghcjs - compilerVersion: "8.4" - setup-method: hvr-ppa + - compiler: ghc-9.10.1 + compilerKind: ghc + compilerVersion: 9.10.1 + setup-method: ghcup allow-failure: false - - compiler: ghc-9.8.1 + - compiler: ghc-9.8.2 compilerKind: ghc - compilerVersion: 9.8.1 + compilerVersion: 9.8.2 setup-method: ghcup allow-failure: false - - compiler: ghc-9.6.2 + - compiler: ghc-9.6.5 compilerKind: ghc - compilerVersion: 9.6.2 + compilerVersion: 9.6.5 setup-method: ghcup allow-failure: false - - compiler: ghc-9.4.5 + - compiler: ghc-9.4.8 compilerKind: ghc - compilerVersion: 9.4.5 + compilerVersion: 9.4.8 setup-method: ghcup allow-failure: false - compiler: ghc-9.2.7 @@ -66,65 +66,39 @@ 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 fail-fast: false steps: - - name: Set GHCJS environment variables - run: | - if [ $HCKIND = ghcjs ]; then - echo "GHCJS=true" >> "$GITHUB_ENV" - echo "GHCJSARITH=1" >> "$GITHUB_ENV" - else - echo "GHCJS=false" >> "$GITHUB_ENV" - echo "GHCJSARITH=0" >> "$GITHUB_ENV" - fi - env: - HCKIND: ${{ matrix.compilerKind }} - HCNAME: ${{ matrix.compiler }} - HCVER: ${{ matrix.compilerVersion }} - name: apt run: | apt-get update - 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.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.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 - if [ $((GHCJSARITH)) -ne 0 ] ; then curl -sSL "https://deb.nodesource.com/gpgkey/nodesource.gpg.key" | apt-key add - ; fi - if [ $((GHCJSARITH)) -ne 0 ] ; then apt-add-repository -y 'deb https://deb.nodesource.com/node_10.x bionic main' ; fi - 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.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.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false) - fi + apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5 libnuma-dev + mkdir -p "$HOME/.ghcup/bin" + 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.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false) env: HCKIND: ${{ matrix.compilerKind }} HCNAME: ${{ matrix.compiler }} @@ -132,33 +106,24 @@ jobs: - name: Set PATH and environment variables run: | echo "$HOME/.cabal/bin" >> $GITHUB_PATH - if [ $((GHCJSARITH)) -ne 0 ] ; then echo "/opt/ghc/8.4.4/bin" >> $GITHUB_PATH ; fi echo "LANG=C.UTF-8" >> "$GITHUB_ENV" echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV" echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV" HCDIR=/opt/$HCKIND/$HCVER - if [ "${{ matrix.setup-method }}" = ghcup ]; then - 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" - 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.2.0 -vnormal+nowrap" >> "$GITHUB_ENV" - fi - + 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" + echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.2.0 -vnormal+nowrap" >> "$GITHUB_ENV" 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 [ $((! GHCJSARITH && HCNUMVER >= 90800)) -ne 0 ] ; then echo "HEADHACKAGE=true" >> "$GITHUB_ENV" ; else echo "HEADHACKAGE=false" >> "$GITHUB_ENV" ; fi + if [ $((HCNUMVER >= 91000)) -ne 0 ] ; then echo "HEADHACKAGE=true" >> "$GITHUB_ENV" ; else echo "HEADHACKAGE=false" >> "$GITHUB_ENV" ; fi echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV" + echo "GHCJSARITH=0" >> "$GITHUB_ENV" env: HCKIND: ${{ matrix.compilerKind }} HCNAME: ${{ matrix.compiler }} @@ -194,7 +159,6 @@ jobs: 26021a13b401500c8eb2761ca95c61f2d625bfef951b939a8124ed12ecf07329 f76d08be13e9a61a377a85e2fb63f4c5435d40f8feb3e12eb05905edb8cdea89 key-threshold: 3 - active-repositories: hackage.haskell.org, head.hackage.ghc.haskell.org:override EOF fi cat >> $CABAL_CONFIG <> cabal.project - 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 + if [ $((HCNUMVER >= 91000)) -ne 0 ] ; then echo "packages: $GITHUB_WORKSPACE/source/./singletons-th" >> cabal.project ; fi + if [ $((HCNUMVER >= 91000)) -ne 0 ] ; then echo "packages: $GITHUB_WORKSPACE/source/./singletons-base" >> cabal.project ; fi cat cabal.project - name: sdist run: | @@ -252,14 +214,14 @@ jobs: touch cabal.project touch cabal.project.local echo "packages: ${PKGDIR_singletons}" >> cabal.project - 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 >= 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 + if [ $((HCNUMVER >= 91000)) -ne 0 ] ; then echo "packages: ${PKGDIR_singletons_th}" >> cabal.project ; fi + if [ $((HCNUMVER >= 91000)) -ne 0 ] ; then echo "packages: ${PKGDIR_singletons_base}" >> cabal.project ; fi + if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo "package singletons" >> cabal.project ; fi + if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi + if [ $((HCNUMVER >= 91000)) -ne 0 ] ; then echo "package singletons-th" >> cabal.project ; fi + if [ $((HCNUMVER >= 91000)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi + if [ $((HCNUMVER >= 91000)) -ne 0 ] ; then echo "package singletons-base" >> cabal.project ; fi + if [ $((HCNUMVER >= 91000)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi cat >> cabal.project <= 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 + if [ $((HCNUMVER >= 91000)) -ne 0 ] ; then cd ${PKGDIR_singletons_th} || false ; fi + if [ $((HCNUMVER >= 91000)) -ne 0 ] ; then ${CABAL} -vnormal check ; fi + if [ $((HCNUMVER >= 91000)) -ne 0 ] ; then cd ${PKGDIR_singletons_base} || false ; fi + if [ $((HCNUMVER >= 91000)) -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 + $CABAL v2-haddock --disable-documentation $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all - name: save cache - uses: actions/cache/save@v3 + uses: actions/cache/save@v4 if: always() with: key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }} diff --git a/README.md b/README.md index f9bc9d13..35850347 100644 --- a/README.md +++ b/README.md @@ -56,11 +56,9 @@ Compatibility windows for requirements on the compiler version needed to build each library: * `singletons` is a minimal library, and as such, it has a relatively - wide support window. `singletons` must be built with one of the following - compilers: - - * GHC 8.0 or greater - * GHCJS + wide support window. `singletons` must be built with GHC 8.0 or later. + `singletons` aims to support cross-compilers as well (e.g., GHC's JavaScript + backend). * `singletons-th` and `singletons-base` require use of many bleeding-edge GHC language extensions, even more so than `singletons` itself. As such, it is difficult to maintain support for multiple GHC versions in any given diff --git a/cabal.haskell-ci b/cabal.haskell-ci index 3b95e162..29812895 100644 --- a/cabal.haskell-ci +++ b/cabal.haskell-ci @@ -1,8 +1,9 @@ -distribution: bionic +distribution: jammy no-tests-no-benchmarks: False unconstrained: False jobs-selection: any -- Needed to avoid https://github.com/haskell/cabal/issues/5423 haddock-components: libs --- Temporarily use head.hackage for GHC 9.8 until the ecosystem catches up -head-hackage: >= 9.8 +-- Using `active-repositories: ..., head.hackage.ghc.haskell.org:override` +-- tends not to work well with singletons-base's custom Setup script. +head-hackage-override: False diff --git a/singletons-base/singletons-base.cabal b/singletons-base/singletons-base.cabal index 11d6052e..e797d751 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.8.1 +tested-with: GHC == 9.10.1 extra-source-files: README.md, CHANGES.md, tests/README.md, tests/compile-and-dump/GradingClient/*.hs, tests/compile-and-dump/InsertionSort/*.hs, diff --git a/singletons-th/singletons-th.cabal b/singletons-th/singletons-th.cabal index a2e5ac8f..d6700f14 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.8.1 +tested-with: GHC == 9.10.1 extra-source-files: README.md, CHANGES.md license: BSD3 license-file: LICENSE diff --git a/singletons/singletons.cabal b/singletons/singletons.cabal index ad735327..7a2d0647 100644 --- a/singletons/singletons.cabal +++ b/singletons/singletons.cabal @@ -16,10 +16,10 @@ tested-with: GHC == 8.0.2 , GHC == 8.10.7 , GHC == 9.0.2 , GHC == 9.2.7 - , GHC == 9.4.5 - , GHC == 9.6.2 - , GHC == 9.8.1 - , GHCJS==8.4 + , GHC == 9.4.8 + , GHC == 9.6.5 + , GHC == 9.8.2 + , GHC == 9.10.1 extra-source-files: README.md, CHANGES.md license: BSD3 license-file: LICENSE