From c87201f35f4c54fef60e1d4c47a86df9daba9903 Mon Sep 17 00:00:00 2001 From: Jan Hrcek <2716069+jhrcek@users.noreply.github.com> Date: Mon, 10 Jun 2024 14:05:06 +0200 Subject: [PATCH] Add support for GHC 9.10 (#75) * Add support for GHC 9.10 * Flip conditional * Switch to base based CPP * Undo manual changes in ci config * Update changelog * Add index-state * Try removing Setup.hs * Try cabal 3.12.0.0 prerelease --- .github/workflows/haskell-ci.yml | 37 ++++++++++++++++++++------------ CHANGELOG.md | 4 ++++ Setup.hs | 2 -- cabal.project | 2 ++ hiedb.cabal | 9 ++++---- test/Main.hs | 7 +++++- 6 files changed, 40 insertions(+), 21 deletions(-) delete mode 100644 Setup.hs diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index 88d554c..dd9436e 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.17.20240109 +# version: 0.19.20240514 # -# REGENDATA ("0.17.20240109",["github","cabal.project"]) +# REGENDATA ("0.19.20240514",["github","cabal.project"]) # name: Haskell-CI on: @@ -23,19 +23,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.8.1 + - compiler: ghc-9.10.1 compilerKind: ghc - compilerVersion: 9.8.1 + compilerVersion: 9.10.1 setup-method: ghcup allow-failure: false - - compiler: ghc-9.6.4 + - compiler: ghc-9.8.2 compilerKind: ghc - compilerVersion: 9.6.4 + compilerVersion: 9.8.2 + setup-method: ghcup + allow-failure: false + - compiler: ghc-9.6.5 + compilerKind: ghc + compilerVersion: 9.6.5 setup-method: ghcup allow-failure: false - compiler: ghc-9.4.8 @@ -60,10 +65,13 @@ jobs: apt-get update apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5 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" + curl -sL https://downloads.haskell.org/ghcup/0.1.22.0/x86_64-linux-ghcup-0.1.22.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 + # From https://discourse.haskell.org/t/ann-cabal-3-12-0-0-released/9504 + "$HOME/.ghcup/bin/ghcup" --no-cache install cabal -u 'https://gitlab.haskell.org/haskell/cabal/-/jobs/1848320/artifacts/raw/out/cabal-install-3.11.0.0-x86_64-linux-alpine3_12.tar.xz' 3.12.0.0-prerelease || (cat "$HOME"/.ghcup/logs/*.* && false) + "$HOME/.ghcup/bin/cabal-3.12.0.0-prerelease" --version || true "$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 }} @@ -81,7 +89,7 @@ jobs: 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" + echo "CABAL=$HOME/.ghcup/bin/cabal-3.12.0.0-prerelease -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" @@ -138,7 +146,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 @@ -165,8 +173,9 @@ jobs: echo "package hiedb" >> cabal.project echo " ghc-options: -Werror=missing-methods" >> cabal.project cat >> cabal.project <> cabal.project.local + $HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(hiedb)$/; }' >> cabal.project.local cat cabal.project cat cabal.project.local - name: dump install plan @@ -174,7 +183,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 @@ -204,7 +213,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/CHANGELOG.md b/CHANGELOG.md index d646776..e3643a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Revision history for hiedb +## Unreleased + +* Bump base and ghc version bounds to support GHC 9.10 + ## 0.6.0.0 -- 2024-02-11 * Add index on column `unit` of table `mods` 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.project b/cabal.project index e6fdbad..2e6d125 100644 --- a/cabal.project +++ b/cabal.project @@ -1 +1,3 @@ packages: . +allow-newer: hie-compat:base + diff --git a/hiedb.cabal b/hiedb.cabal index 68e3f92..a4c42b0 100644 --- a/hiedb.cabal +++ b/hiedb.cabal @@ -19,8 +19,9 @@ extra-source-files: tested-with: GHC ==9.0.2 || ==9.2.8 || ==9.4.8 - || ==9.6.4 - || ==9.8.1 + || ==9.6.5 + || ==9.8.2 + || ==9.10.1 source-repository head type: git @@ -28,7 +29,7 @@ source-repository head common common-options default-language: Haskell2010 - build-depends: base >= 4.12 && < 4.20 + build-depends: base >= 4.12 && < 4.21 ghc-options: -Wall -Wcompat -Widentities @@ -59,7 +60,7 @@ library HieDb.Dump, HieDb.Html, HieDb.Run - build-depends: ghc >= 8.6 && < 9.9 + build-depends: ghc >= 8.6 && < 9.11 , array , containers , filepath diff --git a/test/Main.hs b/test/Main.hs index b3557a1..c716905 100644 --- a/test/Main.hs +++ b/test/Main.hs @@ -191,7 +191,12 @@ cliSpec = (exitCode, actualStdout, actualStderr) <- runHieDbCli ["point-defs", "Module1", "13", "24"] actualStdout `shouldBe` "" exitCode `shouldBe` ExitFailure 1 - actualStderr `shouldBe` "Couldn't find name: $ from module GHC.Base(base)\n" + actualStderr `shouldBe` +#if MIN_VERSION_base(4,20,0) + "Couldn't find name: $ from module GHC.Internal.Base(ghc-internal)\n" +#else + "Couldn't find name: $ from module GHC.Base(base)\n" +#endif describe "point-info" $ do it "gives information about symbol at specified location" $