Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to use hspec dependency #409

Closed
srid opened this issue Mar 31, 2022 · 2 comments
Closed

Unable to use hspec dependency #409

srid opened this issue Mar 31, 2022 · 2 comments

Comments

@srid
Copy link
Member

srid commented Mar 31, 2022

Just adding hspec to the cabal file is enough to trigger input-output-hk/haskell.nix#1177

As can be seen in CI,

Configuring library for hspec-core-2.9.4..
Error:
    The following packages are broken because other packages they depend on are missing. These broken packages must be rebuilt before they can be used.
installed package ghc-9.2.1 is broken due to missing package exceptions-0.10.4

exceptions is already listed in nonReinstallablePkgs: https://github.com/Plutonomicon/plutarch/blob/19b5e9b90d9df9492e494be730b2169abcdca386/flake.nix#L177

.. yet it doesn't work, contradicting the suggestion from input-output-hk/haskell.nix#1177

@srid
Copy link
Member Author

srid commented Mar 31, 2022

Umm, PEBKAC! I hadn't noticed that modules was defined inside tools.haskell-language-server.

@srid
Copy link
Member Author

srid commented Mar 31, 2022

--- a/flake.nix
+++ b/flake.nix
@@ -154,11 +154,8 @@

       ghcVersion = "ghc921";

-      tools.fourmolu = { };
-      tools.haskell-language-server = {
-        modules = [{
-          # https://github.com/input-output-hk/haskell.nix/issues/1177
-          nonReinstallablePkgs = [
+      # https://github.com/input-output-hk/haskell.nix/issues/1177
+      nonReinstallablePkgs = [
             "rts"
             "ghc-heap"
             "ghc-prim"
@@ -201,7 +198,12 @@
             "xhtml"
             "terminfo"
           ];
-        }];
+
+      tools.fourmolu = { };
+      tools.haskell-language-server = {
+        modules = [
+          { inherit nonReinstallablePkgs; }
+          ];
         compiler-nix-name = ghcVersion;
         # For some reason it doesn't use the latest version automatically.
         index-state =
@@ -222,6 +224,7 @@
       };

       haskellModule = system: {
+        inherit nonReinstallablePkgs;  # Needed only so we can use hspec; https://github.com/Plutonomicon/plutarch/issues/409
         packages = {
           basement.src = "${inputs.foundation}/basement";
           basement.components.library.postUnpack = "\n";

@srid srid closed this as completed Mar 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant