Skip to content

Commit 28d346f

Browse files
authored
Add Stack setup for GHC 9.6.5 (#2592)
* Bumped upper version bounds of several packages in preperation for GHC 9.6.5 build * Added some CPP to suppress redundant import warnings * Added Stack setup for GHC 9.6.5
1 parent edce221 commit 28d346f

File tree

10 files changed

+96
-38
lines changed

10 files changed

+96
-38
lines changed

.github/workflows/main.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ jobs:
3434
- os:
3535
runner: "ubuntu-latest"
3636
stack-yaml: "stack.ghc-9.2.yaml"
37+
- os:
38+
runner: "ubuntu-latest"
39+
stack-yaml: "stack.ghc-9.4.yaml"
3740
fail-fast: false
3841
name: ${{ matrix.os.runner }} - ${{ matrix.stack-yaml }}
3942
runs-on: ${{ matrix.os.runner }}

dhall-json/dhall-json.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Library
3838
Hs-Source-Dirs: src
3939
Build-Depends:
4040
base >= 4.11.0.0 && < 5 ,
41-
aeson >= 1.4.6.0 && < 2.2 ,
41+
aeson >= 1.4.6.0 && < 2.3 ,
4242
aeson-pretty >= 0.8.0 && < 0.9 ,
4343
aeson-yaml >= 1.1.0 && < 1.2 ,
4444
bytestring < 0.13,

dhall-lsp-server/dhall-lsp-server.cabal

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,15 @@ library
5454
, dhall-json >= 1.4 && < 1.8
5555
, filepath >= 1.4.2 && < 1.5
5656
, lsp >= 2.1.0.0 && < 2.2
57-
, lens >= 4.16.1 && < 5.3
57+
, lens >= 4.16.1 && < 5.4
5858
-- megaparsec follows SemVer: https://github.com/mrkkrp/megaparsec/issues/469#issuecomment-927918469
5959
, megaparsec >= 7.0.2 && < 10
60-
, mtl >= 2.2.2 && < 2.3
60+
, mtl >= 2.2.2 && < 2.4
6161
, network-uri >= 2.6.1.0 && < 2.7
6262
, prettyprinter >= 1.7.0 && < 1.8
6363
, text >= 1.2.3.0 && < 2.1
6464
, text-rope >= 0.2 && < 0.3
65-
, transformers >= 0.5.5.0 && < 0.6
65+
, transformers >= 0.5.5.0 && < 0.7
6666
, unordered-containers >= 0.2.9.0 && < 0.3
6767
, uri-encode >= 1.5.0.5 && < 1.6
6868
default-language: Haskell2010
@@ -105,7 +105,7 @@ Test-Suite tests
105105
Build-Depends:
106106
base ,
107107
lsp-types >= 2.0.1 && < 2.1 ,
108-
hspec >= 2.7 && < 2.11 ,
108+
hspec >= 2.7 && < 2.12 ,
109109
lsp-test >= 0.15.0.0 && < 0.16 ,
110110
tasty >= 0.11.2 && < 1.5 ,
111111
tasty-hspec >= 1.1 && < 1.3 ,

dhall-nixpkgs/dhall-nixpkgs.cabal

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Build-Type: Simple
1717
Executable dhall-to-nixpkgs
1818
Main-Is: Main.hs
1919
Build-Depends: base >= 4.11 && < 5
20-
, aeson >= 1.0.0.0 && < 2.2
20+
, aeson >= 1.0.0.0 && < 2.3
2121
, base16-bytestring >= 1.0.0.0
2222
, base64-bytestring >= 1.1.0.0
2323
, bytestring < 0.12
@@ -33,7 +33,7 @@ Executable dhall-to-nixpkgs
3333
, optparse-applicative >= 0.14.0.0 && < 0.19
3434
, prettyprinter >= 1.7.0 && < 1.8
3535
, text >= 0.11.1.0 && < 2.1
36-
, transformers >= 0.2.0.0 && < 0.6
36+
, transformers >= 0.2.0.0 && < 0.7
3737
, turtle >= 1.6 && < 1.7
3838
, network-uri < 2.8
3939
Default-Language: Haskell2010

dhall/src/Dhall/Import/Headers.hs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{-# LANGUAGE CPP #-}
12
{-# LANGUAGE OverloadedStrings #-}
23
{-# LANGUAGE ScopedTypeVariables #-}
34
{-# LANGUAGE ViewPatterns #-}
@@ -9,7 +10,12 @@ module Dhall.Import.Headers
910
, toOriginHeaders
1011
) where
1112

12-
import Control.Applicative (Alternative (..), liftA2)
13+
import Control.Applicative
14+
( Alternative (..)
15+
#if !MIN_VERSION_base(4,18,0)
16+
, liftA2
17+
#endif
18+
)
1319
import Control.Exception (SomeException)
1420
import Control.Monad.Catch (handle, throwM)
1521
import Data.Text (Text)

dhall/src/Dhall/Marshal/Decode.hs

Lines changed: 32 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{-# LANGUAGE ApplicativeDo #-}
22
{-# LANGUAGE ConstraintKinds #-}
3+
{-# LANGUAGE CPP #-}
34
{-# LANGUAGE DefaultSignatures #-}
45
{-# LANGUAGE DeriveFunctor #-}
56
{-# LANGUAGE DerivingStrategies #-}
@@ -135,7 +136,12 @@ module Dhall.Marshal.Decode
135136
) where
136137

137138

138-
import Control.Applicative (empty, liftA2)
139+
import Control.Applicative
140+
( empty
141+
#if !MIN_VERSION_base(4,18,0)
142+
, liftA2
143+
#endif
144+
)
139145
import Control.Exception (Exception)
140146
import Control.Monad (guard)
141147
import Control.Monad.Trans.State.Strict
@@ -1604,14 +1610,15 @@ data ExtractError s a =
16041610
instance (Pretty s, Pretty a, Typeable s, Typeable a) => Show (ExtractError s a) where
16051611
show (TypeMismatch e) = show e
16061612
show (ExpectedTypeError e) = show e
1607-
show (ExtractError es) =
1608-
_ERROR <> ": Failed extraction \n\
1609-
\ \n\
1610-
\The expression type-checked successfully but the transformation to the target \n\
1611-
\type failed with the following error: \n\
1612-
\ \n\
1613-
\" <> Data.Text.unpack es <> "\n\
1614-
\ \n"
1613+
show (ExtractError es) = unlines
1614+
[ _ERROR <> ": Failed extraction "
1615+
, " "
1616+
, "The expression type-checked successfully but the transformation to the target "
1617+
, "type failed with the following error: "
1618+
, " "
1619+
, Data.Text.unpack es
1620+
, " "
1621+
]
16151622

16161623
instance (Pretty s, Pretty a, Typeable s, Typeable a) => Exception (ExtractError s a)
16171624

@@ -1669,24 +1676,22 @@ data InvalidDecoder s a = InvalidDecoder
16691676
instance (Pretty s, Typeable s, Pretty a, Typeable a) => Exception (InvalidDecoder s a)
16701677

16711678
instance (Pretty s, Pretty a, Typeable s, Typeable a) => Show (InvalidDecoder s a) where
1672-
show InvalidDecoder { .. } =
1673-
_ERROR <> ": Invalid Dhall.Decoder \n\
1674-
\ \n\
1675-
\Every Decoder must provide an extract function that does not fail with a type \n\
1676-
\error if an expression matches the expected type. You provided a Decoder that \n\
1677-
\disobeys this contract \n\
1678-
\ \n\
1679-
\The Decoder provided has the expected dhall type: \n\
1680-
\ \n\
1681-
\" <> show txt0 <> "\n\
1682-
\ \n\
1683-
\and it threw a type error during extraction from the well-typed expression: \n\
1684-
\ \n\
1685-
\" <> show txt1 <> "\n\
1686-
\ \n"
1687-
where
1688-
txt0 = Dhall.Util.insert invalidDecoderExpected
1689-
txt1 = Dhall.Util.insert invalidDecoderExpression
1679+
show InvalidDecoder { .. } = unlines
1680+
[ _ERROR <> ": Invalid Dhall.Decoder "
1681+
, " "
1682+
, "Every Decoder must provide an extract function that does not fail with a type "
1683+
, "error if an expression matches the expected type. You provided a Decoder that "
1684+
, "disobeys this contract "
1685+
, " "
1686+
, "The Decoder provided has the expected dhall type: "
1687+
, " "
1688+
, show (Dhall.Util.insert invalidDecoderExpected)
1689+
, " "
1690+
, "and it threw a type error during extraction from the well-typed expression: "
1691+
, " "
1692+
, show (Dhall.Util.insert invalidDecoderExpression)
1693+
, " "
1694+
]
16901695

16911696
{-| Useful synonym for the `Validation` type used when marshalling Dhall
16921697
expressions.

dhall/src/Dhall/Parser/Combinators.hs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,12 @@ module Dhall.Parser.Combinators
2323
) where
2424

2525

26-
import Control.Applicative (Alternative (..), liftA2)
26+
import Control.Applicative
27+
( Alternative (..)
28+
#if !MIN_VERSION_base(4,18,0)
29+
, liftA2
30+
#endif
31+
)
2732
import Control.Exception (Exception)
2833
import Control.Monad (MonadPlus (..))
2934
import Data.String (IsString (..))

dhall/src/Dhall/Parser/Expression.hs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{-# LANGUAGE CPP #-}
12
{-# LANGUAGE NamedFieldPuns #-}
23
{-# LANGUAGE OverloadedLists #-}
34
{-# LANGUAGE OverloadedStrings #-}
@@ -7,7 +8,13 @@
78
-- | Parsing Dhall expressions.
89
module Dhall.Parser.Expression where
910

10-
import Control.Applicative (Alternative (..), liftA2, optional)
11+
import Control.Applicative
12+
( Alternative (..)
13+
#if !MIN_VERSION_base(4,18,0)
14+
, liftA2
15+
#endif
16+
, optional
17+
)
1118
import Data.Foldable (foldl')
1219
import Data.List.NonEmpty (NonEmpty (..))
1320
import Data.Text (Text)

stack.ghc-9.6.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
resolver: lts-22.23
2+
packages:
3+
- dhall
4+
- dhall-bash
5+
- dhall-csv
6+
- dhall-docs
7+
- dhall-json
8+
- dhall-lsp-server
9+
- dhall-nix
10+
- dhall-openapi
11+
- dhall-toml
12+
- dhall-yaml
13+
extra-deps:
14+
- lsp-test-0.15.0.1
15+
- algebraic-graphs-0.6.1@sha256:b0b0a916a74f9cba3e678cde25e27f045d7b026a8d0f1a55a05e86f2877fdfd2,8807
16+
- free-5.1.10@sha256:58496bb68e5704be250ddc823622d50b5a3b8bdf0dc4f6539ecfde25bc4ef6e2,5169
17+
- hnix-0.17.0@sha256:57e172f915d70be2dd88c6377caebe8bd63337123ffef42df49b05dc0b1f168b,19224
18+
- hnix-store-core-0.6.1.0@sha256:0171c3a571ab263c3e3aa3e6daca15602f2030a6862cb032038017e6d0265898,3882
19+
- hnix-store-remote-0.6.0.0@sha256:a8ea18bb355164bfd357fac12b0c5d32c95ffd455260f8b6c7fcaeddebf5918c,3270
20+
- lens-family-th-0.5.3.1@sha256:725700a89f26f790ee7d6630a4fa394ac0305ae8d2cff06c037ee47cb3499654,1700
21+
- lsp-2.1.0.0@sha256:ef6fc28eac6dc27672cd8471c9f83f14de646a9c1fcaf993a451d2ae4de274e8,3533
22+
- lsp-types-2.0.2.0@sha256:a9a51c3cea0726d91fe63fa0670935ee720f7b31bc3f3b33b2483fc538152677,29421
23+
- tomland-1.3.3.2@sha256:8dd15cd2e8178a9bc3c3db4ef53e706e36ee093417a98b1d26131524629c3c07,9483
24+
- validation-selective-0.2.0.0@sha256:cc847f1a110e3b1bd437a5356f115881b61cafcb11781b570b180efd88bf0907,3917
25+
nix:
26+
packages:
27+
- ncurses
28+
- zlib
29+
flags:
30+
# https://github.com/RyanGlScott/mintty/issues/4
31+
mintty:
32+
Win32-2-13-1: false

stack.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
stack.ghc-9.4.yaml
1+
stack.ghc-9.6.yaml

0 commit comments

Comments
 (0)