Skip to content

Commit 191bda6

Browse files
authored
9.6 support for HLS (#3480)
* 9.6 support Fixes hls-refactor-plugin 9.6 support hls-gadt-plugin Fix 9.4 build Fixes hls-gadt-plugin fixes WIP 9.6 patches fixes fixes fixes fixes fixes Fixes and add CI CI CI fixes patch haskell/actions for haskell/ghcup-hs#783 CI fixes CI fixes CI fixes CI CI CI CI CI Fix build on 9.0 Fix build on 9.0 hls-splice-plugin 9.6 compat fixes fixes fixes fixes Fix benchmark build errors 9.2.5 and 8.10.7 had build errors when running benchmarks due to `mfsolve` test suite having duplicate instances, so stop building tests for mfsolve (see: kuribas/mfsolve#8). Also, `http2-4.0.0` has a parse error due to a misplaced haddock comment that causes build failure with `-haddock`. It is fixed in the latest commit of the source repo, so use that in the `cabal.project` for now. Checkout correct commit on `pull_request` in CI By default, the `pull_request` event has a `GITHUB_SHA` env variable set to the "last merge commit on the GITHUB_REF branch" (see https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request). But we want to check out the latest commit on the branch whether or not it is a merge commit. This commit changes the CI actions to do just that. fixes Use head.hackage for 9.4 Only use head.hackage for 9.5 and up Reverts the change that caused head.hackage to be used for 9.4 as well Reintroduce source-repo-package for ekg-json Fix refactor plugin tests Fix missing constraint detection in refactor plugin ghc 9.6+ allow newer unordered-containers:template-haskell Some refactor tests no longer broken for 9.2 Fix simple-multi-test on 9.6 Mark simple-plugin as broken on 9.6 func-test fixes Disable unsupported plugins on 9.6 Eval plugin fixes Eval plugin test fixes, debug output in CI script Restore 'working' setup/actions WIP Fix GHC prerelease windows install Fix eval plugin T11 fixes Eval plugin fixes Fix splice plugin test Mark `simple plugin` ghcide test broken on 9.6 fixes fixes Use GHC 9.6-rc1 in CI Try using 9.6.1 for CI * 9.6 nix * Remove head.hackage * fixes * fixes * fixes * fixes * fixes * fixes
1 parent 6e42e9a commit 191bda6

File tree

78 files changed

+984
-228
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+984
-228
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ runs:
2626
- name: Workaround runner image issue
2727
if: runner.os == 'Linux'
2828
# https://github.com/actions/runner-images/issues/7061
29-
run: |
29+
run: |
3030
sudo mkdir -p /usr/local/.ghcup
3131
sudo chown -R $USER /usr/local/.ghcup
3232
shell: bash
3333

34-
- uses: haskell/actions/setup@v2.3.5
34+
- uses: haskell/actions/setup@v2.3.6
3535
id: HaskEnvSetup
3636
with:
3737
ghc-version : ${{ inputs.ghc }}

.github/workflows/bench.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,14 @@ jobs:
5757

5858
steps:
5959
- uses: actions/checkout@v3
60+
with:
61+
62+
# By default, the `pull_request` event has a `GITHUB_SHA` env variable
63+
# set to the "last merge commit on the GITHUB_REF branch" (see
64+
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request).
65+
# But we want to check out the latest commit on the branch whether or
66+
# not it is a merge commit, so this is how we do that.
67+
ref: "${{ github.event.pull_request.head.sha }}"
6068

6169
- run: git fetch origin master # check the master branch for benchmarking
6270

.github/workflows/flags.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,14 @@ jobs:
5555

5656
steps:
5757
- uses: actions/checkout@v3
58+
with:
59+
60+
# By default, the `pull_request` event has a `GITHUB_SHA` env variable
61+
# set to the "last merge commit on the GITHUB_REF branch" (see
62+
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request).
63+
# But we want to check out the latest commit on the branch whether or
64+
# not it is a merge commit, so this is how we do that.
65+
ref: "${{ github.event.pull_request.head.sha }}"
5866

5967
- uses: ./.github/actions/setup-build
6068
with:

.github/workflows/nix.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ jobs:
103103
# We only build nix dev shell for current GHC version because some are
104104
# failing with different GHC version on darwin.
105105
- name: Build development shell with nix dependencies for current GHC version
106-
run: nix develop --print-build-logs .#haskell-language-server-dev-nix --profile dev
106+
run: nix develop --print-build-logs .#all-nix-dev-shells --profile dev
107107
- name: Push development shell
108108
if: ${{ env.HAS_TOKEN == 'true' }}
109109
run: cachix push haskell-language-server dev
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
[ "9.4.4" , "9.2.5" , "9.0.2" , "8.10.7" ]
1+
[ "9.6.1", "9.4.4" , "9.2.5" , "9.0.2" , "8.10.7" ]

.github/workflows/test.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ jobs:
136136
name: Test hls-refactor-plugin
137137
run: cabal test hls-refactor-plugin --test-options="$TEST_OPTS" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-refactor-plugin --test-options="$TEST_OPTS"
138138

139-
- if: matrix.test
139+
- if: matrix.test && matrix.ghc != '9.6.1'
140140
name: Test hls-floskell-plugin
141141
run: cabal test hls-floskell-plugin --test-options="$TEST_OPTS" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-floskell-plugin --test-options="$TEST_OPTS"
142142

@@ -152,27 +152,27 @@ jobs:
152152
name: Test hls-eval-plugin
153153
run: cabal test hls-eval-plugin --test-options="$TEST_OPTS" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-eval-plugin --test-options="$TEST_OPTS"
154154

155-
- if: matrix.test && matrix.ghc != '9.2.5' && matrix.ghc != '9.4.4'
155+
- if: matrix.test && matrix.ghc != '9.2.5' && matrix.ghc != '9.4.4' && matrix.ghc != '9.6.1'
156156
name: Test hls-haddock-comments-plugin
157157
run: cabal test hls-haddock-comments-plugin --test-options="$TEST_OPTS" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-haddock-comments-plugin --test-options="$TEST_OPTS"
158158

159159
- if: matrix.test
160160
name: Test hls-splice-plugin
161161
run: 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"
162162

163-
- if: matrix.test
163+
- if: matrix.test && matrix.ghc != '9.6.1'
164164
name: Test hls-stylish-haskell-plugin
165165
run: 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"
166166

167-
- if: matrix.test
167+
- if: matrix.test && matrix.ghc != '9.6.1'
168168
name: Test hls-ormolu-plugin
169169
run: cabal test hls-ormolu-plugin --test-options="$TEST_OPTS" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-ormolu-plugin --test-options="$TEST_OPTS"
170170

171-
- if: matrix.test
171+
- if: matrix.test && matrix.ghc != '9.6.1'
172172
name: Test hls-fourmolu-plugin
173173
run: 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"
174174

175-
- if: matrix.test && matrix.ghc != '9.2.5' && matrix.ghc != '9.4.4'
175+
- if: matrix.test && matrix.ghc != '9.2.5' && matrix.ghc != '9.4.4' && matrix.ghc != '9.6.1'
176176
name: Test hls-tactics-plugin test suite
177177
run: 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"
178178

@@ -192,11 +192,11 @@ jobs:
192192
name: Test hls-rename-plugin test suite
193193
run: cabal test hls-rename-plugin --test-options="$TEST_OPTS" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-rename-plugin --test-options="$TEST_OPTS"
194194

195-
- if: matrix.test
195+
- if: matrix.test && matrix.ghc != '9.6.1'
196196
name: Test hls-hlint-plugin test suite
197197
run: cabal test hls-hlint-plugin --test-options="$TEST_OPTS" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-hlint-plugin --test-options="$TEST_OPTS"
198198

199-
- if: matrix.test && matrix.ghc != '9.0.2' && matrix.ghc != '9.2.5' && matrix.ghc != '9.4.4'
199+
- if: matrix.test && matrix.ghc != '9.0.2' && matrix.ghc != '9.2.5' && matrix.ghc != '9.4.4' && matrix.ghc != '9.6.1'
200200
name: Test hls-stan-plugin test suite
201201
run: cabal test hls-stan-plugin --test-options="$TEST_OPTS" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-stan-plugin --test-options="$TEST_OPTS"
202202

cabal.project

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,26 @@ packages:
4242
-- See https://github.com/haskell/haskell-language-server/blob/master/.gitlab-ci.yml
4343
optional-packages: vendored/*/*.cabal
4444

45-
tests: true
45+
tests: True
46+
47+
-- mfsolve has duplicate instances in its test suite
48+
-- See: https://github.com/kuribas/mfsolve/issues/8
49+
package mfsolve
50+
tests: False
51+
52+
if impl(ghc >= 9.5)
53+
source-repository-package
54+
type:git
55+
location: https://github.com/wz1000/retrie
56+
tag: 0a2dbfc00e745737f249f16325b2815d2e3a14eb
4657

4758
package *
4859
ghc-options: -haddock
4960
test-show-details: direct
5061

5162
write-ghc-environment-files: never
5263

53-
index-state: 2023-03-15T00:00:00Z
64+
index-state: 2023-03-23T00:00:00Z
5465

5566
constraints:
5667
-- For GHC 9.4, older versions of entropy fail to build on Windows
@@ -67,8 +78,9 @@ constraints:
6778
ghc-lib-parser-ex -auto,
6879
stylish-haskell +ghc-lib,
6980
fourmolu -fixity-th,
70-
-- http2 doesn't build with -haddock on ghc-8.10
71-
http2 < 4.0.0
81+
setup.happy == 1.20.1.1,
82+
happy == 1.20.1.1,
83+
filepath installed,
7284

7385
-- This is benign and won't affect our ability to release to Hackage,
7486
-- because we only depend on `ekg-json` when a non-default flag
@@ -81,7 +93,6 @@ source-repository-package
8193
type:git
8294
location: https://github.com/pepeiborra/ekg-json
8395
tag: 7a0af7a8fd38045fd15fb13445bdcc7085325460
84-
-- https://github.com/tibbe/ekg-json/pull/12
8596
-- END DELETE
8697

8798
allow-newer:
@@ -107,3 +118,23 @@ allow-newer:
107118
uuid:time,
108119
vector-space:base,
109120
ekg-wai:time,
121+
122+
if impl(ghc >= 9.5)
123+
allow-newer:
124+
-- ghc-9.6
125+
algebraic-graphs:transformers,
126+
cryptohash-md5:base,
127+
cryptohash-sha1:base,
128+
ekg-core:ghc-prim,
129+
focus:transformers,
130+
ghc-trace-events:base,
131+
implicit-hie-cradle:transformers,
132+
retrie:base,
133+
retrie:ghc,
134+
retrie:ghc-exactprint,
135+
retrie:mtl,
136+
retrie:transformers,
137+
semigroupoids:base,
138+
stm-hamt:transformers,
139+
entropy:Cabal,
140+

configuration-ghc-96.nix

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{ pkgs, inputs }:
2+
3+
let
4+
disabledPlugins = [
5+
# That one is not technically a plugin, but by putting it in this list, we
6+
# get it removed from the top level list of requirement and it is not pull
7+
# in the nix shell.
8+
"shake-bench"
9+
"hls-retrie-plugin"
10+
"hls-splice-plugin"
11+
"hls-class-plugin"
12+
"hls-rename-plugin"
13+
"hls-gadt-plugin"
14+
"hls-refactor-plugin"
15+
];
16+
17+
hpkgsOverride = hself: hsuper:
18+
with pkgs.haskell.lib;
19+
{
20+
hlsDisabledPlugins = disabledPlugins;
21+
22+
# Override for all derivation
23+
# If they are considered as broken, we just disable jailbreak and hope for the best
24+
mkDerivation = args:
25+
hsuper.mkDerivation (args //
26+
{
27+
jailbreak = true;
28+
broken = false;
29+
doCheck = false;
30+
});
31+
apply-refact = hsuper.apply-refact_0_12_0_0;
32+
tagged = hself.callHackage "tagged" "0.8.7" { };
33+
primitive = hself.callHackage "primitive" "0.8.0.0" { };
34+
unix-compat = hself.callCabal2nix "unix-compat" inputs.haskell-unix-compat { };
35+
MonadRandom = hself.callHackage "MonadRandom" "0.6" { };
36+
hiedb = hself.callCabal2nix "hiedb" inputs.haskell-hiedb { };
37+
hie-bios = hself.callCabal2nix "hie-bios" inputs.haskell-hie-bios { };
38+
ghc-exactprint = hself.callCabal2nix "ghc-exactprint" inputs.haskell-ghc-exactprint { };
39+
40+
# ptr-poker breaks on MacOS without SSE2 optimizations
41+
# https://github.com/nikita-volkov/ptr-poker/issues/11
42+
ptr-poker = hself.callCabal2nix "ptr-poker" inputs.ptr-poker { };
43+
44+
ormolu = hself.ormolu_0_5_3_0;
45+
46+
stylish-haskell = appendConfigureFlag hsuper.stylish-haskell "-fghc-lib";
47+
48+
# Re-generate HLS drv excluding some plugins
49+
haskell-language-server =
50+
hself.callCabal2nixWithOptions "haskell-language-server" ./.
51+
# Pedantic cannot be used due to -Werror=unused-top-binds
52+
# Check must be disabled due to some missing required files
53+
(pkgs.lib.concatStringsSep " " [ "--no-check" "-f-pedantic" "-f-hlint" "-f-refactor" "-f-retrie" "-f-class" "-f-gadt" "-f-splice" "-f-rename" ]) { };
54+
};
55+
in {
56+
inherit disabledPlugins;
57+
tweakHpkgs = hpkgs: hpkgs.extend hpkgsOverride;
58+
}

flake.lock

Lines changed: 80 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)