From 683dceafb3f3ae40a51e4e19ddb01c347f3c4d94 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 (cherry picked from commit 72674999960deb8b04aa26766f5a2b2d4583aeaa) # Conflicts: # cabal.project # clash-ghc/clash-ghc.cabal # clash-lib/clash-lib.cabal # clash-prelude/clash-prelude.cabal --- cabal.project | 9 +++++++++ clash-cosim/Setup.hs | 7 +++++++ clash-ghc/clash-ghc.cabal | 7 ++++++- clash-lib/clash-lib.cabal | 7 ++++++- clash-lib/src/Clash/Driver/Manifest.hs | 3 +-- clash-lib/src/Clash/Primitives/Types.hs | 12 +++++++++++- clash-prelude/clash-prelude.cabal | 5 +++++ 7 files changed, 45 insertions(+), 5 deletions(-) diff --git a/cabal.project b/cabal.project index 32429a33b9..00f3d810bc 100644 --- a/cabal.project +++ b/cabal.project @@ -16,7 +16,11 @@ 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) +<<<<<<< HEAD index-state: 2021-06-21T10:46:43Z +======= +index-state: 2021-10-10T07:42:38Z +>>>>>>> 72674999 (Bump dependency versions (#1949)) -- For some reason the `clash-testsuite` executable fails to run without -- this, as it cannot find the related library... @@ -60,3 +64,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 d0367623d0..2546674832 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 2baf534e1a..6155755a89 100644 --- a/clash-ghc/clash-ghc.cabal +++ b/clash-ghc/clash-ghc.cabal @@ -160,7 +160,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.4.3, @@ -170,8 +170,13 @@ library ghc-typelits-knownnat >= 0.6 && < 0.8, ghc-typelits-natnormalise >= 0.6 && < 0.8, deepseq >= 1.3.0.2 && < 1.5, +<<<<<<< HEAD time >= 1.4.0.1 && < 1.12, ghc-boot >= 8.4.0 && < 9.1, +======= + time >= 1.4.0.1 && < 1.13, + ghc-boot >= 8.6.0 && < 9.1, +>>>>>>> 72674999 (Bump dependency versions (#1949)) ghc-prim >= 0.3.1.0 && < 0.8, ghci >= 8.4.0 && < 9.1, uniplate >= 1.6.12 && < 1.8, diff --git a/clash-lib/clash-lib.cabal b/clash-lib/clash-lib.cabal index 5ab6056b21..a843c40324 100644 --- a/clash-lib/clash-lib.cabal +++ b/clash-lib/clash-lib.cabal @@ -135,7 +135,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, @@ -180,9 +180,14 @@ Library temporary >= 1.2.1 && < 1.4, terminal-size >= 0.3 && < 0.4, text >= 1.2.2 && < 1.3, +<<<<<<< HEAD text-show >= 3.7 && < 3.10, 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, +>>>>>>> 72674999 (Bump dependency versions (#1949)) trifecta >= 1.7.1.1 && < 2.2, utf8-string >= 1.0.1 && < 1.1, vector >= 0.11 && < 1.0, diff --git a/clash-lib/src/Clash/Driver/Manifest.hs b/clash-lib/src/Clash/Driver/Manifest.hs index c094cca101..cf3c00c577 100644 --- a/clash-lib/src/Clash/Driver/Manifest.hs +++ b/clash-lib/src/Clash/Driver/Manifest.hs @@ -211,12 +211,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 8abd043508..3ece26a816 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 LambdaCase #-} @@ -51,6 +53,10 @@ import Data.Text.Lazy (Text) import GHC.Generics (Generic) import GHC.Stack (HasCallStack) +#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 1f8f0926ed..8875eed7cb 100644 --- a/clash-prelude/clash-prelude.cabal +++ b/clash-prelude/clash-prelude.cabal @@ -335,9 +335,14 @@ Library th-lift >= 0.7.0 && < 0.9, th-orphans >= 0.13.1 && < 1.0, text >= 0.11.3.1 && < 1.3, +<<<<<<< HEAD text-show >= 3.7 && < 3.10, time >= 1.8 && < 1.12, transformers >= 0.5.2.0 && < 0.6, +======= + time >= 1.8 && < 1.13, + transformers >= 0.5.2.0 && < 0.7, +>>>>>>> 72674999 (Bump dependency versions (#1949)) type-errors >= 0.2.0.0 && < 0.3, uniplate >= 1.6.12 && < 1.7, vector >= 0.11 && < 1.0