Skip to content

Commit

Permalink
Add support for building with ghc-9.2 and CHaP
Browse files Browse the repository at this point in the history
  • Loading branch information
erikd committed Nov 29, 2022
1 parent 1b5ae75 commit 4c08015
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 26 deletions.
53 changes: 34 additions & 19 deletions cabal.project
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
index-state: 2022-02-18T00:00:00Z
-- Custom repository for cardano haskell packages, see CONTRIBUTING for more
repository cardano-haskell-packages
url: https://input-output-hk.github.io/cardano-haskell-packages
secure: True
root-keys:
3e0cce471cf09815f930210f7827266fd09045445d65923e6d0238a6cd15126f
443abb7fb497a134c343faf52f0b659bd7999bc06b7f63fa76dc99d631f9bea1
a86a1f6ce86c449c46666bda44268677abf29b5b2d2eb5ec7af903ec2f117a82
bcec67e8e99cabfa7764d75ad9b158d72bfacf70ca1d0ec8bc6b4406d1bf8413
c00aae8461a256275598500ea0e187588c35a5d5d7454fb57eac18d9edb86a56
d4a35cd3121aa00d18544bb0ac01c3e1691d618f462c46129271bccf39f7e8ee

-- See CONTRIBUTING for information about these, including some Nix commands
-- you need to run if you change them
index-state: 2022-11-30T00:00:00Z
index-state: cardano-haskell-packages 2022-11-14T13:56:33Z

packages:
contra-tracer
Expand All @@ -17,26 +32,26 @@ packages:
package iohk-monitoring
tests: True

allow-newer:
libsystemd-journal:base,
ekg:aeson

source-repository-package
type: git
location: https://github.com/vshabanov/ekg-json
tag: 00ebe7211c981686e65730b7144fbf5350462608
--sha256: sha256-VT8Ur585TCn03P2TVi6t92v2Z6tl8vKijICjse6ocv8=

source-repository-package
type: git
location: https://github.com/input-output-hk/Win32-network
tag: 94153b676617f8f33abe8d8182c37377d2784bd1
--sha256: 0pb7bg0936fldaa5r08nqbxvi2g8pcy4w3c7kdcg7pdgmimr30ss

constraints:
ip < 1.5,
hedgehog >= 1.0,
bimap >= 0.4.0
bimap >= 0.4.0,

allow-newer:
libsystemd-journal:base
, ekg:*
, ekg-core:base
, ekg-json:aeson
, ekg-json:base
, threepenny-gui:base
, threepenny-gui:template-haskell
, websockets-snap:bytestring

package comonad
flags: -test-doctests

-- This is an IOG custom version with some hacks to force it to only provide HTTPS
-- connections. In talks with upstream on how to fix this.
source-repository-package
type: git
location: https://github.com/input-output-hk/threepenny-gui
tag: c24c7effe8b2df011a31397bb409e560f3afb4ab
3 changes: 2 additions & 1 deletion iohk-monitoring/src/Cardano/BM/Data/Backend.lhs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ module Cardano.BM.Data.Backend
import Control.Exception (Exception)
import Data.Aeson (FromJSON)
import Data.Kind (Type)
import Data.Text (Text)
import Cardano.BM.Data.BackendKind
Expand Down Expand Up @@ -59,7 +60,7 @@ class ( IsEffectuator t a
, FromJSON a
, Exception (BackendFailure t)
) => IsBackend t a where
type BackendFailure t :: *
type BackendFailure t :: Type
type BackendFailure t = GenericBackendFailure
bekind :: t a -> BackendKind
realize :: Configuration -> IO (t a)
Expand Down
15 changes: 10 additions & 5 deletions iohk-monitoring/src/Cardano/BM/Stats/Resources.hs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ module Cardano.BM.Stats.Resources
)
where

import Data.Aeson
import Data.Word
import Data.Aeson (FromJSON (..), Options (..), SumEncoding (..), ToJSON (..),
defaultOptions, genericParseJSON, genericToEncoding, genericToJSON)
import Data.Word (Word64)
import GHC.Generics (Generic)

-- | Concrete data provided by 'readResourceStats'.
Expand Down Expand Up @@ -58,9 +59,13 @@ encodingOptions = defaultOptions
{ fieldLabelModifier = drop 1
, tagSingleConstructors = True
, sumEncoding =
defaultTaggedObject
{ tagFieldName = "kind"
}
-- This is a copy of defaultTaggedObject in the `aeson` library, but using that generates a
-- pattern match error with `ghc-9.2` but is accepted by `ghc-8.10`.
-- https://gitlab.haskell.org/ghc/ghc/-/issues/15656
TaggedObject
{ tagFieldName = "kind"
, contentsFieldName = "contents"
}
}

instance FromJSON a => FromJSON (Resources a) where
Expand Down
5 changes: 5 additions & 0 deletions iohk-monitoring/test/Cardano/BM/Test/Aggregated.lhs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@

%if style == newcode
\begin{code}
-- Acceptable only because this is test code and because it is in code that will
-- be deprecated in the future.
{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}
module Cardano.BM.Test.Aggregated (
tests
,prop_Aggregation_comm
Expand Down
6 changes: 5 additions & 1 deletion iohk-monitoring/test/Cardano/BM/Test/Trace.lhs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE ScopedTypeVariables #-}
-- Acceptable only because this is test code and because it is in code that will
-- be deprecated in the future.
{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}
module Cardano.BM.Test.Trace (
TraceConfiguration (..)
, setupTrace
Expand Down Expand Up @@ -414,7 +418,7 @@ unitNamedMinSeverity = do
let trace = appendName "sev-change" basetrace
logInfo trace "Message #1"
-- lower the minimum severity to Info
-- lower the minimum severity to Info
setSeverity cfg "test-named-severity.sev-change" (Just Info)
msev <- Cardano.BM.Configuration.inspectSeverity cfg "test-named-severity.sev-change"
assertBool ("min severity should be Info, but is " ++ (show msev))
Expand Down

0 comments on commit 4c08015

Please sign in to comment.