Skip to content

Commit

Permalink
Support Aeson 2.2 (#2578)
Browse files Browse the repository at this point in the history
Co-authored-by: Vekhir <134215107+Vekhir@users.noreply.github.com>
Co-authored-by: rowanG077 <goemansrowan@gmail.com>
Co-authored-by: Peter Lebbing <peter@digitalbrains.com>
  • Loading branch information
3 people committed Sep 22, 2023
1 parent f6d0fdb commit ebe9ab8
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 2 deletions.
1 change: 1 addition & 0 deletions .ci/stack-8.10.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ extra-deps:
- doctest-parallel-0.2.1@sha256:c6c0d095dd6e0b8ce1bd9f6f5fc4e0cf5cf50b6895b557356ac41b8aa2947399,5631
- fakedata-1.0.2@sha256:37c93be9a81acbc9109e2c0b300a793d9c1f5ead1d34330d869d76568191f428,24593
- tasty-1.2.3@sha256:bba67074e5326d57e8f53fc1dabcb6841daa4dc51b053506eb7f40a6f49a0497,2517
- attoparsec-aeson-2.1.0.0@sha256:fa83aba43bfa58490de8f274d19b9d58b6403a207b12cac5f93922102b084c52,1154
1 change: 1 addition & 0 deletions .ci/stack-8.6.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ extra-deps:
- fakedata-parser-0.1.0.0@sha256:6de870a2c21624aa4516f7ee28fc0076b3b19f3c32d23c969f8f0d7de47c606a,1362
- string-random-0.1.4.2@sha256:d34c614b63dbf928af428c1f2be033463c9bddfb286f3002657ef13336a2de32,2172
- lazysmallcheck-0.6@sha256:dac7a1e4877681f1260309e863e896674dd6efc1159897b7945893e693f2a6bc,1696
- attoparsec-aeson-2.1.0.0@sha256:fa83aba43bfa58490de8f274d19b9d58b6403a207b12cac5f93922102b084c52,1154
1 change: 1 addition & 0 deletions .ci/stack-8.8.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ extra-deps:
- fakedata-parser-0.1.0.0@sha256:6de870a2c21624aa4516f7ee28fc0076b3b19f3c32d23c969f8f0d7de47c606a,1362
- string-random-0.1.4.2@sha256:d34c614b63dbf928af428c1f2be033463c9bddfb286f3002657ef13336a2de32,2172
- lazysmallcheck-0.6@sha256:dac7a1e4877681f1260309e863e896674dd6efc1159897b7945893e693f2a6bc,1696
- attoparsec-aeson-2.1.0.0@sha256:fa83aba43bfa58490de8f274d19b9d58b6403a207b12cac5f93922102b084c52,1154
1 change: 1 addition & 0 deletions .ci/stack-9.0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ packages:

extra-deps:
- tasty-1.2.3@sha256:bba67074e5326d57e8f53fc1dabcb6841daa4dc51b053506eb7f40a6f49a0497,2517
- attoparsec-aeson-2.1.0.0@sha256:fa83aba43bfa58490de8f274d19b9d58b6403a207b12cac5f93922102b084c52,1154
5 changes: 4 additions & 1 deletion clash-lib/clash-lib.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ Library
RecordWildCards
TemplateHaskell

Build-depends: aeson >= 0.6.2.0 && < 2.2,
Build-depends: aeson >= 0.6.2.0 && < 2.3,
attoparsec-aeson >= 2.1 && < 2.3,
aeson-pretty >= 0.8 && < 0.9,
ansi-terminal >= 0.8.0.0 && < 0.12,
array,
Expand Down Expand Up @@ -307,6 +308,7 @@ executable v16-upgrade-primitives
Build-Depends:
base,
aeson,
attoparsec-aeson,
deepseq,
yaml,
bytestring,
Expand Down Expand Up @@ -336,6 +338,7 @@ test-suite unittests
ghc-typelits-knownnat,

aeson,
attoparsec-aeson,
aeson-pretty,
base,
base16-bytestring,
Expand Down
3 changes: 2 additions & 1 deletion clash-lib/src/Data/Aeson/Extra.hs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ import Data.Text.Encoding.Error (UnicodeException(..))
import Data.List (intercalate)
import Data.List.Extra (groupOn)
import Data.Tuple.Extra (second, first)
import Data.Aeson (FromJSON, Result (..), fromJSON, json)
import Data.Aeson (FromJSON, Result (..), fromJSON)
import Data.Aeson.Parser (json)
import Data.Attoparsec.Lazy (Result (..), parse)
import Data.ByteString.Lazy (ByteString)
import qualified Data.ByteString.Lazy as BS
Expand Down
3 changes: 3 additions & 0 deletions nix/nixpkgs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ let
doctest-parallel =
self.callCabal2nix "doctest-parallel" sources.doctest-parallel {};

attoparsec-aeson =
self.callCabal2nix "attoparsec-aeson" sources.attoparsec-aeson {};

# Internal overrides
clash-lib = import ../clash-lib { inherit nixpkgs; };
clash-ghc = import ../clash-ghc { inherit nixpkgs; };
Expand Down
7 changes: 7 additions & 0 deletions nix/sources.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
{
"attoparsec-aeson": {
"sha256": "068d77pb3kbnqp2x7qgqmlcw5d93hna5px8vsdg8np9ngwq1bp72",
"type": "tarball",
"url": "https://hackage.haskell.org/package/attoparsec-aeson-2.1.0.0/attoparsec-aeson-2.1.0.0.tar.gz",
"url_template": "https://hackage.haskell.org/package/attoparsec-aeson-<version>/attoparsec-aeson-<version>.tar.gz",
"version": "2.1.0.0"
},
"doctest-parallel": {
"branch": "main",
"description": "Test interactive Haskell examples",
Expand Down
1 change: 1 addition & 0 deletions stack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ packages:

extra-deps:
- ./clash-cosim
- attoparsec-aeson-2.1.0.0@sha256:fa83aba43bfa58490de8f274d19b9d58b6403a207b12cac5f93922102b084c52,1154

0 comments on commit ebe9ab8

Please sign in to comment.