From cef201d752f57aad90279e072392da6ba56c531b Mon Sep 17 00:00:00 2001 From: j6carey Date: Tue, 21 May 2024 09:20:24 -0700 Subject: [PATCH] v1.4.3: support GHC 9.6, 9.8 (#105) v1.4.3: support GHC 9.6, 9.8 Skip GHC 9.0+Darwin due to crypton problem. --- .github/workflows/ci.yml | 9 +- CHANGELOG.md | 4 + README.md | 27 ++++++ nix/haskell-packages.nix | 160 +++++++++++++++++++++++++++++-- nix/nixpkgs.nix | 8 +- nix/packages/bifunctors.nix | 22 +++++ nix/packages/doctest.nix | 30 ++++++ nix/packages/free.nix | 19 ++++ nix/packages/hpack.nix | 40 ++++++++ nix/packages/http-client-tls.nix | 23 +++++ nix/packages/lens.nix | 37 +++++++ nix/packages/parsec-class.nix | 10 ++ nix/packages/semigroupoids.nix | 19 ++++ nix/packages/tagged.nix | 15 +++ nix/packages/th-abstraction.nix | 14 +++ nix/patches/aeson-2.1.2.1.patch | 11 +++ nix/patches/pantry-0.9.3.2.patch | 13 +++ proto3-wire.cabal | 2 +- shell.nix | 13 ++- test/Main.hs | 5 +- 20 files changed, 458 insertions(+), 23 deletions(-) create mode 100644 nix/packages/bifunctors.nix create mode 100644 nix/packages/doctest.nix create mode 100644 nix/packages/free.nix create mode 100644 nix/packages/hpack.nix create mode 100644 nix/packages/http-client-tls.nix create mode 100644 nix/packages/lens.nix create mode 100644 nix/packages/parsec-class.nix create mode 100644 nix/packages/semigroupoids.nix create mode 100644 nix/packages/tagged.nix create mode 100644 nix/packages/th-abstraction.nix create mode 100644 nix/patches/aeson-2.1.2.1.patch create mode 100644 nix/patches/pantry-0.9.3.2.patch diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7693a08..6bab750 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,8 +14,13 @@ jobs: ghc: - 8107 - 902 - - 924 - - 946 + - 928 + - 948 + - 962 + - 981 + exclude: + - os: macos-latest + ghc: 902 runs-on: ${{ matrix.os }} steps: diff --git a/CHANGELOG.md b/CHANGELOG.md index fd4885c..05ee2cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +1.4.3 + - Support GHC 9.8 + - Support GHC 9.6 + 1.4.2 - Support GHC 9.4 diff --git a/README.md b/README.md index 99aa4c2..e77f8ad 100644 --- a/README.md +++ b/README.md @@ -25,3 +25,30 @@ To run tests or generate documentation, use ```text stack build [--test] [--haddock] ``` + +### GHC Versions + +#### GHC 9.8 + +Supported on Linux and Darwin. + +#### GHC 9.6 + +Supported on Linux and Darwin. + +#### GHC 9.4 + +Supported on Linux and Darwin. + +#### GHC 9.2 + +Supported on Linux and Darwin. + +#### GHC 9.0 + +Supported only on Linux because "crypton" fails a test on Darwin, +probably due to [this issue](https://github.com/kazu-yamamoto/crypton/issues/35). + +#### GHC 8.10.7 + +Supported on Linux and Darwin. diff --git a/nix/haskell-packages.nix b/nix/haskell-packages.nix index 6580ff6..0b17be9 100644 --- a/nix/haskell-packages.nix +++ b/nix/haskell-packages.nix @@ -5,15 +5,157 @@ pkgsNew: pkgsOld: { haskellPackages = pkgsOld.haskell.packages."${compiler}".override (old: { overrides = - pkgsOld.lib.composeExtensions + pkgsNew.lib.fold pkgsNew.lib.composeExtensions (old.overrides or (_: _: {})) - (haskellPackagesFinal: haskellPackagesPrev: { - proto3-wire = haskellPackagesFinal.callCabal2nix "proto3-wire" ../. { }; - - # ghc-9.2 requires word-compat-0.0.6 - word-compat = haskellPackagesFinal.callPackage ./word-compat.nix { }; - # Use newer version 4.7.1.0 for ghc-9.x support - data-diverse = haskellPackagesFinal.callPackage ./data-diverse.nix { }; - }); + [ (pkgsNew.haskell.lib.packagesFromDirectory { directory = ./packages; }) + (haskellPackagesFinal: haskellPackagesPrev: { + # With nixpkgs-23.11 and ghc981, adjunctions wants hspec for testing, + # which causes problems. + adjunctions = + pkgsNew.haskell.lib.dontCheck haskellPackagesPrev.adjunctions; + + # With nixpkgs-23.11 and ghc981, aeson-2.1.2.1 thinks that th-abstraction is out of bounds. + # Also, in order to avoid the breaking change to package structure in aeson-2.2.0.0, + # we patch the import list of aeson-2.1.2.1. + aeson = + pkgsNew.haskell.lib.doJailbreak + ( pkgsNew.haskell.lib.appendPatches haskellPackagesPrev.aeson + [ ./patches/aeson-2.1.2.1.patch ] ); + + # With nixpkgs-23.11 and ghc981, base-compat-batteries wants hspec for testing, + # which causes problems. + base-compat-batteries = + pkgsNew.haskell.lib.dontCheck haskellPackagesPrev.base-compat-batteries; + + # With nixpkgs-23.11 and ghc981, base-orphans wants hspec for testing, + # which causes problems. + base-orphans = + pkgsNew.haskell.lib.dontCheck haskellPackagesPrev.base-orphans; + + # With nixpkgs-23.11 and ghc981, bifunctors wants hspec for testing, + # which causes problems. + bifunctors = + pkgsNew.haskell.lib.dontCheck haskellPackagesPrev.bifunctors; + + # With nixpkgs-23.11 and ghc981, conduit wants hspec for testing, + # which causes problems. + conduit = + pkgsNew.haskell.lib.dontCheck haskellPackagesPrev.conduit; + + # With nixpkgs-23.11 and ghc981, data-diverse wants hspec for testing, + # which causes problems. + data-diverse = + pkgsNew.haskell.lib.dontCheck haskellPackagesPrev.data-diverse; + + # With nixpkgs-23.11 and ghc981, distribution-nixpkgs wants hspec for testing, + # which causes problems. + distribution-nixpkgs = + pkgsNew.haskell.lib.dontCheck haskellPackagesPrev.distribution-nixpkgs; + + # With nixpkgs-23.11 and ghc981, distributive wants hspec for testing, + # which causes problems. + distributive = + pkgsNew.haskell.lib.dontCheck haskellPackagesPrev.distributive; + + # With ghc981, doctest-0.22.2 complains about the version of the base + # package and depends on hspec for testing, which causes problems. + doctest = + pkgsNew.haskell.lib.dontCheck + (pkgsNew.haskell.lib.doJailbreak haskellPackagesPrev.doctest); + + # With nixpkgs-23.11 and ghc981, generic-deriving wants hspec for testing, + # which causes problems. Also, it generic-deriving thinks that + # th-abstraction is out of bounds. + generic-deriving = + pkgsNew.haskell.lib.dontCheck + (pkgsNew.haskell.lib.doJailbreak haskellPackagesPrev.generic-deriving); + + # With nixpkgs-23.11 and ghc981, hourglass does not support the version + # of the time package that is provided, but that matters only to tests. + hourglass = + pkgsNew.haskell.lib.dontCheck haskellPackagesPrev.hourglass; + + # With nixpkgs-23.11 and ghc981, hpack-0.36.0 wants hspec for testing, + # which causes problems. + hpack = + pkgsNew.haskell.lib.dontCheck haskellPackagesPrev.hpack; + + # With nixpkgs-23.11 and ghc981, http-types wants hspec for testing, + # which causes problems. + http-types = + pkgsNew.haskell.lib.dontCheck haskellPackagesPrev.http-types; + + # With nixpkgs-23.11 and ghc981, infer-license wants hspec for testing, + # which causes problems. + infer-license = + pkgsNew.haskell.lib.dontCheck haskellPackagesPrev.infer-license; + + # With nixpkgs-23.11 and ghc981, invariant indirectly depends on hspec for testing, + # which causes problems. Also, it generic-deriving thinks that + # th-abstraction is out of bounds. + invariant = + pkgsNew.haskell.lib.dontCheck + (pkgsNew.haskell.lib.doJailbreak haskellPackagesPrev.invariant); + + # With nixpkgs-23.11 and ghc981, iproute wants hspec for testing, + # which causes problems. + iproute = + pkgsNew.haskell.lib.dontCheck haskellPackagesPrev.iproute; + + # With nixpkgs-23.11 and ghc981, monad-par wants test-framework for testing, which + # wants language-haskell-extract, which does not support modern template-haskell. + monad-par = + pkgsNew.haskell.lib.dontCheck haskellPackagesPrev.monad-par; + + # With nixpkgs-23.11 and ghc981, mono-traversable wants hspec for testing, + # which causes problems. + mono-traversable = + pkgsNew.haskell.lib.dontCheck haskellPackagesPrev.mono-traversable; + + # With nixpkgs-23.11 and ghc981, streaming-commons wants hspec for testing, + # which causes problems. + streaming-commons = + pkgsNew.haskell.lib.dontCheck haskellPackagesPrev.streaming-commons; + + # With nixpkgs-23.11 and ghc981, reflection indirectly depends on hspec for testing, + # which causes problems. + reflection = + pkgsNew.haskell.lib.dontCheck haskellPackagesPrev.reflection; + + # With nixpkgs-23.11 and ghc981, resourcet wants hspec for testing, + # which causes problems. + resourcet = + pkgsNew.haskell.lib.dontCheck haskellPackagesPrev.resourcet; + + # Suppress: + # warning: non-portable path to file '"dist/build/Test/autogen/cabal_macros.h"'; specified path differs in case from file name on disk [-Wnonportable-include-path] + tasty-golden = + pkgsNew.haskell.lib.appendConfigureFlags haskellPackagesPrev.tasty-golden + [ "--ghc-option=-Wno-nonportable-include-path" ]; + + # With nixpkgs-23.11 and ghc981, text-metrics wants hspec for testing, + # which causes problems. + text-metrics = + pkgsNew.haskell.lib.dontCheck haskellPackagesPrev.text-metrics; + + # With nixpkgs-23.11 and ghc981, th-compat wants hspec for testing, + # which causes problems. + th-compat = + pkgsNew.haskell.lib.dontCheck haskellPackagesPrev.th-compat; + + # With nixpkgs-23.11 and ghc981, hpack-0.36.0 wants hspec for testing, + # which causes problems. + unix-time = + pkgsNew.haskell.lib.dontCheck haskellPackagesPrev.unix-time; + + # With nixpkgs-23.11 and ghc981, yaml wants hspec for testing, + # which causes problems. + yaml = + pkgsNew.haskell.lib.dontCheck haskellPackagesPrev.yaml; + }) + (haskellPackagesFinal: haskellPackagesPrev: { + proto3-wire = haskellPackagesFinal.callCabal2nix "proto3-wire" ../. { }; + }) + ]; }); } diff --git a/nix/nixpkgs.nix b/nix/nixpkgs.nix index f1b7458..fdb1eac 100644 --- a/nix/nixpkgs.nix +++ b/nix/nixpkgs.nix @@ -2,9 +2,9 @@ args: let nixpkgs = builtins.fetchTarball { - # release: nixpkgs-23.05pre491123.261abe8a44a7 - # commit: 261abe8a44a7e8392598d038d2e01f7b33cf26d0 - url = "https://hydra.nixos.org/build/236149912/download/2/nixpkgs-23.05pre491123.261abe8a44a7.tar.xz"; - sha256 = "0yhf6zbnkj3a7wfas5clli5qk4xl0cw5zq5w4fzvd724za5nb04f"; + # build: https://hydra.nixos.org/build/258096332 + # commit: 0638fe2715d998fa81d173aad264eb671ce2ebc1 + url = "https://hydra.nixos.org/build/258096332/download/2/nixpkgs-23.11pre558121.0638fe2715d9.tar.xz"; + sha256 = "1z3s1hqg3b72g608pf9sv474d4y9s00p86nsvfw5i9xgwhjncjjb"; }; in import nixpkgs ({ config = { }; } // args) diff --git a/nix/packages/bifunctors.nix b/nix/packages/bifunctors.nix new file mode 100644 index 0000000..f4cf326 --- /dev/null +++ b/nix/packages/bifunctors.nix @@ -0,0 +1,22 @@ +{ mkDerivation, assoc, base, comonad, containers +, foldable1-classes-compat, hspec, hspec-discover, lib, QuickCheck +, tagged, template-haskell, th-abstraction, transformers +, transformers-compat +}: +mkDerivation { + pname = "bifunctors"; + version = "5.6.2"; + sha256 = "1086a9285061eed0c2c5d3cb65aa223defd52fca6d0515bb69ddf2dbc3d9697a"; + libraryHaskellDepends = [ + assoc base comonad containers foldable1-classes-compat tagged + template-haskell th-abstraction transformers + ]; + testHaskellDepends = [ + base hspec QuickCheck template-haskell transformers + transformers-compat + ]; + testToolDepends = [ hspec-discover ]; + homepage = "http://github.com/ekmett/bifunctors/"; + description = "Bifunctors"; + license = lib.licenses.bsd3; +} diff --git a/nix/packages/doctest.nix b/nix/packages/doctest.nix new file mode 100644 index 0000000..9e64520 --- /dev/null +++ b/nix/packages/doctest.nix @@ -0,0 +1,30 @@ +{ mkDerivation, base, code-page, deepseq, directory, exceptions +, filepath, ghc, ghc-paths, hspec, hspec-core, hspec-discover +, HUnit, lib, mockery, process, QuickCheck, setenv, silently +, stringbuilder, syb, transformers +}: +mkDerivation { + pname = "doctest"; + version = "0.22.2"; + sha256 = "afb839c14019c17e3ec7900871a9fc104226028858c724932d53225ae382c6e5"; + isLibrary = true; + isExecutable = true; + libraryHaskellDepends = [ + base code-page deepseq directory exceptions filepath ghc ghc-paths + process syb transformers + ]; + executableHaskellDepends = [ + base code-page deepseq directory exceptions filepath ghc ghc-paths + process syb transformers + ]; + testHaskellDepends = [ + base code-page deepseq directory exceptions filepath ghc ghc-paths + hspec hspec-core HUnit mockery process QuickCheck setenv silently + stringbuilder syb transformers + ]; + testToolDepends = [ hspec-discover ]; + homepage = "https://github.com/sol/doctest#readme"; + description = "Test interactive Haskell examples"; + license = lib.licenses.mit; + mainProgram = "doctest"; +} diff --git a/nix/packages/free.nix b/nix/packages/free.nix new file mode 100644 index 0000000..f19700e --- /dev/null +++ b/nix/packages/free.nix @@ -0,0 +1,19 @@ +{ mkDerivation, base, comonad, containers, distributive, exceptions +, indexed-traversable, lib, mtl, profunctors, semigroupoids +, template-haskell, th-abstraction, transformers, transformers-base +}: +mkDerivation { + pname = "free"; + version = "5.2"; + sha256 = "72867f7c89173263765736e8d395e94291f1aaea626ecb1d673d72ce90b94f89"; + revision = "4"; + editedCabalFile = "0vic3p2viip8gjww8fx19ax6ry7y34h7xclvhzkvmbspjh9d219x"; + libraryHaskellDepends = [ + base comonad containers distributive exceptions indexed-traversable + mtl profunctors semigroupoids template-haskell th-abstraction + transformers transformers-base + ]; + homepage = "http://github.com/ekmett/free/"; + description = "Monads for free"; + license = lib.licenses.bsd3; +} diff --git a/nix/packages/hpack.nix b/nix/packages/hpack.nix new file mode 100644 index 0000000..8b74b68 --- /dev/null +++ b/nix/packages/hpack.nix @@ -0,0 +1,40 @@ +{ mkDerivation, aeson, base, bifunctors, bytestring, Cabal +, containers, crypton, deepseq, directory, filepath, Glob, hspec +, hspec-discover, http-client, http-client-tls, http-types, HUnit +, infer-license, interpolate, lib, mockery, mtl, pretty, QuickCheck +, scientific, template-haskell, temporary, text, transformers +, unordered-containers, vector, yaml +}: +mkDerivation { + pname = "hpack"; + version = "0.36.0"; + sha256 = "a0de4e1a0fe587030fa643cad99cd96de81e295923ffb57cfc7b1575f253ea7a"; + revision = "1"; + editedCabalFile = "1zh5rsf38xmwp7lf80iifrhnkl80lri4xzlhz2n5df3vc0dqzya8"; + isLibrary = true; + isExecutable = true; + libraryHaskellDepends = [ + aeson base bifunctors bytestring Cabal containers crypton deepseq + directory filepath Glob http-client http-client-tls http-types + infer-license mtl pretty scientific text transformers + unordered-containers vector yaml + ]; + executableHaskellDepends = [ + aeson base bifunctors bytestring Cabal containers crypton deepseq + directory filepath Glob http-client http-client-tls http-types + infer-license mtl pretty scientific text transformers + unordered-containers vector yaml + ]; + testHaskellDepends = [ + aeson base bifunctors bytestring Cabal containers crypton deepseq + directory filepath Glob hspec http-client http-client-tls + http-types HUnit infer-license interpolate mockery mtl pretty + QuickCheck scientific template-haskell temporary text transformers + unordered-containers vector yaml + ]; + testToolDepends = [ hspec-discover ]; + homepage = "https://github.com/sol/hpack#readme"; + description = "A modern format for Haskell packages"; + license = lib.licenses.mit; + mainProgram = "hpack"; +} diff --git a/nix/packages/http-client-tls.nix b/nix/packages/http-client-tls.nix new file mode 100644 index 0000000..327b264 --- /dev/null +++ b/nix/packages/http-client-tls.nix @@ -0,0 +1,23 @@ +{ mkDerivation, base, bytestring, case-insensitive, containers +, crypton, crypton-connection, data-default-class, exceptions +, gauge, hspec, http-client, http-types, lib, memory, network +, network-uri, text, tls, transformers +}: +mkDerivation { + pname = "http-client-tls"; + version = "0.3.6.3"; + sha256 = "38dcfc3d772eb6898b4a8856d6159824d13f65eb291733619f625a802dad9095"; + libraryHaskellDepends = [ + base bytestring case-insensitive containers crypton + crypton-connection data-default-class exceptions http-client + http-types memory network network-uri text tls transformers + ]; + testHaskellDepends = [ + base crypton-connection hspec http-client http-types + ]; + benchmarkHaskellDepends = [ base gauge http-client ]; + doCheck = false; + homepage = "https://github.com/snoyberg/http-client"; + description = "http-client backend using the connection package and tls library"; + license = lib.licenses.mit; +} diff --git a/nix/packages/lens.nix b/nix/packages/lens.nix new file mode 100644 index 0000000..d495523 --- /dev/null +++ b/nix/packages/lens.nix @@ -0,0 +1,37 @@ +{ mkDerivation, array, assoc, base, base-orphans, bifunctors +, bytestring, call-stack, comonad, containers, contravariant +, criterion, deepseq, distributive, exceptions, filepath, free +, generic-deriving, ghc-prim, hashable, HUnit, indexed-traversable +, indexed-traversable-instances, kan-extensions, lib, mtl, parallel +, profunctors, QuickCheck, reflection, semigroupoids +, simple-reflect, strict, tagged, template-haskell, test-framework +, test-framework-hunit, test-framework-quickcheck2, text +, th-abstraction, these, transformers, transformers-compat +, unordered-containers, vector +}: +mkDerivation { + pname = "lens"; + version = "5.3.1"; + sha256 = "dac3ff7abd483ef36956882631fdcde922e086b51f459c0c02e690c6b7f24b6c"; + libraryHaskellDepends = [ + array assoc base base-orphans bifunctors bytestring call-stack + comonad containers contravariant distributive exceptions filepath + free ghc-prim hashable indexed-traversable + indexed-traversable-instances kan-extensions mtl parallel + profunctors reflection semigroupoids strict tagged template-haskell + text th-abstraction these transformers transformers-compat + unordered-containers vector + ]; + testHaskellDepends = [ + base bytestring containers deepseq HUnit mtl QuickCheck + simple-reflect test-framework test-framework-hunit + test-framework-quickcheck2 text transformers + ]; + benchmarkHaskellDepends = [ + base bytestring comonad containers criterion deepseq + generic-deriving transformers unordered-containers vector + ]; + homepage = "http://github.com/ekmett/lens/"; + description = "Lenses, Folds and Traversals"; + license = lib.licenses.bsd2; +} diff --git a/nix/packages/parsec-class.nix b/nix/packages/parsec-class.nix new file mode 100644 index 0000000..ebb55dd --- /dev/null +++ b/nix/packages/parsec-class.nix @@ -0,0 +1,10 @@ +{ mkDerivation, base, lib, parsec }: +mkDerivation { + pname = "parsec-class"; + version = "1.0.1.0"; + sha256 = "068686c03627ffca77128a762de295c4a43095b9e8dbe3829efc91fed00c418c"; + libraryHaskellDepends = [ base parsec ]; + homepage = "https://github.com/peti/parsec-class"; + description = "Class of types that can be constructed from their text representation"; + license = lib.licenses.mit; +} diff --git a/nix/packages/semigroupoids.nix b/nix/packages/semigroupoids.nix new file mode 100644 index 0000000..0058ab1 --- /dev/null +++ b/nix/packages/semigroupoids.nix @@ -0,0 +1,19 @@ +{ mkDerivation, base, base-orphans, bifunctors, comonad, containers +, contravariant, distributive, foldable1-classes-compat, hashable +, lib, tagged, template-haskell, transformers, transformers-compat +, unordered-containers +}: +mkDerivation { + pname = "semigroupoids"; + version = "6.0.1"; + sha256 = "1d532030862414f5d4f2f6f001783f77aa14e5f05ee8e3c4a2d2129fca29cc1f"; + libraryHaskellDepends = [ + base base-orphans bifunctors comonad containers contravariant + distributive foldable1-classes-compat hashable tagged + template-haskell transformers transformers-compat + unordered-containers + ]; + homepage = "http://github.com/ekmett/semigroupoids"; + description = "Semigroupoids: Category sans id"; + license = lib.licenses.bsd2; +} diff --git a/nix/packages/tagged.nix b/nix/packages/tagged.nix new file mode 100644 index 0000000..c773cf6 --- /dev/null +++ b/nix/packages/tagged.nix @@ -0,0 +1,15 @@ +{ mkDerivation, base, deepseq, lib, template-haskell, transformers +}: +mkDerivation { + pname = "tagged"; + version = "0.8.8"; + sha256 = "a083fa7835516203c168433a1c8dfc0290a94b05fedab566ad0640fc9137a6a7"; + revision = "1"; + editedCabalFile = "0chbxdppgpsrjqzf28z53x9wqwz0ncfimhfc6rr9knixvvxxx4wi"; + libraryHaskellDepends = [ + base deepseq template-haskell transformers + ]; + homepage = "http://github.com/ekmett/tagged"; + description = "Haskell 98 phantom types to avoid unsafely passing dummy arguments"; + license = lib.licenses.bsd3; +} diff --git a/nix/packages/th-abstraction.nix b/nix/packages/th-abstraction.nix new file mode 100644 index 0000000..abce3dd --- /dev/null +++ b/nix/packages/th-abstraction.nix @@ -0,0 +1,14 @@ +{ mkDerivation, base, containers, ghc-prim, lib, template-haskell +}: +mkDerivation { + pname = "th-abstraction"; + version = "0.7.0.0"; + sha256 = "b2854c612f2fa4adfa1ecbb4089a2211fd9cb3210aec17ba4a455ae486b22721"; + libraryHaskellDepends = [ + base containers ghc-prim template-haskell + ]; + testHaskellDepends = [ base containers template-haskell ]; + homepage = "https://github.com/glguy/th-abstraction"; + description = "Nicer interface for reified information about data types"; + license = lib.licenses.isc; +} diff --git a/nix/patches/aeson-2.1.2.1.patch b/nix/patches/aeson-2.1.2.1.patch new file mode 100644 index 0000000..d08277b --- /dev/null +++ b/nix/patches/aeson-2.1.2.1.patch @@ -0,0 +1,11 @@ +--- a/src/Data/Aeson/Internal/Text.hs 2001-09-08 18:46:40.000000000 -0700 ++++ b/src/Data/Aeson/Internal/Text.hs 2024-05-09 21:16:49.964743729 -0700 +@@ -8,5 +8,5 @@ + import qualified Data.Text as T + + #if MIN_VERSION_text(2,0,0) +-import Data.Text.Array (Array (..)) ++import Data.Text.Array + import qualified Data.Text.Internal as T (Text (..)) + + import qualified Data.ByteString.Short.Internal as SBS diff --git a/nix/patches/pantry-0.9.3.2.patch b/nix/patches/pantry-0.9.3.2.patch new file mode 100644 index 0000000..05e1b2f --- /dev/null +++ b/nix/patches/pantry-0.9.3.2.patch @@ -0,0 +1,13 @@ +--- a/src/Hackage/Security/Client/Repository/HttpLib/HttpClient.hs 2023-11-02 09:37:03.000000000 -0700 ++++ b/src/Hackage/Security/Client/Repository/HttpLib/HttpClient.hs 2024-05-14 12:44:48.812084736 -0700 +@@ -81,8 +81,9 @@ + -- NOTE: The only other exception defined in @http-client@ is @TimeoutTriggered@ + -- but it is currently disabled + wrapCustomEx :: ++ Throws SomeRemoteError => + (Throws HTTP.HttpException => IO a) +- -> (Throws SomeRemoteError => IO a) ++ -> IO a + wrapCustomEx = handleChecked (\(ex :: HTTP.HttpException) -> go ex) + where + go ex = throwChecked (SomeRemoteError ex) diff --git a/proto3-wire.cabal b/proto3-wire.cabal index c520571..81af856 100644 --- a/proto3-wire.cabal +++ b/proto3-wire.cabal @@ -1,7 +1,7 @@ cabal-version: >=1.10 name: proto3-wire -version: 1.4.2 +version: 1.4.3 synopsis: A low-level implementation of the Protocol Buffers (version 3) wire format license: Apache-2.0 license-file: LICENSE diff --git a/shell.nix b/shell.nix index d9a90d8..93c75c7 100644 --- a/shell.nix +++ b/shell.nix @@ -1,14 +1,17 @@ -{ compiler ? "ghc8107", enableStack ? true }: +{ compiler ? "ghc8107", enableStack ? false }: let pkgs = import ./nix/pkgs.nix { inherit compiler; }; - proto3-wire = pkgs.haskellPackages.proto3-wire; +in pkgs.haskellPackages.shellFor { + packages = hpkgs: [ + hpkgs.proto3-wire + ]; -in proto3-wire.env.overrideAttrs (old: { - buildInputs = (old.buildInputs or []) ++ [ + nativeBuildInputs = [ pkgs.cabal-install + pkgs.cabal2nix ] ++ (if enableStack then [ pkgs.stack ] else []); -}) +} diff --git a/test/Main.hs b/test/Main.hs index 9ecd5b1..3fe159d 100644 --- a/test/Main.hs +++ b/test/Main.hs @@ -34,7 +34,8 @@ import qualified Data.ByteString.Builder.Internal as BBI import Data.Either ( isLeft ) import Data.Maybe ( fromMaybe ) import Data.Int -import Data.List ( group, sort ) +import Data.List ( sort ) +import qualified Data.List.NonEmpty as NE import qualified Data.Text.Lazy as T import qualified Data.Text.Short as TS import qualified Data.Vector as V @@ -320,7 +321,7 @@ parseWhile p = StateT (Just . BL.span p) -- | Run-length encode lazy a 'BL.ByteString' -- for concise display in test results. rle :: BL.ByteString -> [(Int, Word8)] -rle = map (length &&& head) . group . BL.unpack +rle = map (NE.length &&& NE.head) . NE.group . BL.unpack -- | Please adjust this expected size of the metadata header -- to match that expected of the current implementation.