Skip to content

Commit

Permalink
Bump to base16 1.0, aeson 2.2, compatibiliity with GHC9.8 (#87)
Browse files Browse the repository at this point in the history
* compatibility with base16 > 1 and ghc 9.8

* bump to aeson-2.2
  • Loading branch information
locallycompact authored Apr 4, 2024
1 parent 04cd67d commit 2e00f04
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 15 deletions.
4 changes: 3 additions & 1 deletion app/Foliage/HackageSecurity.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE ImportQualifiedPost #-}
Expand All @@ -14,6 +15,7 @@ where

import Control.Monad (replicateM)
import Crypto.Sign.Ed25519 (unPublicKey)
import Data.Base16.Types (extractBase16)
import Data.ByteString.Base16 (encodeBase16)
import Data.ByteString.Char8 qualified as BS
import Data.ByteString.Lazy qualified as BSL
Expand Down Expand Up @@ -58,7 +60,7 @@ createKeys base = do
putStrLn $ " " ++ showKey key

showKey :: Some Key -> [Char]
showKey k = T.unpack $ encodeBase16 $ exportSomePublicKey $ somePublicKey k
showKey k = T.unpack $ extractBase16 $ encodeBase16 $ exportSomePublicKey $ somePublicKey k

writeKeyWithId :: FilePath -> Some Key -> IO ()
writeKeyWithId base k =
Expand Down
5 changes: 0 additions & 5 deletions app/Foliage/Meta/Aeson.hs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import Data.Text
import Distribution.Types.Orphans ()
import Foliage.Meta
import Foliage.Utils.Aeson
import Network.URI (URI)

deriving via MyAesonEncoding RevisionSpec instance ToJSON RevisionSpec

Expand All @@ -29,7 +28,3 @@ instance ToJSON PackageVersionSource where
{ sumEncoding = ObjectWithSingleField
, omitNothingFields = True
}

instance ToJSON URI where
toJSON :: URI -> Value
toJSON = toJSON . show
3 changes: 2 additions & 1 deletion app/Foliage/PrepareSdist.hs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ where

import Control.Monad (when)
import Crypto.Hash.SHA256 qualified as SHA256
import Data.Base16.Types (extractBase16)
import Data.Binary qualified as Binary
import Data.ByteString qualified as BS
import Data.ByteString.Base16
Expand Down Expand Up @@ -110,4 +111,4 @@ readFileHashValue :: FilePath -> IO BS.ByteString
readFileHashValue = fmap SHA256.hash . BS.readFile

showHashValue :: BS.ByteString -> [Char]
showHashValue = T.unpack . encodeBase16
showHashValue = T.unpack . extractBase16 . encodeBase16
16 changes: 8 additions & 8 deletions foliage.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ executable foliage
Network.URI.Orphans

build-depends:
base >=4.14.3.0 && <4.18,
aeson >=2.0.3.0 && <2.2,
base16 >=0.3.2.0 && <0.4,
base >=4.14.3.0 && <4.20,
aeson >=2.2 && <2.3,
base16 >=0.3.2.0 && <1.1,
binary >=0.8.9.0 && <0.9,
bytestring >=0.10.12.0 && <0.12,
Cabal >=3.10 && <3.11,
Cabal-syntax >=3.10 && <3.11,
cabal-install >=3.10 && <3.11,
bytestring >=0.10.12.0 && <0.13,
Cabal >=3.10 && <3.12,
Cabal-syntax >=3.10 && <3.12,
cabal-install >=3.10 && <3.12,
containers >=0.6.5.1 && <0.7,
cryptohash-sha256 >=0.11.102.1 && <0.12,
directory >=1.3.6.0 && <1.4,
Expand All @@ -62,7 +62,7 @@ executable foliage
shake >=0.19.6 && <0.20,
stache >=2.3.3 && <2.4,
tar >=0.5.1.1 && <0.6,
text >=1.2.4.1 && <2.1,
text >=1.2.4.1 && <2.2,
time >=1.9.3 && <1.13,
time-compat >=1.9.6.1 && <1.10,
tomland >=1.3.3.1 && <1.4,
Expand Down

0 comments on commit 2e00f04

Please sign in to comment.