Skip to content

Commit 3f46851

Browse files
jneiramergify[bot]
andauthored
Add support for ghc 9.0.2 (#2567)
* Extract out ci build setup * Add required shell property * Add support for ghc-9.0.2 * Test ghc 9.0.2 * Add unix boot package * Use primitive-unlifted < 1.0 * Use primitive-unlifted < 1.0 for stack * Ude 9.0.1 for hackage We cant use 9.0.2 until all deps do not need allow-newer * Use a unified cabal-ghc90.project And bump up index state to get lastest hie-bios * Use last snapshot with ghc-9.0.2 support * Use new cabal-ghc90.project in build * Add stm-containers * Add specific tweaks for ghc-9.0.2 * Use the las ghc-boot-9.0 * Fix test adding allow-newer Co-Authored-By: @michaelpj * Use unix-compat from hackage * Use unix-compat from hackage * Make consistent lastest stack.yamls * Clean up cabal.project * more cleanups * Update tweaks in hackage ci * Correct comment * Correct fourmolu condition * Correct fourmolu condition in tests * Removing the all target from caching It builds all project packages even if we they are not buildables (and are not included in hls due to flags) Its goal was build all tests and benchmarks but --enable-tests ans --enable-benchmarks should work Last one does not: haskell/cabal#6259 * exclude Brittany 0.14.0.1 * Update snapshot to get new lsp * document flag * Document and build ghcide benchmark * Doc and use ghc-9.0.2 in hackage * Add ghc-9.2.1 to tested-with * Use 9.0.2 in gitlab * Use last *molus * Use same versions as cabal build * Use cabal freeze versions * Add dep for ghcide tests * one by one * Unnecessary change * Remove unnecessary flag * Corrections * Move blocks Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
1 parent b01a94a commit 3f46851

19 files changed

+246
-101
lines changed

.circleci/config.yml

+6
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,11 @@ jobs:
100100
- STACK_FILE: "stack-9.0.1.yaml"
101101
<<: *defaults
102102

103+
ghc-9.0.2:
104+
environment:
105+
- STACK_FILE: "stack-9.0.2.yaml"
106+
<<: *defaults
107+
103108
ghc-default:
104109
environment:
105110
- STACK_FILE: "stack.yaml"
@@ -115,4 +120,5 @@ workflows:
115120
- ghc-8.10.6
116121
- ghc-8.10.7
117122
- ghc-9.0.1
123+
- ghc-9.0.2
118124
- ghc-default

.github/actions/setup-build/action.yml

+8-3
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ runs:
2626
run: |
2727
echo "CABAL_PKGS_DIR=C:\\cabal\\packages" >> $GITHUB_ENV
2828
shell: bash
29+
2930
- if: ( inputs.os == 'Linux' ) || ( inputs.os == 'macOS' )
3031
name: (Linux,macOS) Platform config
3132
run: |
@@ -43,9 +44,13 @@ runs:
4344
# (most probably sticky bit is set on $HOME)
4445
# `&&` insures `rm -f` return is positive.
4546
# Many platforms aslo have `alias cp='cp -i'`.
46-
ALT_PROJECT_FILE=cabal-ghc${GHCVER//./}.project
47-
if [[ -f "$ALT_PROJECT_FILE" ]]; then
48-
rm -f -v cabal.project && cp -v "$ALT_PROJECT_FILE" cabal.project
47+
GHCVER2=${GHCVER//./}
48+
ALT_PROJECT_FILE_MINOR=cabal-ghc${GHCVER2}.project
49+
ALT_PROJECT_FILE_MAJOR=cabal-ghc${GHCVER2:0:2}.project
50+
if [[ -f "$ALT_PROJECT_FILE_MINOR" ]]; then
51+
rm -f -v cabal.project && cp -v "$ALT_PROJECT_FILE_MINOR" cabal.project
52+
elif [[ -f "$ALT_PROJECT_FILE_MAJOR" ]]; then
53+
rm -f -v cabal.project && cp -v "$ALT_PROJECT_FILE_MAJOR" cabal.project
4954
fi
5055
shell: bash
5156

.github/workflows/build.yml

+13-6
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ jobs:
2020
matrix:
2121
ghc:
2222
[ "9.2.1"
23+
, "9.0.2"
2324
, "9.0.1"
2425
, "8.10.7"
2526
, "8.10.6"
@@ -54,12 +55,18 @@ jobs:
5455
echo -e 'package blaze-textual\n flags: +integer-simple' >> cabal.project.local
5556
fi
5657
57-
- name: (GHC 9.0) Use modified cabal.project for GHC 9.0
58-
if: ${{ matrix.ghc == '9.0.1' }}
59-
run: cp cabal-ghc901.project cabal.project
60-
- name: Use modified cabal.project for ghc9.2
61-
if: ${{ matrix.ghc == '9.2.1' }}
62-
run: cp cabal-ghc921.project cabal.project
58+
- name: Use modified cabal.project
59+
env:
60+
GHCVER: ${{ matrix.ghc }}
61+
run: |
62+
GHCVER2=${GHCVER//./}
63+
ALT_PROJECT_FILE_MINOR=cabal-ghc${GHCVER2}.project
64+
ALT_PROJECT_FILE_MAJOR=cabal-ghc${GHCVER2:0:2}.project
65+
if [[ -f "$ALT_PROJECT_FILE_MINOR" ]]; then
66+
rm -f -v cabal.project && cp -v "$ALT_PROJECT_FILE_MINOR" cabal.project
67+
elif [[ -f "$ALT_PROJECT_FILE_MAJOR" ]]; then
68+
rm -f -v cabal.project && cp -v "$ALT_PROJECT_FILE_MAJOR" cabal.project
69+
fi
6370
6471
- name: Shorten binary names
6572
run: |

.github/workflows/caching.yml

+20-15
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,10 @@ on:
4444
# & so it gets shared across all PRs.
4545
- cron: "25 2/8 * * *"
4646

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

5052
jobs:
5153

@@ -77,6 +79,7 @@ jobs:
7779
fail-fast: false
7880
matrix:
7981
ghc: [ "9.2.1"
82+
, "9.0.2"
8083
, "9.0.1"
8184
, "8.10.7"
8285
, "8.10.6"
@@ -96,24 +99,26 @@ jobs:
9699
ghc: ${{ matrix.ghc }}
97100
os: ${{ runner.os }}
98101

102+
# Download sources for feeding build sources cache
103+
# Fetching from github cache is faster than doing it from hackage
104+
# Sources does not change per ghc and ghc version son only doing it
105+
# for one matrix job (it is arbitrary)
99106
- if: steps.compiled-deps.outputs.cache-hit != 'true' && runner.os == 'Linux' && matrix.ghc == '8.10.7'
100-
name: Download sources for bench
101-
# Downloaded separately, to match the tested work/PR workflow guarantees
107+
name: Download sources
102108
run: |
103-
cabal $cabalBuild --only-download --enable-benchmarks
109+
cabal $cabalBuild --only-download --enable-benchmarks --enable-tests
104110
111+
# This build agenda is not to have successful code but produce cache as much as possible
105112
- if: steps.compiled-deps.outputs.cache-hit != 'true'
106-
name: Download the rest of the sources
107-
# Downloaded separately, to match the tested work/PR workflow guarantees
113+
name: Build haskell-language-server
108114
run: |
109-
cabal $cabalBuild --only-download --enable-tests
115+
# repeating builds to workaround segfaults in windows and ghc-8.8.4
116+
cabal $cabalBuild || cabal $cabalBuild || cabal $cabalBuild
110117
111-
# repeating builds to workaround segfaults in windows and ghc-8.8.4
112-
# This build agenda in not to have successful code,
113-
# but to cache what can be cached, so step is fault tolerant & would always succseed.
114-
# 2021-12-11: NOTE: Building all targets, since
115-
# current Cabal does not allow `all --enable-tests --enable-benchmarks --only-dependencies`
116-
- if: steps.compiled-deps.outputs.cache-hit != 'true'
117-
name: Build all targets; try 3 times
118+
# We build ghcide with benchs and test enabled to include its dependencies in the cache
119+
# (including shake-bench)
120+
# Only for the same ghc and os used in the bench workflow, so we save cache space
121+
- if: steps.compiled-deps.outputs.cache-hit != 'true' && runner.os == 'Linux' && matrix.ghc == '8.10.7'
122+
name: Build ghcide benchmark
118123
run: |
119-
cabal $cabalBuild || cabal $cabalBuild || cabal $cabalBuild
124+
cabal $cabalBuild ghcide --enable-benchmarks --enable-tests

.github/workflows/hackage.yml

+16-24
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,15 @@ jobs:
3434
"hls-call-hierarchy-plugin", "hls-alternate-number-format-plugin",
3535
"hls-qualify-imported-names-plugin",
3636
"haskell-language-server"]
37-
ghc: [ "9.0.1",
38-
"8.10.7",
39-
"8.8.4",
40-
"8.6.5"]
37+
ghc: [ "9.0.2"
38+
, "8.10.7"
39+
, "8.8.4"
40+
, "8.6.5"
41+
]
4142
exclude:
42-
- ghc: "9.0.1"
43-
package: "hls-brittany-plugin"
44-
- ghc: "9.0.1"
43+
- ghc: "9.0.2"
4544
package: "hls-stylish-haskell-plugin"
46-
- ghc: "9.0.1"
47-
package: "hls-class-plugin"
48-
- ghc: "9.0.1"
45+
- ghc: "9.0.2"
4946
package: "hls-tactics-plugin"
5047

5148
steps:
@@ -103,22 +100,18 @@ jobs:
103100
cd $(ls -d ./incoming/${{ matrix.package }}-*)
104101
echo "packages: . ../../* ../../plugins/*" > cabal.project
105102
106-
- name: "Add temporary needed allow-newer"
107-
if: steps.get-hackage-version.outputs.exists != 'true'
108-
run: |
109-
# TODO: remove when not needed
110-
cd $(ls -d ./incoming/${{ matrix.package }}-*)
111-
echo "allow-newer: Chart-diagrams:diagrams-core, SVGFonts:diagrams-core," >> cabal.project
112-
103+
# These tweaks are already in cabal-901.project but we dont want to use the entire file,
104+
# Only the tricks needed by the solver which we know will not make the hackage build fail.
105+
# The solver takes in account all project packages, even if they are not gonna be effectively built
106+
# (like brittany or stylish-haskell for ghc-9.0)
113107
- name: "Add temporary needed allow-newer for ghc-9.0"
114-
if: steps.get-hackage-version.outputs.exists != 'true' && matrix.ghc == '9.0.1'
108+
if: steps.get-hackage-version.outputs.exists != 'true' && matrix.ghc == '9.0.2'
115109
run: |
116-
# TODO: remove when not needed
117110
cd $(ls -d ./incoming/${{ matrix.package }}-*)
118111
# For brittany
119-
echo " brittany:base, brittany:ghc, brittany:ghc-boot-th, butcher:base, multistate:base, data-tree-print:base," >> cabal.project
120-
# For floskell and stylish-haskell
121-
echo " floskell:base, floskell:ghc-prim, stylish-haskell:Cabal,stylish-haskell:ghc-lib-parser," >> cabal.project
112+
echo " butcher:base, multistate:base, data-tree-print:base," >> cabal.project
113+
# For stylish-haskell
114+
echo " stylish-haskell:Cabal,stylish-haskell:ghc-lib-parser,stylish-haskell:aeson" >> cabal.project
122115
123116
- name: "Build main package components in isolation"
124117
if: steps.get-hackage-version.outputs.exists != 'true'
@@ -130,8 +123,7 @@ jobs:
130123
if: steps.get-hackage-version.outputs.exists != 'true'
131124
run: |
132125
cd $(ls -d ./incoming/${{ matrix.package }}-*)
133-
# cabal-3.4.0.0 run out of backjumps with tests and benchs enabled
134-
cabal build --enable-tests --enable-benchmarks --max-backjumps 8000
126+
cabal build --enable-tests --enable-benchmarks
135127
136128
- name: "Generate haddock for hackage"
137129
if: steps.get-hackage-version.outputs.exists != 'true'

.github/workflows/test.yml

+12-4
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ jobs:
5757
fail-fast: true
5858
matrix:
5959
ghc: [ "9.2.1"
60+
, "9.0.2"
6061
, "9.0.1"
6162
, "8.10.7"
6263
, "8.10.6"
@@ -72,7 +73,7 @@ jobs:
7273
ghc: '9.2.1'
7374
test: true
7475
- os: ubuntu-latest
75-
ghc: '9.0.1'
76+
ghc: '9.0.2'
7677
test: true
7778
- os: ubuntu-latest
7879
ghc: '8.10.7'
@@ -87,14 +88,21 @@ jobs:
8788
ghc: '9.2.1'
8889
test: true
8990
- os: windows-latest
90-
ghc: '9.0.1'
91+
ghc: '9.0.2'
9192
test: true
9293
- os: windows-latest
9394
ghc: '8.10.7'
9495
test: true
9596
- os: windows-latest
9697
ghc: '8.6.5'
9798
test: true
99+
# only build rest of supported ghc versions for windows
100+
- os: windows-latest
101+
ghc: '9.0.1'
102+
- os: windows-latest
103+
ghc: '8.10.6'
104+
- os: windows-latest
105+
ghc: '8.8.4'
98106

99107
steps:
100108
- uses: actions/checkout@v2
@@ -174,7 +182,7 @@ jobs:
174182
name: Test hls-splice-plugin
175183
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"
176184

177-
- if: matrix.test && matrix.ghc != '9.0.1' && matrix.ghc != '9.2.1'
185+
- if: matrix.test && matrix.ghc != '9.0.1' && matrix.ghc != '9.0.2' && matrix.ghc != '9.2.1'
178186
name: Test hls-stylish-haskell-plugin
179187
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"
180188

@@ -186,7 +194,7 @@ jobs:
186194
name: Test hls-fourmolu-plugin
187195
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"
188196

189-
- if: matrix.test && matrix.ghc != '9.0.1' && matrix.ghc != '9.2.1' && !(matrix.os == 'ubuntu-latest' && matrix.ghc == '8.6.5')
197+
- 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')
190198
name: Test hls-tactics-plugin test suite
191199
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"
192200

.gitlab-ci.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ variables:
1616
CABAL_PROJECT: cabal.project
1717
- GHC_VERSION: 8.10.7
1818
CABAL_PROJECT: cabal.project
19-
- GHC_VERSION: 9.0.1
20-
CABAL_PROJECT: cabal-ghc901.project
19+
- GHC_VERSION: 9.0.2
20+
CABAL_PROJECT: cabal-ghc90.project
2121

2222
.m1_matrix: &m1_matrix
2323
matrix:
@@ -284,4 +284,3 @@ tar-x86_64-windows:
284284
variables:
285285
TARBALL_ARCHIVE_SUFFIX: x86_64-windows
286286
TARBALL_EXT: zip
287-

cabal-ghc901.project renamed to cabal-ghc90.project

+14-15
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ packages:
2727
./plugins/hls-call-hierarchy-plugin
2828
./plugins/hls-alternate-number-format-plugin
2929

30-
with-compiler: ghc-9.0.1
31-
3230
tests: true
3331

3432
package *
@@ -37,7 +35,7 @@ package *
3735

3836
write-ghc-environment-files: never
3937

40-
index-state: 2022-01-10T17:57:05Z
38+
index-state: 2022-01-11T22:05:45Z
4139

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

52-
-- brittany: update ghc bounds in hls.cabal when those are removed
53-
-- https://github.com/lspitzner/multistate/pull/8
54-
multistate:base,
55-
-- https://github.com/lspitzner/data-tree-print/pull/3
56-
data-tree-print:base,
57-
-- https://github.com/lspitzner/butcher/pull/8
58-
butcher:base,
50+
-- brittany: update ghc bounds in hls.cabal when those are removed
51+
-- https://github.com/lspitzner/multistate/pull/8
52+
multistate:base,
53+
-- https://github.com/lspitzner/data-tree-print/pull/3
54+
data-tree-print:base,
55+
-- https://github.com/lspitzner/butcher/pull/8
56+
butcher:base,
5957

60-
stylish-haskell:Cabal,
61-
stylish-haskell:ghc-lib-parser,
62-
stylish-haskell:aeson,
58+
stylish-haskell:Cabal,
59+
stylish-haskell:ghc-lib-parser,
60+
stylish-haskell:aeson,
6361

64-
floskell:base,
65-
floskell:ghc-prim,
62+
-- ghc-9.0.2 specific
63+
-- for ghcide:test via ghc-typelits-knownnat
64+
ghc-typelits-natnormalise:ghc-bignum

cabal.project

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ package *
4040

4141
write-ghc-environment-files: never
4242

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

4545
constraints:
4646
hyphenation +embed

docs/supported-versions.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ The current support for different GHC versions is given in the following table.
66

77
| GHC version | Last supporting HLS version | Deprecation status |
88
| ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------- |
9-
| 9.2.0 | incoming [partial](https://github.com/haskell/haskell-language-server/issues/2179) | |
9+
| 9.2.0 | incoming [partial](https://github.com/haskell/haskell-language-server/issues/2179) | |
10+
| 9.0.2 | [current](https://github.com/haskell/haskell-language-server/releases/latest) ([partial](https://github.com/haskell/haskell-language-server/issues/297)) | |
1011
| 9.0.1 | [current](https://github.com/haskell/haskell-language-server/releases/latest) ([partial](https://github.com/haskell/haskell-language-server/issues/297)) | |
1112
| 8.10.7 | [current](https://github.com/haskell/haskell-language-server/releases/latest) | |
1213
| 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 |

ghcide/ghcide.cabal

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ description:
1313
A library for building Haskell IDE's on top of the GHC API.
1414
homepage: https://github.com/haskell/haskell-language-server/tree/master/ghcide#readme
1515
bug-reports: https://github.com/haskell/haskell-language-server/issues
16-
tested-with: GHC == 8.6.5 || == 8.8.4 || == 8.10.6 || == 8.10.7 || == 9.0.1
16+
tested-with: GHC == 8.6.5 || == 8.8.4 || == 8.10.6 || == 8.10.7 || == 9.0.1 || == 9.0.2 || == 9.2.1
1717
extra-source-files: README.md CHANGELOG.md
1818
test/data/**/*.project
1919
test/data/**/*.cabal
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
11
packages: .
2+
3+
-- Needed for ghc >= 9.0.2 and ghc-typelits-natnormalise == 0.7.6
4+
allow-newer: ghc-typelits-natnormalise:ghc-bignum

ghcide/test/exe/Main.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ diagnosticTests = testGroup "diagnostics"
590590
]
591591
_ <- createDoc "Foo.hs" "haskell" fooContent
592592
if ghcVersion >= GHC90 then
593-
-- Haddock parse errors are ignored on ghc-9.0.1
593+
-- Haddock parse errors are ignored on ghc-9.0
594594
pure ()
595595
else
596596
expectDiagnostics

haskell-language-server.cabal

+5-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ copyright: The Haskell IDE Team
1414
license: Apache-2.0
1515
license-file: LICENSE
1616
build-type: Simple
17-
tested-with: GHC == 8.6.5 || == 8.8.4 || == 8.10.6 || == 8.10.7 || == 9.0.1
17+
tested-with: GHC == 8.6.5 || == 8.8.4 || == 8.10.6 || == 8.10.7 || == 9.0.1 || == 9.0.2 || == 9.2.1
1818
extra-source-files:
1919
README.md
2020
ChangeLog.md
@@ -93,6 +93,9 @@ library
9393
-- - Bulk flags should be default:False
9494
-- - Individual flags should be default:True
9595

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

0 commit comments

Comments
 (0)