Skip to content

A peer-to-peer stack for code collaboration

Update stackage base snapshot to LTS 13.2

Thomas Scholtes3da6be318862
diff --git a/cloudbuild.yaml b/cloudbuild.yaml
index b54697d..4fa4b7f 100644
--- a/cloudbuild.yaml
+++ b/cloudbuild.yaml
@@ -12,7 +12,7 @@ steps:
load-cache
- id: "Build deps"
- name: 'haskell:8.4.3'
+ name: 'haskell:8.6.3'
env: ['STACK_ROOT=/workspace/.stack']
entrypoint: 'bash'
args:
@@ -26,17 +26,17 @@ steps:
stack build stylish-haskell hlint weeder
- id: "Format"
- name: 'haskell:8.4.3'
+ name: 'haskell:8.6.3'
env: ['STACK_ROOT=/workspace/.stack']
args: ['./scripts/check-fmt.sh']
- id: "Lint"
- name: 'haskell:8.4.3'
+ name: 'haskell:8.6.3'
env: ['STACK_ROOT=/workspace/.stack']
args: ['stack', 'exec', '--', 'hlint', '.']
- id: "Build & Test"
- name: 'haskell:8.4.3'
+ name: 'haskell:8.6.3'
env: ['STACK_ROOT=/workspace/.stack']
entrypoint: bash
args:
@@ -54,14 +54,14 @@ steps:
- id: "Lint (weeder)"
waitFor: ["Build & Test"]
- name: 'haskell:8.4.3'
+ name: 'haskell:8.6.3'
env: ["STACK_ROOT=/workspace/.stack"]
args: ["stack", "exec", "--", "weeder", "--match"]
- id: "Build reference document"
waitFor:
- "Build & Test"
- name: 'haskell:8.4.3'
+ name: 'haskell:8.6.3'
env: ['STACK_ROOT=/workspace/.stack']
entrypoint: bash
args:
@@ -79,7 +79,7 @@ steps:
- id: "Check tutorial"
waitFor:
- "Build & Test"
- name: 'haskell:8.4.3'
+ name: 'haskell:8.6.3'
env: ['STACK_ROOT=/workspace/.stack']
entrypoint: bash
args:
@@ -138,7 +138,7 @@ steps:
- id: "radicle-server integration test"
waitFor:
- "Start and expose radicle-server"
- name: 'haskell:8.4.3'
+ name: 'haskell:8.6.3'
env: ['STACK_ROOT=/workspace/.stack']
entrypoint: 'bash'
args:
diff --git a/docs/source/reference.rst b/docs/source/reference.rst
index 362d2a8..5bd034c 100644
--- a/docs/source/reference.rst
+++ b/docs/source/reference.rst
@@ -504,7 +504,7 @@ Close a handle
~~~~~~~~~~~
(system! proc) execute a system process. Returns the dict with the form
-``{ :stdin maybe-handle :stdout maybe-handle :stderr maybe-handle :proc prochandle }``
+``{ :stdin maybe-handle :stdout maybe-handle :stderr maybe-handle :proc prochandle }``
Where ``maybe-handle`` is either ``[:just handle]`` or ``:nothing``.
Note that this is quite a low-level function; higher-level ones are more
convenient.
diff --git a/scripts/ci.sh b/scripts/ci.sh
index 3caddb2..be6abde 100755
--- a/scripts/ci.sh
+++ b/scripts/ci.sh
@@ -4,7 +4,7 @@ set -euo pipefail
dependency_hash=$( (cat package.yaml; cat snapshot.yaml) | sha256sum | cut -d ' ' -f 1)
-remote="gs://radicle-build-cache/v2"
+remote="gs://radicle-build-cache/v3"
local_cache_archive="stack-root.tar.gz"
remote_cache_master="$remote/stack-root-master.tar.gz"
diff --git a/snapshot.yaml b/snapshot.yaml
index 2439ddb..e07c151 100644
--- a/snapshot.yaml
+++ b/snapshot.yaml
@@ -5,10 +5,10 @@
#
# See https://docs.haskellstack.org/en/stable/custom_snapshot/
#
-name: radicle-deps-12.9
-resolver: lts-12.9
+name: radicle-deps-13.2
+resolver: lts-13.2
packages:
-- acid-state-0.14.3
-- cborg-0.2.0.0
-- serialise-0.2.0.0
+- cborg-0.2.1.0
+- serialise-0.2.1.0
+- github-0.20
diff --git a/src/Radicle/Internal/Core.hs b/src/Radicle/Internal/Core.hs
index 78e448b..3721875 100644
--- a/src/Radicle/Internal/Core.hs
+++ b/src/Radicle/Internal/Core.hs
@@ -76,7 +76,7 @@ data LangErrorData r =
| NonHashableKey
| ModuleError ModuleError
| OtherError Text
- | ParseError (Par.ParseError Char Void)
+ | ParseError (Par.ParseErrorBundle Text Void)
-- | Raised if @(throw ident value)@ is evaluated. Arguments are
-- provided by the call to @throw@.
| ThrownError Ident r
diff --git a/src/Radicle/Internal/Orphans.hs b/src/Radicle/Internal/Orphans.hs
index e64cabb..8e500ca 100644
--- a/src/Radicle/Internal/Orphans.hs
+++ b/src/Radicle/Internal/Orphans.hs
@@ -2,19 +2,11 @@
module Radicle.Internal.Orphans () where
import Codec.Serialise (Serialise(..))
-import Codec.Serialise.Decoding (Decoder)
import Data.Scientific
import Prelude (fail)
import Protolude
import Text.Megaparsec
- ( ErrorFancy
- , ErrorItem
- , ParseError(..)
- , Pos
- , SourcePos
- , mkPos
- , unPos
- )
+ (ErrorFancy, ErrorItem, Pos, SourcePos, mkPos, unPos)
instance Serialise Scientific where
encode = encode . (show :: Scientific -> Text)
@@ -26,14 +18,3 @@ instance Serialise SourcePos
instance Serialise Pos where
encode = encode . unPos
decode = mkPos <$> decode
-
-instance {-# OVERLAPPABLE #-} (Serialise a, Ord a, Serialise b, Ord b) => Serialise (ParseError a b)
-instance {-# OVERLAPPING #-} (Serialise a, Ord a) => Serialise (ParseError a Void) where
- encode = encode . unvoidParseError
- where
- unvoidParseError x = case x of
- FancyError{} -> panic "impossible"
- _ -> x
- decode = (decode :: Decoder s (ParseError a ())) >>= \case
- TrivialError a b c -> pure $ TrivialError a b c
- _ -> fail "Expecting Trivial Error"
diff --git a/src/Radicle/Internal/Parse.hs b/src/Radicle/Internal/Parse.hs
index 31be7e2..cdad873 100644
--- a/src/Radicle/Internal/Parse.hs
+++ b/src/Radicle/Internal/Parse.hs
@@ -10,14 +10,15 @@ import Text.Megaparsec
, between
, choice
, eof
- , getPosition
+ , getSourcePos
, manyTill
+ , satisfy
, sepBy
, try
, (<?>)
)
import qualified Text.Megaparsec as M
-import Text.Megaparsec.Char (char, satisfy, space1, string)
+import Text.Megaparsec.Char (char, space1, string)
import qualified Text.Megaparsec.Char.Lexer as L
import qualified Text.Megaparsec.Error as Par
@@ -38,7 +39,7 @@ spaceConsumer = L.space space1 lineComment blockComment
tag :: ValueF Value -> VParser
tag v = do
- pos <- getPosition -- N.B. in megaparsec 7 this is called getSourcePos
+ pos <- getSourcePos -- N.B. in megaparsec 7 this is called getSourcePos
pure $ Ann.Annotated (Ann.WithPos (Ann.SrcPos pos) v)
symbol :: Text -> Parser Text
@@ -146,7 +147,7 @@ valueP = do
parseValues
:: Text -- ^ Name of source file (for error reporting)
-> Text -- ^ Source code to be parsed
- -> Either (Par.ParseError Char Void) [Value]
+ -> Either (Par.ParseErrorBundle Text Void) [Value]
parseValues sourceName srcCode
= M.parse (spaceConsumer *> many valueP <* eof) (toS sourceName) srcCode
@@ -166,7 +167,7 @@ parse :: MonadError Text m
parse file src = do
let res = runIdentity (M.runParserT (spaceConsumer *> valueP <* eof) (toS file) src)
case res of
- Left err -> throwError . toS $ M.parseErrorPretty' src err
+ Left err -> throwError . toS $ M.errorBundlePretty err
Right v -> pure v
-- | Smart constructor for Ident.
diff --git a/src/Radicle/Internal/Pretty.hs b/src/Radicle/Internal/Pretty.hs
index 329d2a5..b4244af 100644
--- a/src/Radicle/Internal/Pretty.hs
+++ b/src/Radicle/Internal/Pretty.hs
@@ -13,7 +13,7 @@ import Data.Text.Prettyprint.Doc
import Data.Text.Prettyprint.Doc.Render.Terminal (Color(..), color)
import qualified Data.Text.Prettyprint.Doc.Render.Terminal as Term
import Data.Text.Prettyprint.Doc.Render.Text
-import Text.Megaparsec.Error (parseErrorPretty)
+import Text.Megaparsec.Error (errorBundlePretty)
import Text.Megaparsec.Pos (sourcePosPretty)
import qualified Radicle.Internal.Annotation as Ann
@@ -116,7 +116,7 @@ instance PrettyV r => PrettyV (LangErrorData r) where
<+> sep (prettyV . asValue . Atom <$> is)
OtherError t -> "Error:" <+> pretty t
SpecialForm f t -> "Error using special form" <+> pretty f <> ":" <+> pretty t <> "."
- ParseError t -> "Parser error:" <+> pretty (parseErrorPretty t)
+ ParseError t -> "Parser error:" <+> pretty (errorBundlePretty t)
Exit code -> "Exit with code " <+> pretty code
ThrownError i val -> "Exception" <+> pretty i <+> prettyV val
PatternMatchError e -> case e of
diff --git a/src/Radicle/Internal/PrimFns.hs b/src/Radicle/Internal/PrimFns.hs
index 1c2258e..ed34f99 100644
--- a/src/Radicle/Internal/PrimFns.hs
+++ b/src/Radicle/Internal/PrimFns.hs
@@ -11,7 +11,7 @@ import qualified Data.Sequence as Seq
import qualified Data.Set as Set
import qualified Data.Text as T
import GHC.Exts (IsList(..), sortWith)
-import Text.Megaparsec (parseErrorPretty)
+import Text.Megaparsec (errorBundlePretty)
import qualified Radicle.Internal.Annotation as Ann
import Radicle.Internal.Core
@@ -713,7 +713,7 @@ readValues
readValues sourceFile code = do
case parseValues sourceFile code of
Right vs -> pure vs
- Left e -> throwErrorHere $ ThrownError (Ident "parse-error") (String . toS $ parseErrorPretty e)
+ Left e -> throwErrorHere $ ThrownError (Ident "parse-error") (String . toS $ errorBundlePretty e)
allDocs :: [(Text, Text, a)] -> [(Ident, Maybe Text, a)]
allDocs = fmap $ \(x,y,z) -> (unsafeToIdent x, Just y, z)