Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Haskell to LTS 22.9 #294

Merged
merged 10 commits into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ on:

env:
RUST: 1.68
GHC: 9.2.7
GHC: 9.6.4

jobs:
fourmolu:
Expand Down
2 changes: 2 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Unreleased

- Update GHC version to 9.6.4 (lts-22.9).

## 6.2.1

- Remove uses of `baker` term when printing chain parameters.
Expand Down
21 changes: 7 additions & 14 deletions concordium-client.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ cabal-version: 1.24
-- see: https://github.com/sol/hpack

name: concordium-client
version: 6.2.1
version: 6.3.0
description: Please see the README on GitHub at <https://github.com/Concordium/concordium-client#readme>
homepage: https://github.com/Concordium/concordium-client#readme
bug-reports: https://github.com/Concordium/concordium-client/issues
Expand Down Expand Up @@ -68,17 +68,15 @@ library
FlexibleContexts
LambdaCase
TupleSections
TypeOperators
ghc-options: -Wall -Wcompat -Werror=missing-fields -Wredundant-constraints -O
build-depends:
aeson
, aeson-pretty
, ansi-terminal
, ansi-wl-pprint
, async >=2.2
, attoparsec
, base >=4.7 && <5
, base16-bytestring
, base64-bytestring
, bytestring
, case-insensitive
, cborg
Expand All @@ -87,7 +85,6 @@ library
, concordium-base
, containers
, cookie
, cryptonite
, directory
, filepath
, hashable >=1.2
Expand All @@ -99,16 +96,15 @@ library
, mtl
, optparse-applicative
, pretty
, prettyprinter
, prettyprinter-ansi-terminal
, proto-lens ==0.7.*
, proto-lens-protobuf-types ==0.7.*
, random
, scientific
, split
, string-interpolate
, text
, time
, transformers
, unordered-containers
, uri-encode >=1.5
, vector >=0.12
default-language: Haskell2010
Expand All @@ -127,6 +123,7 @@ executable concordium-client
FlexibleContexts
LambdaCase
TupleSections
TypeOperators
ghc-options: -Wall -Wcompat -Werror=missing-fields -Wredundant-constraints -O
build-depends:
base
Expand All @@ -150,14 +147,13 @@ executable tx-generator
FlexibleContexts
LambdaCase
TupleSections
TypeOperators
ghc-options: -Wall -Wcompat -Werror=missing-fields -Wredundant-constraints -O
build-depends:
aeson
, base
, bytestring
, concordium-base
, concordium-client
, containers
, mtl
, optparse-applicative
, time
Expand Down Expand Up @@ -195,6 +191,7 @@ test-suite concordium-client-test
FlexibleContexts
LambdaCase
TupleSections
TypeOperators
ghc-options: -Wall -Wcompat -Werror=missing-fields -Wredundant-constraints -O
build-depends:
HUnit >=1.6
Expand All @@ -207,14 +204,10 @@ test-suite concordium-client-test
, concordium-base
, concordium-client
, containers
, filepath
, hspec >=2.6
, hspec-expectations >=0.8
, mtl >=2.2.2
, random
, text
, time
, transformers
, unordered-containers
, vector
default-language: Haskell2010
2 changes: 1 addition & 1 deletion deps/concordium-base
Submodule concordium-base updated 215 files
1 change: 1 addition & 0 deletions generator/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import Concordium.Types.Queries
import Concordium.Types.Transactions

import Control.Concurrent
import Control.Monad
import Control.Monad.Reader
import qualified Data.Aeson as AE
import qualified Data.Aeson.Types as AE
Expand Down
16 changes: 3 additions & 13 deletions package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ default-extensions:
- FlexibleContexts
- LambdaCase
- TupleSections
- TypeOperators

ghc-options: -Wall

Expand Down Expand Up @@ -57,23 +58,18 @@ library:
- aeson
- aeson-pretty
- ansi-terminal
- ansi-wl-pprint
- attoparsec
- base >=4.7 && <5
- base16-bytestring
- base64-bytestring
- bytestring
- case-insensitive
- cereal
- cborg
- cborg-json
- concordium-base
- containers
- cryptonite
- directory
- filepath
- optparse-applicative
- random
- split
- mtl
- text
Expand All @@ -82,11 +78,11 @@ library:
- http2-client >= 0.9
- http2-grpc-types
- http2-grpc-proto-lens
- unordered-containers
- hashable >= 1.2
- pretty
- prettyprinter
- prettyprinter-ansi-terminal
- proto-lens == 0.7.*
- proto-lens-protobuf-types == 0.7.*
- microlens-platform
- transformers
- uri-encode >= 1.5
Expand Down Expand Up @@ -135,11 +131,9 @@ executables:
dependencies:
- optparse-applicative
- mtl
- containers
- base
- concordium-client
- concordium-base
- bytestring
- aeson
- time

Expand All @@ -161,14 +155,10 @@ tests:
- base64-bytestring
- containers
- hspec >= 2.6
- hspec-expectations >= 0.8
- HUnit >= 1.6
- QuickCheck >= 2.13
- mtl >= 2.2.2
- text
- transformers
- time
- unordered-containers
- filepath
- vector
- random
2 changes: 1 addition & 1 deletion scripts/distributables/linux-concordium-client.Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pipeline {
agent any
environment {
GHC_VERSION = '9.2.7'
GHC_VERSION = '9.6.4'
VERSION = sh(
returnStdout: true,
script: '''\
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
# syntax=docker/dockerfile:experimental
FROM alpine

# It seems that linker errors occur on alpine:3.19, which seem to be related to
# (rust) libc and musl, though it is not clear exactly why.
FROM alpine:3.18

ENV PATH="${PATH}:/root/.cargo/bin:/root/.stack/bin"

COPY . /build

RUN apk add perl g++ make protoc ncurses ncurses-dev zlib zlib-static zlib-dev git wget postgresql-dev gmp-dev gmp
RUN apk add perl g++ make protoc ncurses ncurses-dev zlib zlib-static zlib-dev git wget postgresql-dev gmp-dev gmp xz

ARG RUST_VERSION=1.68
RUN wget -qO - https://sh.rustup.rs | sh -s -- --profile minimal --default-toolchain ${RUST_VERSION} -y

ARG GHC_VERSION=9.2.7
ARG GHC_VERSION=9.6.4
RUN wget -q https://s3-eu-west-1.amazonaws.com/static-libraries.concordium.com/ghc-${GHC_VERSION}-x86_64-unknown-linux-integer-gmp.tar.xz && \
tar -xf ghc-${GHC_VERSION}-x86_64-unknown-linux-integer-gmp.tar.xz && \
cd ghc-${GHC_VERSION}-x86_64-unknown-linux && \
Expand All @@ -19,7 +22,7 @@ RUN wget -q https://s3-eu-west-1.amazonaws.com/static-libraries.concordium.com/g
cd .. && \
rm -rf ghc-${GHC_VERSION}-x86_64-unknown-linux-integer-gmp.tar.xz ghc-${GHC_VERSION}-x86_64-unknown-linux

ARG STACK_VERSION=2.9.1
ARG STACK_VERSION=2.13.1
RUN wget -q https://github.com/commercialhaskell/stack/releases/download/v${STACK_VERSION}/stack-${STACK_VERSION}-linux-x86_64.tar.gz && \
tar -xf stack-${STACK_VERSION}-linux-x86_64.tar.gz && \
mkdir -p $HOME/.stack/bin && \
Expand Down
2 changes: 1 addition & 1 deletion scripts/distributables/macos-concordium-client.Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pipeline {
agent { label 'jenkins-worker' }
environment {
GHC_VERSION = '9.2.7'
GHC_VERSION = '9.6.4'
RUST_VERSION = '1.68'
VERSION = sh(
returnStdout: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pipeline {
stages {
stage('build') {
environment {
GHC_VERSION = '9.2.7'
GHC_VERSION = '9.6.4'
BASE_OUTFILE = 's3://distribution.concordium.software/tools/windows/concordium-client'
}
steps {
Expand Down
1 change: 1 addition & 0 deletions src/Concordium/Client/Cli.hs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import Concordium.Client.Types.TransactionStatus
import Control.Exception
import Control.Monad
import Control.Monad.Except
import Control.Monad.IO.Class
import Data.Aeson as AE
import Data.Aeson.Types (Pair)
import qualified Data.Char as C
Expand Down
8 changes: 5 additions & 3 deletions src/Concordium/Client/Commands.hs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import Concordium.Types
import Concordium.Types.Execution
import qualified Concordium.Wasm as Wasm
import Control.Monad
import Data.String
import Data.Text hiding (map, unlines)
import Data.Time.Format.ISO8601
import Data.Version (showVersion)
Expand All @@ -48,7 +49,8 @@ import Network.HTTP2.Client
import Options.Applicative
import Options.Applicative.Help.Pretty (fillCat, hang, softline)
import Paths_concordium_client (version)
import qualified Text.PrettyPrint.ANSI.Leijen as P
import qualified Prettyprinter as P
import qualified Prettyprinter.Render.Terminal as P
import Text.Printf

type Verbose = Bool
Expand Down Expand Up @@ -1967,8 +1969,8 @@ identityShowARsCmd =
(progDesc "Show anonymity revokers at a given block.")
)

docFromLines :: [String] -> Maybe P.Doc
docFromLines = Just . P.vsep . map P.text
docFromLines :: [String] -> Maybe (P.Doc P.AnsiStyle)
docFromLines = Just . P.vsep . map fromString

-- | A parameter file used for initializing, updating, and invoking smart contracts.
-- For the JSON parameter a schema must be embedded in the module or supplied with the --schema flag.
Expand Down
2 changes: 2 additions & 0 deletions src/Concordium/Client/Config.hs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ import qualified Concordium.ID.Types as IDTypes
import Concordium.Types as Types

import Control.Exception
import Control.Monad
import Control.Monad.Except
import Control.Monad.IO.Class
import Control.Monad.Trans.Except
import qualified Data.Aeson as AE
import qualified Data.Aeson.Encode.Pretty as AE
Expand Down
2 changes: 2 additions & 0 deletions src/Concordium/Client/Export.hs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ import Concordium.Crypto.SignatureScheme (KeyPair)
import qualified Concordium.ID.Types as IDTypes

import Control.Exception
import Control.Monad
import Control.Monad.Except
import Control.Monad.IO.Class
import Data.Aeson ((.:), (.:?), (.=))
import qualified Data.Aeson as AE
import qualified Data.Aeson.Types as AE
Expand Down
2 changes: 2 additions & 0 deletions src/Concordium/Client/GRPC2.hs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ module Concordium.Client.GRPC2 where
import Control.Concurrent
import Control.Concurrent.Async
import Control.Exception
import Control.Monad
import Control.Monad.Reader
import Control.Monad.State.Strict
import Data.ByteString (ByteString)
Expand Down Expand Up @@ -811,6 +812,7 @@ instance FromProto Proto.ProtocolVersion where
Proto.PROTOCOL_VERSION_4 -> return P4
Proto.PROTOCOL_VERSION_5 -> return P5
Proto.PROTOCOL_VERSION_6 -> return P6
Proto.PROTOCOL_VERSION_7 -> return P7
Proto.ProtocolVersion'Unrecognized _ ->
fromProtoFail "Unable to convert 'ProtocolVersion'."

Expand Down
1 change: 1 addition & 0 deletions src/Concordium/Client/Output.hs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import Codec.CBOR.Read
import Concordium.Client.Types.Contract.BuildInfo (showBuildInfo)
import Concordium.Common.Time (DurationSeconds (durationSeconds))
import Concordium.Types.Execution (Event (ecEvents))
import Control.Monad
import Control.Monad.Writer
import qualified Data.Aeson as AE
import qualified Data.Aeson.Types as AE
Expand Down
7 changes: 4 additions & 3 deletions src/Concordium/Client/Runner.hs
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,9 @@ import Concordium.Client.Types.Contract.BuildInfo (extractBuildInfo)
import Control.Arrow (Arrow (second))
import Control.Concurrent (threadDelay)
import Control.Exception
import Control.Monad
import Control.Monad.Except
import Control.Monad.Reader hiding (fail)
import Control.Monad.Reader
import Control.Monad.State.Strict
import Data.Aeson as AE
import qualified Data.Aeson.Encode.Pretty as AE
Expand Down Expand Up @@ -163,12 +164,12 @@ getFromJsonAndHandleError ::
(Value -> String -> m a) ->
Either String Value ->
m a
getFromJsonAndHandleError handleError r = do
getFromJsonAndHandleError errHandler r = do
s <- case r of
Left err -> logFatal [printf "I/O error: %s" err]
Right v -> return v
case fromJSON s of
Error err -> handleError s err
Error err -> errHandler s err
Success v -> return v

-- | Look up account from the provided name or address.
Expand Down
1 change: 1 addition & 0 deletions src/Concordium/Client/Types/Account.hs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ module Concordium.Client.Types.Account (
import Control.Exception
import Control.Monad
import Control.Monad.Except
import Control.Monad.IO.Class

import Data.Aeson ((.!=), (.:), (.:?), (.=))
import qualified Data.Aeson as AE
Expand Down
2 changes: 1 addition & 1 deletion src/Concordium/Client/Types/Contract/Info.hs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import Concordium.Client.Cli
import qualified Concordium.Client.Config as Config
import Concordium.Client.GRPC2 (ClientMonad)
import Concordium.Client.Types.Contract.BuildInfo
import Control.Monad.Cont (MonadIO)
import Control.Monad.IO.Class (MonadIO)
import Data.Aeson ((.:))
import qualified Data.Aeson as AE
import qualified Data.Aeson.KeyMap as KM
Expand Down
2 changes: 1 addition & 1 deletion src/Concordium/Client/Types/TransactionStatus.hs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

module Concordium.Client.Types.TransactionStatus where

import Control.Monad.State (foldM)
import Control.Monad (foldM)
import Data.Aeson
import Data.Aeson.TH
import qualified Data.Map.Strict as Map
Expand Down
Loading
Loading