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

Add support for ghc 9.0.2 #2567

Merged
merged 50 commits into from Jan 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
ddfede4
Extract out ci build setup
jneira Jan 4, 2022
b956c3b
Add required shell property
jneira Jan 4, 2022
4caf4e1
Add support for ghc-9.0.2
jneira Jan 5, 2022
bf280fa
Test ghc 9.0.2
jneira Jan 5, 2022
77ffca7
Add unix boot package
jneira Jan 10, 2022
87a8c9d
Use primitive-unlifted < 1.0
jneira Jan 10, 2022
81e8aab
Use primitive-unlifted < 1.0 for stack
jneira Jan 10, 2022
857edb9
Ude 9.0.1 for hackage
jneira Jan 11, 2022
23e6c82
Merge branch 'master' into ghc-9.0.2
jneira Jan 11, 2022
9421c63
Use a unified cabal-ghc90.project
jneira Jan 11, 2022
1d3acf3
Use last snapshot with ghc-9.0.2 support
jneira Jan 11, 2022
3acfcf4
Use new cabal-ghc90.project in build
jneira Jan 11, 2022
ad03a95
Add stm-containers
jneira Jan 11, 2022
eaaafdb
Add specific tweaks for ghc-9.0.2
jneira Jan 11, 2022
ec80d94
Use the las ghc-boot-9.0
jneira Jan 11, 2022
0664619
Merge branch 'master' into ghc-9.0.2
jneira Jan 12, 2022
9161fb8
Fix test adding allow-newer
jneira Jan 12, 2022
d7c63f8
Use unix-compat from hackage
jneira Jan 12, 2022
d58ea42
Merge branch 'master' into ghc-9.0.2
jneira Jan 13, 2022
e377956
Use unix-compat from hackage
jneira Jan 13, 2022
52a6a4d
Make consistent lastest stack.yamls
jneira Jan 13, 2022
c3b8a54
Clean up cabal.project
jneira Jan 13, 2022
75e234a
more cleanups
jneira Jan 13, 2022
d549a26
Update tweaks in hackage ci
jneira Jan 13, 2022
e3c41d9
Correct comment
jneira Jan 13, 2022
c5e1f4b
Merge branch 'master' into ghc-9.0.2
jneira Jan 13, 2022
51db994
Correct fourmolu condition
jneira Jan 13, 2022
eeb343d
Correct fourmolu condition in tests
jneira Jan 13, 2022
6a77064
Removing the all target from caching
jneira Jan 13, 2022
fba33f5
exclude Brittany 0.14.0.1
jneira Jan 13, 2022
0c89870
Merge remote-tracking branch 'upstream/master' into ghc-9.0.2
jneira Jan 14, 2022
5dcec89
Update snapshot to get new lsp
jneira Jan 14, 2022
b44f58b
document flag
jneira Jan 14, 2022
bfedf97
Document and build ghcide benchmark
jneira Jan 14, 2022
4e535c7
Doc and use ghc-9.0.2 in hackage
jneira Jan 14, 2022
2c7ac63
Add ghc-9.2.1 to tested-with
jneira Jan 14, 2022
d2f0216
Use 9.0.2 in gitlab
jneira Jan 14, 2022
d210d99
Use last *molus
jneira Jan 15, 2022
dd335b6
Use same versions as cabal build
jneira Jan 16, 2022
6326efe
Merge branch 'master' into ghc-9.0.2
jneira Jan 16, 2022
e27f56d
Use cabal freeze versions
jneira Jan 16, 2022
a5f5907
Merge branch 'ghc-9.0.2' of https://github.com/jneira/haskell-languag…
jneira Jan 16, 2022
e694ebb
Add dep for ghcide tests
jneira Jan 16, 2022
47e213c
one by one
jneira Jan 16, 2022
c1fc2ee
Merge branch 'master' into ghc-9.0.2
jneira Jan 16, 2022
f965d3c
Unnecessary change
jneira Jan 16, 2022
3e75867
Remove unnecessary flag
jneira Jan 16, 2022
3a8e61e
Corrections
jneira Jan 16, 2022
3980b6d
Move blocks
jneira Jan 16, 2022
6b8c707
Merge branch 'master' into ghc-9.0.2
mergify[bot] Jan 16, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions .circleci/config.yml
Expand Up @@ -100,6 +100,11 @@ jobs:
- STACK_FILE: "stack-9.0.1.yaml"
<<: *defaults

ghc-9.0.2:
environment:
- STACK_FILE: "stack-9.0.2.yaml"
<<: *defaults

ghc-default:
environment:
- STACK_FILE: "stack.yaml"
Expand All @@ -115,4 +120,5 @@ workflows:
- ghc-8.10.6
- ghc-8.10.7
- ghc-9.0.1
- ghc-9.0.2
- ghc-default
11 changes: 8 additions & 3 deletions .github/actions/setup-build/action.yml
Expand Up @@ -26,6 +26,7 @@ runs:
run: |
echo "CABAL_PKGS_DIR=C:\\cabal\\packages" >> $GITHUB_ENV
shell: bash

- if: ( inputs.os == 'Linux' ) || ( inputs.os == 'macOS' )
name: (Linux,macOS) Platform config
run: |
Expand All @@ -43,9 +44,13 @@ runs:
# (most probably sticky bit is set on $HOME)
# `&&` insures `rm -f` return is positive.
# Many platforms aslo have `alias cp='cp -i'`.
ALT_PROJECT_FILE=cabal-ghc${GHCVER//./}.project
if [[ -f "$ALT_PROJECT_FILE" ]]; then
rm -f -v cabal.project && cp -v "$ALT_PROJECT_FILE" cabal.project
GHCVER2=${GHCVER//./}
ALT_PROJECT_FILE_MINOR=cabal-ghc${GHCVER2}.project
ALT_PROJECT_FILE_MAJOR=cabal-ghc${GHCVER2:0:2}.project
if [[ -f "$ALT_PROJECT_FILE_MINOR" ]]; then
rm -f -v cabal.project && cp -v "$ALT_PROJECT_FILE_MINOR" cabal.project
elif [[ -f "$ALT_PROJECT_FILE_MAJOR" ]]; then
rm -f -v cabal.project && cp -v "$ALT_PROJECT_FILE_MAJOR" cabal.project
fi
shell: bash

Expand Down
19 changes: 13 additions & 6 deletions .github/workflows/build.yml
Expand Up @@ -20,6 +20,7 @@ jobs:
matrix:
ghc:
[ "9.2.1"
, "9.0.2"
, "9.0.1"
, "8.10.7"
, "8.10.6"
Expand Down Expand Up @@ -54,12 +55,18 @@ jobs:
echo -e 'package blaze-textual\n flags: +integer-simple' >> cabal.project.local
fi

- name: (GHC 9.0) Use modified cabal.project for GHC 9.0
if: ${{ matrix.ghc == '9.0.1' }}
run: cp cabal-ghc901.project cabal.project
- name: Use modified cabal.project for ghc9.2
if: ${{ matrix.ghc == '9.2.1' }}
run: cp cabal-ghc921.project cabal.project
- name: Use modified cabal.project
Anton-Latukha marked this conversation as resolved.
Show resolved Hide resolved
env:
GHCVER: ${{ matrix.ghc }}
run: |
GHCVER2=${GHCVER//./}
ALT_PROJECT_FILE_MINOR=cabal-ghc${GHCVER2}.project
ALT_PROJECT_FILE_MAJOR=cabal-ghc${GHCVER2:0:2}.project
if [[ -f "$ALT_PROJECT_FILE_MINOR" ]]; then
rm -f -v cabal.project && cp -v "$ALT_PROJECT_FILE_MINOR" cabal.project
elif [[ -f "$ALT_PROJECT_FILE_MAJOR" ]]; then
rm -f -v cabal.project && cp -v "$ALT_PROJECT_FILE_MAJOR" cabal.project
fi

- name: Shorten binary names
run: |
Expand Down
35 changes: 20 additions & 15 deletions .github/workflows/caching.yml
Expand Up @@ -44,8 +44,10 @@ on:
# & so it gets shared across all PRs.
- cron: "25 2/8 * * *"

# Not using a explicit target to build the top level haskell-language-server package
# which make build the rest of subpackages *libs* (but shake-bench)
env:
cabalBuild: "v2-build all --keep-going"
cabalBuild: "v2-build --keep-going"

jobs:

Expand Down Expand Up @@ -77,6 +79,7 @@ jobs:
fail-fast: false
matrix:
ghc: [ "9.2.1"
, "9.0.2"
, "9.0.1"
, "8.10.7"
, "8.10.6"
Expand All @@ -96,24 +99,26 @@ jobs:
ghc: ${{ matrix.ghc }}
os: ${{ runner.os }}

# Download sources for feeding build sources cache
# Fetching from github cache is faster than doing it from hackage
# Sources does not change per ghc and ghc version son only doing it
# for one matrix job (it is arbitrary)
- if: steps.compiled-deps.outputs.cache-hit != 'true' && runner.os == 'Linux' && matrix.ghc == '8.10.7'
name: Download sources for bench
# Downloaded separately, to match the tested work/PR workflow guarantees
name: Download sources
run: |
cabal $cabalBuild --only-download --enable-benchmarks
cabal $cabalBuild --only-download --enable-benchmarks --enable-tests

# This build agenda is not to have successful code but produce cache as much as possible
- if: steps.compiled-deps.outputs.cache-hit != 'true'
name: Download the rest of the sources
# Downloaded separately, to match the tested work/PR workflow guarantees
name: Build haskell-language-server
run: |
cabal $cabalBuild --only-download --enable-tests
# repeating builds to workaround segfaults in windows and ghc-8.8.4
cabal $cabalBuild || cabal $cabalBuild || cabal $cabalBuild

# repeating builds to workaround segfaults in windows and ghc-8.8.4
# This build agenda in not to have successful code,
# but to cache what can be cached, so step is fault tolerant & would always succseed.
# 2021-12-11: NOTE: Building all targets, since
# current Cabal does not allow `all --enable-tests --enable-benchmarks --only-dependencies`
- if: steps.compiled-deps.outputs.cache-hit != 'true'
name: Build all targets; try 3 times
# We build ghcide with benchs and test enabled to include its dependencies in the cache
# (including shake-bench)
# Only for the same ghc and os used in the bench workflow, so we save cache space
- if: steps.compiled-deps.outputs.cache-hit != 'true' && runner.os == 'Linux' && matrix.ghc == '8.10.7'
name: Build ghcide benchmark
run: |
cabal $cabalBuild || cabal $cabalBuild || cabal $cabalBuild
cabal $cabalBuild ghcide --enable-benchmarks --enable-tests
40 changes: 16 additions & 24 deletions .github/workflows/hackage.yml
Expand Up @@ -34,18 +34,15 @@ jobs:
"hls-call-hierarchy-plugin", "hls-alternate-number-format-plugin",
"hls-qualify-imported-names-plugin",
"haskell-language-server"]
ghc: [ "9.0.1",
"8.10.7",
"8.8.4",
"8.6.5"]
ghc: [ "9.0.2"
, "8.10.7"
, "8.8.4"
, "8.6.5"
]
exclude:
- ghc: "9.0.1"
package: "hls-brittany-plugin"
- ghc: "9.0.1"
- ghc: "9.0.2"
package: "hls-stylish-haskell-plugin"
- ghc: "9.0.1"
package: "hls-class-plugin"
- ghc: "9.0.1"
- ghc: "9.0.2"
package: "hls-tactics-plugin"

steps:
Expand Down Expand Up @@ -103,22 +100,18 @@ jobs:
cd $(ls -d ./incoming/${{ matrix.package }}-*)
echo "packages: . ../../* ../../plugins/*" > cabal.project

- name: "Add temporary needed allow-newer"
if: steps.get-hackage-version.outputs.exists != 'true'
run: |
# TODO: remove when not needed
cd $(ls -d ./incoming/${{ matrix.package }}-*)
echo "allow-newer: Chart-diagrams:diagrams-core, SVGFonts:diagrams-core," >> cabal.project

# These tweaks are already in cabal-901.project but we dont want to use the entire file,
# Only the tricks needed by the solver which we know will not make the hackage build fail.
# The solver takes in account all project packages, even if they are not gonna be effectively built
# (like brittany or stylish-haskell for ghc-9.0)
- name: "Add temporary needed allow-newer for ghc-9.0"
Anton-Latukha marked this conversation as resolved.
Show resolved Hide resolved
if: steps.get-hackage-version.outputs.exists != 'true' && matrix.ghc == '9.0.1'
if: steps.get-hackage-version.outputs.exists != 'true' && matrix.ghc == '9.0.2'
run: |
# TODO: remove when not needed
cd $(ls -d ./incoming/${{ matrix.package }}-*)
# For brittany
echo " brittany:base, brittany:ghc, brittany:ghc-boot-th, butcher:base, multistate:base, data-tree-print:base," >> cabal.project
# For floskell and stylish-haskell
echo " floskell:base, floskell:ghc-prim, stylish-haskell:Cabal,stylish-haskell:ghc-lib-parser," >> cabal.project
echo " butcher:base, multistate:base, data-tree-print:base," >> cabal.project
# For stylish-haskell
echo " stylish-haskell:Cabal,stylish-haskell:ghc-lib-parser,stylish-haskell:aeson" >> cabal.project
Anton-Latukha marked this conversation as resolved.
Show resolved Hide resolved

- name: "Build main package components in isolation"
if: steps.get-hackage-version.outputs.exists != 'true'
Expand All @@ -130,8 +123,7 @@ jobs:
if: steps.get-hackage-version.outputs.exists != 'true'
run: |
cd $(ls -d ./incoming/${{ matrix.package }}-*)
# cabal-3.4.0.0 run out of backjumps with tests and benchs enabled
cabal build --enable-tests --enable-benchmarks --max-backjumps 8000
cabal build --enable-tests --enable-benchmarks

- name: "Generate haddock for hackage"
if: steps.get-hackage-version.outputs.exists != 'true'
Expand Down
16 changes: 12 additions & 4 deletions .github/workflows/test.yml
Expand Up @@ -57,6 +57,7 @@ jobs:
fail-fast: true
matrix:
ghc: [ "9.2.1"
, "9.0.2"
, "9.0.1"
, "8.10.7"
, "8.10.6"
Expand All @@ -72,7 +73,7 @@ jobs:
ghc: '9.2.1'
test: true
- os: ubuntu-latest
ghc: '9.0.1'
ghc: '9.0.2'
test: true
- os: ubuntu-latest
ghc: '8.10.7'
Expand All @@ -87,14 +88,21 @@ jobs:
ghc: '9.2.1'
test: true
- os: windows-latest
ghc: '9.0.1'
ghc: '9.0.2'
test: true
- os: windows-latest
ghc: '8.10.7'
test: true
- os: windows-latest
ghc: '8.6.5'
test: true
# only build rest of supported ghc versions for windows
- os: windows-latest
ghc: '9.0.1'
- os: windows-latest
ghc: '8.10.6'
- os: windows-latest
ghc: '8.8.4'

steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -174,7 +182,7 @@ jobs:
name: Test hls-splice-plugin
run: cabal test hls-splice-plugin --test-options="$TEST_OPTS" || cabal test hls-splice-plugin --test-options="$TEST_OPTS" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-splice-plugin --test-options="$TEST_OPTS"

- if: matrix.test && matrix.ghc != '9.0.1' && matrix.ghc != '9.2.1'
- if: matrix.test && matrix.ghc != '9.0.1' && matrix.ghc != '9.0.2' && matrix.ghc != '9.2.1'
name: Test hls-stylish-haskell-plugin
run: cabal test hls-stylish-haskell-plugin --test-options="$TEST_OPTS" || cabal test hls-stylish-haskell-plugin --test-options="$TEST_OPTS" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-stylish-haskell-plugin --test-options="$TEST_OPTS"

Expand All @@ -186,7 +194,7 @@ jobs:
name: Test hls-fourmolu-plugin
run: cabal test hls-fourmolu-plugin --test-options="$TEST_OPTS" || cabal test hls-fourmolu-plugin --test-options="$TEST_OPTS" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-fourmolu-plugin --test-options="$TEST_OPTS"

- if: matrix.test && matrix.ghc != '9.0.1' && matrix.ghc != '9.2.1' && !(matrix.os == 'ubuntu-latest' && matrix.ghc == '8.6.5')
- if: matrix.test && matrix.ghc != '9.0.1' && matrix.ghc != '9.0.2' && matrix.ghc != '9.2.1' && !(matrix.os == 'ubuntu-latest' && matrix.ghc == '8.6.5')
name: Test hls-tactics-plugin test suite
run: cabal test hls-tactics-plugin --test-options="$TEST_OPTS" || cabal test hls-tactics-plugin --test-options="$TEST_OPTS" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-tactics-plugin --test-options="$TEST_OPTS"

Expand Down
5 changes: 2 additions & 3 deletions .gitlab-ci.yml
Expand Up @@ -16,8 +16,8 @@ variables:
CABAL_PROJECT: cabal.project
- GHC_VERSION: 8.10.7
CABAL_PROJECT: cabal.project
- GHC_VERSION: 9.0.1
CABAL_PROJECT: cabal-ghc901.project
- GHC_VERSION: 9.0.2
CABAL_PROJECT: cabal-ghc90.project

.m1_matrix: &m1_matrix
matrix:
Expand Down Expand Up @@ -284,4 +284,3 @@ tar-x86_64-windows:
variables:
TARBALL_ARCHIVE_SUFFIX: x86_64-windows
TARBALL_EXT: zip

29 changes: 14 additions & 15 deletions cabal-ghc901.project → cabal-ghc90.project
Expand Up @@ -27,8 +27,6 @@ packages:
./plugins/hls-call-hierarchy-plugin
./plugins/hls-alternate-number-format-plugin

with-compiler: ghc-9.0.1
Anton-Latukha marked this conversation as resolved.
Show resolved Hide resolved

tests: true

package *
Expand All @@ -37,7 +35,7 @@ package *

write-ghc-environment-files: never

index-state: 2022-01-10T17:57:05Z
index-state: 2022-01-11T22:05:45Z

constraints:
-- These plugins don't work on GHC9 yet
Expand All @@ -49,17 +47,18 @@ constraints:
-- this way we track explicitly all transitive dependencies which need support for ghc-9
allow-newer:

-- brittany: update ghc bounds in hls.cabal when those are removed
-- https://github.com/lspitzner/multistate/pull/8
multistate:base,
-- https://github.com/lspitzner/data-tree-print/pull/3
data-tree-print:base,
-- https://github.com/lspitzner/butcher/pull/8
butcher:base,
-- brittany: update ghc bounds in hls.cabal when those are removed
-- https://github.com/lspitzner/multistate/pull/8
multistate:base,
-- https://github.com/lspitzner/data-tree-print/pull/3
data-tree-print:base,
-- https://github.com/lspitzner/butcher/pull/8
butcher:base,

stylish-haskell:Cabal,
stylish-haskell:ghc-lib-parser,
stylish-haskell:aeson,
stylish-haskell:Cabal,
stylish-haskell:ghc-lib-parser,
stylish-haskell:aeson,

floskell:base,
floskell:ghc-prim,
-- ghc-9.0.2 specific
-- for ghcide:test via ghc-typelits-knownnat
ghc-typelits-natnormalise:ghc-bignum
2 changes: 1 addition & 1 deletion cabal.project
Expand Up @@ -40,7 +40,7 @@ package *

write-ghc-environment-files: never

index-state: 2022-01-10T17:57:05Z
index-state: 2022-01-11T22:05:45Z

constraints:
hyphenation +embed
Expand Down
3 changes: 2 additions & 1 deletion docs/supported-versions.md
Expand Up @@ -6,7 +6,8 @@ The current support for different GHC versions is given in the following table.

| GHC version | Last supporting HLS version | Deprecation status |
| ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------- |
| 9.2.0 | incoming [partial](https://github.com/haskell/haskell-language-server/issues/2179) | |
| 9.2.0 | incoming [partial](https://github.com/haskell/haskell-language-server/issues/2179) | |
| 9.0.2 | [current](https://github.com/haskell/haskell-language-server/releases/latest) ([partial](https://github.com/haskell/haskell-language-server/issues/297)) | |
| 9.0.1 | [current](https://github.com/haskell/haskell-language-server/releases/latest) ([partial](https://github.com/haskell/haskell-language-server/issues/297)) | |
| 8.10.7 | [current](https://github.com/haskell/haskell-language-server/releases/latest) | |
| 8.10.6 | [current](https://github.com/haskell/haskell-language-server/releases/latest) | will be deprecated after LTS and HLS full support for ghc-9.0 |
Expand Down
2 changes: 1 addition & 1 deletion ghcide/ghcide.cabal
Expand Up @@ -13,7 +13,7 @@ description:
A library for building Haskell IDE's on top of the GHC API.
homepage: https://github.com/haskell/haskell-language-server/tree/master/ghcide#readme
bug-reports: https://github.com/haskell/haskell-language-server/issues
tested-with: GHC == 8.6.5 || == 8.8.4 || == 8.10.6 || == 8.10.7 || == 9.0.1
tested-with: GHC == 8.6.5 || == 8.8.4 || == 8.10.6 || == 8.10.7 || == 9.0.1 || == 9.0.2 || == 9.2.1
extra-source-files: README.md CHANGELOG.md
test/data/**/*.project
test/data/**/*.cabal
Expand Down
3 changes: 3 additions & 0 deletions ghcide/test/data/plugin-knownnat/cabal.project
@@ -1 +1,4 @@
packages: .

-- Needed for ghc >= 9.0.2 and ghc-typelits-natnormalise == 0.7.6
allow-newer: ghc-typelits-natnormalise:ghc-bignum
2 changes: 1 addition & 1 deletion ghcide/test/exe/Main.hs
Expand Up @@ -590,7 +590,7 @@ diagnosticTests = testGroup "diagnostics"
]
_ <- createDoc "Foo.hs" "haskell" fooContent
if ghcVersion >= GHC90 then
-- Haddock parse errors are ignored on ghc-9.0.1
-- Haddock parse errors are ignored on ghc-9.0
pure ()
else
expectDiagnostics
Expand Down
7 changes: 5 additions & 2 deletions haskell-language-server.cabal
Expand Up @@ -14,7 +14,7 @@ copyright: The Haskell IDE Team
license: Apache-2.0
license-file: LICENSE
build-type: Simple
tested-with: GHC == 8.6.5 || == 8.8.4 || == 8.10.6 || == 8.10.7 || == 9.0.1
tested-with: GHC == 8.6.5 || == 8.8.4 || == 8.10.6 || == 8.10.7 || == 9.0.1 || == 9.0.2 || == 9.2.1
extra-source-files:
README.md
ChangeLog.md
Expand Down Expand Up @@ -93,6 +93,9 @@ library
-- - Bulk flags should be default:False
-- - Individual flags should be default:True

-- The intent of this flag is being able to keep the ghc condition for hackage
-- but skip it via flags in cabal.project as plugins for new ghcs usually
-- are buildable using cabal.project tweaks
flag ignore-plugins-ghc-bounds
description: Force the inclusion of plugins even if they are not buildable by default with a specific ghc version
default: False
Expand Down Expand Up @@ -475,7 +478,7 @@ test-suite func-test
-- formatters
if flag(floskell) && (impl(ghc < 9.2.1) || flag(ignore-plugins-ghc-bounds))
cpp-options: -Dfloskell
if flag(fourmolu) && flag(ignore-plugins-ghc-bounds)
if flag(fourmolu)
cpp-options: -Dfourmolu
if flag(ormolu)
cpp-options: -Dormolu
Expand Down