From 00b18eb5219a917ec39f368fdd283db8c71d3408 Mon Sep 17 00:00:00 2001 From: Oleg Grenrus Date: Thu, 21 Aug 2025 18:08:44 +0300 Subject: [PATCH] Test with GHC-9.14-alpha1 --- .github/workflows/haskell-ci-bench.yml | 42 +++++++++++--------- .github/workflows/haskell-ci.yml | 53 ++++++++++++++++++-------- cabal.haskell-ci | 3 ++ cabal.project | 4 +- hashable.cabal | 16 +++----- src/Data/Hashable/Class.hs | 3 ++ 6 files changed, 77 insertions(+), 44 deletions(-) diff --git a/.github/workflows/haskell-ci-bench.yml b/.github/workflows/haskell-ci-bench.yml index 0524a6e..f72bc7f 100644 --- a/.github/workflows/haskell-ci-bench.yml +++ b/.github/workflows/haskell-ci-bench.yml @@ -8,9 +8,9 @@ # # For more information, see https://github.com/haskell-CI/haskell-ci # -# version: 0.19.20241109 +# version: 0.19.20250821 # -# REGENDATA ("0.19.20241109",["github","--project","cabal.bench.project","-o",".github/workflows/haskell-ci-bench.yml","--github-action-name","Benchmarks"]) +# REGENDATA ("0.19.20250821",["github","--project","cabal.bench.project","-o",".github/workflows/haskell-ci-bench.yml","--github-action-name","Benchmarks"]) # name: Benchmarks on: @@ -23,7 +23,7 @@ on: jobs: linux: name: Benchmarks - Linux - ${{ matrix.compiler }} - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 timeout-minutes: 60 container: @@ -49,16 +49,29 @@ jobs: allow-failure: false fail-fast: false steps: - - name: apt + - name: apt-get install run: | apt-get update apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5 + - name: Install GHCup + run: | mkdir -p "$HOME/.ghcup/bin" - curl -sL https://downloads.haskell.org/ghcup/0.1.30.0/x86_64-linux-ghcup-0.1.30.0 > "$HOME/.ghcup/bin/ghcup" + curl -sL https://downloads.haskell.org/ghcup/0.1.50.1/x86_64-linux-ghcup-0.1.50.1 > "$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.8.yaml; + - name: Install cabal-install + run: | + "$HOME/.ghcup/bin/ghcup" install cabal 3.16.0.0 || (cat "$HOME"/.ghcup/logs/*.* && false) + echo "CABAL=$HOME/.ghcup/bin/cabal-3.16.0.0 -vnormal+nowrap" >> "$GITHUB_ENV" + - name: Install GHC (GHCup) + if: matrix.setup-method == 'ghcup' + run: | "$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false) - "$HOME/.ghcup/bin/ghcup" install cabal 3.12.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false) + 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" env: HCKIND: ${{ matrix.compilerKind }} HCNAME: ${{ matrix.compiler }} @@ -69,21 +82,12 @@ jobs: 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 - 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.12.1.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=--disable-benchmarks" >> "$GITHUB_ENV" echo "HEADHACKAGE=false" >> "$GITHUB_ENV" echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV" - echo "GHCJSARITH=0" >> "$GITHUB_ENV" env: HCKIND: ${{ matrix.compilerKind }} HCNAME: ${{ matrix.compiler }} @@ -158,7 +162,9 @@ jobs: touch cabal.project.local echo "packages: ${PKGDIR_hashable_bench}" >> cabal.project echo "package hashable-bench" >> cabal.project - echo " ghc-options: -Werror=missing-methods" >> cabal.project + echo " ghc-options: -Werror=missing-methods -Werror=missing-fields" >> cabal.project + echo "package hashable-bench" >> cabal.project + echo " ghc-options: -Werror=incomplete-patterns -Werror=incomplete-uni-patterns" >> cabal.project cat >> cabal.project <> cabal.project.local @@ -217,8 +223,8 @@ jobs: $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='hashable +random-initial-seed' --dependencies-only -j2 all $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='hashable +random-initial-seed' all - name: save cache - uses: actions/cache/save@v4 if: always() + uses: actions/cache/save@v4 with: key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }} path: ~/.cabal/store diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index 49cc174..1baad0c 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.19.20241219 +# version: 0.19.20250821 # -# REGENDATA ("0.19.20241219",["github","cabal.project"]) +# REGENDATA ("0.19.20250821",["github","cabal.project"]) # name: Haskell-CI on: @@ -23,7 +23,7 @@ on: jobs: linux: name: Haskell-CI - Linux - ${{ matrix.compiler }} - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 timeout-minutes: 60 container: @@ -32,14 +32,19 @@ jobs: strategy: matrix: include: - - compiler: ghc-9.12.1 + - compiler: ghc-9.14.0.20250819 compilerKind: ghc - compilerVersion: 9.12.1 + compilerVersion: 9.14.0.20250819 + setup-method: ghcup-prerelease + allow-failure: false + - compiler: ghc-9.12.2 + compilerKind: ghc + compilerVersion: 9.12.2 setup-method: ghcup allow-failure: false - - compiler: ghc-9.10.1 + - compiler: ghc-9.10.2 compilerKind: ghc - compilerVersion: 9.10.1 + compilerVersion: 9.10.2 setup-method: ghcup allow-failure: false - compiler: ghc-9.8.3 @@ -66,13 +71,12 @@ jobs: - name: Install GHCup run: | mkdir -p "$HOME/.ghcup/bin" - curl -sL https://downloads.haskell.org/ghcup/0.1.30.0/x86_64-linux-ghcup-0.1.30.0 > "$HOME/.ghcup/bin/ghcup" + curl -sL https://downloads.haskell.org/ghcup/0.1.50.1/x86_64-linux-ghcup-0.1.50.1 > "$HOME/.ghcup/bin/ghcup" chmod a+x "$HOME/.ghcup/bin/ghcup" - - name: Install cabal-install (prerelease) + - name: Install cabal-install run: | - "$HOME/.ghcup/bin/ghcup" config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.8.yaml; - "$HOME/.ghcup/bin/ghcup" install cabal 3.15.0.0.2024.10.3 || (cat "$HOME"/.ghcup/logs/*.* && false) - echo "CABAL=$HOME/.ghcup/bin/cabal-3.15.0.0.2024.10.3 -vnormal+nowrap" >> "$GITHUB_ENV" + "$HOME/.ghcup/bin/ghcup" install cabal 3.16.0.0 || (cat "$HOME"/.ghcup/logs/*.* && false) + echo "CABAL=$HOME/.ghcup/bin/cabal-3.16.0.0 -vnormal+nowrap" >> "$GITHUB_ENV" - name: Install GHC (GHCup) if: matrix.setup-method == 'ghcup' run: | @@ -90,7 +94,22 @@ jobs: - name: Install GHC (GHCup vanilla) if: matrix.setup-method == 'ghcup-vanilla' run: | - "$HOME/.ghcup/bin/ghcup" -s https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-vanilla-0.0.8.yaml install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false) + "$HOME/.ghcup/bin/ghcup" -s https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-vanilla-0.0.9.yaml install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false) + 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" + env: + HCKIND: ${{ matrix.compilerKind }} + HCNAME: ${{ matrix.compiler }} + HCVER: ${{ matrix.compilerVersion }} + - name: Install GHC (GHCup prerelease) + if: matrix.setup-method == 'ghcup-prerelease' + run: | + "$HOME/.ghcup/bin/ghcup" config add-release-channel prereleases + "$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false) HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER") HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#') HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#') @@ -187,9 +206,13 @@ jobs: touch cabal.project.local echo "packages: ${PKGDIR_hashable}" >> cabal.project echo "package hashable" >> cabal.project - echo " ghc-options: -Werror=missing-methods" >> cabal.project + echo " ghc-options: -Werror=missing-methods -Werror=missing-fields" >> cabal.project + echo "package hashable" >> cabal.project + echo " ghc-options: -Werror=incomplete-patterns -Werror=incomplete-uni-patterns" >> cabal.project cat >> cabal.project <> cabal.project.local cat cabal.project diff --git a/cabal.haskell-ci b/cabal.haskell-ci index bfa194e..b3bd7db 100644 --- a/cabal.haskell-ci +++ b/cabal.haskell-ci @@ -17,3 +17,6 @@ constraint-set filepath-1.5 constraints: filepath ^>=1.5.2.0 tests: True run-tests: True + +-- TODO: filepath/os-string causes some issues +error-unused-packages: False diff --git a/cabal.project b/cabal.project index e51943d..7faf334 100644 --- a/cabal.project +++ b/cabal.project @@ -1,7 +1,9 @@ packages: . tests: True -allow-newer: splitmix-0.1.0.5:base +allow-newer: splitmix-0.1.3.1:base +allow-newer: primitive-0.9.1.0:base +allow-newer: tagged-0.8.9:template-haskell -- -- allow-newer: base diff --git a/hashable.cabal b/hashable.cabal index 618b0e5..35e5e45 100644 --- a/hashable.cabal +++ b/hashable.cabal @@ -32,7 +32,7 @@ stability: Provisional category: Data build-type: Simple tested-with: - GHC ==9.6.5 || ==9.8.2 || ==9.8.3 || ==9.10.1 || ==9.12.1 + GHC ==9.6.5 || ==9.8.2 || ==9.8.3 || ==9.10.2 || ==9.12.2 || ==9.14.1 extra-source-files: CHANGES.md @@ -83,13 +83,15 @@ library hs-source-dirs: src build-depends: - , base >=4.18.0.0 && <4.22 + , base >=4.18.0.0 && <4.23 , bytestring >=0.11.5.3 && <0.13 - , containers >=0.6.7 && <0.8 + , containers >=0.6.7 && <0.9 , deepseq >=1.4.8.1 && <1.6 - , ghc-prim , text >=2.0.2 && <2.2 + if impl(ghc <9.8) + build-depends: ghc-prim + -- depend on os-string on newer GHCs only. -- os-string has tight lower bound on bytestring, which prevents -- using bundled version on older GHCs. @@ -99,9 +101,6 @@ library -- therefore there is else-branch with stricter upper bound. build-depends: filepath >=1.4.200.1 && <1.6 - -- Integer internals - build-depends: ghc-bignum >=1.3 && <1.4 - if (flag(random-initial-seed) && impl(ghc)) cpp-options: -DHASHABLE_RANDOM_SEED=1 @@ -154,9 +153,7 @@ test-suite hashable-tests , filepath , ghc-prim , hashable - , HUnit , QuickCheck >=2.15 - , random >=1.0 && <1.3 , tasty ^>=1.5 , tasty-hunit ^>=0.10.1 , tasty-quickcheck ^>=0.10.3 || ^>=0.11 @@ -166,7 +163,6 @@ test-suite hashable-tests build-depends: os-string if !os(windows) - build-depends: unix cpp-options: -DHAVE_MMAP other-modules: Regress.Mmap other-extensions: CApiFFI diff --git a/src/Data/Hashable/Class.hs b/src/Data/Hashable/Class.hs index 9de9209..34b11dd 100644 --- a/src/Data/Hashable/Class.hs +++ b/src/Data/Hashable/Class.hs @@ -170,6 +170,9 @@ import Data.Hashable.XXH3 #include "MachDeps.h" +-- sometimes we need dependency of filepath, sometimes we dont +import System.FilePath () + infixl 0 `hashWithSalt` ------------------------------------------------------------------------