From 5d1195fea4ca19e00e6542079213c49fdd58852a Mon Sep 17 00:00:00 2001 From: cydparser Date: Wed, 19 Jul 2023 19:58:09 -0700 Subject: [PATCH] Fix Nix builds --- .github/workflows/nix.yml | 4 ++ configuration-ghc-90.nix | 8 +-- configuration-ghc-92.nix | 12 ++--- configuration-ghc-94.nix | 4 +- configuration-ghc-96.nix | 28 ++++------ flake.lock | 105 ++++++++++++++------------------------ flake.nix | 47 +++++++---------- 7 files changed, 79 insertions(+), 129 deletions(-) diff --git a/.github/workflows/nix.yml b/.github/workflows/nix.yml index 0e6d2fe84a..55edf99dc7 100644 --- a/.github/workflows/nix.yml +++ b/.github/workflows/nix.yml @@ -103,6 +103,10 @@ jobs: # We only build nix dev shell for current GHC version because some are # failing with different GHC version on darwin. - name: Build development shell with nix dependencies for current GHC version + if: matrix.os == 'macOS-latest' + run: nix develop --print-build-logs .#haskell-language-server-dev-nix --profile dev + - name: Build development shells with nix dependencies + if: matrix.os == 'ubuntu-latest' run: nix develop --print-build-logs .#all-nix-dev-shells --profile dev - name: Push development shell if: ${{ env.HAS_TOKEN == 'true' }} diff --git a/configuration-ghc-90.nix b/configuration-ghc-90.nix index e14705093c..8152f110fa 100644 --- a/configuration-ghc-90.nix +++ b/configuration-ghc-90.nix @@ -14,15 +14,11 @@ let doCheck = false; }); } // (builtins.mapAttrs (_: drv: disableLibraryProfiling drv) { - # ptr-poker breaks on MacOS without SSE2 optimizations - # https://github.com/nikita-volkov/ptr-poker/issues/11 - ptr-poker = hself.callCabal2nix "ptr-poker" inputs.ptr-poker { }; - Cabal = hself.Cabal_3_6_3_0; Cabal-syntax = hself.Cabal-syntax_3_8_1_0; - ghc-lib-parser = hself.callCabal2nix "ghc-lib-parser" inputs.ghc-lib-parser-94 {}; + ghc-lib-parser = hsuper.ghc-lib-parser_9_4_5_20230430; lsp = hself.callCabal2nix "lsp" inputs.lsp {}; lsp-types = hself.callCabal2nix "lsp-types" inputs.lsp-types {}; @@ -42,7 +38,7 @@ let ormolu = hself.callCabal2nix "ormolu" inputs.ormolu-052 {}; - fourmolu = hself.callHackage "fourmolu" "0.10.1.0" {}; + fourmolu = hsuper.fourmolu_0_10_1_0; # Re-generate HLS drv excluding some plugins haskell-language-server = diff --git a/configuration-ghc-92.nix b/configuration-ghc-92.nix index e7dd2e384e..01402a6497 100644 --- a/configuration-ghc-92.nix +++ b/configuration-ghc-92.nix @@ -21,21 +21,17 @@ let } // (builtins.mapAttrs (_: drv: disableLibraryProfiling drv) { 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 - ptr-poker = hself.callCabal2nix "ptr-poker" inputs.ptr-poker { }; - Cabal-syntax = hself.Cabal-syntax_3_8_1_0; - ghc-lib-parser = hself.callCabal2nix "ghc-lib-parser" inputs.ghc-lib-parser-94 {}; + ghc-lib-parser = hsuper.ghc-lib-parser_9_4_5_20230430; hlint = appendConfigureFlag (hself.callCabal2nix "hlint" inputs.hlint-35 {}) "-fghc-lib"; ormolu = hself.callCabal2nix "ormolu" inputs.ormolu-052 {}; - fourmolu = hself.callHackage "fourmolu" "0.10.1.0" {}; + fourmolu = hsuper.fourmolu_0_10_1_0; - stylish-haskell = appendConfigureFlag hsuper.stylish-haskell "-fghc-lib"; + stylish-haskell = hsuper.stylish-haskell_0_14_4_0; hie-bios = hself.callCabal2nix "hie-bios" inputs.haskell-hie-bios { }; @@ -43,7 +39,7 @@ let lsp = hself.callCabal2nix "lsp" inputs.lsp {}; lsp-types = hself.callCabal2nix "lsp-types" inputs.lsp-types {}; - lsp-test = hself.callCabal2nix "lsp-test" inputs.lsp-test {}; + lsp-test = dontCheck (hself.callCabal2nix "lsp-test" inputs.lsp-test {}); # Re-generate HLS drv excluding some plugins haskell-language-server = diff --git a/configuration-ghc-94.nix b/configuration-ghc-94.nix index c53cc16ce7..e561496955 100644 --- a/configuration-ghc-94.nix +++ b/configuration-ghc-94.nix @@ -15,11 +15,13 @@ let } // (builtins.mapAttrs (_: drv: disableLibraryProfiling drv) { apply-refact = hsuper.apply-refact_0_13_0_0; + fourmolu = dontCheck (hself.callCabal2nix "fourmolu" inputs.fourmolu-011 {}); + stylish-haskell = appendConfigureFlag hsuper.stylish-haskell "-fghc-lib"; lsp = hself.callCabal2nix "lsp" inputs.lsp {}; lsp-types = hself.callCabal2nix "lsp-types" inputs.lsp-types {}; - lsp-test = hself.callCabal2nix "lsp-test" inputs.lsp-test {}; + lsp-test = dontCheck (hself.callCabal2nix "lsp-test" inputs.lsp-test {}); # Re-generate HLS drv excluding some plugins haskell-language-server = diff --git a/configuration-ghc-96.nix b/configuration-ghc-96.nix index 7dad1a944c..744e7047d1 100644 --- a/configuration-ghc-96.nix +++ b/configuration-ghc-96.nix @@ -29,34 +29,24 @@ let doCheck = false; }); 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 { }; - MonadRandom = hself.callHackage "MonadRandom" "0.6" { }; - hiedb = hself.callCabal2nix "hiedb" inputs.haskell-hiedb { }; + tagged = hsuper.tagged_0_8_7; + primitive = hsuper.primitive_0_8_0_0; + MonadRandom = hsuper.MonadRandom_0_6; hie-bios = hself.callCabal2nix "hie-bios" inputs.haskell-hie-bios { }; + hlint = hself.callCabal2nix "hlint" inputs.hlint-36 {}; 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 - # https://github.com/nikita-volkov/ptr-poker/issues/11 - ptr-poker = hself.callCabal2nix "ptr-poker" inputs.ptr-poker { }; + fourmolu = hself.callCabal2nix "fourmolu" inputs.fourmolu-012 {}; - ormolu = hself.ormolu_0_5_3_0; + ghc-lib-parser-ex = hsuper.ghc-lib-parser-ex_9_6_0_0; - # 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" {}; + ormolu = hself.callCabal2nix "ormolu" inputs.ormolu-07 {}; - stylish-haskell = appendConfigureFlag hsuper.stylish-haskell "-fghc-lib"; + stylish-haskell = hself.callCabal2nix "stylish-haskell" inputs.stylish-haskell-0145 {}; lsp = hself.callCabal2nix "lsp" inputs.lsp {}; lsp-types = hself.callCabal2nix "lsp-types" inputs.lsp-types {}; - lsp-test = hself.callCabal2nix "lsp-test" inputs.lsp-test {}; + lsp-test = dontCheck (hself.callCabal2nix "lsp-test" inputs.lsp-test {}); # Re-generate HLS drv excluding some plugins haskell-language-server = diff --git a/flake.lock b/flake.lock index 8b15b2f87d..04f2e6a04a 100644 --- a/flake.lock +++ b/flake.lock @@ -34,16 +34,28 @@ "type": "github" } }, - "ghc-lib-parser-94": { + "fourmolu-011": { "flake": false, "locked": { - "narHash": "sha256-WElfrJexd0VciSYe0T23s/5pxpOQzKhMn0z5zxa0Ax0=", + "narHash": "sha256-g/yDZXeLCHq/iXoZTaTYSb8l9CMny3AKsRQgWElagZI=", "type": "tarball", - "url": "https://hackage.haskell.org/package/ghc-lib-parser-9.4.4.20221225/ghc-lib-parser-9.4.4.20221225.tar.gz" + "url": "https://hackage.haskell.org/package/fourmolu-0.11.0.0/fourmolu-0.11.0.0.tar.gz" }, "original": { "type": "tarball", - "url": "https://hackage.haskell.org/package/ghc-lib-parser-9.4.4.20221225/ghc-lib-parser-9.4.4.20221225.tar.gz" + "url": "https://hackage.haskell.org/package/fourmolu-0.11.0.0/fourmolu-0.11.0.0.tar.gz" + } + }, + "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" } }, "gitignore": { @@ -62,23 +74,6 @@ "type": "github" } }, - "haskell-ghc-exactprint": { - "flake": false, - "locked": { - "lastModified": 1678824759, - "narHash": "sha256-2I+GyVrfevo/vWZqIdXZ+Cg0+cU/755M0GhaSHiiZCQ=", - "owner": "alanz", - "repo": "ghc-exactprint", - "rev": "db5e8ab3817c9ee34e37359d5839e9526e05e448", - "type": "github" - }, - "original": { - "owner": "alanz", - "ref": "ghc-9.6", - "repo": "ghc-exactprint", - "type": "github" - } - }, "haskell-hie-bios": { "flake": false, "locked": { @@ -95,22 +90,6 @@ "type": "github" } }, - "haskell-hiedb": { - "flake": false, - "locked": { - "lastModified": 1680249133, - "narHash": "sha256-v6PnDMlrdC56QJ9HwDvVFzHkhVbvivUj1LXMVJ0ZLec=", - "owner": "wz1000", - "repo": "HieDb", - "rev": "dac3ebb37ad33f9c042f59091ee87a4b9a2d63d1", - "type": "github" - }, - "original": { - "owner": "wz1000", - "repo": "HieDb", - "type": "github" - } - }, "haskell-implicit-hie-cradle": { "flake": false, "locked": { @@ -128,33 +107,28 @@ "type": "github" } }, - "haskell-unix-compat": { + "hlint-35": { "flake": false, "locked": { - "lastModified": 1664758053, - "narHash": "sha256-JD/EPdPYEOfS6WqGXOZrdcRUiVkHInSwZT8hn/iQmLs=", - "owner": "jacobstanley", - "repo": "unix-compat", - "rev": "3f6bd688cb56224955e77245a2649ba99ea32fff", - "type": "github" + "narHash": "sha256-qQNUlQQnahUGEO92Lm0RwjTGBGr2Yaw0KRuFRMoc5No=", + "type": "tarball", + "url": "https://hackage.haskell.org/package/hlint-3.5/hlint-3.5.tar.gz" }, "original": { - "owner": "jacobstanley", - "repo": "unix-compat", - "rev": "3f6bd688cb56224955e77245a2649ba99ea32fff", - "type": "github" + "type": "tarball", + "url": "https://hackage.haskell.org/package/hlint-3.5/hlint-3.5.tar.gz" } }, - "hlint-35": { + "hlint-36": { "flake": false, "locked": { - "narHash": "sha256-qQNUlQQnahUGEO92Lm0RwjTGBGr2Yaw0KRuFRMoc5No=", + "narHash": "sha256-fH4RYnWeuBqJI5d3Ba+Xs0BxYr0IYFH1OWO3k2iHGlU=", "type": "tarball", - "url": "https://hackage.haskell.org/package/hlint-3.5/hlint-3.5.tar.gz" + "url": "https://hackage.haskell.org/package/hlint-3.6.1/hlint-3.6.1.tar.gz" }, "original": { "type": "tarball", - "url": "https://hackage.haskell.org/package/hlint-3.5/hlint-3.5.tar.gz" + "url": "https://hackage.haskell.org/package/hlint-3.6.1/hlint-3.6.1.tar.gz" } }, "lsp": { @@ -221,49 +195,48 @@ "url": "https://hackage.haskell.org/package/ormolu-0.5.2.0/ormolu-0.5.2.0.tar.gz" } }, - "ptr-poker": { + "ormolu-07": { "flake": false, "locked": { - "narHash": "sha256-ll3wuUjkhTE8Grcs8LfGpdiuyobrSBmwgjqPOTlrPac=", + "narHash": "sha256-5M5gNzSvsiQH1+0oexRByzf5EIET+0BFwR4fLIr2P7g=", "type": "tarball", - "url": "https://hackage.haskell.org/package/ptr-poker-0.1.2.8/ptr-poker-0.1.2.8.tar.gz" + "url": "https://hackage.haskell.org/package/ormolu-0.7.1.0/ormolu-0.7.1.0.tar.gz" }, "original": { "type": "tarball", - "url": "https://hackage.haskell.org/package/ptr-poker-0.1.2.8/ptr-poker-0.1.2.8.tar.gz" + "url": "https://hackage.haskell.org/package/ormolu-0.7.1.0/ormolu-0.7.1.0.tar.gz" } }, "root": { "inputs": { "flake-compat": "flake-compat", "flake-utils": "flake-utils", - "ghc-lib-parser-94": "ghc-lib-parser-94", + "fourmolu-011": "fourmolu-011", + "fourmolu-012": "fourmolu-012", "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", + "hlint-36": "hlint-36", "lsp": "lsp", "lsp-test": "lsp-test", "lsp-types": "lsp-types", "nixpkgs": "nixpkgs", "ormolu-052": "ormolu-052", - "ptr-poker": "ptr-poker", - "stylish-haskell": "stylish-haskell" + "ormolu-07": "ormolu-07", + "stylish-haskell-0145": "stylish-haskell-0145" } }, - "stylish-haskell": { + "stylish-haskell-0145": { "flake": false, "locked": { - "narHash": "sha256-493M/S38dad82mA04l98xK50WPfue618TIln+7hE7VM=", + "narHash": "sha256-EE7RFQ6q4Ek8daRgOpNMGepYLa9o8cM4OLjTNUSHQf0=", "type": "tarball", - "url": "https://hackage.haskell.org/package/stylish-haskell-0.14.4.0/stylish-haskell-0.14.4.0.tar.gz" + "url": "https://hackage.haskell.org/package/stylish-haskell-0.14.5.0/stylish-haskell-0.14.5.0.tar.gz" }, "original": { "type": "tarball", - "url": "https://hackage.haskell.org/package/stylish-haskell-0.14.4.0/stylish-haskell-0.14.4.0.tar.gz" + "url": "https://hackage.haskell.org/package/stylish-haskell-0.14.5.0/stylish-haskell-0.14.5.0.tar.gz" } }, "systems": { diff --git a/flake.nix b/flake.nix index 1ba231f939..12f9b21259 100644 --- a/flake.nix +++ b/flake.nix @@ -20,24 +20,32 @@ }; # List of hackage dependencies - ghc-lib-parser-94 = { - url = "https://hackage.haskell.org/package/ghc-lib-parser-9.4.4.20221225/ghc-lib-parser-9.4.4.20221225.tar.gz"; - flake = false; - }; hlint-35 = { url = "https://hackage.haskell.org/package/hlint-3.5/hlint-3.5.tar.gz"; flake = false; }; - ptr-poker = { - url = "https://hackage.haskell.org/package/ptr-poker-0.1.2.8/ptr-poker-0.1.2.8.tar.gz"; + hlint-36 = { + url = "https://hackage.haskell.org/package/hlint-3.6.1/hlint-3.6.1.tar.gz"; + flake = false; + }; + fourmolu-011 = { + url = "https://hackage.haskell.org/package/fourmolu-0.11.0.0/fourmolu-0.11.0.0.tar.gz"; + flake = false; + }; + fourmolu-012 = { + url = "https://hackage.haskell.org/package/fourmolu-0.12.0.0/fourmolu-0.12.0.0.tar.gz"; flake = false; }; ormolu-052 = { url = "https://hackage.haskell.org/package/ormolu-0.5.2.0/ormolu-0.5.2.0.tar.gz"; flake = false; }; - stylish-haskell = { - url = "https://hackage.haskell.org/package/stylish-haskell-0.14.4.0/stylish-haskell-0.14.4.0.tar.gz"; + ormolu-07 = { + url = "https://hackage.haskell.org/package/ormolu-0.7.1.0/ormolu-0.7.1.0.tar.gz"; + flake = false; + }; + stylish-haskell-0145 = { + url = "https://hackage.haskell.org/package/stylish-haskell-0.14.5.0/stylish-haskell-0.14.5.0.tar.gz"; flake = false; }; @@ -55,25 +63,10 @@ flake = false; }; - haskell-unix-compat = { - url = "github:jacobstanley/unix-compat/3f6bd688cb56224955e77245a2649ba99ea32fff"; - flake = false; - }; - haskell-hiedb = { - url = "github:wz1000/HieDb"; - flake = false; - }; - haskell-hie-bios = { url = "github:haskell/hie-bios"; flake = false; }; - - haskell-ghc-exactprint = { - url = "github:alanz/ghc-exactprint/ghc-9.6"; - flake = false; - }; - # smunix: github:haskell/hie-bios defines # 'CabalType :: Maybe String -> Maybe FilePath -> CabalType' # while the original githcom:Avi-D-coder/hie-bios still has this: @@ -149,8 +142,6 @@ if final.system == "aarch64-darwin" then overrideCabal hsuper.ormolu (_: { enableSeparateBinOutput = false; }) else hsuper.ormolu; - - stylish-haskell = hself.callCabal2nix "stylish-haskell" inputs.stylish-haskell {}; }; hlsSources = @@ -400,10 +391,8 @@ # distributed using nix. all-haskell-language-server = linkFarmFromDrvs "all-haskell-language-server" (lib.unique (builtins.attrValues allPackages)); - # Same for all shells - # We try to build as much as possible, but not much shells are - # working (especially on darwing), so this list is limited. - all-nix-dev-shells = linkFarmFromDrvs "all-dev-shells" (builtins.map (shell: shell.inputDerivation) (lib.unique [nixDevShells.haskell-language-server-dev-nix])); + all-nix-dev-shells = linkFarmFromDrvs "all-dev-shells" + (builtins.map (shell: shell.inputDerivation) (lib.unique (builtins.attrValues nixDevShells))); all-simple-dev-shells = linkFarmFromDrvs "all-simple-dev-shells" (builtins.map (shell: shell.inputDerivation) (lib.unique (builtins.attrValues simpleDevShells)));