From 8fe4e5fc927dbd1a1a17e5ff726671fb51bb67d3 Mon Sep 17 00:00:00 2001 From: Jade Date: Sat, 4 Sep 2021 15:50:45 -0700 Subject: [PATCH 1/7] Update nix flake Doing a nixpkgs update gains ghc 8.10.6 support. lsp-types needed updating to satisfy bounds so I did that. --- flake.lock | 18 +++++++++--------- flake.nix | 28 ++++++++-------------------- 2 files changed, 17 insertions(+), 29 deletions(-) diff --git a/flake.lock b/flake.lock index e3939fd59d..31726920e4 100644 --- a/flake.lock +++ b/flake.lock @@ -3,11 +3,11 @@ "flake-compat": { "flake": false, "locked": { - "lastModified": 1627832136, - "narHash": "sha256-OUBMZeJ01AdzGjJ9ZkY5rh1bQircBoPoV2anXSE+luI=", + "lastModified": 1627913399, + "narHash": "sha256-hY8g6H2KFL8ownSiFeMOjwPC8P0ueXpCVEbxgda3pko=", "owner": "edolstra", "repo": "flake-compat", - "rev": "bef1b74164e238c530aec28335e761372dafe4c4", + "rev": "12c64ca55c1014cdc1b16ed5a804aa8576601ff2", "type": "github" }, "original": { @@ -18,11 +18,11 @@ }, "flake-utils": { "locked": { - "lastModified": 1623875721, - "narHash": "sha256-A8BU7bjS5GirpAUv4QA+QnJ4CceLHkcXdRp4xITDB0s=", + "lastModified": 1629481132, + "narHash": "sha256-JHgasjPR0/J1J3DRm4KxM4zTyAj4IOJY8vIl75v/kPI=", "owner": "numtide", "repo": "flake-utils", - "rev": "f7e004a55b120c02ecb6219596820fcd32ca8772", + "rev": "997f7efcb746a9c140ce1f13c72263189225f482", "type": "github" }, "original": { @@ -49,11 +49,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1627814220, - "narHash": "sha256-P+MDgdZw2CBk9X1ZZaUgHgN+32pTfLFf3XVIBOXirI4=", + "lastModified": 1630140382, + "narHash": "sha256-ntXepAHFlAEtaYIU5EzckRUODeeMgpu1u2Yug+4LFNc=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "ab5b6828af26215bf2646c31961da5d3749591ef", + "rev": "08ef0f28e3a41424b92ba1d203de64257a9fca6a", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index ca6559feba..c98e86de09 100644 --- a/flake.nix +++ b/flake.nix @@ -79,23 +79,13 @@ sha256 = "byehvdxQxhNk5ZQUXeFHjAZpAze4Ct9261ro4c5acZk="; }) { }; - lsp = hself.callCabal2nix "lsp" - (builtins.fetchTarball { - url = "https://hackage.haskell.org/package/lsp-1.2.0.1/lsp-1.2.0.1.tar.gz"; - sha256 = "1lhzsraiw11ldxvxn8ax11hswpyzsvw2da2qmp3p6fc9rfpz4pj5"; - }) { }; + lsp = hself.lsp_1_2_0_1; - lsp-types = hself.callCabal2nix "lsp-types" - (builtins.fetchTarball { - url = "https://hackage.haskell.org/package/lsp-types-1.3.0.0/lsp-types-1.3.0.0.tar.gz"; - sha256 = "0qajyyj2d51daa4y0pqaa87n4nny0i920ivvzfnrk9gq9386iac7"; - }) { }; + lsp-types = hself.lsp-types_1_3_0_1; - lsp-test = hself.callCabal2nix "lsp-test" - (builtins.fetchTarball { - url = "https://hackage.haskell.org/package/lsp-test-0.14.0.1/lsp-test-0.14.0.1.tar.gz"; - sha256 = "10lnyg7nlbd3ymgvjjlrkfndyy7ay9cwnsk684p08k2gzlric4yq"; - }) { }; + lsp-test = hself.lsp-test_0_14_0_1; + + ormolu = hself.ormolu_0_2_0_0; }; hlsSources = @@ -177,7 +167,7 @@ + pkgs.lib.replaceStrings [ "." ] [ "" ] pkgs.haskellPackages.ghc.version); ghc884 = pkgs.hlsHpkgs "ghc884"; - ghc8104 = pkgs.hlsHpkgs "ghc8104"; + ghc8106 = pkgs.hlsHpkgs "ghc8106"; ghc901 = ghc901Config.tweakHpkgs (pkgs.hlsHpkgs "ghc901"); # For markdown support @@ -252,15 +242,13 @@ # dev shell haskell-language-server-dev = mkDevShell ghcDefault; haskell-language-server-884-dev = mkDevShell ghc884; - haskell-language-server-8104-dev = mkDevShell ghc8104; - haskell-language-server-8105-dev = builtins.throw "GHC 8.10.5 is not available in nixpkgs"; + haskell-language-server-8106-dev = mkDevShell ghc8106; 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 = builtins.throw "GHC 8.10.5 is not available in nixpkgs"; + haskell-language-server-8106 = mkExe ghc8106; haskell-language-server-901 = mkExe ghc901; # docs From 7ec59eb8e72abc46911ac3b8c2018ccaebcc723d Mon Sep 17 00:00:00 2001 From: Jade Date: Sat, 4 Sep 2021 16:42:18 -0700 Subject: [PATCH 2/7] Add ghc-lib-parser override required for ormolu --- flake.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/flake.nix b/flake.nix index c98e86de09..609938ccb9 100644 --- a/flake.nix +++ b/flake.nix @@ -85,6 +85,8 @@ lsp-test = hself.lsp-test_0_14_0_1; + # required for ormolu 0.2.0.0 + ghc-lib-parser = hself.ghc-lib-parser_9_0_1_20210324; ormolu = hself.ormolu_0_2_0_0; }; From 659b84add243d593394188623db6c1d8eb47aa10 Mon Sep 17 00:00:00 2001 From: Jade Date: Sat, 4 Sep 2021 17:08:42 -0700 Subject: [PATCH 3/7] Put the override in the right spot, oopsie --- configuration-ghc-901.nix | 2 ++ flake.nix | 4 ---- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/configuration-ghc-901.nix b/configuration-ghc-901.nix index 7f3d38554c..36777ad92b 100644 --- a/configuration-ghc-901.nix +++ b/configuration-ghc-901.nix @@ -69,6 +69,8 @@ let ghc-lib-parser-ex = hself.ghc-lib-parser-ex_9_0_0_4; + ormolu = hself.ormolu_0_2_0_0; + operational = hself.callCabal2nix "operational" (pkgs.fetchFromGitHub { owner = "HeinrichApfelmus"; repo = "operational"; diff --git a/flake.nix b/flake.nix index 609938ccb9..f03cfe6c3f 100644 --- a/flake.nix +++ b/flake.nix @@ -84,10 +84,6 @@ lsp-types = hself.lsp-types_1_3_0_1; lsp-test = hself.lsp-test_0_14_0_1; - - # required for ormolu 0.2.0.0 - ghc-lib-parser = hself.ghc-lib-parser_9_0_1_20210324; - ormolu = hself.ormolu_0_2_0_0; }; hlsSources = From 5d8c7d8f66e4fa01288efbab4cbf2e89758c914f Mon Sep 17 00:00:00 2001 From: Jade Date: Sun, 5 Sep 2021 14:15:20 -0700 Subject: [PATCH 4/7] Pass --print-build-logs to nix commands --- .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 20a797dd2f..005506946d 100644 --- a/.github/workflows/nix.yml +++ b/.github/workflows/nix.yml @@ -57,8 +57,8 @@ jobs: skipPush: true - if: ${{ needs.pre_job.outputs.should_skip_develop != 'true' }} run: | - nix develop --command cabal update - nix develop --command cabal build + nix develop --print-build-logs --command cabal update + nix develop --print-build-logs --command cabal build # Build and then push HLS binaries with developmet shell to cachix # This job runs when @@ -91,16 +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 --print-build-logs --profile dev - name: Build development shell (GHC 9.0.1) - run: nix develop .#haskell-language-server-901-dev --profile dev + run: nix develop --print-build-logs .#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 --print-build-logs - name: Build binaries (GHC 9.0.1) - run: nix build .#haskell-language-server-901 + run: nix build --print-build-logs .#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 e453e4041631aebe60a4da9d26f8cdb4420b91a8 Mon Sep 17 00:00:00 2001 From: Jade Date: Sun, 5 Sep 2021 14:42:29 -0700 Subject: [PATCH 5/7] Fix tracy on darwin --- flake.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/flake.nix b/flake.nix index f03cfe6c3f..6a2b8b2fdf 100644 --- a/flake.nix +++ b/flake.nix @@ -103,6 +103,11 @@ in { inherit hlsSources; + # can remove once https://github.com/NixOS/nixpkgs/pull/136818 is merged + tracy = prev.tracy.overrideAttrs (old: { + NIX_CFLAGS_COMPILE = old.NIX_CFLAGS_COMPILE ++ lib.optional stdenv.isDarwin "-Wno-format-security"; + }); + # Haskell packages extended with our packages hlsHpkgs = compiler: extended haskell.packages.${compiler}; From 68c6134fbdf4f4502b11844096e34aaebb939c6d Mon Sep 17 00:00:00 2001 From: Jade Date: Sun, 5 Sep 2021 17:30:11 -0700 Subject: [PATCH 6/7] Remove the macOS hack since it got merged --- flake.lock | 6 +++--- flake.nix | 5 ----- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/flake.lock b/flake.lock index 31726920e4..ed2b424993 100644 --- a/flake.lock +++ b/flake.lock @@ -49,11 +49,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1630140382, - "narHash": "sha256-ntXepAHFlAEtaYIU5EzckRUODeeMgpu1u2Yug+4LFNc=", + "lastModified": 1630887066, + "narHash": "sha256-0ecIlrLsNIIa+zrNmzXXmbMBLZlmHU/aWFsa4bq99Hk=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "08ef0f28e3a41424b92ba1d203de64257a9fca6a", + "rev": "5e47a07e9f2d7ed999f2c7943b0896f5f7321ca3", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 6a2b8b2fdf..f03cfe6c3f 100644 --- a/flake.nix +++ b/flake.nix @@ -103,11 +103,6 @@ in { inherit hlsSources; - # can remove once https://github.com/NixOS/nixpkgs/pull/136818 is merged - tracy = prev.tracy.overrideAttrs (old: { - NIX_CFLAGS_COMPILE = old.NIX_CFLAGS_COMPILE ++ lib.optional stdenv.isDarwin "-Wno-format-security"; - }); - # Haskell packages extended with our packages hlsHpkgs = compiler: extended haskell.packages.${compiler}; From 1f80d7514199c3525cd6423eff0b68c3ff367f8e Mon Sep 17 00:00:00 2001 From: Jade Date: Sun, 5 Sep 2021 18:48:10 -0700 Subject: [PATCH 7/7] It appears this is actually ghc8107 by now --- flake.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.nix b/flake.nix index f03cfe6c3f..e7409c385a 100644 --- a/flake.nix +++ b/flake.nix @@ -165,7 +165,7 @@ + pkgs.lib.replaceStrings [ "." ] [ "" ] pkgs.haskellPackages.ghc.version); ghc884 = pkgs.hlsHpkgs "ghc884"; - ghc8106 = pkgs.hlsHpkgs "ghc8106"; + ghc8107 = pkgs.hlsHpkgs "ghc8107"; ghc901 = ghc901Config.tweakHpkgs (pkgs.hlsHpkgs "ghc901"); # For markdown support @@ -240,13 +240,13 @@ # dev shell haskell-language-server-dev = mkDevShell ghcDefault; haskell-language-server-884-dev = mkDevShell ghc884; - haskell-language-server-8106-dev = mkDevShell ghc8106; + haskell-language-server-8107-dev = mkDevShell ghc8107; haskell-language-server-901-dev = mkDevShell ghc901; # hls package haskell-language-server = mkExe ghcDefault; haskell-language-server-884 = mkExe ghc884; - haskell-language-server-8106 = mkExe ghc8106; + haskell-language-server-8107 = mkExe ghc8107; haskell-language-server-901 = mkExe ghc901; # docs