From 8df94c31e207953be36c8c447f5079d4b721c5b6 Mon Sep 17 00:00:00 2001 From: Potato Hatsue <1793913507@qq.com> Date: Fri, 2 Jul 2021 10:16:54 +0800 Subject: [PATCH 01/16] nix: add support for ghc 9.0.1 --- configuration-ghc-901.nix | 103 ++++++++++++++++++++++++++++++++++++++ flake.nix | 58 ++++++++++++--------- 2 files changed, 136 insertions(+), 25 deletions(-) create mode 100644 configuration-ghc-901.nix diff --git a/configuration-ghc-901.nix b/configuration-ghc-901.nix new file mode 100644 index 0000000000..5c702afbad --- /dev/null +++ b/configuration-ghc-901.nix @@ -0,0 +1,103 @@ +# nix version of cabal-ghc901.project +{ pkgs }: + +let + removePluginPackages = hpkgs: + removeAttrs hpkgs [ + "hls-tactics-plugin" + "hls-brittany-plugin" + "hls-stylish-haskell-plugin" + "hls-fourmolu-plugin" + "hls-splice-plugin" + "hls-ormolu-plugin" + ]; + hpkgsOverride = hself: hsuper: + with pkgs.haskell.lib; + let + lsp-src = pkgs.fetchFromGitHub { + owner = "anka-213"; + repo = "lsp"; + rev = "tag-ghc-9.0.1-without-pr-326"; + sha256 = "lW/EdBnvKPLE2+CGE/grIekOu+U/Wh6zMCN4xhJDtPY="; + }; + + dependent-sum-src = pkgs.fetchFromGitHub { + owner = "anka-213"; + repo = "dependent-sum"; + rev = "8cf4c7fbc3bfa2be475a17bb7c94a1e1e9a830b5"; + sha256 = "WtxTB6ufTZC6SxOtGSfhlO4mY0y9eWejMSa0yUJ7dHQ="; + }; + hlint_3_3_1-src = builtins.fetchTarball { + url = + "https://hackage.haskell.org/package/hlint-3.3.1/hlint-3.3.1.tar.gz"; + sha256 = "03vb4s4w8k5vp5cjzg7m2bsinbjz1j2aqx4q06syq4r5vb3ai5yq"; + }; + in { + blaze-textual = hself.callCabal2nix "blaze-textual" + (pkgs.fetchFromGitHub { + owner = "jwaldmann"; + repo = "blaze-textual"; + rev = "d8ee6cf80e27f9619d621c936bb4bda4b99a183f"; + sha256 = "C0dIzf64fBaY8mlhMm1kCQC5Jc1wKBtNO2Y24k7YPUw="; + }) { }; + + czipwith = hself.callCabal2nix "czipwith" (pkgs.fetchFromGitHub { + owner = "mithrandi"; + repo = "czipwith"; + rev = "b6245884ae83e00dd2b5261762549b37390179f8"; + sha256 = "2uSoGyrxT/OstRcpx55kwP4JwjPbWLxD72LajeyQV0E="; + }) { }; + + hie-bios = hself.callCabal2nix "hie-bios" (pkgs.fetchFromGitHub { + owner = "jneira"; + repo = "hie-bios"; + rev = "9b1445ab5efcabfad54043fc9b8e50e9d8c5bbf3"; + sha256 = "8ct7t3xIxIAoC+f8VO5e5+QKrd5L5Zu1eButSaE+1Uk="; + }) { }; + + ghc-api-compat = hself.callCabal2nix "ghc-api-compat" + (pkgs.fetchFromGitHub { + owner = "hsyl20"; + repo = "ghc-api-compat"; + rev = "8fee87eac97a538dbe81ff1ab18cff10f2f9fa15"; + sha256 = "byehvdxQxhNk5ZQUXeFHjAZpAze4Ct9261ro4c5acZk="; + }) { }; + + th-extras = hself.callCabal2nix "th-extras" (pkgs.fetchFromGitHub { + owner = "anka-213"; + repo = "th-extras"; + rev = "57a97b4df128eb7b360e8ab9c5759392de8d1659"; + sha256 = "Qtha1ge/C0L+uFcV2dZ5xpG59DCxQT7LuK/OYfiM4Pk="; + }) { }; + + lsp = hself.callCabal2nix "lsp" "${lsp-src}/lsp" { }; + lsp-types = hself.callCabal2nix "lsp-types" "${lsp-src}/lsp-types" { }; + lsp-test = hself.callCabal2nix "lsp-test" "${lsp-src}/lsp-test" { }; + + dependent-sum = + hself.callCabal2nix "dependent-sum" "${dependent-sum-src}/dependent-sum" + { }; + + # Copied from https://github.com/NixOS/nixpkgs/blob/2e672ed71afb9d0cea962b694ddb4e63a9ee00eb/pkgs/development/haskell-modules/configuration-ghc-9.0.x.nix#L109 + hlint = (hself.callCabal2nix "hlint" hlint_3_3_1-src { }).overrideScope + (self: super: { + ghc-lib-parser = overrideCabal self.ghc-lib-parser_9_0_1_20210324 { + doHaddock = false; + }; + ghc-lib-parser-ex = self.ghc-lib-parser-ex_9_0_0_4; + }); + + # Disable plugins + haskell-language-server = + appendConfigureFlags hsuper.haskell-language-server [ + "-brittany" + "-eval" + "-fourmolu" + "-ormolu" + "-splice" + "-stylishhaskell" + "-tactic" + "-refineImports" + ]; + }; +in { tweakHpkgs = hpkgs: (removePluginPackages hpkgs).extend hpkgsOverride; } diff --git a/flake.nix b/flake.nix index 1a3c5d3f47..7cbdc599db 100644 --- a/flake.nix +++ b/flake.nix @@ -30,24 +30,22 @@ overlay = final: prev: with prev; let - haskellOverrides = { - overrides = hself: hsuper: { - # we override mkDerivation here to apply the following - # tweak to each haskell package: - # if the package is broken, then we disable its check and relax the cabal bounds; - # otherwise, we leave it unchanged. - # hopefully, this could fix packages marked as broken by nix due to check failures - # or the build failure because of tight cabal bounds - mkDerivation = args: - let - broken = args.broken or false; - check = args.doCheck or true; - jailbreak = args.jailbreak or false; - in hsuper.mkDerivation (args // { - jailbreak = if broken then true else jailbreak; - doCheck = if broken then false else check; - }); - }; + haskellOverrides = hself: hsuper: { + # we override mkDerivation here to apply the following + # tweak to each haskell package: + # if the package is broken, then we disable its check and relax the cabal bounds; + # otherwise, we leave it unchanged. + # hopefully, this could fix packages marked as broken by nix due to check failures + # or the build failure because of tight cabal bounds + mkDerivation = args: + let + broken = args.broken or false; + check = args.doCheck or true; + jailbreak = args.jailbreak or false; + in hsuper.mkDerivation (args // { + jailbreak = if broken then true else jailbreak; + doCheck = if broken then false else check; + }); }; gitignoreSource = (import gitignore { inherit lib; }).gitignoreSource; @@ -91,7 +89,10 @@ builtins.mapAttrs (_: dir: gitignoreSource dir) sourceDirs; extended = hpkgs: - (hpkgs.override haskellOverrides).extend (hself: hsuper: + (hpkgs.override (old: { + overrides = lib.composeExtensions (old.overrides or (_: _: { })) + haskellOverrides; + })).extend (hself: hsuper: # disable all checks for our packages builtins.mapAttrs (_: drv: haskell.lib.dontCheck drv) (lib.composeExtensions @@ -135,7 +136,7 @@ hooks = { stylish-haskell.enable = true; # use stylish-haskell with our target ghc - stylish-haskell.entry = "${hpkgs.stylish-haskell}/bin/stylish-haskell --inplace"; + stylish-haskell.entry = pkgs.lib.mkForce "${hpkgs.stylish-haskell}/bin/stylish-haskell --inplace"; stylish-haskell.excludes = [ # Ignored files "^Setup.hs$" @@ -156,6 +157,8 @@ }; }; + ghc901Config = (import ./configuration-ghc-901.nix) { inherit pkgs; }; + # GHC versions ghcDefault = pkgs.hlsHpkgs ("ghc" + pkgs.lib.replaceStrings [ "." ] [ "" ] @@ -163,7 +166,7 @@ ghc884 = pkgs.hlsHpkgs "ghc884"; ghc8104 = pkgs.hlsHpkgs "ghc8104"; ghc8105 = pkgs.hlsHpkgs "ghc8105"; - ghc901 = pkgs.hlsHpkgs "ghc901"; + ghc901 = ghc901Config.tweakHpkgs (pkgs.hlsHpkgs "ghc901"); # Create a development shell of hls project # See https://github.com/NixOS/nixpkgs/blob/5d4a430472cafada97888cc80672fab255231f57/pkgs/development/haskell-modules/make-package-set.nix#L319 @@ -172,8 +175,13 @@ hpkgs.shellFor { doBenchmark = true; packages = p: - with builtins; - map (name: p.${name}) (attrNames hlsSources); + with lib; + # we can remove sources attrs from hpkgs to exclude HLS plugins, + # so hpkgs may not be the superset of hlsSources + pipe (attrNames hlsSources) [ + (xs: map (name: p.${name} or null) xs) + (xs: remove null xs) + ]; buildInputs = [ gmp zlib ncurses capstone tracy (gen-hls-changelogs hpkgs) ] ++ (with hpkgs; [ cabal-install @@ -213,14 +221,14 @@ haskell-language-server-884-dev = mkDevShell ghc884; haskell-language-server-8104-dev = mkDevShell ghc8104; haskell-language-server-8105-dev = mkDevShell ghc8105; - haskell-language-server-901-dev = builtins.throw "Nix expression for developing HLS in GHC 9.0.1 is not yet available"; # mkDevShell ghc901; + haskell-language-server-901-dev = mkDevShell ghc901; # hls package haskell-language-server = mkExe ghcDefault; haskell-language-server-884 = mkExe ghc884; haskell-language-server-8104 = mkExe ghc8104; haskell-language-server-8105 = mkExe ghc8105; - haskell-language-server-901 = builtins.throw "Nix expression for building HLS in GHC 9.0.1 is not yet available"; # mkExe ghc901; + haskell-language-server-901 = mkExe ghc901; }; defaultPackage = packages.haskell-language-server; From c9f963d2a3e286939a49821f862b43e671e6952c Mon Sep 17 00:00:00 2001 From: Potato Hatsue <1793913507@qq.com> Date: Fri, 2 Jul 2021 10:31:30 +0800 Subject: [PATCH 02/16] Add CI --- .github/workflows/nix.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/nix.yml b/.github/workflows/nix.yml index 3bc009c411..f562f0f35b 100644 --- a/.github/workflows/nix.yml +++ b/.github/workflows/nix.yml @@ -91,12 +91,16 @@ jobs: name: haskell-language-server authToken: ${{ secrets.HLS_CACHIX_AUTH_TOKEN }} - name: Build development shell - run: nix develop --profile dev + run: | + nix develop --profile dev + nix develop .#haskell-language-server-901-dev --profile dev - name: Push development shell if: ${{ env.HAS_TOKEN == 'true' }} run: cachix push haskell-language-server dev - name: Build binaries - run: nix build + run: | + nix build + nix build .#haskell-language-server-901 - name: Push binaries if: ${{ env.HAS_TOKEN == 'true' }} run: nix path-info --json | jq -r '.[].path' | cachix push haskell-language-server From 978f060dc3cc20a9056f5d0c5567f37db08ef559 Mon Sep 17 00:00:00 2001 From: Potato Hatsue <1793913507@qq.com> Date: Fri, 2 Jul 2021 17:27:46 +0800 Subject: [PATCH 03/16] Don't use overrideScope --- configuration-ghc-901.nix | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/configuration-ghc-901.nix b/configuration-ghc-901.nix index 5c702afbad..6a8ca1306a 100644 --- a/configuration-ghc-901.nix +++ b/configuration-ghc-901.nix @@ -78,14 +78,11 @@ let hself.callCabal2nix "dependent-sum" "${dependent-sum-src}/dependent-sum" { }; - # Copied from https://github.com/NixOS/nixpkgs/blob/2e672ed71afb9d0cea962b694ddb4e63a9ee00eb/pkgs/development/haskell-modules/configuration-ghc-9.0.x.nix#L109 - hlint = (hself.callCabal2nix "hlint" hlint_3_3_1-src { }).overrideScope - (self: super: { - ghc-lib-parser = overrideCabal self.ghc-lib-parser_9_0_1_20210324 { - doHaddock = false; - }; - ghc-lib-parser-ex = self.ghc-lib-parser-ex_9_0_0_4; - }); + hlint = hself.callCabal2nix "hlint" hlint_3_3_1-src { }; + + ghc-lib-parser = hself.ghc-lib-parser_9_0_1_20210324; + + ghc-lib-parser-ex = hself.ghc-lib-parser-ex_9_0_0_4; # Disable plugins haskell-language-server = From 2126a1571ad21228d6db8aab79cada901ff14388 Mon Sep 17 00:00:00 2001 From: Potato Hatsue <1793913507@qq.com> Date: Fri, 2 Jul 2021 18:38:44 +0800 Subject: [PATCH 04/16] Try to disable plugins properly --- configuration-ghc-901.nix | 25 +++++++++++++------------ flake.nix | 2 +- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/configuration-ghc-901.nix b/configuration-ghc-901.nix index 6a8ca1306a..91d4bf003c 100644 --- a/configuration-ghc-901.nix +++ b/configuration-ghc-901.nix @@ -10,6 +10,7 @@ let "hls-fourmolu-plugin" "hls-splice-plugin" "hls-ormolu-plugin" + "hls-eval-plugin" ]; hpkgsOverride = hself: hsuper: with pkgs.haskell.lib; @@ -84,17 +85,17 @@ let ghc-lib-parser-ex = hself.ghc-lib-parser-ex_9_0_0_4; - # Disable plugins + # Re-generate HLS drv excluding some plugins haskell-language-server = - appendConfigureFlags hsuper.haskell-language-server [ - "-brittany" - "-eval" - "-fourmolu" - "-ormolu" - "-splice" - "-stylishhaskell" - "-tactic" - "-refineImports" - ]; + hself.callCabal2nixWithOptions "haskell-language-server" ./. + (pkgs.lib.concatStringsSep " " [ + "-f-brittany" + "-f-eval" + "-f-fourmolu" + "-f-ormolu" + "-f-splice" + "-f-stylishhaskell" + "-f-tactic" + ]) { }; }; -in { tweakHpkgs = hpkgs: (removePluginPackages hpkgs).extend hpkgsOverride; } +in { tweakHpkgs = hpkgs: removePluginPackages (hpkgs.extend hpkgsOverride); } diff --git a/flake.nix b/flake.nix index 7cbdc599db..d478984adf 100644 --- a/flake.nix +++ b/flake.nix @@ -179,7 +179,7 @@ # we can remove sources attrs from hpkgs to exclude HLS plugins, # so hpkgs may not be the superset of hlsSources pipe (attrNames hlsSources) [ - (xs: map (name: p.${name} or null) xs) + (xs: map (name: if hpkgs ? name then p.${name} else null) xs) (xs: remove null xs) ]; buildInputs = [ gmp zlib ncurses capstone tracy (gen-hls-changelogs hpkgs) ] From 66362b5f2b151519f0ac00f4d2520ce7a4f51e84 Mon Sep 17 00:00:00 2001 From: Potato Hatsue <1793913507@qq.com> Date: Fri, 2 Jul 2021 20:26:28 +0800 Subject: [PATCH 05/16] Avoid removing attrs of hpkgs --- configuration-ghc-901.nix | 25 ++++++++++++++----------- flake.nix | 13 ++++++------- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/configuration-ghc-901.nix b/configuration-ghc-901.nix index 91d4bf003c..4f0553e4ff 100644 --- a/configuration-ghc-901.nix +++ b/configuration-ghc-901.nix @@ -2,16 +2,16 @@ { pkgs }: let - removePluginPackages = hpkgs: - removeAttrs hpkgs [ - "hls-tactics-plugin" - "hls-brittany-plugin" - "hls-stylish-haskell-plugin" - "hls-fourmolu-plugin" - "hls-splice-plugin" - "hls-ormolu-plugin" - "hls-eval-plugin" - ]; + disabledPlugins = [ + "hls-tactics-plugin" + "hls-brittany-plugin" + "hls-stylish-haskell-plugin" + "hls-fourmolu-plugin" + "hls-splice-plugin" + "hls-ormolu-plugin" + "hls-eval-plugin" + ]; + hpkgsOverride = hself: hsuper: with pkgs.haskell.lib; let @@ -98,4 +98,7 @@ let "-f-tactic" ]) { }; }; -in { tweakHpkgs = hpkgs: removePluginPackages (hpkgs.extend hpkgsOverride); } +in { + inherit disabledPlugins; + tweakHpkgs = hpkgs: hpkgs.extend hpkgsOverride; +} diff --git a/flake.nix b/flake.nix index d478984adf..cec5d24e52 100644 --- a/flake.nix +++ b/flake.nix @@ -175,13 +175,12 @@ hpkgs.shellFor { doBenchmark = true; packages = p: - with lib; - # we can remove sources attrs from hpkgs to exclude HLS plugins, - # so hpkgs may not be the superset of hlsSources - pipe (attrNames hlsSources) [ - (xs: map (name: if hpkgs ? name then p.${name} else null) xs) - (xs: remove null xs) - ]; + with builtins; + map (name: p.${name}) (attrNames + (if hpkgs.ghc.version == "9.0.1" then + removeAttrs hlsSources ghc901Config.disabledPlugins + else + hlsSources)); buildInputs = [ gmp zlib ncurses capstone tracy (gen-hls-changelogs hpkgs) ] ++ (with hpkgs; [ cabal-install From 0842b30424fa1e8ea42738b44180b484897ee0b2 Mon Sep 17 00:00:00 2001 From: Potato Hatsue <1793913507@qq.com> Date: Fri, 2 Jul 2021 20:28:33 +0800 Subject: [PATCH 06/16] Split CI steps --- .github/workflows/nix.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/nix.yml b/.github/workflows/nix.yml index f562f0f35b..f48b8c2d9c 100644 --- a/.github/workflows/nix.yml +++ b/.github/workflows/nix.yml @@ -91,16 +91,16 @@ jobs: name: haskell-language-server authToken: ${{ secrets.HLS_CACHIX_AUTH_TOKEN }} - name: Build development shell - run: | - nix develop --profile dev - nix develop .#haskell-language-server-901-dev --profile dev + run: nix develop --profile dev + - name: Build development shell (GHC 9.0.1) + run: nix develop .#haskell-language-server-901-dev --profile dev - name: Push development shell if: ${{ env.HAS_TOKEN == 'true' }} run: cachix push haskell-language-server dev - name: Build binaries - run: | - nix build - nix build .#haskell-language-server-901 + run: nix build + - name: Build binaries (GHC 9.0.1) + run: nix build .#haskell-language-server-901 - name: Push binaries if: ${{ env.HAS_TOKEN == 'true' }} run: nix path-info --json | jq -r '.[].path' | cachix push haskell-language-server From f0cb7558b74e090fa9cb53d5d02c3fe62327ab8e Mon Sep 17 00:00:00 2001 From: Potato Hatsue <1793913507@qq.com> Date: Fri, 2 Jul 2021 21:08:22 +0800 Subject: [PATCH 07/16] Jailbreak all ghc901 packages --- configuration-ghc-901.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/configuration-ghc-901.nix b/configuration-ghc-901.nix index 4f0553e4ff..dc04e6f3cf 100644 --- a/configuration-ghc-901.nix +++ b/configuration-ghc-901.nix @@ -97,6 +97,9 @@ let "-f-stylishhaskell" "-f-tactic" ]) { }; + + # YOLO + mkDerivation = args: hsuper.mkDerivation (args // { jailbreak = true; }); }; in { inherit disabledPlugins; From 6d5b50b68cb7b7e6cfca06a913eab49b26b2cba4 Mon Sep 17 00:00:00 2001 From: Potato Hatsue <1793913507@qq.com> Date: Fri, 2 Jul 2021 22:19:11 +0800 Subject: [PATCH 08/16] Override `operational` --- cabal-ghc901.project | 7 +++++++ configuration-ghc-901.nix | 10 +++++++++- stack-9.0.1.yaml | 5 +++++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/cabal-ghc901.project b/cabal-ghc901.project index c6242f007a..942cfe7691 100644 --- a/cabal-ghc901.project +++ b/cabal-ghc901.project @@ -75,6 +75,13 @@ source-repository-package subdir: lsp-test -- https://github.com/haskell/lsp/pull/312 +-- benchmark dependency +source-repository-package + type: git + location: https://github.com/berberman/operational + tag: 0e062895678f49fd673ae493371262cfb8c5ab56 +-- https://github.com/HeinrichApfelmus/operational/pull/26 + write-ghc-environment-files: never index-state: 2021-06-30T16:00:00Z diff --git a/configuration-ghc-901.nix b/configuration-ghc-901.nix index dc04e6f3cf..a036c63117 100644 --- a/configuration-ghc-901.nix +++ b/configuration-ghc-901.nix @@ -79,12 +79,20 @@ let hself.callCabal2nix "dependent-sum" "${dependent-sum-src}/dependent-sum" { }; - hlint = hself.callCabal2nix "hlint" hlint_3_3_1-src { }; + hlint = hself.hlint_3_3_1; ghc-lib-parser = hself.ghc-lib-parser_9_0_1_20210324; ghc-lib-parser-ex = hself.ghc-lib-parser-ex_9_0_0_4; + operational = hself.callCabal2nix "operational" + (pkgs.fetchFromGitHub { + owner = "berberman"; + repo = "operational"; + rev = "0e062895678f49fd673ae493371262cfb8c5ab56"; + sha256 = "P+aocEcqCN8klnW3IMrmIqq6ztBZJxk4sBp1ewN6YaA="; + }) { }; + # Re-generate HLS drv excluding some plugins haskell-language-server = hself.callCabal2nixWithOptions "haskell-language-server" ./. diff --git a/stack-9.0.1.yaml b/stack-9.0.1.yaml index c335fa7947..a38c400ef6 100644 --- a/stack-9.0.1.yaml +++ b/stack-9.0.1.yaml @@ -94,6 +94,11 @@ extra-deps: commit: ca23431a8dfa013992f9164ccc882a3277361f17 # https://github.com/diagrams/active/pull/36 +# benchmark dependency +- github: berberman/operational + commit: 0e062895678f49fd673ae493371262cfb8c5ab56 +# https://github.com/HeinrichApfelmus/operational/pull/26 + configure-options: ghcide: - --disable-library-for-ghci From 75aaae02adcdc6070a15543fdbb999080e843ddb Mon Sep 17 00:00:00 2001 From: Potato Hatsue <1793913507@qq.com> Date: Sat, 3 Jul 2021 10:03:36 +0800 Subject: [PATCH 09/16] Disable the test of `dual-tree` --- configuration-ghc-901.nix | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/configuration-ghc-901.nix b/configuration-ghc-901.nix index a036c63117..b2cca4a2b4 100644 --- a/configuration-ghc-901.nix +++ b/configuration-ghc-901.nix @@ -28,11 +28,6 @@ let rev = "8cf4c7fbc3bfa2be475a17bb7c94a1e1e9a830b5"; sha256 = "WtxTB6ufTZC6SxOtGSfhlO4mY0y9eWejMSa0yUJ7dHQ="; }; - hlint_3_3_1-src = builtins.fetchTarball { - url = - "https://hackage.haskell.org/package/hlint-3.3.1/hlint-3.3.1.tar.gz"; - sha256 = "03vb4s4w8k5vp5cjzg7m2bsinbjz1j2aqx4q06syq4r5vb3ai5yq"; - }; in { blaze-textual = hself.callCabal2nix "blaze-textual" (pkgs.fetchFromGitHub { @@ -85,13 +80,15 @@ let ghc-lib-parser-ex = hself.ghc-lib-parser-ex_9_0_0_4; - operational = hself.callCabal2nix "operational" - (pkgs.fetchFromGitHub { - owner = "berberman"; - repo = "operational"; - rev = "0e062895678f49fd673ae493371262cfb8c5ab56"; - sha256 = "P+aocEcqCN8klnW3IMrmIqq6ztBZJxk4sBp1ewN6YaA="; - }) { }; + operational = hself.callCabal2nix "operational" (pkgs.fetchFromGitHub { + owner = "berberman"; + repo = "operational"; + rev = "0e062895678f49fd673ae493371262cfb8c5ab56"; + sha256 = "P+aocEcqCN8klnW3IMrmIqq6ztBZJxk4sBp1ewN6YaA="; + }) { }; + + # needs https://github.com/JonasDuregard/sized-functors/pull/9 + dual-tree = dontCheck hsuper.dual-tree; # Re-generate HLS drv excluding some plugins haskell-language-server = From 8e6e1ef764989a78f5442360dbcbf3d0f3d63ec9 Mon Sep 17 00:00:00 2001 From: Potato Hatsue <1793913507@qq.com> Date: Sat, 3 Jul 2021 12:06:23 +0800 Subject: [PATCH 10/16] Override `dependent-sum-template` --- configuration-ghc-901.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/configuration-ghc-901.nix b/configuration-ghc-901.nix index b2cca4a2b4..4f3343d4df 100644 --- a/configuration-ghc-901.nix +++ b/configuration-ghc-901.nix @@ -74,6 +74,9 @@ let hself.callCabal2nix "dependent-sum" "${dependent-sum-src}/dependent-sum" { }; + dependent-sum-template = hself.callCabal2nix "dependent-sum-template" + "${dependent-sum-src}/dependent-sum-template" { }; + hlint = hself.hlint_3_3_1; ghc-lib-parser = hself.ghc-lib-parser_9_0_1_20210324; From 06387afdfc844ac6b35a0023ad110b952cff883b Mon Sep 17 00:00:00 2001 From: Potato Hatsue <1793913507@qq.com> Date: Sat, 3 Jul 2021 14:01:25 +0800 Subject: [PATCH 11/16] Disable tests for every ghc901 package --- configuration-ghc-901.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/configuration-ghc-901.nix b/configuration-ghc-901.nix index 4f3343d4df..3d7cf2e753 100644 --- a/configuration-ghc-901.nix +++ b/configuration-ghc-901.nix @@ -107,7 +107,11 @@ let ]) { }; # YOLO - mkDerivation = args: hsuper.mkDerivation (args // { jailbreak = true; }); + mkDerivation = args: + hsuper.mkDerivation (args // { + jailbreak = true; + doCheck = false; + }); }; in { inherit disabledPlugins; From 05c9a8cdd8b0838df1bbf62a082da605a1d28380 Mon Sep 17 00:00:00 2001 From: Potato Hatsue <1793913507@qq.com> Date: Sat, 3 Jul 2021 15:10:11 +0800 Subject: [PATCH 12/16] Remove formatters executables from dev shell --- configuration-ghc-901.nix | 3 --- flake.nix | 4 ++-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/configuration-ghc-901.nix b/configuration-ghc-901.nix index 3d7cf2e753..70dbd22f49 100644 --- a/configuration-ghc-901.nix +++ b/configuration-ghc-901.nix @@ -90,9 +90,6 @@ let sha256 = "P+aocEcqCN8klnW3IMrmIqq6ztBZJxk4sBp1ewN6YaA="; }) { }; - # needs https://github.com/JonasDuregard/sized-functors/pull/9 - dual-tree = dontCheck hsuper.dual-tree; - # Re-generate HLS drv excluding some plugins haskell-language-server = hself.callCabal2nixWithOptions "haskell-language-server" ./. diff --git a/flake.nix b/flake.nix index cec5d24e52..293ebff11d 100644 --- a/flake.nix +++ b/flake.nix @@ -185,8 +185,8 @@ ++ (with hpkgs; [ cabal-install hlint - ormolu - stylish-haskell + # ormolu + # stylish-haskell opentelemetry-extra ]); From 53f3ad52a6b813493cf3e84b144548683897fffc Mon Sep 17 00:00:00 2001 From: Potato Hatsue <1793913507@qq.com> Date: Sat, 3 Jul 2021 15:54:25 +0800 Subject: [PATCH 13/16] Disable pre-commit check for ghc901 --- flake.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index 293ebff11d..ea8cdc3c65 100644 --- a/flake.nix +++ b/flake.nix @@ -195,7 +195,7 @@ export LD_LIBRARY_PATH=${gmp}/lib:${zlib}/lib:${ncurses}/lib:${capstone}/lib export DYLD_LIBRARY_PATH=${gmp}/lib:${zlib}/lib:${ncurses}/lib:${capstone}/lib export PATH=$PATH:$HOME/.local/bin - ${(pre-commit-check hpkgs).shellHook} + ${if hpkgs.ghc.version != "9.0.1" then (pre-commit-check hpkgs).shellHook else ""} ''; }; # Create a hls executable From 2962a7a8bd74780addebfc03b6dbaef5bce1f4bc Mon Sep 17 00:00:00 2001 From: Potato Hatsue <1793913507@qq.com> Date: Sat, 3 Jul 2021 16:49:43 +0800 Subject: [PATCH 14/16] Override `diagrams` packages --- configuration-ghc-901.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/configuration-ghc-901.nix b/configuration-ghc-901.nix index 70dbd22f49..4c3aa0405b 100644 --- a/configuration-ghc-901.nix +++ b/configuration-ghc-901.nix @@ -90,6 +90,12 @@ let sha256 = "P+aocEcqCN8klnW3IMrmIqq6ztBZJxk4sBp1ewN6YaA="; }) { }; + diagrams-core = hself.diagrams-core_1_5_0; + + diagrams-lib = hself.diagrams-lib_1_4_4; + + dual-tree = hself.dual-tree_0_2_3_0; + # Re-generate HLS drv excluding some plugins haskell-language-server = hself.callCabal2nixWithOptions "haskell-language-server" ./. From d7c706881a17b816fb5e9a32fc840937059a53a2 Mon Sep 17 00:00:00 2001 From: Potato Hatsue <1793913507@qq.com> Date: Sat, 3 Jul 2021 18:12:58 +0800 Subject: [PATCH 15/16] Override `monoid-extras` --- configuration-ghc-901.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configuration-ghc-901.nix b/configuration-ghc-901.nix index 4c3aa0405b..01abe14a56 100644 --- a/configuration-ghc-901.nix +++ b/configuration-ghc-901.nix @@ -96,6 +96,8 @@ let dual-tree = hself.dual-tree_0_2_3_0; + monoid-extras = hself.monoid-extras_0_6; + # Re-generate HLS drv excluding some plugins haskell-language-server = hself.callCabal2nixWithOptions "haskell-language-server" ./. From 874f22bfd917409d36d026e8b9a579d3622ad05e Mon Sep 17 00:00:00 2001 From: Potato Hatsue <1793913507@qq.com> Date: Sat, 3 Jul 2021 18:19:46 +0800 Subject: [PATCH 16/16] Disable class plugin and refineImports plugin (consistent with cabal-ghc901.project) --- configuration-ghc-901.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/configuration-ghc-901.nix b/configuration-ghc-901.nix index 01abe14a56..9c74864608 100644 --- a/configuration-ghc-901.nix +++ b/configuration-ghc-901.nix @@ -10,6 +10,8 @@ let "hls-splice-plugin" "hls-ormolu-plugin" "hls-eval-plugin" + "hls-class-plugin" + "hls-refine-imports-plugin" ]; hpkgsOverride = hself: hsuper: @@ -103,12 +105,14 @@ let hself.callCabal2nixWithOptions "haskell-language-server" ./. (pkgs.lib.concatStringsSep " " [ "-f-brittany" + "-f-class" "-f-eval" "-f-fourmolu" "-f-ormolu" "-f-splice" "-f-stylishhaskell" "-f-tactic" + "-f-refineImports" ]) { }; # YOLO