From 72674999960deb8b04aa26766f5a2b2d4583aeaa Mon Sep 17 00:00:00 2001 From: Martijn Bastiaan Date: Mon, 11 Oct 2021 13:16:08 +0200 Subject: [PATCH] Bump dependency versions (#1949) Related: https://github.com/commercialhaskell/stackage/issues/6217 --- cabal.project | 7 ++++++- clash-cosim/Setup.hs | 7 +++++++ clash-ghc/clash-ghc.cabal | 4 ++-- clash-lib/clash-lib.cabal | 6 +++--- clash-lib/src/Clash/Driver/Manifest.hs | 3 +-- clash-lib/src/Clash/Primitives/Types.hs | 12 +++++++++++- clash-prelude/clash-prelude.cabal | 4 ++-- 7 files changed, 32 insertions(+), 11 deletions(-) diff --git a/cabal.project b/cabal.project index f9b91b3acc..16ddb1df50 100644 --- a/cabal.project +++ b/cabal.project @@ -16,7 +16,7 @@ write-ghc-environment-files: always -- index state, to go along with the cabal.project.freeze file. update the index -- state by running `cabal update` twice and looking at the index state it -- displays to you (as the second update will be a no-op) -index-state: 2021-08-01T23:17:24Z +index-state: 2021-10-10T07:42:38Z -- For some reason the `clash-testsuite` executable fails to run without -- this, as it cannot find the related library... @@ -60,3 +60,8 @@ source-repository-package location: https://github.com/kcsongor/generic-lens.git tag: 8e1fc7dcf444332c474fca17110d4bc554db08c8 subdir: generic-lens + +source-repository-package + type: git + location: https://github.com/hasufell/aeson-pretty.git + tag: e902ab866bb41d990b66af3644aeb352ff7aaf6f diff --git a/clash-cosim/Setup.hs b/clash-cosim/Setup.hs index 4aea4dc3ef..93917f07fd 100644 --- a/clash-cosim/Setup.hs +++ b/clash-cosim/Setup.hs @@ -45,6 +45,9 @@ import Text.Printf (printf) import qualified Data.Text.Lazy as TL import qualified Data.Text.Lazy.Encoding as TL +#if MIN_VERSION_aeson(2,0,0) +import qualified Data.Aeson.KeyMap as KM +#endif __COSIM_MAX_NUMBER_OF_ARGUMENTS__ = 16 __COSIM_MAX_NUMBER_OF_CLOCKS__ = 1 @@ -192,7 +195,11 @@ blackboxObject -- ^ templateD -> Value blackboxObject bbname type_ templateD = +#if MIN_VERSION_aeson(2,0,0) + Object (KM.fromList [("BlackBox", Object (KM.fromList [ +#else Object (fromList [("BlackBox", Object (fromList [ +#endif ("name", String $ Text.pack bbname) , ("kind", "Declaration") , ("type", String $ Text.pack type_) diff --git a/clash-ghc/clash-ghc.cabal b/clash-ghc/clash-ghc.cabal index 042dc31e0b..1f452a8ada 100644 --- a/clash-ghc/clash-ghc.cabal +++ b/clash-ghc/clash-ghc.cabal @@ -149,7 +149,7 @@ library mtl >= 2.1.1 && < 2.3, split >= 0.2.3 && < 0.3, text >= 1.2.2 && < 1.3, - transformers >= 0.5.2.0 && < 0.6, + transformers >= 0.5.2.0 && < 0.7, unordered-containers >= 0.2.1.0 && < 0.3, clash-lib == 1.5.0, @@ -159,7 +159,7 @@ library ghc-typelits-knownnat >= 0.6 && < 0.8, ghc-typelits-natnormalise >= 0.6 && < 0.8, deepseq >= 1.3.0.2 && < 1.5, - time >= 1.4.0.1 && < 1.12, + time >= 1.4.0.1 && < 1.13, ghc-boot >= 8.6.0 && < 9.1, ghc-prim >= 0.3.1.0 && < 0.8, ghci >= 8.6.0 && < 9.1, diff --git a/clash-lib/clash-lib.cabal b/clash-lib/clash-lib.cabal index 3335c73510..af7021917a 100644 --- a/clash-lib/clash-lib.cabal +++ b/clash-lib/clash-lib.cabal @@ -126,7 +126,7 @@ Library RecordWildCards TemplateHaskell - Build-depends: aeson >= 0.6.2.0 && < 1.6, + Build-depends: aeson >= 0.6.2.0 && < 2.1, aeson-pretty >= 0.8 && < 0.9, ansi-terminal >= 0.8.0.0 && < 0.12, array, @@ -167,8 +167,8 @@ Library temporary >= 1.2.1 && < 1.4, terminal-size >= 0.3 && < 0.4, text >= 1.2.2 && < 1.3, - time >= 1.4.0.1 && < 1.12, - transformers >= 0.5.2.0 && < 0.6, + time >= 1.4.0.1 && < 1.13, + transformers >= 0.5.2.0 && < 0.7, trifecta >= 1.7.1.1 && < 2.2, vector >= 0.11 && < 1.0, vector-binary-instances >= 0.2.3.5 && < 0.3, diff --git a/clash-lib/src/Clash/Driver/Manifest.hs b/clash-lib/src/Clash/Driver/Manifest.hs index 221d758260..ed843d5b5f 100644 --- a/clash-lib/src/Clash/Driver/Manifest.hs +++ b/clash-lib/src/Clash/Driver/Manifest.hs @@ -229,12 +229,11 @@ instance FromJSON Manifest where <*> parseWithRead "init_behavior" v <*> parseWithRead "reset_polarity" v - parseWithRead :: Read a => Text -> Aeson.Object -> Parser a parseWithRead field obj = do v <- obj .:? field case readMaybe =<< v of Just a -> pure a - Nothing -> fail $ "Could not read field: " <> Text.unpack field + Nothing -> fail $ "Could not read field: " <> show field data UnexpectedModification -- | Clash generated file was modified diff --git a/clash-lib/src/Clash/Primitives/Types.hs b/clash-lib/src/Clash/Primitives/Types.hs index 6fcfb330cb..22d9d2723a 100644 --- a/clash-lib/src/Clash/Primitives/Types.hs +++ b/clash-lib/src/Clash/Primitives/Types.hs @@ -2,12 +2,14 @@ Copyright : (C) 2012-2016, University of Twente, 2016-2017, Myrtle Software Ltd 2018 , Google Inc. + 2021 , QBayLogic B.V. License : BSD2 (see the file LICENSE) - Maintainer : Christiaan Baaij + Maintainer : QBayLogic B.V. Type and instance definitions for Primitive -} +{-# LANGUAGE CPP #-} {-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NamedFieldPuns #-} @@ -51,6 +53,10 @@ import GHC.Generics (Generic) import GHC.Stack (HasCallStack) import Text.Read (readMaybe) +#if MIN_VERSION_aeson(2,0,0) +import qualified Data.Aeson.KeyMap as KeyMap +#endif + -- | An unresolved primitive still contains pointers to files. type UnresolvedPrimitive = Primitive Text ((TemplateFormat,BlackBoxFunctionName),Maybe TemplateSource) (Maybe S.Text) (Maybe TemplateSource) @@ -227,7 +233,11 @@ data Primitive a b c d instance FromJSON UnresolvedPrimitive where parseJSON (Object v) = +#if MIN_VERSION_aeson(2,0,0) + case KeyMap.toList v of +#else case H.toList v of +#endif [(conKey,Object conVal)] -> case conKey of "BlackBoxHaskell" -> do diff --git a/clash-prelude/clash-prelude.cabal b/clash-prelude/clash-prelude.cabal index 10515e02e1..8c44a1243b 100644 --- a/clash-prelude/clash-prelude.cabal +++ b/clash-prelude/clash-prelude.cabal @@ -344,8 +344,8 @@ Library th-lift >= 0.7.0 && < 0.9, th-orphans >= 0.13.1 && < 1.0, text >= 0.11.3.1 && < 1.3, - time >= 1.8 && < 1.12, - transformers >= 0.5.2.0 && < 0.6, + time >= 1.8 && < 1.13, + transformers >= 0.5.2.0 && < 0.7, type-errors >= 0.2.0.0 && < 0.3, uniplate >= 1.6.12 && < 1.7, vector >= 0.11 && < 1.0