Skip to content

Commit

Permalink
Upgrade GHC version with which Summoner creates projects
Browse files Browse the repository at this point in the history
  • Loading branch information
vrom911 committed Oct 20, 2024
1 parent 9dc5f2c commit b56c795
Show file tree
Hide file tree
Showing 25 changed files with 116 additions and 25 deletions.
5 changes: 5 additions & 0 deletions summoner-cli/examples/cabal-full/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ jobs:
- "9.2.8"
- "9.4.8"
- "9.6.6"
- "9.8.2"
exclude:
- os: macOS-latest
ghc: 9.6.6
- os: macOS-latest
ghc: 9.4.8
- os: macOS-latest
Expand All @@ -41,6 +44,8 @@ jobs:
ghc: 8.6.5
- os: macOS-latest
ghc: 8.4.4
- os: windows-latest
ghc: 9.6.6
- os: windows-latest
ghc: 9.4.8
- os: windows-latest
Expand Down
1 change: 1 addition & 0 deletions summoner-cli/examples/cabal-full/.travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
- ghc: 9.2.8
- ghc: 9.4.8
- ghc: 9.6.6
- ghc: 9.8.2

install:
# HLint check
Expand Down
4 changes: 2 additions & 2 deletions summoner-cli/examples/cabal-full/appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ environment:
CABOPTS: --store-dir=C:\\SR

matrix:
- GHCVER: 9.6.6
- GHCVER: 9.8.2

install:
- choco source add -n mistuke -s https://www.myget.org/F/mistuke/api/v2
- choco install -y cabal --version 3.6.2.0
- choco install -y ghc --version 9.6.6
- choco install -y ghc --version 9.8.2
- refreshenv

before_build:
Expand Down
15 changes: 14 additions & 1 deletion summoner-cli/examples/cabal-full/cabal-full.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,14 @@ tested-with: GHC == 8.4.4
GHC == 9.2.8
GHC == 9.4.8
GHC == 9.6.6
GHC == 9.8.2

source-repository head
type: git
location: https://github.com/kowainik/cabal-full.git

common common-options
build-depends: base >= 4.11.1.0 && < 4.19
build-depends: base >= 4.11.1.0 && < 4.20
, relude

mixins: base hiding (Prelude)
Expand All @@ -54,6 +55,18 @@ common common-options
-hiedir=.hie
if impl(ghc >= 8.10)
ghc-options: -Wunused-packages
if impl(ghc >= 9.0)
ghc-options: -Winvalid-haddock
if impl(ghc >= 9.2)
ghc-options: -Wredundant-bang-patterns
-Woperator-whitespace
if impl(ghc >= 9.4 && < 9.10)
ghc-options: -Wforall-identifier
if impl(ghc >= 9.4)
ghc-options: -Wredundant-strictness-flags
if impl(ghc >= 9.8)
ghc-options: -Wterm-variable-capture
-Winconsistent-flags

default-language: Haskell2010
default-extensions: DeriveGeneric
Expand Down
16 changes: 14 additions & 2 deletions summoner-cli/examples/cabal-minimal/cabal-minimal.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ copyright: 2022 Kowainik
build-type: Simple
extra-doc-files: README.md
CHANGELOG.md
tested-with: GHC == 9.6.6
tested-with: GHC == 9.8.2

common common-options
build-depends: base ^>= 4.18.2.1
build-depends: base ^>= 4.19.1.0

ghc-options: -Wall
-Wcompat
Expand All @@ -35,6 +35,18 @@ common common-options
-hiedir=.hie
if impl(ghc >= 8.10)
ghc-options: -Wunused-packages
if impl(ghc >= 9.0)
ghc-options: -Winvalid-haddock
if impl(ghc >= 9.2)
ghc-options: -Wredundant-bang-patterns
-Woperator-whitespace
if impl(ghc >= 9.4 && < 9.10)
ghc-options: -Wforall-identifier
if impl(ghc >= 9.4)
ghc-options: -Wredundant-strictness-flags
if impl(ghc >= 9.8)
ghc-options: -Wterm-variable-capture
-Winconsistent-flags

default-language: Haskell2010

Expand Down
2 changes: 1 addition & 1 deletion summoner-cli/examples/cabalScript.hs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env cabal
{- cabal:
build-depends:
, base ^>= 4.18.2.1
, base ^>= 4.19.1.0
-}

main :: IO ()
Expand Down
6 changes: 6 additions & 0 deletions summoner-cli/examples/full-batteries/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ jobs:
- "9.2.8"
- "9.4.8"
- "9.6.6"
- "9.8.2"
exclude:
- os: macOS-latest
ghc: 9.6.6
- os: macOS-latest
ghc: 9.4.8
- os: macOS-latest
Expand All @@ -47,6 +50,8 @@ jobs:
ghc: 8.2.2
- os: macOS-latest
ghc: 8.0.2
- os: windows-latest
ghc: 9.6.6
- os: windows-latest
ghc: 9.4.8
- os: windows-latest
Expand Down Expand Up @@ -124,6 +129,7 @@ jobs:
- "9.2.8"
- "9.4.8"
- "9.6.6"
- "9.8.2"

steps:
- uses: actions/checkout@v2
Expand Down
4 changes: 4 additions & 0 deletions summoner-cli/examples/full-batteries/.travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ jobs:
- ghc: 9.2.8
- ghc: 9.4.8
- ghc: 9.6.6
- ghc: 9.8.2

- ghc: 8.0.2
env: STACK_YAML="$TRAVIS_BUILD_DIR/stack-8.0.2.yaml"
Expand Down Expand Up @@ -52,6 +53,9 @@ jobs:
env: STACK_YAML="$TRAVIS_BUILD_DIR/stack-9.4.8.yaml"

- ghc: 9.6.6
env: STACK_YAML="$TRAVIS_BUILD_DIR/stack-9.6.6.yaml"

- ghc: 9.8.2
env: STACK_YAML="$TRAVIS_BUILD_DIR/stack.yaml"

allow_failures:
Expand Down
4 changes: 2 additions & 2 deletions summoner-cli/examples/full-batteries/appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ environment:
CABOPTS: --store-dir=C:\\SR

matrix:
- GHCVER: 9.6.6
- GHCVER: 9.8.2

install:
- choco source add -n mistuke -s https://www.myget.org/F/mistuke/api/v2
- choco install -y cabal --version 3.6.2.0
- choco install -y ghc --version 9.6.6
- choco install -y ghc --version 9.8.2
- refreshenv

before_build:
Expand Down
3 changes: 2 additions & 1 deletion summoner-cli/examples/full-batteries/full-batteries.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,14 @@ tested-with: GHC == 8.0.2
GHC == 9.2.8
GHC == 9.4.8
GHC == 9.6.6
GHC == 9.8.2

source-repository head
type: git
location: https://github.com/kowainik/full-batteries.git

common common-options
build-depends: base >= 4.9.1.0 && < 4.19
build-depends: base >= 4.9.1.0 && < 4.20
, relude

mixins: base hiding (Prelude)
Expand Down
1 change: 1 addition & 0 deletions summoner-cli/examples/full-batteries/stack-9.6.6.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
resolver: lts-22.38
2 changes: 1 addition & 1 deletion summoner-cli/examples/full-batteries/stack.yaml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
resolver: lts-22.34
resolver: nightly-2024-10-11
1 change: 1 addition & 0 deletions summoner-cli/examples/stack-full/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
- "9.2.8"
- "9.4.8"
- "9.6.6"
- "9.8.2"

steps:
- uses: actions/checkout@v2
Expand Down
3 changes: 3 additions & 0 deletions summoner-cli/examples/stack-full/.travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ jobs:
env: STACK_YAML="$TRAVIS_BUILD_DIR/stack-9.4.8.yaml"

- ghc: 9.6.6
env: STACK_YAML="$TRAVIS_BUILD_DIR/stack-9.6.6.yaml"

- ghc: 9.8.2
env: STACK_YAML="$TRAVIS_BUILD_DIR/stack.yaml"

allow_failures:
Expand Down
1 change: 1 addition & 0 deletions summoner-cli/examples/stack-full/stack-9.6.6.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
resolver: lts-22.38
15 changes: 14 additions & 1 deletion summoner-cli/examples/stack-full/stack-full.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,14 @@ tested-with: GHC == 8.4.4
GHC == 9.2.8
GHC == 9.4.8
GHC == 9.6.6
GHC == 9.8.2

source-repository head
type: git
location: https://github.com/kowainik/stack-full.git

common common-options
build-depends: base >= 4.11.1.0 && < 4.19
build-depends: base >= 4.11.1.0 && < 4.20
, relude

mixins: base hiding (Prelude)
Expand All @@ -54,6 +55,18 @@ common common-options
-hiedir=.hie
if impl(ghc >= 8.10)
ghc-options: -Wunused-packages
if impl(ghc >= 9.0)
ghc-options: -Winvalid-haddock
if impl(ghc >= 9.2)
ghc-options: -Wredundant-bang-patterns
-Woperator-whitespace
if impl(ghc >= 9.4 && < 9.10)
ghc-options: -Wforall-identifier
if impl(ghc >= 9.4)
ghc-options: -Wredundant-strictness-flags
if impl(ghc >= 9.8)
ghc-options: -Wterm-variable-capture
-Winconsistent-flags

default-language: Haskell2010
default-extensions: DeriveGeneric
Expand Down
2 changes: 1 addition & 1 deletion summoner-cli/examples/stack-full/stack.yaml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
resolver: lts-22.34
resolver: nightly-2024-10-11
2 changes: 1 addition & 1 deletion summoner-cli/examples/stackScript.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env stack
{- stack
--resolver lts-22.34
--resolver nightly-2024-10-11
script
--package base
-}
Expand Down
4 changes: 2 additions & 2 deletions summoner-cli/examples/summoner-default.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ license = "MIT"
# travis = true # Travis CI
# appveyor = true # AppVeyor CI

# List of additional GHC versions to support besides 9.6.6.
# List of additional GHC versions to support besides 9.8.2.
# Run the 'summon show ghc' command to see the list of all supported GHC versions.
# ghcVersions = ["9.2.8", "9.4.8"]
# ghcVersions = ["9.4.8", "9.6.6"]

# List of default-extensions in the .cabal file
# extensions = [ "ConstraintKinds"
Expand Down
16 changes: 10 additions & 6 deletions summoner-cli/src/Summoner/GhcVer.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{- |
Module : Summoner.GhcVer
Copyright : (c) 2017-2022 Kowainik
Copyright : (c) 2017-2024 Kowainik
SPDX-License-Identifier : MPL-2.0
Maintainer : Kowainik <[email protected]>
Stability : Stable
Expand Down Expand Up @@ -38,8 +38,9 @@ data GhcVer
| Ghc8107
| Ghc902
| Ghc928
| Ghc945
| Ghc948
| Ghc966
| Ghc982
deriving stock (Eq, Ord, Show, Enum, Bounded)

-- | Converts 'GhcVer' into dot-separated string.
Expand All @@ -53,8 +54,9 @@ showGhcVer = \case
Ghc8107 -> "8.10.7"
Ghc902 -> "9.0.2"
Ghc928 -> "9.2.8"
Ghc945 -> "9.4.8"
Ghc948 -> "9.4.8"
Ghc966 -> "9.6.6"
Ghc982 -> "9.8.2"

{- | These are old GHC versions that are not working with default GHC versions
when using Stack.
Expand All @@ -76,8 +78,9 @@ latestLts = \case
Ghc8107 -> "lts-18.28"
Ghc902 -> "lts-19.33"
Ghc928 -> "lts-20.26"
Ghc945 -> "lts-21.25"
Ghc966 -> "lts-22.34"
Ghc948 -> "lts-21.25"
Ghc966 -> "lts-22.38"
Ghc982 -> "nightly-2024-10-11"

-- | Represents PVP versioning (4 numbers).
data Pvp = Pvp
Expand All @@ -102,8 +105,9 @@ baseVerPvp = \case
Ghc8107 -> Pvp 4 14 3 0
Ghc902 -> Pvp 4 15 1 0
Ghc928 -> Pvp 4 16 4 0
Ghc945 -> Pvp 4 17 0 0
Ghc948 -> Pvp 4 17 2 1
Ghc966 -> Pvp 4 18 2 1
Ghc982 -> Pvp 4 19 1 0

-- | Returns corresponding @base@ version of the given GHC version.
baseVer :: GhcVer -> Text
Expand Down
12 changes: 12 additions & 0 deletions summoner-cli/src/Summoner/Template/Cabal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,18 @@ cabalFile Settings{..} = File (toString settingsRepo ++ ".cabal") cabalFileConte
, " -hiedir=.hie"
, " if impl(ghc >= 8.10)"
, " ghc-options: -Wunused-packages"
, " if impl(ghc >= 9.0)"
, " ghc-options: -Winvalid-haddock"
, " if impl(ghc >= 9.2)"
, " ghc-options: -Wredundant-bang-patterns"
, " -Woperator-whitespace"
, " if impl(ghc >= 9.4 && < 9.10)"
, " ghc-options: -Wforall-identifier"
, " if impl(ghc >= 9.4)"
, " ghc-options: -Wredundant-strictness-flags"
, " if impl(ghc >= 9.8)"
, " ghc-options: -Wterm-variable-capture"
, " -Winconsistent-flags"
]

libraryStanza :: Text
Expand Down
5 changes: 3 additions & 2 deletions summoner-cli/test/Test/Show.hs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ goldenGhcTable =
, "GHC-8.10.7 base-4.14.3.0 lts-18.28"
, "GHC-9.0.2 base-4.15.1.0 lts-19.33"
, "GHC-9.2.8 base-4.16.4.0 lts-20.26"
, "GHC-9.4.8 base-4.17.0.0 lts-21.25"
, "GHC-9.6.6 base-4.18.2.1 lts-22.34"
, "GHC-9.4.8 base-4.17.2.1 lts-21.25"
, "GHC-9.6.6 base-4.18.2.1 lts-22.38"
, "GHC-9.8.2 base-4.19.1.0 nightly-2024-10-11"
]
4 changes: 3 additions & 1 deletion summoner-tui/src/Summoner/Tui.hs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ import Summoner.Tui.Widget (borderLabel, listInBorder)

import qualified Brick (on)
import qualified Graphics.Vty as V
import qualified Graphics.Vty.Config as VConfig
import qualified Graphics.Vty.CrossPlatform as VC
import qualified Paths_summoner_tui as Meta (version)


Expand Down Expand Up @@ -352,7 +354,7 @@ runApp app s = do
where
buildVty :: IO V.Vty
buildVty = do
v <- V.mkVty =<< V.standardIOConfig
v <- VC.mkVty VConfig.defaultConfig
V.setMode (V.outputIface v) V.Mouse True
pure v

Expand Down
Loading

0 comments on commit b56c795

Please sign in to comment.