From 1132ce687633a8e2237266cf3160ee35839a453c Mon Sep 17 00:00:00 2001 From: amesgen Date: Fri, 31 May 2024 00:26:11 +0200 Subject: [PATCH 1/2] Support GHC 9.10, minor adjustments --- .github/workflows/haskell-ci.yml | 86 ++++++++++++++------------------ Setup.hs | 2 - cabal.haskell-ci | 2 + safe-wild-cards.cabal | 16 +++--- 4 files changed, 49 insertions(+), 57 deletions(-) delete mode 100644 Setup.hs create mode 100644 cabal.haskell-ci diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index 63c67f1..5c21a4a 100644 --- a/.github/workflows/haskell-ci.yml +++ b/.github/workflows/haskell-ci.yml @@ -8,14 +8,18 @@ # # For more information, see https://github.com/haskell-CI/haskell-ci # -# version: 0.18.1 +# version: 0.19.20240514 # -# REGENDATA ("0.18.1",["github","safe-wild-cards.cabal"]) +# REGENDATA ("0.19.20240514",["github","safe-wild-cards.cabal"]) # name: Haskell-CI on: - - push - - pull_request + push: + branches: + - master + pull_request: + branches: + - master jobs: linux: name: Haskell-CI - Linux - ${{ matrix.compiler }} @@ -23,19 +27,24 @@ jobs: timeout-minutes: 60 container: - image: buildpack-deps:bionic + image: buildpack-deps:jammy continue-on-error: ${{ matrix.allow-failure }} strategy: matrix: include: + - compiler: ghc-9.10.1 + compilerKind: ghc + compilerVersion: 9.10.1 + setup-method: ghcup + allow-failure: false - compiler: ghc-9.8.2 compilerKind: ghc compilerVersion: 9.8.2 setup-method: ghcup allow-failure: false - - compiler: ghc-9.6.4 + - compiler: ghc-9.6.5 compilerKind: ghc - compilerVersion: 9.6.4 + compilerVersion: 9.6.5 setup-method: ghcup allow-failure: false - compiler: ghc-9.4.8 @@ -61,49 +70,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: 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' - apt-get update - apt-get install -y "$HCNAME" - 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 }} @@ -115,22 +114,13 @@ jobs: 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" @@ -187,7 +177,7 @@ 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 @@ -215,7 +205,7 @@ jobs: if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi cat >> cabal.project <> cabal.project.local + $HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(safe-wild-cards)$/; }' >> cabal.project.local cat cabal.project cat cabal.project.local - name: dump install plan @@ -223,7 +213,7 @@ jobs: $CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all cabal-plan - name: restore cache - uses: actions/cache/restore@v3 + uses: actions/cache/restore@v4 with: key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }} path: ~/.cabal/store @@ -253,7 +243,7 @@ jobs: rm -f cabal.project.local $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks 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/Setup.hs b/Setup.hs deleted file mode 100644 index 9a994af..0000000 --- a/Setup.hs +++ /dev/null @@ -1,2 +0,0 @@ -import Distribution.Simple -main = defaultMain diff --git a/cabal.haskell-ci b/cabal.haskell-ci new file mode 100644 index 0000000..1c4f4c5 --- /dev/null +++ b/cabal.haskell-ci @@ -0,0 +1,2 @@ +branches: master +ghcup-jobs: >=0 diff --git a/safe-wild-cards.cabal b/safe-wild-cards.cabal index 1a38a06..83383d0 100644 --- a/safe-wild-cards.cabal +++ b/safe-wild-cards.cabal @@ -1,4 +1,4 @@ -cabal-version: >=1.10 +cabal-version: 3.0 name: safe-wild-cards version: 1.0.0.1 @@ -7,16 +7,17 @@ description: @-XRecordWildCards@ is convenient, but sometimes you want to assert that you have handled all fields of a record, and there is no easy way to do that. -license: BSD3 +license: BSD-3-Clause license-file: LICENSE author: Emily April Kazak -maintainer: Monadfix +maintainer: amesgen homepage: https://github.com/monadfix/safe-wild-cards category: Control build-type: Simple extra-source-files: - CHANGELOG.md README.md +extra-doc-files: + CHANGELOG.md tested-with: GHC ==8.0.2 GHC ==8.2.2 @@ -27,8 +28,9 @@ tested-with: GHC ==9.0.2 GHC ==9.2.8 GHC ==9.4.8 - GHC ==9.6.4 + GHC ==9.6.5 GHC ==9.8.2 + GHC ==9.10.1 source-repository head type: git @@ -39,8 +41,8 @@ library SafeWildCards build-depends: base <5, - template-haskell <2.22, - th-abstraction >=0.3 && <0.7 + template-haskell <2.23, + th-abstraction >=0.3 && <0.8 hs-source-dirs: src default-language: From 58d39fdcf2ef5a363799bc2a216b39049ddf0785 Mon Sep 17 00:00:00 2001 From: amesgen Date: Fri, 31 May 2024 20:42:13 +0200 Subject: [PATCH 2/2] Release 1.0.0.2 --- CHANGELOG.md | 4 ++++ safe-wild-cards.cabal | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 807eae8..73c9810 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Revision history for safe-wild-cards +## 1.0.0.2 + +* Dependency version bump for GHC 9.10. + ## 1.0.0.1 * Dependency version bump, thanks to @amesgen (https://github.com/monadfix/safe-wild-cards/pull/1). diff --git a/safe-wild-cards.cabal b/safe-wild-cards.cabal index 83383d0..6e7a820 100644 --- a/safe-wild-cards.cabal +++ b/safe-wild-cards.cabal @@ -1,7 +1,7 @@ cabal-version: 3.0 name: safe-wild-cards -version: 1.0.0.1 +version: 1.0.0.2 synopsis: Use RecordWildCards safely description: @-XRecordWildCards@ is convenient, but sometimes you want to assert that