Skip to content

Commit

Permalink
Add support for GHC 9.10 (#75)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
jhrcek authored Jun 10, 2024
1 parent cf132f1 commit c87201f
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 21 deletions.
37 changes: 23 additions & 14 deletions .github/workflows/haskell-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -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 }}
Expand All @@ -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"
Expand Down Expand Up @@ -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
Expand All @@ -165,16 +173,17 @@ jobs:
echo "package hiedb" >> cabal.project
echo " ghc-options: -Werror=missing-methods" >> cabal.project
cat >> cabal.project <<EOF
allow-newer: hie-compat:base
EOF
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(hiedb)$/; }' >> 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
run: |
$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
Expand Down Expand Up @@ -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 }}
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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`
Expand Down
2 changes: 0 additions & 2 deletions Setup.hs

This file was deleted.

2 changes: 2 additions & 0 deletions cabal.project
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
packages: .
allow-newer: hie-compat:base

9 changes: 5 additions & 4 deletions hiedb.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,17 @@ 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
location: https://github.com/wz1000/HieDb

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
Expand Down Expand Up @@ -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
Expand Down
7 changes: 6 additions & 1 deletion test/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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" $
Expand Down

0 comments on commit c87201f

Please sign in to comment.