From d1fbad43767bf542916c0897c066cb93afbe29e1 Mon Sep 17 00:00:00 2001 From: Oleg Grenrus Date: Thu, 16 May 2024 16:04:11 +0300 Subject: [PATCH] Support GHC-9.6.5...9.10.1 (uuid-types) --- .github/workflows/haskell-ci-bench.yml | 92 ++++-------- .github/workflows/haskell-ci.yml | 141 ++++++------------ cabal.haskell-ci | 4 - uuid-bench/uuid-bench.cabal | 19 +-- uuid-types/src/Data/UUID/Types.hs | 4 - uuid-types/src/Data/UUID/Types/Internal.hs | 73 +-------- .../src/Data/UUID/Types/Internal/Builder.hs | 3 - uuid-types/uuid-types.cabal | 30 ++-- uuid/uuid.cabal | 28 ++-- 9 files changed, 97 insertions(+), 297 deletions(-) diff --git a/.github/workflows/haskell-ci-bench.yml b/.github/workflows/haskell-ci-bench.yml index 9498834..87dda47 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.20240402 +# version: 0.19.20240514 # -# REGENDATA ("0.19.20240402",["github","--project","cabal.bench.project","-o",".github/workflows/haskell-ci-bench.yml","--github-action-name","Benchmarks"]) +# REGENDATA ("0.19.20240514",["github","--project","cabal.bench.project","-o",".github/workflows/haskell-ci-bench.yml","--github-action-name","Benchmarks"]) # name: Benchmarks on: @@ -27,7 +27,7 @@ jobs: timeout-minutes: 60 container: - image: buildpack-deps:bionic + image: buildpack-deps:jammy continue-on-error: ${{ matrix.allow-failure }} strategy: matrix: @@ -65,27 +65,12 @@ jobs: - compiler: ghc-8.8.4 compilerKind: ghc compilerVersion: 8.8.4 - setup-method: hvr-ppa - allow-failure: false - - compiler: ghc-8.6.4 - compilerKind: ghc - compilerVersion: 8.6.4 - 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 + setup-method: ghcup allow-failure: false - - compiler: ghc-8.0.2 + - compiler: ghc-8.6.5 compilerKind: ghc - compilerVersion: 8.0.2 - setup-method: hvr-ppa + compilerVersion: 8.6.5 + setup-method: ghcup allow-failure: false fail-fast: false steps: @@ -93,23 +78,11 @@ jobs: 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) - 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" 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" 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 }} @@ -121,22 +94,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" @@ -193,7 +157,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 @@ -217,11 +181,11 @@ jobs: touch cabal.project touch cabal.project.local echo "packages: ${PKGDIR_uuid_bench}" >> cabal.project - if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo "package uuid-bench" >> cabal.project ; fi - if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi + echo "package uuid-bench" >> 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 /^(uuid-bench)$/; }' >> cabal.project.local cat cabal.project cat cabal.project.local - name: dump install plan @@ -229,7 +193,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 @@ -264,14 +228,8 @@ jobs: cabal-plan topo | sort $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='random==1.2.*' --dependencies-only -j2 all $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='random==1.2.*' all - - name: constraint set random-1.1 - run: | - if [ $((HCNUMVER < 90800)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='random==1.1.*' 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 --disable-tests --disable-benchmarks --constraint='random==1.1.*' --dependencies-only -j2 all ; fi - if [ $((HCNUMVER < 90800)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='random==1.1.*' 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/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index 269e6af..1731671 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.20240514 # -# REGENDATA ("0.19.20240402",["github","cabal.project"]) +# REGENDATA ("0.19.20240514",["github","cabal.project"]) # name: Haskell-CI on: @@ -27,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 @@ -65,47 +70,12 @@ jobs: - compiler: ghc-8.8.4 compilerKind: ghc compilerVersion: 8.8.4 - setup-method: hvr-ppa - allow-failure: false - - compiler: ghc-8.6.4 - compilerKind: ghc - compilerVersion: 8.6.4 - 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 + setup-method: ghcup allow-failure: false - - compiler: ghc-7.4.2 + - compiler: ghc-8.6.5 compilerKind: ghc - compilerVersion: 7.4.2 - setup-method: hvr-ppa + compilerVersion: 8.6.5 + setup-method: ghcup allow-failure: false fail-fast: false steps: @@ -113,23 +83,11 @@ jobs: 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) - 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" 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" 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 }} @@ -141,22 +99,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" @@ -213,14 +162,14 @@ 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 run: | touch cabal.project echo "packages: $GITHUB_WORKSPACE/source/uuid-types" >> cabal.project - echo "packages: $GITHUB_WORKSPACE/source/uuid" >> cabal.project + if [ $((HCNUMVER < 91000)) -ne 0 ] ; then echo "packages: $GITHUB_WORKSPACE/source/uuid" >> cabal.project ; fi cat cabal.project - name: sdist run: | @@ -240,14 +189,14 @@ jobs: touch cabal.project touch cabal.project.local echo "packages: ${PKGDIR_uuid_types}" >> cabal.project - echo "packages: ${PKGDIR_uuid}" >> cabal.project - if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo "package uuid-types" >> cabal.project ; fi - if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi - if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo "package uuid" >> cabal.project ; fi - if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi + if [ $((HCNUMVER < 91000)) -ne 0 ] ; then echo "packages: ${PKGDIR_uuid}" >> cabal.project ; fi + echo "package uuid-types" >> cabal.project + echo " ghc-options: -Werror=missing-methods" >> cabal.project + if [ $((HCNUMVER < 91000)) -ne 0 ] ; then echo "package uuid" >> cabal.project ; fi + if [ $((HCNUMVER < 91000)) -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 /^(uuid|uuid-types)$/; }' >> cabal.project.local cat cabal.project cat cabal.project.local - name: dump install plan @@ -255,7 +204,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 @@ -277,8 +226,8 @@ jobs: run: | cd ${PKGDIR_uuid_types} || false ${CABAL} -vnormal check - cd ${PKGDIR_uuid} || false - ${CABAL} -vnormal check + if [ $((HCNUMVER < 91000)) -ne 0 ] ; then cd ${PKGDIR_uuid} || false ; fi + if [ $((HCNUMVER < 91000)) -ne 0 ] ; then ${CABAL} -vnormal check ; fi - name: haddock run: | $CABAL v2-haddock --disable-documentation --haddock-all $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all @@ -291,18 +240,12 @@ jobs: rm -f cabal.project.local - name: constraint set random-1.2 run: | - if [ $((HCNUMVER >= 71000)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='random==1.2.*' all --dry-run ; fi - if [ $((HCNUMVER >= 71000)) -ne 0 ] ; then cabal-plan topo | sort ; fi - if [ $((HCNUMVER >= 71000)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='random==1.2.*' --dependencies-only -j2 all ; fi - if [ $((HCNUMVER >= 71000)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='random==1.2.*' all ; fi - - name: constraint set random-1.1 - run: | - if [ $((HCNUMVER < 90800)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='random==1.1.*' 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 --disable-tests --disable-benchmarks --constraint='random==1.1.*' --dependencies-only -j2 all ; fi - if [ $((HCNUMVER < 90800)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='random==1.1.*' all ; fi + $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='random==1.2.*' all --dry-run + cabal-plan topo | sort + $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='random==1.2.*' --dependencies-only -j2 all + $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='random==1.2.*' 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/cabal.haskell-ci b/cabal.haskell-ci index dac4b30..1e93e76 100644 --- a/cabal.haskell-ci +++ b/cabal.haskell-ci @@ -2,10 +2,6 @@ branches: master jobs-selection: any head-hackage: False -constraint-set random-1.1 - ghc: <9.7 - constraints: random==1.1.* - constraint-set random-1.2 ghc: >=7.10 constraints: random==1.2.* diff --git a/uuid-bench/uuid-bench.cabal b/uuid-bench/uuid-bench.cabal index 8741444..35454e6 100644 --- a/uuid-bench/uuid-bench.cabal +++ b/uuid-bench/uuid-bench.cabal @@ -14,10 +14,7 @@ build-type: Simple -- Benchmarking with older GHCs is not meaningful tested-with: - GHC ==8.0.2 - || ==8.2.2 - || ==8.4.4 - || ==8.6.4 + GHC ==8.6.5 || ==8.8.4 || ==8.10.7 || ==9.0.2 @@ -42,17 +39,17 @@ source-repository head library build-depends: - base >=4.9 && <5 - , binary >=0.5.1.0 && <0.9 - , bytestring >=0.9.2.1 && <0.13 + base >=4.12.0.0 && <5 + , binary >=0.8.6.0 && <0.9 + , bytestring >=0.10.8.2 && <0.13 , cryptohash-md5 >=0.11.100 && <0.12 , cryptohash-sha1 >=0.11.100 && <0.12 - , deepseq >=1.3.0.0 && <1.6 + , deepseq >=1.4.4.0 && <1.6 , entropy >=0.3.7 && <0.5 - , hashable >=1.2.7.0 && <1.5 + , hashable >=1.4.4.0 && <1.5 , network-info >=0.2 && <0.3 - , random >=1.1 && <1.3 - , template-haskell >=2.7.0.0 && <2.22 + , random >=1.2.1.2 && <1.3 + , template-haskell >=2.14.0.0 && <2.22 , text >=1.2.3.0 && <1.3 || >=2.0 && <2.2 , time >=1.4 && <1.13 diff --git a/uuid-types/src/Data/UUID/Types.hs b/uuid-types/src/Data/UUID/Types.hs index 5bdfeb2..2757867 100644 --- a/uuid-types/src/Data/UUID/Types.hs +++ b/uuid-types/src/Data/UUID/Types.hs @@ -1,8 +1,4 @@ -{-# LANGUAGE CPP #-} - -#if __GLASGOW_HASKELL__ >= 702 {-# LANGUAGE Trustworthy #-} -#endif {- | Module : Data.UUID.Types diff --git a/uuid-types/src/Data/UUID/Types/Internal.hs b/uuid-types/src/Data/UUID/Types/Internal.hs index 9cedd82..83fc898 100644 --- a/uuid-types/src/Data/UUID/Types/Internal.hs +++ b/uuid-types/src/Data/UUID/Types/Internal.hs @@ -2,14 +2,9 @@ {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE ViewPatterns #-} -#if __GLASGOW_HASKELL__ >= 704 {-# LANGUAGE Unsafe #-} -#endif -#if __GLASGOW_HASKELL__ >=800 {-# LANGUAGE DeriveLift #-} {-# LANGUAGE StandaloneDeriving #-} -#endif - {-# OPTIONS_HADDOCK hide #-} -- | @@ -76,19 +71,10 @@ import qualified Data.Text.Encoding as T import Data.UUID.Types.Internal.Builder -#if MIN_VERSION_random(1,2,0) import System.Random (Random (..), uniform) import System.Random.Stateful (Uniform (..), uniformWord64) -#else -import System.Random (Random (..), next) -#endif -#if __GLASGOW_HASKELL__ >=800 import Language.Haskell.TH.Syntax (Lift) -#else -import Language.Haskell.TH (appE, varE) -import Language.Haskell.TH.Syntax (Lift (..), mkNameG_v, Lit (IntegerL), Exp (LitE)) -#endif -- | Type representing as specified in -- . @@ -471,23 +457,13 @@ fromASCIIBytes bs = do -- | Similar to `toASCIIBytes` except we produce a lazy `BL.ByteString`. toLazyASCIIBytes :: UUID -> BL.ByteString toLazyASCIIBytes = -#if MIN_VERSION_bytestring(0,10,0) BL.fromStrict -#else - BL.fromChunks . return -#endif . toASCIIBytes -- | Similar to `fromASCIIBytes` except parses from a lazy `BL.ByteString`. fromLazyASCIIBytes :: BL.ByteString -> Maybe UUID fromLazyASCIIBytes bs = - if BL.length bs == 36 then fromASCIIBytes ( -#if MIN_VERSION_bytestring(0,10,0) - BL.toStrict bs -#else - B.concat $ BL.toChunks bs -#endif - ) else Nothing + if BL.length bs == 36 then fromASCIIBytes (BL.toStrict bs) else Nothing -- -- Class Instances @@ -495,7 +471,6 @@ fromLazyASCIIBytes bs = -- | This 'Random' instance produces __insecure__ version 4 UUIDs as -- specified in . -#if MIN_VERSION_random(1,2,0) instance Random UUID where random = uniform randomR _ = random -- range is ignored @@ -506,29 +481,6 @@ instance Uniform UUID where w0 <- uniformWord64 gen w1 <- uniformWord64 gen pure $ buildFromBytes 4 /-/ w0 /-/ w1 -#else -instance Random UUID where - random g = (fromGenNext w0 w1 w2 w3 w4, g4) - where (w0, g0) = next g - (w1, g1) = next g0 - (w2, g2) = next g1 - (w3, g3) = next g2 - (w4, g4) = next g3 - randomR _ = random -- range is ignored - --- |Build a UUID from the results of five calls to next on a StdGen. --- While next on StdGet returns an Int, it doesn't provide 32 bits of --- randomness. This code relies on at last 28 bits of randomness in the --- and optimizes its use so as to make only five random values, not six. -fromGenNext :: Int -> Int -> Int -> Int -> Int -> UUID -fromGenNext w0 w1 w2 w3 w4 = - buildFromBytes 4 /-/ (ThreeByte w0) - /-/ (ThreeByte w1) - /-/ w2 -- use all 4 bytes because we know the version - -- field will "cover" the upper, non-random bits - /-/ (ThreeByte w3) - /-/ (ThreeByte w4) -#endif -- |A ByteSource to extract only three bytes from an Int, since next on StdGet -- only returns 31 bits of randomness. @@ -622,27 +574,4 @@ instance Data UUID where uuidType :: DataType uuidType = mkNoRepType "Data.UUID.Types.UUID" -#if !MIN_VERSION_base(4,5,0) -unsafeShiftR, unsafeShiftL :: Bits w => w -> Int -> w -{-# INLINE unsafeShiftR #-} -unsafeShiftR = shiftR -{-# INLINE unsafeShiftL #-} -unsafeShiftL = shiftL -#endif - -#if __GLASGOW_HASKELL__ >=800 deriving instance Lift UUID -#else -instance Lift UUID where - lift (UUID w1 w2) = varE fromWords64Name `appE` liftW64 w1 `appE` liftW64 w2 - where - fromWords64Name = mkNameG_v currentPackageKey "Data.UUID.Types.Internal" "fromWords64" - liftW64 x = return (LitE (IntegerL (fromIntegral x))) - -currentPackageKey :: String -#ifdef CURRENT_PACKAGE_KEY -currentPackageKey = CURRENT_PACKAGE_KEY -#else -currentPackageKey = "uuid-types-1.0.5" -#endif -#endif diff --git a/uuid-types/src/Data/UUID/Types/Internal/Builder.hs b/uuid-types/src/Data/UUID/Types/Internal/Builder.hs index 2f19e89..d826534 100644 --- a/uuid-types/src/Data/UUID/Types/Internal/Builder.hs +++ b/uuid-types/src/Data/UUID/Types/Internal/Builder.hs @@ -1,8 +1,5 @@ -{-# LANGUAGE CPP #-} {-# LANGUAGE TypeFamilies #-} -#if __GLASGOW_HASKELL__ >= 704 {-# LANGUAGE Unsafe #-} -#endif {-# OPTIONS_HADDOCK hide #-} diff --git a/uuid-types/uuid-types.cabal b/uuid-types/uuid-types.cabal index 0f398d4..ad24bfd 100644 --- a/uuid-types/uuid-types.cabal +++ b/uuid-types/uuid-types.cabal @@ -1,6 +1,6 @@ cabal-version: 1.12 name: uuid-types -version: 1.0.5.1 +version: 1.0.6 copyright: (c) 2017-2018 Herbert Valerio Riedel (c) 2008-2014 Antoine Latter @@ -12,21 +12,15 @@ license-file: LICENSE category: Data build-type: Simple tested-with: - GHC ==7.4.2 - || ==7.6.3 - || ==7.8.4 - || ==7.10.3 - || ==8.0.2 - || ==8.2.2 - || ==8.4.4 - || ==8.6.4 + GHC ==8.6.5 || ==8.8.4 || ==8.10.7 || ==9.0.2 || ==9.2.8 || ==9.4.8 - || ==9.6.4 + || ==9.6.5 || ==9.8.2 + || ==9.10.1 synopsis: Type definitions for Universally Unique Identifiers description: @@ -50,14 +44,14 @@ source-repository head library build-depends: - base >=4.5 && <5 - , binary >=0.5.1.0 && <0.9 - , bytestring >=0.9.2.1 && <0.13 - , deepseq >=1.3.0.0 && <1.6 - , hashable >=1.2.7.0 && <1.5 - , random >=1.1 && <1.3 - , template-haskell >=2.7.0.0 && <2.22 - , text >=1.2.3.0 && <1.3 || >=2.0 && <2.2 + base >=4.12.0.0 && <5 + , binary >=0.8.6.0 && <0.9 + , bytestring >=0.10.8.2 && <0.13 + , deepseq >=1.4.4.0 && <1.6 + , hashable >=1.4.4.0 && <1.5 + , random >=1.2.1.2 && <1.3 + , template-haskell >=2.14.0.0 && <2.23 + , text >=1.2.3.0 && <1.3 || >=2.0 && <2.2 exposed-modules: Data.UUID.Types diff --git a/uuid/uuid.cabal b/uuid/uuid.cabal index f0157aa..7c7b8c1 100644 --- a/uuid/uuid.cabal +++ b/uuid/uuid.cabal @@ -1,7 +1,6 @@ cabal-version: 1.12 name: uuid -version: 1.3.15 -x-revision: 3 +version: 1.3.16 copyright: (c) 2008-2014 Antoine Latter author: Antoine Latter maintainer: Oleg Grenrus @@ -10,20 +9,13 @@ license-file: LICENSE category: Data build-type: Simple tested-with: - GHC ==7.4.2 - || ==7.6.3 - || ==7.8.4 - || ==7.10.3 - || ==8.0.2 - || ==8.2.2 - || ==8.4.4 - || ==8.6.4 + GHC ==8.6.5 || ==8.8.4 || ==8.10.7 || ==9.0.2 || ==9.2.8 || ==9.4.8 - || ==9.6.4 + || ==9.6.5 || ==9.8.2 synopsis: @@ -46,22 +38,20 @@ source-repository head library build-depends: - base >=4.5 && <5 - , binary >=0.5.1.0 && <0.9 - , bytestring >=0.9.2.1 && <0.13 + base >=4.12 && <5 + , binary >=0.8.6.0 && <0.9 + , bytestring >=0.10.8.2 && <0.13 , cryptohash-md5 >=0.11.100 && <0.12 , cryptohash-sha1 >=0.11.100 && <0.12 , entropy >=0.3.7 && <0.5 , network-info >=0.2 && <0.3 - , random >=1.1 && <1.3 - , text >=1.2.3.0 && <1.3 || >=2.0 && <2.2 + , random >=1.2.1.2 && <1.3 + , text >=1.2.3.0 && <1.3 || >=2.0 && <2.2 , time >=1.4 && <1.13 -- strict dependency on uuid-types, -- as we re-rexport datatype, thus leak instances etc. - build-depends: - uuid-types >=1.0.5 && <1.0.6 - + build-depends: uuid-types >=1.0.6 && <1.0.7 exposed-modules: Data.UUID Data.UUID.Util