Skip to content

Commit 686fa1a

Browse files
9999yearswavewaveGabriella439wz1000
authored
Update refactor/splice/hlint/fourmolu/retrie/gadt plugin for GHC 9.4 (#3317)
* Set buildable on GHC 9.4 * Start work on GHC 9.4 compat * Use patched `retrie` * update retrie with github address. circumvent nix-prefetch-url. * handle ExactPrint * fix ghc 9.0 env. * unwrap big CPP conditional for GHC 9.4 * GHC 9.4 buildable by disabling a few suggest.. functions * enable disabled suggest...! * hls-fourmolu-plugin is buildable * hls-splice-plugin is buildable * hls-hlint-plugin is buildable * Enable plugins on GHC 9.4 * Add fourmolu for GHC 9.4 * fourmolu tweawk * Fix `hls-hlint-plugin` build - Build against GHC 9.4 API - Increase upper bound on `hlint` * Fix build of `hls-splice-plugin` * annotation on close parenthesis. still need more work. * found where closing parenthesis were missing * examine internal annotation information. * make use of makeDeltaAst. This fixes most of test failures in GHC 9.4 * remove dead code * update apply-refact and hlint deps * temporarily comment out hls-fourmolu-plugin. * comment out build-tool-depends. then hls-fourmolu-plugin build succeeds with cabal v2-build * remove unused fourmolu flake inputs * fix ghc 9.0 build again. * hlint and fourmolu for GHC 9.2! * fix mistakenly overriden nix exp. * remove unused hlint-3.3.6 * Fix CPP in hls-refactor-plugin * Fix build error in hls-refactor-plugin * Fix import * Use `showErrors` instead of `showBag` * fix initialization test error in refactor plugin. * alternateNumberFormat and explicitFixity don't build on GHC 9.4 * force demoteIfDefer = id in typecheckModule for GHC 9.4. * ignore tests which were already ignored with GHC 9.2 * fix extractDoesNotExportModuleName for GHC 9.4 by adjusting regex match * use makeDeltaAst in removeRedundantConstraints * fix addTypeAnnotationsToLiteralsTest * Revert "alternateNumberFormat and explicitFixity don't build on GHC 9.4" This reverts commit 4903092. * Update flake lockfile * Use upstream `retrie` * Use upstream `retrie` * Update lockfile * Use upstream fourmolu * fix arrow annotation on ghc 9.4 * fix flake.nix issue * revert demoteIfDefer change for GHC 9.4. * fix hls-splice-plugin build on GHC 9.0.2 * disable tracy on darwin. * disable fourmolu plugin and ekg-json for now. * fourmolu update to 0.10.1.0 * build fix for hls-refactor-plugin after merge * update index-state. * downgrade fourmolu to 0.9 for ghc 9.2 and 9.0 * remove unnecessary problematic Cabal-syntax dependency. * update Cabal for ormolu in ghc 9.0 nix env. * use custom apply-refact for now for both ghc 9.2 and 9.4 * added ghc >= 9.2 condition * fix fourmolu with -f-fixity-th in nix env * limit implicit-hie < 0.1.3 * add fourmolu back to build-tools-depends * mark GHC92-failing tests to be failed on GHC 9.4 * ci failure test * bump nix file. * disable cachix action * further comment out * revive cachix action. * remove commented-out * fix hls-cabal-plugin by removing Cabal-syntax. note that this is an opposite to #3383, to prioritize CI fix first. * limit implicit-hie < 0.1.3 * added a small comment and link to the issue. * put implicit-hie to ghcide dep * update apply-refact rev * use apply-refact-0.11.0.0 on hackage. * 9.4 support for gadt and retrie plugins Co-authored-by: Ian-Woo Kim <[email protected]> Co-authored-by: Gabriella Gonzalez <[email protected]> Co-authored-by: Zubin Duggal <[email protected]>
1 parent 6e4612d commit 686fa1a

File tree

27 files changed

+438
-202
lines changed

27 files changed

+438
-202
lines changed

cabal.project

+3-3
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ package *
5151

5252
write-ghc-environment-files: never
5353

54-
55-
index-state: 2022-12-13T21:00:15Z
54+
index-state: 2022-12-19T19:08:33Z
5655

5756
constraints:
5857
-- For GHC 9.4, older versions of entropy fail to build on Windows
@@ -66,7 +65,8 @@ constraints:
6665
-- https://github.com/ndmitchell/hlint/issues/1376
6766
hlint +ghc-lib,
6867
ghc-lib-parser-ex -auto,
69-
stylish-haskell +ghc-lib
68+
stylish-haskell +ghc-lib,
69+
fourmolu -fixity-th
7070

7171
-- This is benign and won't affect our ability to release to Hackage,
7272
-- because we only depend on `ekg-json` when a non-default flag

configuration-ghc-90.nix

+8-5
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,14 @@ let
1818
# https://github.com/nikita-volkov/ptr-poker/issues/11
1919
ptr-poker = hself.callCabal2nix "ptr-poker" inputs.ptr-poker { };
2020

21-
ghc-lib = hself.ghc-lib_9_2_4_20220729;
22-
ghc-lib-parser = hself.ghc-lib-parser_9_2_4_20220729;
21+
ghc-lib = hself.ghc-lib_9_2_5_20221107;
22+
ghc-lib-parser = hself.ghc-lib-parser_9_2_5_20221107;
2323
ghc-lib-parser-ex = hself.ghc-lib-parser-ex_9_2_1_1;
2424

2525
Cabal = hself.Cabal_3_6_3_0;
2626
ormolu = hself.ormolu_0_5_0_1;
27-
28-
# Hlint is still broken
29-
hlint = doJailbreak (hself.callCabal2nix "hlint" inputs.hlint-34 { });
27+
fourmolu = hself.fourmolu_0_9_0_0;
28+
hlint = appendConfigureFlag (hself.callCabal2nix "hlint" inputs.hlint-341 {}) "-fghc-lib";
3029

3130
hls-hlint-plugin = hself.callCabal2nixWithOptions "hls-hlint-plugin"
3231
./plugins/hls-hlint-plugin
@@ -37,6 +36,10 @@ let
3736
hself.callCabal2nixWithOptions "haskell-language-server" ./.
3837
(pkgs.lib.concatStringsSep " " [ "-f-brittany" "-f-stylishhaskell" ])
3938
{ };
39+
40+
retrie = hself.retrie_1_1_0_0;
41+
apply-refact = hself.apply-refact_0_9_3_0;
42+
4043
});
4144
in {
4245
inherit disabledPlugins;

configuration-ghc-92.nix

+5-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
let
44
disabledPlugins = [
5-
"hls-hlint-plugin"
65
# That one is not technically a plugin, but by putting it in this list, we
76
# get it removed from the top level list of requirement and it is not pull
87
# in the nix shell.
@@ -24,15 +23,18 @@ let
2423
# https://github.com/nikita-volkov/ptr-poker/issues/11
2524
ptr-poker = hself.callCabal2nix "ptr-poker" inputs.ptr-poker { };
2625

27-
# Hlint is still broken
28-
hlint = doJailbreak (hself.callCabal2nix "hlint" inputs.hlint { });
26+
ghc-exactprint =
27+
hself.callCabal2nix "ghc-exactprint" inputs.ghc-exactprint-150 { };
28+
fourmolu = hself.fourmolu_0_9_0_0;
29+
hlint = appendConfigureFlag (hself.callCabal2nix "hlint" inputs.hlint-341 {}) "-fghc-lib";
2930

3031
stylish-haskell = appendConfigureFlag hsuper.stylish-haskell "-fghc-lib";
3132

3233
# Re-generate HLS drv excluding some plugins
3334
haskell-language-server =
3435
hself.callCabal2nixWithOptions "haskell-language-server" ./.
3536
(pkgs.lib.concatStringsSep " " [ "-fpedantic" "-f-hlint" ]) { };
37+
3638
});
3739
in {
3840
inherit disabledPlugins;

configuration-ghc-94.nix

+2-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
let
44
disabledPlugins = [
5-
"hls-hlint-plugin"
65
# That one is not technically a plugin, but by putting it in this list, we
76
# get it removed from the top level list of requirement and it is not pull
87
# in the nix shell.
@@ -26,15 +25,15 @@ let
2625

2726
ghc-exactprint =
2827
hself.callCabal2nix "ghc-exactprint" inputs.ghc-exactprint-160 { };
29-
# Hlint is still broken
30-
hlint = doJailbreak (hself.callCabal2nix "hlint" inputs.hlint { });
28+
hlint = hsuper.callCabal2nix "hlint" inputs.hlint-35 {};
3129

3230
stylish-haskell = appendConfigureFlag hsuper.stylish-haskell "-fghc-lib";
3331

3432
# Re-generate HLS drv excluding some plugins
3533
haskell-language-server =
3634
hself.callCabal2nixWithOptions "haskell-language-server" ./.
3735
(pkgs.lib.concatStringsSep " " [ "-fpedantic" "-f-hlint" ]) { };
36+
3837
});
3938
in {
4039
inherit disabledPlugins;

flake.lock

+137-20
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)