Skip to content

Commit

Permalink
[#539] Support GHC 9.0 in generated projects (#556)
Browse files Browse the repository at this point in the history
* [#539] Support GHC 9.0 in generated projects

Resolves #539

* Update CHANGELOG

* Fix ci setup for 9.0.2

* Apply suggestions from code review

Co-authored-by: Dmitrii Kovanikov <[email protected]>

* Update lts version for 8.10

* Fix

* Fix stack build

Co-authored-by: Dmitrii Kovanikov <[email protected]>
  • Loading branch information
vrom911 and chshersh authored Jan 11, 2022
1 parent 31b10b9 commit 0c03dd0
Show file tree
Hide file tree
Showing 62 changed files with 111 additions and 85 deletions.
15 changes: 6 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- "8.6.5"
- "8.8.4"
- "8.10.7"
- "9.0.1"
- "9.0.2"
exclude:
- os: macOS-latest
ghc: 8.10.7
Expand Down Expand Up @@ -78,29 +78,26 @@ jobs:
run: |
cabal test all
- if: matrix.ghc == '8.10.7'
- if: matrix.ghc == '9.0.2'
name: Build 'cabal-minimal'
run: |
cd "summoner-cli/examples/cabal-minimal/"
echo "packages: ." > cabal.project
cabal build all
- if: matrix.ghc != '9.0.1'
name: Build 'cabal-full'
- name: Build 'cabal-full'
run: |
cd "summoner-cli/examples/cabal-full/"
echo "packages: ." > cabal.project
cabal build all
- if: matrix.ghc != '9.0.1'
name: Build 'stack-full'
- name: Build 'stack-full'
run: |
cd "summoner-cli/examples/stack-full/"
echo "packages: ." > cabal.project
cabal build all
- if: matrix.ghc != '9.0.1'
name: Build 'full-batteries'
- name: Build 'full-batteries'
run: |
cd "summoner-cli/examples/full-batteries/"
echo "packages: ." > cabal.project
Expand All @@ -112,7 +109,7 @@ jobs:
strategy:
matrix:
stack: ["2.7.3"]
ghc: ["8.10.7"]
ghc: ["9.0.2"]

steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ The changelog is available [on GitHub][2].

## Unreleased

* [#539](https://github.com/kowainik/summoner/issues/539):
Use GHC-9.0 as default version for generated projects.
* [#540](https://github.com/kowainik/summoner/issues/540):
Build Summoner with GHC-9.0.
* [#520](https://github.com/kowainik/summoner/issues/520):
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ Here is the list of the options that can be configured to suit your needs. If op
| `fullName` | Text | Full name. |
| `email` | Text | E-mail address. |
| `license` | License | One of: `MIT`, `BSD2`, `BSD3`, `GPL-2`, `GPL-3`, `LGPL-2.1`, `LGPL-3`, `AGPL-3`, `Apache-2.0`, `MPL-2.0`, `None`. |
| `ghcVersions` | [GHC] | `summoner` uses default `GHC-8.10.7`. However, additionally you can specify other versions. For each version `x.y.z` the `stack-x.y.z.yaml` will be created. Use `summon show ghc` to see all supported GHC versions. |
| `ghcVersions` | [GHC] | `summoner` uses default `GHC-9.0.2`. However, additionally you can specify other versions. For each version `x.y.z` the `stack-x.y.z.yaml` will be created. Use `summon show ghc` to see all supported GHC versions. |
| `github` | Bool | Turn on `GitHub` integration by default? |
| `gitignore` | [Text] | List of files you want added to the default `.gitignore`. (Ignored if `github = false`) |
| `noUpload` | Bool | Do not upload to GitHub, but create all GitHub related files if specified (Ignored if `github = false`) |
Expand Down
7 changes: 2 additions & 5 deletions stack.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
resolver: lts-18.10
resolver: nightly-2022-01-10

packages:
- summoner-cli/
- summoner-tui/

extra-deps:
- colourista-0.1.0.1
- generic-data-0.8.0.0
- hashable-1.3.1.0
- megaparsec-9.0.1
- microaeson-0.1.0.0
- optparse-applicative-0.16.0.0
- relude-1.0.0.1
- tomland-1.3.3.0
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 @@ -22,13 +22,18 @@ jobs:
- "8.6.5"
- "8.8.4"
- "8.10.7"
- "9.0.2"
exclude:
- os: macOS-latest
ghc: 8.10.7
- os: macOS-latest
ghc: 8.8.4
- os: macOS-latest
ghc: 8.6.5
- os: macOS-latest
ghc: 8.4.4
- os: windows-latest
ghc: 8.10.7
- os: windows-latest
ghc: 8.8.4
- 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 @@ -15,6 +15,7 @@ jobs:
- ghc: 8.6.5
- ghc: 8.8.4
- ghc: 8.10.7
- ghc: 9.0.2

install:
# HLint check
Expand Down
2 changes: 1 addition & 1 deletion summoner-cli/examples/cabal-full/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
BSD 3-Clause License

Copyright (c) 2021, Kowainik
Copyright (c) 2022, Kowainik
All rights reserved.

Redistribution and use in source and binary forms, with or without
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: 8.10.7
- GHCVER: 9.0.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 8.10.7
- choco install -y ghc --version 9.0.2
- refreshenv

before_build:
Expand Down
5 changes: 3 additions & 2 deletions summoner-cli/examples/cabal-full/cabal-full.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ license: BSD-3-Clause
license-file: LICENSE
author: Kowainik
maintainer: Kowainik <[email protected]>
copyright: 2021 Kowainik
copyright: 2022 Kowainik
category: Testing
build-type: Simple
extra-doc-files: README.md
Expand All @@ -20,13 +20,14 @@ tested-with: GHC == 8.4.4
GHC == 8.6.5
GHC == 8.8.4
GHC == 8.10.7
GHC == 9.0.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.15
build-depends: base >= 4.11.1.0 && < 4.16
, relude

mixins: base hiding (Prelude)
Expand Down
2 changes: 1 addition & 1 deletion summoner-cli/examples/cabal-full/src/CabalFull.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{- |
Copyright: (c) 2021 Kowainik
Copyright: (c) 2022 Kowainik
SPDX-License-Identifier: BSD-3-Clause
Maintainer: Kowainik <[email protected]>
Expand Down
6 changes: 3 additions & 3 deletions summoner-cli/examples/cabal-minimal/cabal-minimal.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ description:
license: NONE
author: Kowainik
maintainer: Kowainik <[email protected]>
copyright: 2021 Kowainik
copyright: 2022 Kowainik
build-type: Simple
extra-doc-files: README.md
CHANGELOG.md
tested-with: GHC == 8.10.7
tested-with: GHC == 9.0.2

common common-options
build-depends: base ^>= 4.14.3.0
build-depends: base ^>= 4.15.1.0

ghc-options: -Wall
-Wcompat
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.14.3.0
, base ^>= 4.15.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 @@ -24,7 +24,10 @@ jobs:
- "8.6.5"
- "8.8.4"
- "8.10.7"
- "9.0.2"
exclude:
- os: macOS-latest
ghc: 8.10.7
- os: macOS-latest
ghc: 8.8.4
- os: macOS-latest
Expand All @@ -35,6 +38,8 @@ jobs:
ghc: 8.2.2
- os: macOS-latest
ghc: 8.0.2
- os: windows-latest
ghc: 8.10.7
- os: windows-latest
ghc: 8.8.4
- os: windows-latest
Expand Down Expand Up @@ -100,6 +105,7 @@ jobs:
- "8.6.5"
- "8.8.4"
- "8.10.7"
- "9.0.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 @@ -19,6 +19,7 @@ jobs:
- ghc: 8.6.5
- ghc: 8.8.4
- ghc: 8.10.7
- ghc: 9.0.2

- ghc: 8.0.2
env: STACK_YAML="$TRAVIS_BUILD_DIR/stack-8.0.2.yaml"
Expand All @@ -36,6 +37,9 @@ jobs:
env: STACK_YAML="$TRAVIS_BUILD_DIR/stack-8.8.4.yaml"

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

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

allow_failures:
Expand Down
2 changes: 1 addition & 1 deletion summoner-cli/examples/full-batteries/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2021 Kowainik
Copyright (c) 2022 Kowainik

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
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: 8.10.7
- GHCVER: 9.0.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 8.10.7
- choco install -y ghc --version 9.0.2
- refreshenv

before_build:
Expand Down
5 changes: 3 additions & 2 deletions summoner-cli/examples/full-batteries/full-batteries.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ license: MIT
license-file: LICENSE
author: Kowainik
maintainer: Kowainik <[email protected]>
copyright: 2021 Kowainik
copyright: 2022 Kowainik
category: Testing
build-type: Simple
extra-doc-files: README.md
Expand All @@ -22,13 +22,14 @@ tested-with: GHC == 8.0.2
GHC == 8.6.5
GHC == 8.8.4
GHC == 8.10.7
GHC == 9.0.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.15
build-depends: base >= 4.9.1.0 && < 4.16
, relude

mixins: base hiding (Prelude)
Expand Down
2 changes: 1 addition & 1 deletion summoner-cli/examples/full-batteries/src/FullBatteries.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{- |
Copyright: (c) 2021 Kowainik
Copyright: (c) 2022 Kowainik
SPDX-License-Identifier: MIT
Maintainer: Kowainik <[email protected]>
Expand Down
1 change: 1 addition & 0 deletions summoner-cli/examples/full-batteries/stack-8.10.7.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
resolver: lts-18.21
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-18.10
resolver: nightly-2022-01-10
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 @@ -21,6 +21,7 @@ jobs:
- "8.6.5"
- "8.8.4"
- "8.10.7"
- "9.0.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 @@ -23,6 +23,9 @@ jobs:
env: STACK_YAML="$TRAVIS_BUILD_DIR/stack-8.8.4.yaml"

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

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

allow_failures:
Expand Down
2 changes: 1 addition & 1 deletion summoner-cli/examples/stack-full/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
BSD 3-Clause License

Copyright (c) 2021, Kowainik
Copyright (c) 2022, Kowainik
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion summoner-cli/examples/stack-full/src/StackFull.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{- |
Copyright: (c) 2021 Kowainik
Copyright: (c) 2022 Kowainik
SPDX-License-Identifier: BSD-3-Clause
Maintainer: Kowainik <[email protected]>
Expand Down
1 change: 1 addition & 0 deletions summoner-cli/examples/stack-full/stack-8.10.7.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
resolver: lts-18.21
5 changes: 3 additions & 2 deletions summoner-cli/examples/stack-full/stack-full.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ license: BSD-3-Clause
license-file: LICENSE
author: Kowainik
maintainer: Kowainik <[email protected]>
copyright: 2021 Kowainik
copyright: 2022 Kowainik
category: Testing
build-type: Simple
extra-doc-files: README.md
Expand All @@ -20,13 +20,14 @@ tested-with: GHC == 8.4.4
GHC == 8.6.5
GHC == 8.8.4
GHC == 8.10.7
GHC == 9.0.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.15
build-depends: base >= 4.11.1.0 && < 4.16
, relude

mixins: base hiding (Prelude)
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-18.10
resolver: nightly-2022-01-10
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-18.10
--resolver nightly-2022-01-10
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 8.10.7.
# List of additional GHC versions to support besides 9.0.2.
# Run the 'summon show ghc' command to see the list of all supported GHC versions.
# ghcVersions = ["8.6.5", "8.8.4"]
# ghcVersions = ["8.8.4", "8.10.7"]

# List of default-extensions in the .cabal file
# extensions = [ "ConstraintKinds"
Expand Down
2 changes: 1 addition & 1 deletion summoner-cli/src/Summoner.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{- |
Module : Summoner
Copyright : (c) 2017-2021 Kowainik
Copyright : (c) 2017-2022 Kowainik
SPDX-License-Identifier : MPL-2.0
Maintainer : Kowainik <[email protected]>
Stability : Stable
Expand Down
Loading

0 comments on commit 0c03dd0

Please sign in to comment.