diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index 762209a..a4f090c 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.20240402 +# version: 0.19.20240501 # -# REGENDATA ("0.19.20240402",["github","cabal.project"]) +# REGENDATA ("0.19.20240501",["github","cabal.project"]) # name: Haskell-CI on: @@ -27,19 +27,14 @@ 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 - allow-failure: false - - compiler: ghc-9.10.0.20240328 + - compiler: ghc-9.10.0.20240426 compilerKind: ghc - compilerVersion: 9.10.0.20240328 + compilerVersion: 9.10.0.20240426 setup-method: ghcup allow-failure: false - compiler: ghc-9.8.2 @@ -70,104 +65,32 @@ jobs: - compiler: ghc-8.10.4 compilerKind: ghc compilerVersion: 8.10.4 - setup-method: hvr-ppa + setup-method: ghcup allow-failure: false - 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 - allow-failure: false - - compiler: ghc-8.4.4 - compilerKind: ghc - compilerVersion: 8.4.4 - setup-method: hvr-ppa - allow-failure: false - - compiler: ghc-8.2.2 - compilerKind: ghc - compilerVersion: 8.2.2 - setup-method: hvr-ppa - allow-failure: false - - compiler: ghc-8.0.2 - compilerKind: ghc - compilerVersion: 8.0.2 - setup-method: hvr-ppa - allow-failure: false - - compiler: ghc-7.10.3 - compilerKind: ghc - compilerVersion: 7.10.3 - setup-method: hvr-ppa - allow-failure: false - - compiler: ghc-7.8.4 - compilerKind: ghc - compilerVersion: 7.8.4 - setup-method: hvr-ppa - allow-failure: false - - compiler: ghc-7.6.3 - compilerKind: ghc - compilerVersion: 7.6.3 - setup-method: hvr-ppa - allow-failure: false - - compiler: ghc-7.4.2 - compilerKind: ghc - compilerVersion: 7.4.2 - setup-method: hvr-ppa - allow-failure: false - - compiler: ghc-7.2.2 - compilerKind: ghc - compilerVersion: 7.2.2 - setup-method: hvr-ppa - allow-failure: false - - compiler: ghc-7.0.4 - compilerKind: ghc - compilerVersion: 7.0.4 - 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" config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.8.yaml; - "$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) - apt-get update - apt-get install -y hugs libhugs-time-bundled libtestu01-0-dev - 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" hugs libhugs-time-bundled libtestu01-0-dev ghc-8.4.4 nodejs ; else apt-get install -y "$HCNAME" hugs libhugs-time-bundled libtestu01-0-dev ; 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" 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.10.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false) - 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" config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.8.yaml; + "$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) + apt-get update + apt-get install -y hugs libhugs-time-bundled libtestu01-0-dev env: HCKIND: ${{ matrix.compilerKind }} HCNAME: ${{ matrix.compiler }} @@ -175,33 +98,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" - if [ $((GHCJSARITH || ! GHCJSARITH && HCNUMVER >= 70400 && HCNUMVER < 90000)) -ne 0 ] ; then echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV" ; else echo "ARG_BENCH=--disable-benchmarks" >> "$GITHUB_ENV" ; fi + 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 }} @@ -238,16 +152,9 @@ jobs: $HC --version || true $HC --print-project-git-commit-id || true $CABAL --version || true - if [ $((GHCJSARITH)) -ne 0 ] ; then node --version ; fi - if [ $((GHCJSARITH)) -ne 0 ] ; then echo $GHCJS ; fi - name: update cabal index run: | $CABAL v2-update -v - - name: cache (tools) - uses: actions/cache/restore@v3 - with: - key: ${{ runner.os }}-${{ matrix.compiler }}-tools-f5b47a60 - path: ~/.haskell-ci-tools - name: install cabal-plan run: | mkdir -p $HOME/.cabal/bin @@ -260,24 +167,14 @@ jobs: - name: install cabal-docspec run: | mkdir -p $HOME/.cabal/bin - curl -sL https://github.com/phadej/cabal-extras/releases/download/cabal-docspec-0.0.0.20231219/cabal-docspec-0.0.0.20231219-x86_64-linux.xz > cabal-docspec.xz - echo '8b60448275466bbe2b9409741b5dd07a41c541283017b95b44efe6e31379d067 cabal-docspec.xz' | sha256sum -c - + curl -sL https://github.com/phadej/cabal-extras/releases/download/cabal-docspec-0.0.0.20240414/cabal-docspec-0.0.0.20240414-x86_64-linux.xz > cabal-docspec.xz + echo '2d18a3f79619e8ec5f11870f926f6dc2616e02a6c889315b7f82044b95a1adb9 cabal-docspec.xz' | sha256sum -c - xz -d < cabal-docspec.xz > $HOME/.cabal/bin/cabal-docspec rm -f cabal-docspec.xz chmod a+x $HOME/.cabal/bin/cabal-docspec cabal-docspec --version - - name: install doctest - run: | - if [ $((! GHCJSARITH && HCNUMVER >= 80000 && HCNUMVER < 90000)) -ne 0 ] ; then $CABAL --store-dir=$HOME/.haskell-ci-tools/store v2-install $ARG_COMPILER --ignore-project -j2 doctest --constraint='doctest ^>=0.22.0' ; fi - if [ $((! GHCJSARITH && HCNUMVER >= 80000 && HCNUMVER < 90000)) -ne 0 ] ; then doctest --version ; fi - - name: save cache (tools) - uses: actions/cache/save@v3 - if: always() - with: - key: ${{ runner.os }}-${{ matrix.compiler }}-tools-f5b47a60 - path: ~/.haskell-ci-tools - name: checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: path: source - name: initial cabal.project for sdist @@ -301,8 +198,8 @@ jobs: touch cabal.project touch cabal.project.local echo "packages: ${PKGDIR_splitmix}" >> cabal.project - if [ $((GHCJSARITH || ! GHCJSARITH && HCNUMVER >= 80200)) -ne 0 ] ; then echo "package splitmix" >> cabal.project ; fi - if [ $((GHCJSARITH || ! GHCJSARITH && HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi + echo "package splitmix" >> cabal.project + echo " ghc-options: -Werror=missing-methods" >> cabal.project cat >> cabal.project <= 80000 && HCNUMVER < 90000)) -ne 0 ] ; then cd ${PKGDIR_splitmix} || false ; fi - if [ $((! GHCJSARITH && HCNUMVER >= 80000 && HCNUMVER < 90000)) -ne 0 ] ; then doctest -XHaskell2010 src src-compat ; fi + $CABAL v2-test $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --test-show-details=direct - name: docspec run: | - if [ $((! GHCJSARITH && HCNUMVER >= 70600)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH all ; fi - if [ $((! GHCJSARITH && HCNUMVER >= 70600)) -ne 0 ] ; then cabal-docspec $ARG_COMPILER ; fi + $CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH all + cabal-docspec $ARG_COMPILER - name: cabal check run: | cd ${PKGDIR_splitmix} || false ${CABAL} -vnormal check - name: haddock run: | - if [ $((! GHCJSARITH)) -ne 0 ] ; then $CABAL v2-haddock --disable-documentation --haddock-all $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all ; fi + $CABAL v2-haddock --disable-documentation --haddock-all $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all - name: unconstrained build run: | rm -f cabal.project.local @@ -365,39 +251,39 @@ jobs: rm -f cabal.project.local - name: constraint set bytestring-0.12 run: | - if [ $((! GHCJSARITH && HCNUMVER >= 80200)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='bytestring ^>=0.12' all --dry-run ; fi - if [ $((! GHCJSARITH && HCNUMVER >= 80200)) -ne 0 ] ; then cabal-plan topo | sort ; fi - if [ $((! GHCJSARITH && HCNUMVER >= 80200)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='bytestring ^>=0.12' --dependencies-only -j2 all ; fi - if [ $((! GHCJSARITH && HCNUMVER >= 80200)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='bytestring ^>=0.12' all ; fi - if [ $((! GHCJSARITH && HCNUMVER >= 80200)) -ne 0 ] ; then $CABAL v2-test $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='bytestring ^>=0.12' all ; fi + $CABAL v2-build $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='bytestring ^>=0.12' all --dry-run + cabal-plan topo | sort + $CABAL v2-build $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='bytestring ^>=0.12' --dependencies-only -j2 all + $CABAL v2-build $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='bytestring ^>=0.12' all + $CABAL v2-test $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='bytestring ^>=0.12' all - name: constraint set bytestring-0.11 run: | - if [ $((! GHCJSARITH && HCNUMVER >= 70400 && HCNUMVER < 90800)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='bytestring ^>=0.11' all --dry-run ; fi - if [ $((! GHCJSARITH && HCNUMVER >= 70400 && HCNUMVER < 90800)) -ne 0 ] ; then cabal-plan topo | sort ; fi - if [ $((! GHCJSARITH && HCNUMVER >= 70400 && HCNUMVER < 90800)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='bytestring ^>=0.11' --dependencies-only -j2 all ; fi - if [ $((! GHCJSARITH && HCNUMVER >= 70400 && HCNUMVER < 90800)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='bytestring ^>=0.11' all ; fi - if [ $((! GHCJSARITH && HCNUMVER >= 70400 && HCNUMVER < 90800)) -ne 0 ] ; then $CABAL v2-test $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='bytestring ^>=0.11' all ; fi + if [ $((HCNUMVER < 90800)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='bytestring ^>=0.11' all --dry-run ; fi + if [ $((HCNUMVER < 90800)) -ne 0 ] ; then cabal-plan topo | sort ; fi + if [ $((HCNUMVER < 90800)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='bytestring ^>=0.11' --dependencies-only -j2 all ; fi + if [ $((HCNUMVER < 90800)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='bytestring ^>=0.11' all ; fi + if [ $((HCNUMVER < 90800)) -ne 0 ] ; then $CABAL v2-test $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='bytestring ^>=0.11' all ; fi - name: constraint set time-1.12 run: | - if [ $((! GHCJSARITH && HCNUMVER >= 80800)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='time ^>=1.12' all --dry-run ; fi - if [ $((! GHCJSARITH && HCNUMVER >= 80800)) -ne 0 ] ; then cabal-plan topo | sort ; fi - if [ $((! GHCJSARITH && HCNUMVER >= 80800)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='time ^>=1.12' --dependencies-only -j2 all ; fi - if [ $((! GHCJSARITH && HCNUMVER >= 80800)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='time ^>=1.12' all ; fi - if [ $((! GHCJSARITH && HCNUMVER >= 80800)) -ne 0 ] ; then $CABAL v2-test $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='time ^>=1.12' all ; fi + if [ $((HCNUMVER >= 80800)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='time ^>=1.12' all --dry-run ; fi + if [ $((HCNUMVER >= 80800)) -ne 0 ] ; then cabal-plan topo | sort ; fi + if [ $((HCNUMVER >= 80800)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='time ^>=1.12' --dependencies-only -j2 all ; fi + if [ $((HCNUMVER >= 80800)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='time ^>=1.12' all ; fi + if [ $((HCNUMVER >= 80800)) -ne 0 ] ; then $CABAL v2-test $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='time ^>=1.12' all ; fi - name: constraint set time-1.11 run: | - if [ $((GHCJSARITH || ! GHCJSARITH && HCNUMVER >= 80000 && HCNUMVER < 90400)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='time ^>=1.11' all --dry-run ; fi - if [ $((GHCJSARITH || ! GHCJSARITH && HCNUMVER >= 80000 && HCNUMVER < 90400)) -ne 0 ] ; then cabal-plan topo | sort ; fi - if [ $((GHCJSARITH || ! GHCJSARITH && HCNUMVER >= 80000 && HCNUMVER < 90400)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='time ^>=1.11' --dependencies-only -j2 all ; fi - if [ $((GHCJSARITH || ! GHCJSARITH && HCNUMVER >= 80000 && HCNUMVER < 90400)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='time ^>=1.11' all ; fi + if [ $((HCNUMVER < 90400)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='time ^>=1.11' all --dry-run ; fi + if [ $((HCNUMVER < 90400)) -ne 0 ] ; then cabal-plan topo | sort ; fi + if [ $((HCNUMVER < 90400)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='time ^>=1.11' --dependencies-only -j2 all ; fi + if [ $((HCNUMVER < 90400)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='time ^>=1.11' all ; fi - name: constraint set time-1.10 run: | - if [ $((GHCJSARITH || ! GHCJSARITH && HCNUMVER >= 80000 && HCNUMVER < 90400)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='time ^>=1.10' all --dry-run ; fi - if [ $((GHCJSARITH || ! GHCJSARITH && HCNUMVER >= 80000 && HCNUMVER < 90400)) -ne 0 ] ; then cabal-plan topo | sort ; fi - if [ $((GHCJSARITH || ! GHCJSARITH && HCNUMVER >= 80000 && HCNUMVER < 90400)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='time ^>=1.10' --dependencies-only -j2 all ; fi - if [ $((GHCJSARITH || ! GHCJSARITH && HCNUMVER >= 80000 && HCNUMVER < 90400)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='time ^>=1.10' all ; fi + if [ $((HCNUMVER < 90400)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='time ^>=1.10' all --dry-run ; fi + if [ $((HCNUMVER < 90400)) -ne 0 ] ; then cabal-plan topo | sort ; fi + if [ $((HCNUMVER < 90400)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='time ^>=1.10' --dependencies-only -j2 all ; fi + if [ $((HCNUMVER < 90400)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='time ^>=1.10' all ; fi - 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 b26cc82..994104a 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,3 +1,7 @@ +# 0.1.0.5 + +- Drop support for GHCs prior 8.6.5 + # 0.1.0.4 - Add TestU01 test-suite diff --git a/cabal.haskell-ci b/cabal.haskell-ci index 72b7d11..232673e 100644 --- a/cabal.haskell-ci +++ b/cabal.haskell-ci @@ -1,8 +1,6 @@ branches: master -doctest: <9 -docspec: >=7.6 -benchmarks: >=7.4 && <9 -ghcjs-tests: True +docspec: True +benchmarks: False apt: hugs libhugs-time-bundled libtestu01-0-dev head-hackage: False @@ -33,8 +31,3 @@ constraint-set bytestring-0.12 constraints: bytestring ^>=0.12 tests: True run-tests: True - -raw-travis: - export CABAL - export HC - if [ ! $GHCJS ]; then (cd ${PKGDIR_splitmix} && sh test-hugs.sh); fi diff --git a/splitmix.cabal b/splitmix.cabal index 1def7af..c42011c 100644 --- a/splitmix.cabal +++ b/splitmix.cabal @@ -1,7 +1,6 @@ cabal-version: >=1.10 name: splitmix -version: 0.1.0.5 -x-revision: 1 +version: 0.1.1 synopsis: Fast Splittable PRNG description: Pure Haskell implementation of SplitMix described in @@ -34,16 +33,7 @@ bug-reports: https://github.com/haskellari/splitmix/issues category: System, Random build-type: Simple tested-with: - GHC ==7.0.4 - || ==7.2.2 - || ==7.4.2 - || ==7.6.3 - || ==7.8.4 - || ==7.10.3 - || ==8.0.2 - || ==8.2.2 - || ==8.4.4 - || ==8.6.5 + GHC ==8.6.5 || ==8.8.4 || ==8.10.4 || ==9.0.2 @@ -52,7 +42,6 @@ tested-with: || ==9.6.4 || ==9.8.2 || ==9.10.1 - , GHCJS ==8.4 extra-source-files: Changelog.md @@ -82,8 +71,8 @@ library -- ghc-options: -fplugin=DumpCore -fplugin-opt DumpCore:core-html build-depends: - base >=4.3 && <4.21 - , deepseq >=1.3.0.0 && <1.6 + base >=4.12.0.0 && <4.21 + , deepseq >=1.4.4.0 && <1.6 if flag(optimised-mixer) cpp-options: -DOPTIMISED_MIX32=1 @@ -121,8 +110,8 @@ benchmark comparison main-is: Bench.hs build-depends: base - , containers >=0.4.2.1 && <0.8 - , criterion >=1.1.0.0 && <1.7 + , containers >=0.6.0.1 && <0.8 + , criterion >=1.6.0.0 && <1.7 , random , splitmix , tf-random >=0.5 && <0.6 @@ -150,9 +139,6 @@ benchmark range , random , splitmix - if !impl(ghcjs) - build-depends: clock >=0.8 && <0.9 - test-suite examples type: exitcode-stdio-1.0 default-language: Haskell2010 @@ -161,7 +147,7 @@ test-suite examples main-is: Examples.hs build-depends: base - , HUnit ==1.3.1.2 || >=1.6.0.0 && <1.7 + , HUnit >=1.6.0.0 && <1.7 , splitmix test-suite splitmix-tests @@ -176,10 +162,9 @@ test-suite splitmix-tests build-depends: base - , base-compat >=0.11.1 && <0.14 , containers >=0.4.0.0 && <0.8 - , HUnit ==1.3.1.2 || >=1.6.0.0 && <1.7 - , math-functions ==0.1.7.0 || >=0.3.3.0 && <0.4 + , HUnit >=1.6.0.0 && <1.7 + , math-functions >=0.3.3.0 && <0.4 , splitmix , test-framework >=0.8.2.0 && <0.9 , test-framework-hunit >=0.3.0.2 && <0.4 @@ -213,14 +198,13 @@ test-suite splitmix-dieharder build-depends: async >=2.2.1 && <2.3 , base - , base-compat-batteries >=0.10.5 && <0.14 - , bytestring >=0.9.1.8 && <0.13 + , bytestring >=0.10.8.2 && <0.13 , deepseq - , process >=1.0.1.5 && <1.7 + , process >=1.6.0.0 && <1.7 , random , splitmix , tf-random >=0.5 && <0.6 - , vector >=0.11.0.0 && <0.14 + , vector >=0.13.0.0 && <0.14 test-suite splitmix-testu01 if !os(linux) @@ -246,5 +230,5 @@ test-suite initialization main-is: Initialization.hs build-depends: base - , HUnit ==1.3.1.2 || >=1.6.0.0 && <1.7 + , HUnit >=1.6.0.0 && <1.7 , splitmix diff --git a/src-compat/Data/Bits/Compat.hs b/src-compat/Data/Bits/Compat.hs index 54728d4..d532f64 100644 --- a/src-compat/Data/Bits/Compat.hs +++ b/src-compat/Data/Bits/Compat.hs @@ -6,39 +6,4 @@ module Data.Bits.Compat ( countLeadingZeros, ) where -import Data.Bits - -#if !MIN_VERSION_base(4,7,0) -#define FiniteBits Bits -#endif - -#if !MIN_VERSION_base(4,5,0) -popCount :: Bits a => a -> Int -popCount = go 0 - where - go c 0 = c `seq` c - go c w = go (c+1) (w .&. (w - 1)) -- clear the least significant -{-# INLINE popCount #-} -#endif - -#if !MIN_VERSION_base(4,7,0) -zeroBits :: Bits a => a -zeroBits = clearBit (bit 0) 0 -{-# INLINE zeroBits #-} - -finiteBitSize :: Bits a => a -> Int -finiteBitSize = bitSize -{-# INLINE finiteBitSize #-} -#endif - -#if !MIN_VERSION_base(4,8,0) -countLeadingZeros :: FiniteBits b => b -> Int -countLeadingZeros x = (w-1) - go (w-1) - where - go i | i < 0 = i -- no bit set - | testBit x i = i - | otherwise = go (i-1) - - w = finiteBitSize x -{-# INLINE countLeadingZeros #-} -#endif +import Data.Bits (popCount, zeroBits, finiteBitSize, countLeadingZeros) diff --git a/src/System/Random/SplitMix.hs b/src/System/Random/SplitMix.hs index a261f5f..969ce81 100644 --- a/src/System/Random/SplitMix.hs +++ b/src/System/Random/SplitMix.hs @@ -22,14 +22,8 @@ -- (the mixing functions are easily inverted, and two successive outputs -- suffice to reconstruct the internal state). -- --- Note: This module supports all GHCs since GHC-7.0.4, --- but GHC-7.0 and GHC-7.2 have slow implementation, as there --- are no native 'popCount'. --- {-# LANGUAGE CPP #-} -#if __GLASGOW_HASKELL__ >= 702 {-# LANGUAGE Trustworthy #-} -#endif module System.Random.SplitMix ( SMGen, nextWord64, @@ -62,7 +56,7 @@ import System.IO.Unsafe (unsafePerformIO) import System.Random.SplitMix.Init -#if defined(__HUGS__) || !MIN_VERSION_base(4,8,0) +#if defined(__HUGS__) import Data.Word (Word) #endif diff --git a/src/System/Random/SplitMix32.hs b/src/System/Random/SplitMix32.hs index d0f618a..33a9978 100644 --- a/src/System/Random/SplitMix32.hs +++ b/src/System/Random/SplitMix32.hs @@ -5,14 +5,8 @@ -- -- You __really don't want to use this one__. -- --- Note: This module supports all GHCs since GHC-7.0.4, --- but GHC-7.0 and GHC-7.2 have slow implementation, as there --- are no native 'popCount'. --- {-# LANGUAGE CPP #-} -#if __GLASGOW_HASKELL__ >= 702 {-# LANGUAGE Trustworthy #-} -#endif module System.Random.SplitMix32 ( SMGen, nextWord32, @@ -46,7 +40,7 @@ import System.IO.Unsafe (unsafePerformIO) import System.Random.SplitMix.Init -#if defined(__HUGS__) || !MIN_VERSION_base(4,8,0) +#if defined(__HUGS__) import Data.Word (Word) #endif diff --git a/tests/Dieharder.hs b/tests/Dieharder.hs index e891439..e4cf126 100644 --- a/tests/Dieharder.hs +++ b/tests/Dieharder.hs @@ -3,9 +3,6 @@ {-# LANGUAGE ScopedTypeVariables #-} module Main (main) where -import Prelude () -import Prelude.Compat - import Control.Concurrent.QSem import Control.DeepSeq (force) import Control.Monad (when) diff --git a/tests/MiniQC.hs b/tests/MiniQC.hs index 9c24a2d..8c879dd 100644 --- a/tests/MiniQC.hs +++ b/tests/MiniQC.hs @@ -5,8 +5,6 @@ module MiniQC where import Control.Monad (ap) import Data.Int (Int32, Int64) import Data.Word (Word32, Word64) -import Prelude () -import Prelude.Compat import Test.Framework.Providers.API (Test, TestName) import Test.Framework.Providers.HUnit (testCase) import Test.HUnit (assertFailure)