From 417b9cbbc1bac5ecc319e73b5d2fdb34cbfe2c5a Mon Sep 17 00:00:00 2001 From: Providence Salumu Date: Fri, 9 Jun 2023 01:00:48 -0400 Subject: [PATCH 1/3] update flakes, fix implicit-hie-cradle --- configuration-ghc-92.nix | 2 ++ configuration-ghc-96.nix | 10 +++++- flake.lock | 71 ++++++++++++++++++++++++++-------------- flake.nix | 16 +++++++-- 4 files changed, 71 insertions(+), 28 deletions(-) diff --git a/configuration-ghc-92.nix b/configuration-ghc-92.nix index dfc40d59cf..2bb0cb15e5 100644 --- a/configuration-ghc-92.nix +++ b/configuration-ghc-92.nix @@ -39,6 +39,8 @@ let hie-bios = hself.callCabal2nix "hie-bios" inputs.haskell-hie-bios { }; + implicit-hie-cradle = hself.callCabal2nix "implicit-hie-cradle" inputs.haskell-implicit-hie-cradle { }; + # Re-generate HLS drv excluding some plugins haskell-language-server = hself.callCabal2nixWithOptions "haskell-language-server" ./. diff --git a/configuration-ghc-96.nix b/configuration-ghc-96.nix index ee606bcb89..51f75f973f 100644 --- a/configuration-ghc-96.nix +++ b/configuration-ghc-96.nix @@ -35,6 +35,7 @@ let MonadRandom = hself.callHackage "MonadRandom" "0.6" { }; hiedb = hself.callCabal2nix "hiedb" inputs.haskell-hiedb { }; hie-bios = hself.callCabal2nix "hie-bios" inputs.haskell-hie-bios { }; + implicit-hie-cradle = hself.callCabal2nix "implicit-hie-cradle" inputs.haskell-implicit-hie-cradle { }; ghc-exactprint = hself.callCabal2nix "ghc-exactprint" inputs.haskell-ghc-exactprint { }; # ptr-poker breaks on MacOS without SSE2 optimizations @@ -42,7 +43,14 @@ let ptr-poker = hself.callCabal2nix "ptr-poker" inputs.ptr-poker { }; ormolu = hself.ormolu_0_5_3_0; - fourmolu = hself.callCabal2nix "fourmolu" inputs.fourmolu-012 { }; + + # TODO: smunix: nix fails to build fourmolu-0.13 from Hackage with these errors: + # tar: */fourmolu/0.13.0.0/fourmolu.json: Not found in archive + # tar: */fourmolu/0.13.0.0/fourmolu.cabal: Not found in archive + # tar: Exiting with failure status due to previous errors + # As an alternative, we could build directly from github:fourmolu. How do people + # feel about this? + fourmolu = hself.callHackage "fourmolu" "0.12.0.0" {}; stylish-haskell = appendConfigureFlag hsuper.stylish-haskell "-fghc-lib"; diff --git a/flake.lock b/flake.lock index effcb4756d..ccc291cb20 100644 --- a/flake.lock +++ b/flake.lock @@ -17,12 +17,15 @@ } }, "flake-utils": { + "inputs": { + "systems": "systems" + }, "locked": { - "lastModified": 1678901627, - "narHash": "sha256-U02riOqrKKzwjsxc/400XnElV+UtPUQWpANPlyazjH0=", + "lastModified": 1685518550, + "narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=", "owner": "numtide", "repo": "flake-utils", - "rev": "93a2b84fc4b70d9e089d029deacc3583435c2ed6", + "rev": "a1720a10a6cfe8234c0e93907ffe81be440f4cef", "type": "github" }, "original": { @@ -31,18 +34,6 @@ "type": "github" } }, - "fourmolu-012": { - "flake": false, - "locked": { - "narHash": "sha256-yru8ls67DMM6WSeVU6xDmmwa48I8S9CUv9NBaxSQ29M=", - "type": "tarball", - "url": "https://hackage.haskell.org/package/fourmolu-0.12.0.0/fourmolu-0.12.0.0.tar.gz" - }, - "original": { - "type": "tarball", - "url": "https://hackage.haskell.org/package/fourmolu-0.12.0.0/fourmolu-0.12.0.0.tar.gz" - } - }, "ghc-lib-parser-94": { "flake": false, "locked": { @@ -91,15 +82,15 @@ "haskell-hie-bios": { "flake": false, "locked": { - "lastModified": 1679040151, - "narHash": "sha256-1Y/9wCoR+nMvSrEr0EHnRBCkUuhqWPgPuukNM5zzRT8=", - "owner": "mpickering", + "lastModified": 1683794382, + "narHash": "sha256-GCf5yVZWphqyMiVvnrGUo5baUCcQz2oo3nL/ahTYVmc=", + "owner": "haskell", "repo": "hie-bios", - "rev": "af192d4116a382afa1721a6f8d77729f98993082", + "rev": "57db96016f0b9084e3fc530fd4a0708efc98a6a3", "type": "github" }, "original": { - "owner": "mpickering", + "owner": "haskell", "repo": "hie-bios", "type": "github" } @@ -120,6 +111,23 @@ "type": "github" } }, + "haskell-implicit-hie-cradle": { + "flake": false, + "locked": { + "lastModified": 1686408106, + "narHash": "sha256-OjU5XauKoaFwD1LSQ6AzWQi1zSsiBLLp955lN5t0ZEY=", + "owner": "smunix", + "repo": "implicit-hie-cradle", + "rev": "52e9dd9c5e8f4bbdfdfcf3f841df60b38e4e9456", + "type": "github" + }, + "original": { + "owner": "smunix", + "ref": "smunix-patch-hls-1", + "repo": "implicit-hie-cradle", + "type": "github" + } + }, "haskell-unix-compat": { "flake": false, "locked": { @@ -151,11 +159,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1680680186, - "narHash": "sha256-DqfuocQeQc4pk/ggLntlcf3AoGmnkCcjjL8geGUxv5I=", + "lastModified": 1686355959, + "narHash": "sha256-w+6cxJ3dmDAURDvIKec11Ht12vWk2nEznWZEYlcEor0=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "391e94a986322a002a084574ccf2fd73814872b1", + "rev": "35885ddb2374c090aa6d98ea97e469e269e27d60", "type": "github" }, "original": { @@ -193,12 +201,12 @@ "inputs": { "flake-compat": "flake-compat", "flake-utils": "flake-utils", - "fourmolu-012": "fourmolu-012", "ghc-lib-parser-94": "ghc-lib-parser-94", "gitignore": "gitignore", "haskell-ghc-exactprint": "haskell-ghc-exactprint", "haskell-hie-bios": "haskell-hie-bios", "haskell-hiedb": "haskell-hiedb", + "haskell-implicit-hie-cradle": "haskell-implicit-hie-cradle", "haskell-unix-compat": "haskell-unix-compat", "hlint-35": "hlint-35", "nixpkgs": "nixpkgs", @@ -218,6 +226,21 @@ "type": "tarball", "url": "https://hackage.haskell.org/package/stylish-haskell-0.14.4.0/stylish-haskell-0.14.4.0.tar.gz" } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index d9f89f70d7..e87a852e1a 100644 --- a/flake.nix +++ b/flake.nix @@ -51,7 +51,7 @@ }; haskell-hie-bios = { - url = "github:mpickering/hie-bios"; + url = "github:haskell/hie-bios"; flake = false; }; @@ -60,8 +60,18 @@ flake = false; }; - fourmolu-012 = { - url = "https://hackage.haskell.org/package/fourmolu-0.12.0.0/fourmolu-0.12.0.0.tar.gz"; + # smunix: github:haskell/hie-bios defines + # 'CabalType :: Maybe String -> Maybe FilePath -> CabalType' + # while the original githcom:Avi-D-coder/hie-bios still has this: + # 'CabalType :: Maybe String -> CabalType' + # We need a patched version of implicit-hie-cradle that works with hls, so I've created + # the repository below. Obviously, this is not sustainable as it adds more technical debt. + # We need a better strategy to streamline changes required by HLS from other hie-bios related + # packages. + # See details here: https://github.com/Avi-D-coder/implicit-hie-cradle/compare/master...smunix:implicit-hie-cradle:smunix-patch-hls-1?expand=1 + # + haskell-implicit-hie-cradle = { + url = "github:smunix/implicit-hie-cradle?ref=smunix-patch-hls-1"; flake = false; }; }; From 80c286a89d3b8b91cbbed46658967643eec7c1fb Mon Sep 17 00:00:00 2001 From: Providence Salumu Date: Sat, 10 Jun 2023 13:53:38 -0400 Subject: [PATCH 2/3] bump apply-refact, 0.12 -> 0.13 --- configuration-ghc-92.nix | 2 +- configuration-ghc-94.nix | 2 +- configuration-ghc-96.nix | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/configuration-ghc-92.nix b/configuration-ghc-92.nix index 2bb0cb15e5..77483ff1b9 100644 --- a/configuration-ghc-92.nix +++ b/configuration-ghc-92.nix @@ -19,7 +19,7 @@ let doCheck = false; }); } // (builtins.mapAttrs (_: drv: disableLibraryProfiling drv) { - apply-refact = hsuper.apply-refact_0_12_0_0; + apply-refact = hsuper.apply-refact_0_13_0_0; # ptr-poker breaks on MacOS without SSE2 optimizations # https://github.com/nikita-volkov/ptr-poker/issues/11 diff --git a/configuration-ghc-94.nix b/configuration-ghc-94.nix index 6f2547d581..2d183c9050 100644 --- a/configuration-ghc-94.nix +++ b/configuration-ghc-94.nix @@ -13,7 +13,7 @@ let { hlsDisabledPlugins = disabledPlugins; } // (builtins.mapAttrs (_: drv: disableLibraryProfiling drv) { - apply-refact = hsuper.apply-refact_0_12_0_0; + apply-refact = hsuper.apply-refact_0_13_0_0; stylish-haskell = appendConfigureFlag hsuper.stylish-haskell "-fghc-lib"; diff --git a/configuration-ghc-96.nix b/configuration-ghc-96.nix index 51f75f973f..4ddc27ac51 100644 --- a/configuration-ghc-96.nix +++ b/configuration-ghc-96.nix @@ -28,7 +28,7 @@ let broken = false; doCheck = false; }); - apply-refact = hsuper.apply-refact_0_12_0_0; + apply-refact = hsuper.apply-refact_0_13_0_0; tagged = hself.callHackage "tagged" "0.8.7" { }; primitive = hself.callHackage "primitive" "0.8.0.0" { }; unix-compat = hself.callCabal2nix "unix-compat" inputs.haskell-unix-compat { }; From c416692c316688655d0f0ada6277ea4b3aba7614 Mon Sep 17 00:00:00 2001 From: Providence Salumu Date: Sun, 11 Jun 2023 11:11:40 -0400 Subject: [PATCH 3/3] use 'implicit-hie-cradle-0.5.0.1' instead of '0.4.0.2' (there doesn't appear to be any functional changes) --- flake.lock | 8 ++++---- flake.nix | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/flake.lock b/flake.lock index ccc291cb20..df70e769ad 100644 --- a/flake.lock +++ b/flake.lock @@ -114,16 +114,16 @@ "haskell-implicit-hie-cradle": { "flake": false, "locked": { - "lastModified": 1686408106, - "narHash": "sha256-OjU5XauKoaFwD1LSQ6AzWQi1zSsiBLLp955lN5t0ZEY=", + "lastModified": 1686495518, + "narHash": "sha256-OAe+zOkMZuoTfVEMnxnCT1cmPgRF/riAR8nVdomnwxo=", "owner": "smunix", "repo": "implicit-hie-cradle", - "rev": "52e9dd9c5e8f4bbdfdfcf3f841df60b38e4e9456", + "rev": "d6aa00355898469af56cfd5e62f7fc8bd9959ded", "type": "github" }, "original": { "owner": "smunix", - "ref": "smunix-patch-hls-1", + "ref": "smunix-patch-hls-0.5-1", "repo": "implicit-hie-cradle", "type": "github" } diff --git a/flake.nix b/flake.nix index e87a852e1a..d6ecb14712 100644 --- a/flake.nix +++ b/flake.nix @@ -71,7 +71,7 @@ # See details here: https://github.com/Avi-D-coder/implicit-hie-cradle/compare/master...smunix:implicit-hie-cradle:smunix-patch-hls-1?expand=1 # haskell-implicit-hie-cradle = { - url = "github:smunix/implicit-hie-cradle?ref=smunix-patch-hls-1"; + url = "github:smunix/implicit-hie-cradle?ref=smunix-patch-hls-0.5-1"; flake = false; }; };