From 65102032fc6a122379c923ca1a0f8dd9bb42cae1 Mon Sep 17 00:00:00 2001 From: Jonathan Knowles Date: Thu, 22 Feb 2024 05:31:57 +0000 Subject: [PATCH 01/10] Do not use a fixed `index-state`. --- cabal.project | 3 --- 1 file changed, 3 deletions(-) diff --git a/cabal.project b/cabal.project index 50e99ba..891f6cd 100644 --- a/cabal.project +++ b/cabal.project @@ -1,6 +1,3 @@ -index-state: - , hackage.haskell.org 2023-07-27T22:41:49Z - packages: bech32/bech32.cabal bech32-th/bech32-th.cabal From 1646ef3b2e47000e9a564e6e88cb631011bc188c Mon Sep 17 00:00:00 2001 From: Jonathan Knowles Date: Thu, 22 Feb 2024 05:32:46 +0000 Subject: [PATCH 02/10] Remove names of `cabal` files from `cabal.project`. These are inferred automatically. --- cabal.project | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cabal.project b/cabal.project index 891f6cd..c5e0a87 100644 --- a/cabal.project +++ b/cabal.project @@ -1,5 +1,5 @@ packages: - bech32/bech32.cabal - bech32-th/bech32-th.cabal + bech32 + bech32-th flags: +development From 52468bf1cad44fe7231516875a74a884f8e2e108 Mon Sep 17 00:00:00 2001 From: Jonathan Knowles Date: Thu, 22 Feb 2024 05:36:34 +0000 Subject: [PATCH 03/10] Upgrade to `cabal` file format version 3.0. This also necessitates the use of `build-tool-depends` instead of `build-tools`, which is now deprecated. --- bech32-th/bech32-th.cabal | 6 +++--- bech32/bech32.cabal | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/bech32-th/bech32-th.cabal b/bech32-th/bech32-th.cabal index a3cfe4d..5dee896 100644 --- a/bech32-th/bech32-th.cabal +++ b/bech32-th/bech32-th.cabal @@ -1,3 +1,4 @@ +cabal-version: 3.0 name: bech32-th version: 1.1.1 synopsis: Template Haskell extensions to the Bech32 library. @@ -14,7 +15,6 @@ bug-reports: https://github.com/input-output-hk/bech32/issues category: Web build-type: Simple extra-source-files: ChangeLog.md -cabal-version: >=1.10 source-repository head type: git @@ -66,8 +66,8 @@ test-suite bech32-th-test , bech32-th , hspec , template-haskell - build-tools: - hspec-discover + build-tool-depends: + hspec-discover:hspec-discover main-is: Main.hs other-modules: diff --git a/bech32/bech32.cabal b/bech32/bech32.cabal index b82d762..d0f1977 100644 --- a/bech32/bech32.cabal +++ b/bech32/bech32.cabal @@ -1,3 +1,4 @@ +cabal-version: 3.0 name: bech32 version: 1.1.4 synopsis: Implementation of the Bech32 cryptocurrency address format (BIP 0173). @@ -13,7 +14,6 @@ bug-reports: https://github.com/input-output-hk/bech32/issues category: Web build-type: Simple extra-source-files: ChangeLog.md -cabal-version: >=1.10 source-repository head type: git @@ -106,9 +106,9 @@ test-suite bech32-test , QuickCheck >= 2.12 , text , vector - build-tools: - hspec-discover - , bech32 + build-tool-depends: + hspec-discover:hspec-discover + , bech32:bech32 main-is: Main.hs other-modules: From 777418b2d6ac23865fae031b54ce26c301931a61 Mon Sep 17 00:00:00 2001 From: Jonathan Knowles Date: Thu, 22 Feb 2024 05:50:29 +0000 Subject: [PATCH 04/10] Use `extra-doc-files` for `ChangeLog.md`. Use `extra-doc-files` instead of `extra-source-files`. As recommended by `cabal check`. --- bech32-th/bech32-th.cabal | 4 +++- bech32/bech32.cabal | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/bech32-th/bech32-th.cabal b/bech32-th/bech32-th.cabal index 5dee896..83b627a 100644 --- a/bech32-th/bech32-th.cabal +++ b/bech32-th/bech32-th.cabal @@ -14,7 +14,9 @@ homepage: https://github.com/input-output-hk/bech32 bug-reports: https://github.com/input-output-hk/bech32/issues category: Web build-type: Simple -extra-source-files: ChangeLog.md + +extra-doc-files: + ChangeLog.md source-repository head type: git diff --git a/bech32/bech32.cabal b/bech32/bech32.cabal index d0f1977..5e6493d 100644 --- a/bech32/bech32.cabal +++ b/bech32/bech32.cabal @@ -13,7 +13,9 @@ homepage: https://github.com/input-output-hk/bech32 bug-reports: https://github.com/input-output-hk/bech32/issues category: Web build-type: Simple -extra-source-files: ChangeLog.md + +extra-doc-files: + ChangeLog.md source-repository head type: git From 2fcdc4e0a46fbcb20619f6282ae48c8159e2646d Mon Sep 17 00:00:00 2001 From: Jonathan Knowles Date: Thu, 22 Feb 2024 09:33:23 +0000 Subject: [PATCH 05/10] Add `Paths_bech32` module to `autogen-modules` section. As recommended by `cabal check`. --- bech32/bech32.cabal | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bech32/bech32.cabal b/bech32/bech32.cabal index 5e6493d..d83fb45 100644 --- a/bech32/bech32.cabal +++ b/bech32/bech32.cabal @@ -58,6 +58,8 @@ executable bech32 main-is: Main.hs other-modules: Paths_bech32 + autogen-modules: + Paths_bech32 hs-source-dirs: app build-depends: From 56ea447895b4231c26bddeba577aa74024c47e8f Mon Sep 17 00:00:00 2001 From: Jonathan Knowles Date: Thu, 22 Feb 2024 08:23:00 +0000 Subject: [PATCH 06/10] Use leading commas for all dependencies. --- bech32-th/bech32-th.cabal | 6 +++--- bech32/bech32.cabal | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/bech32-th/bech32-th.cabal b/bech32-th/bech32-th.cabal index 83b627a..47a190b 100644 --- a/bech32-th/bech32-th.cabal +++ b/bech32-th/bech32-th.cabal @@ -38,7 +38,7 @@ library if flag(release) ghc-options: -Werror build-depends: - base >= 4.11.1.0 && < 5 + , base >= 4.11.1.0 && < 5 , bech32 >= 1.1.2 , template-haskell , text @@ -63,13 +63,13 @@ test-suite bech32-th-test if flag(release) ghc-options: -Werror build-depends: - base + , base , bech32 , bech32-th , hspec , template-haskell build-tool-depends: - hspec-discover:hspec-discover + , hspec-discover:hspec-discover main-is: Main.hs other-modules: diff --git a/bech32/bech32.cabal b/bech32/bech32.cabal index d83fb45..6c510da 100644 --- a/bech32/bech32.cabal +++ b/bech32/bech32.cabal @@ -42,7 +42,7 @@ library if flag(release) ghc-options: -Werror build-depends: - array + , array , base >= 4.11.1.0 && <5 , bytestring , containers @@ -63,7 +63,7 @@ executable bech32 hs-source-dirs: app build-depends: - base + , base , base58-bytestring , bech32 , bytestring @@ -97,7 +97,7 @@ test-suite bech32-test if flag(release) ghc-options: -Werror build-depends: - base + , base , base58-bytestring , bech32 , bytestring @@ -111,8 +111,8 @@ test-suite bech32-test , text , vector build-tool-depends: - hspec-discover:hspec-discover , bech32:bech32 + , hspec-discover:hspec-discover main-is: Main.hs other-modules: From 00b507cd2a1804ed41be862c4a5272b7ebe8807d Mon Sep 17 00:00:00 2001 From: Jonathan Knowles Date: Thu, 22 Feb 2024 08:55:23 +0000 Subject: [PATCH 07/10] Move all package dependencies into common sections. --- bech32-th/bech32-th.cabal | 38 +++++++++----- bech32/bech32.cabal | 105 +++++++++++++++++++++++++------------- 2 files changed, 95 insertions(+), 48 deletions(-) diff --git a/bech32-th/bech32-th.cabal b/bech32-th/bech32-th.cabal index 47a190b..7a6ea4e 100644 --- a/bech32-th/bech32-th.cabal +++ b/bech32-th/bech32-th.cabal @@ -27,7 +27,23 @@ flag release default: False manual: True +common dependency-base + build-depends:base >= 4.11.1.0 && < 5 +common dependency-bech32 + build-depends:bech32 >= 1.1.2 +common dependency-hspec + build-depends:hspec +common dependency-template-haskell + build-depends:template-haskell +common dependency-text + build-depends:text + library + import: + , dependency-base + , dependency-bech32 + , dependency-template-haskell + , dependency-text default-language: Haskell2010 default-extensions: @@ -37,17 +53,21 @@ library -Wall -Wcompat -fwarn-redundant-constraints if flag(release) ghc-options: -Werror - build-depends: - , base >= 4.11.1.0 && < 5 - , bech32 >= 1.1.2 - , template-haskell - , text hs-source-dirs: src exposed-modules: Codec.Binary.Bech32.TH test-suite bech32-th-test + import: + , dependency-base + , dependency-bech32 + , dependency-hspec + , dependency-template-haskell + build-depends: + , bech32-th + build-tool-depends: + , hspec-discover:hspec-discover default-language: Haskell2010 default-extensions: @@ -62,14 +82,6 @@ test-suite bech32-th-test -threaded -rtsopts -with-rtsopts=-N if flag(release) ghc-options: -Werror - build-depends: - , base - , bech32 - , bech32-th - , hspec - , template-haskell - build-tool-depends: - , hspec-discover:hspec-discover main-is: Main.hs other-modules: diff --git a/bech32/bech32.cabal b/bech32/bech32.cabal index 6c510da..9d2aa78 100644 --- a/bech32/bech32.cabal +++ b/bech32/bech32.cabal @@ -31,7 +31,47 @@ flag static default: False manual: True +common dependency-array + build-depends:array +common dependency-base + build-depends:base >= 4.11.1.0 && < 5 +common dependency-base58-bytestring + build-depends:base58-bytestring +common dependency-bytestring + build-depends:bytestring +common dependency-containers + build-depends:containers +common dependency-deepseq + build-depends:deepseq +common dependency-extra + build-depends:extra +common dependency-hspec + build-depends:hspec +common dependency-memory + build-depends:memory +common dependency-optparse-applicative + build-depends:optparse-applicative +common dependency-prettyprinter + build-depends:prettyprinter +common dependency-prettyprinter-ansi-terminal + build-depends:prettyprinter-ansi-terminal +common dependency-process + build-depends:process +common dependency-QuickCheck + build-depends:QuickCheck >= 2.12 +common dependency-text + build-depends:text +common dependency-vector + build-depends:vector + library + import: + , dependency-array + , dependency-base + , dependency-bytestring + , dependency-containers + , dependency-extra + , dependency-text default-language: Haskell2010 default-extensions: @@ -41,13 +81,6 @@ library -Wall -Wcompat -fwarn-redundant-constraints if flag(release) ghc-options: -Werror - build-depends: - , array - , base >= 4.11.1.0 && <5 - , bytestring - , containers - , extra - , text hs-source-dirs: src exposed-modules: @@ -55,6 +88,18 @@ library Codec.Binary.Bech32.Internal executable bech32 + import: + , dependency-base + , dependency-base58-bytestring + , dependency-bytestring + , dependency-extra + , dependency-memory + , dependency-optparse-applicative + , dependency-prettyprinter + , dependency-prettyprinter-ansi-terminal + , dependency-text + build-depends: + , bech32 main-is: Main.hs other-modules: Paths_bech32 @@ -62,17 +107,6 @@ executable bech32 Paths_bech32 hs-source-dirs: app - build-depends: - , base - , base58-bytestring - , bech32 - , bytestring - , extra - , memory - , optparse-applicative - , prettyprinter - , prettyprinter-ansi-terminal - , text ghc-options: -Wall -Wcompat -fwarn-redundant-constraints -threaded -rtsopts -with-rtsopts=-N @@ -85,6 +119,24 @@ executable bech32 default-language: Haskell2010 test-suite bech32-test + import: + , dependency-base + , dependency-base58-bytestring + , dependency-bytestring + , dependency-containers + , dependency-deepseq + , dependency-extra + , dependency-hspec + , dependency-memory + , dependency-process + , dependency-QuickCheck + , dependency-text + , dependency-vector + build-depends: + , bech32 + build-tool-depends: + , bech32:bech32 + , hspec-discover:hspec-discover default-language: Haskell2010 type: @@ -96,23 +148,6 @@ test-suite bech32-test -threaded -rtsopts -with-rtsopts=-N if flag(release) ghc-options: -Werror - build-depends: - , base - , base58-bytestring - , bech32 - , bytestring - , containers - , deepseq - , extra - , hspec - , memory - , process - , QuickCheck >= 2.12 - , text - , vector - build-tool-depends: - , bech32:bech32 - , hspec-discover:hspec-discover main-is: Main.hs other-modules: From a77b33d6564ebe9728bca1087a71a1209eac55c7 Mon Sep 17 00:00:00 2001 From: Jonathan Knowles Date: Thu, 22 Feb 2024 09:07:31 +0000 Subject: [PATCH 08/10] Revise lower bounds for package dependencies. --- bech32-th/bech32-th.cabal | 10 +++++----- bech32/bech32.cabal | 32 ++++++++++++++++---------------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/bech32-th/bech32-th.cabal b/bech32-th/bech32-th.cabal index 7a6ea4e..9d2119c 100644 --- a/bech32-th/bech32-th.cabal +++ b/bech32-th/bech32-th.cabal @@ -28,15 +28,15 @@ flag release manual: True common dependency-base - build-depends:base >= 4.11.1.0 && < 5 + build-depends:base >= 4.14.3.0 && < 5 common dependency-bech32 - build-depends:bech32 >= 1.1.2 + build-depends:bech32 >= 1.1.4 common dependency-hspec - build-depends:hspec + build-depends:hspec >= 2.11.7 common dependency-template-haskell - build-depends:template-haskell + build-depends:template-haskell >= 2.16.0.0 common dependency-text - build-depends:text + build-depends:text >= 1.2.4.1 library import: diff --git a/bech32/bech32.cabal b/bech32/bech32.cabal index 9d2aa78..28cfced 100644 --- a/bech32/bech32.cabal +++ b/bech32/bech32.cabal @@ -32,37 +32,37 @@ flag static manual: True common dependency-array - build-depends:array + build-depends:array >= 0.5.4.0 common dependency-base - build-depends:base >= 4.11.1.0 && < 5 + build-depends:base >= 4.14.3.0 && < 5 common dependency-base58-bytestring - build-depends:base58-bytestring + build-depends:base58-bytestring >= 0.1.0 common dependency-bytestring - build-depends:bytestring + build-depends:bytestring >= 0.10.12.0 common dependency-containers - build-depends:containers + build-depends:containers >= 0.6.5.1 common dependency-deepseq - build-depends:deepseq + build-depends:deepseq >= 1.4.4.0 common dependency-extra - build-depends:extra + build-depends:extra >= 1.7.14 common dependency-hspec - build-depends:hspec + build-depends:hspec >= 2.11.7 common dependency-memory - build-depends:memory + build-depends:memory >= 0.18.0 common dependency-optparse-applicative - build-depends:optparse-applicative + build-depends:optparse-applicative >= 0.18.1.0 common dependency-prettyprinter - build-depends:prettyprinter + build-depends:prettyprinter >= 1.7.1 common dependency-prettyprinter-ansi-terminal - build-depends:prettyprinter-ansi-terminal + build-depends:prettyprinter-ansi-terminal >= 1.1.3 common dependency-process - build-depends:process + build-depends:process >= 1.6.13.2 common dependency-QuickCheck - build-depends:QuickCheck >= 2.12 + build-depends:QuickCheck >= 2.14.3 common dependency-text - build-depends:text + build-depends:text >= 1.2.4.1 common dependency-vector - build-depends:vector + build-depends:vector >= 0.13.1.0 library import: From 203a318ec50b57fc20bbf7af74c919c258eb5f2b Mon Sep 17 00:00:00 2001 From: Jonathan Knowles Date: Thu, 22 Feb 2024 09:20:01 +0000 Subject: [PATCH 09/10] Revise upper bounds for package dependencies. --- bech32-th/bech32-th.cabal | 10 +++++----- bech32/bech32.cabal | 32 ++++++++++++++++---------------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/bech32-th/bech32-th.cabal b/bech32-th/bech32-th.cabal index 9d2119c..7c5e9c0 100644 --- a/bech32-th/bech32-th.cabal +++ b/bech32-th/bech32-th.cabal @@ -28,15 +28,15 @@ flag release manual: True common dependency-base - build-depends:base >= 4.14.3.0 && < 5 + build-depends:base >= 4.14.3.0 && < 4.20 common dependency-bech32 - build-depends:bech32 >= 1.1.4 + build-depends:bech32 >= 1.1.4 && < 1.2 common dependency-hspec - build-depends:hspec >= 2.11.7 + build-depends:hspec >= 2.11.7 && < 2.12 common dependency-template-haskell - build-depends:template-haskell >= 2.16.0.0 + build-depends:template-haskell >= 2.16.0.0 && < 2.22 common dependency-text - build-depends:text >= 1.2.4.1 + build-depends:text >= 1.2.4.1 && < 2.2 library import: diff --git a/bech32/bech32.cabal b/bech32/bech32.cabal index 28cfced..ef2f093 100644 --- a/bech32/bech32.cabal +++ b/bech32/bech32.cabal @@ -32,37 +32,37 @@ flag static manual: True common dependency-array - build-depends:array >= 0.5.4.0 + build-depends:array >= 0.5.4.0 && < 0.6 common dependency-base - build-depends:base >= 4.14.3.0 && < 5 + build-depends:base >= 4.14.3.0 && < 4.20 common dependency-base58-bytestring - build-depends:base58-bytestring >= 0.1.0 + build-depends:base58-bytestring >= 0.1.0 && < 0.2 common dependency-bytestring - build-depends:bytestring >= 0.10.12.0 + build-depends:bytestring >= 0.10.12.0 && < 0.13 common dependency-containers - build-depends:containers >= 0.6.5.1 + build-depends:containers >= 0.6.5.1 && < 0.7 common dependency-deepseq - build-depends:deepseq >= 1.4.4.0 + build-depends:deepseq >= 1.4.4.0 && < 1.6 common dependency-extra - build-depends:extra >= 1.7.14 + build-depends:extra >= 1.7.14 && < 1.8 common dependency-hspec - build-depends:hspec >= 2.11.7 + build-depends:hspec >= 2.11.7 && < 2.12 common dependency-memory - build-depends:memory >= 0.18.0 + build-depends:memory >= 0.18.0 && < 0.19 common dependency-optparse-applicative - build-depends:optparse-applicative >= 0.18.1.0 + build-depends:optparse-applicative >= 0.18.1.0 && < 0.19 common dependency-prettyprinter - build-depends:prettyprinter >= 1.7.1 + build-depends:prettyprinter >= 1.7.1 && < 1.8 common dependency-prettyprinter-ansi-terminal - build-depends:prettyprinter-ansi-terminal >= 1.1.3 + build-depends:prettyprinter-ansi-terminal >= 1.1.3 && < 1.2 common dependency-process - build-depends:process >= 1.6.13.2 + build-depends:process >= 1.6.13.2 && < 1.7 common dependency-QuickCheck - build-depends:QuickCheck >= 2.14.3 + build-depends:QuickCheck >= 2.14.3 && < 2.15 common dependency-text - build-depends:text >= 1.2.4.1 + build-depends:text >= 1.2.4.1 && < 2.2 common dependency-vector - build-depends:vector >= 0.13.1.0 + build-depends:vector >= 0.13.1.0 && < 0.14 library import: From 40eb03a71d1d75bae39350da1e26b864ed394419 Mon Sep 17 00:00:00 2001 From: Jonathan Knowles Date: Thu, 22 Feb 2024 09:21:01 +0000 Subject: [PATCH 10/10] Add CI support for GHC 9.8 series. --- .github/workflows/build.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 64d226d..4fb853c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,6 +32,7 @@ jobs: - '9.2' - '9.4' - '9.6' + - '9.8' steps: - name: Checkout uses: actions/checkout@v4 @@ -107,7 +108,7 @@ jobs: if: | github.ref == 'refs/heads/main' && matrix.os == 'ubuntu-latest' - && matrix.ghc == '9.6' + && matrix.ghc == '9.8' run: > mv ${{ env.cabal-build-dir }}/build/*/*/*/doc/html/* gh-pages @@ -117,7 +118,7 @@ jobs: if: | github.ref == 'refs/heads/main' && matrix.os == 'ubuntu-latest' - && matrix.ghc == '9.6' + && matrix.ghc == '9.8' uses: JamesIves/github-pages-deploy-action@v4 with: branch: gh-pages