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

Unordered-Containers error nothunks #25

Closed
LBjerke opened this issue Jun 6, 2023 · 5 comments
Closed

Unordered-Containers error nothunks #25

LBjerke opened this issue Jun 6, 2023 · 5 comments

Comments

@LBjerke
Copy link

LBjerke commented Jun 6, 2023

Hi I am trying to build the following package https://github.com/LBjerke/rasa and I keep getting the following error

nix build 
warning: Git tree '/home/loki/Code/RainyDay/Vault/references/rasa' is dirty
error: anonymous function at /nix/store/az5xi3mw284ijcvd5786zjybqwhfzngb-cabal2nix-unordered-containers-0.2.14.0/default.nix:1:1 called with unexpected argument 'nothunks'

       at /nix/store/1jg6qw69j7wp8zqzwxbrrm13madk0qks-source/pkgs/development/haskell-modules/make-package-set.nix:97:40:

           96|       # this wraps the `drv` function to add `scope` and `overrideScope` to the result.
           97|       drvScope = allArgs: ensureAttrs (drv allArgs) // {
             |                                        ^
           98|         inherit scope;
(use '--show-trace' to show detailed location information)


I was wondering if there is a work around I looked at the cabal override and it seems like this shouldnt be an issue

@oscar-izval
Copy link

oscar-izval commented Jun 6, 2023

Not exactly the same, but I'm getting a very similar error when testing my-example-haskell-lib-advanced, after bumping the rev for all-cabal-hashes. I'm also getting this same error when running tests on a fresh clone.

$ nix build
warning: Git tree '/Users/oizquierdo/sb/stacklock2nix' is dirty
error: anonymous function at /nix/store/0qw23ij01l04ahz82baxzvlspl1nbjwk-cabal2nix-splitmix-0.1.0.4/default.nix:1:1 called with unexpected argument 'testu01'

       at /nix/store/9qkpbm10iypl7zclprk9r0pwncr0snjk-source/pkgs/development/haskell-modules/make-package-set.nix:97:40:

           96|       # this wraps the `drv` function to add a `overrideScope` function to the result.
           97|       drvScope = allArgs: ensureAttrs (drv allArgs) // {
             |                                        ^
           98|         overrideScope = f:
(use '--show-trace' to show detailed location information)

@cdepillabout
Copy link
Owner

@LBjerke There's a couple things going on in your repo. I'm specifically looking at your latest commit on master:

LBjerke/rasa@4169599

  • It looks like you've set lts-19.33 in stack.yaml, but you haven't regenerated the stack.yaml.lock file. The stack.yaml.lock file is still referencing LTS-18, so that is what will be used. You can force stack to regenerate stack.yaml.lock with the command stack query.
  • In flake.nix, you're setting baseHaskellPkgSet = final.haskell.packages.ghc924, but if you want to use LTS-19, then you should instead set baseHaskellPkgSet = final.haskell.packages.ghc902. (Sort of related to make stacklock2nix figure out the ghc version it needs automatically #4)

Then there is also the problem with the nothunks argument. I have a PR up that should fix that: #26.

If you want to fix it locally without waiting for that PR, you should be able to do something like the following:

diff --git a/flake.nix b/flake.nix
index e2de2b4..512336a 100644
--- a/flake.nix
+++ b/flake.nix
@@ -45,11 +45,8 @@
       # stacklock2nix.
       rasa = final.stacklock2nix {
         stackYaml = ./stack.yaml;
-        cabal2nixArgsOverrides = _: {
-          "unordered-containers" = ver: {
-            nothunks = false;
-          };
-          "splitmix" = ver: {testu01 = null;};
+        cabal2nixArgsOverrides = args: args // {
+          "unordered-containers" = ver: { };
         };
 
         # The Haskell package set to use as a base.  You should change this

@cdepillabout
Copy link
Owner

@oscar-izval There is a file that contains default arguments for packages, and it has an entry that should be fixing the splitmix problem:

"splitmix" = ver: { testu01 = null; };

Maybe you're not applying that?

@oscar-izval
Copy link

Hey @cdepillabout, thanks for the quick reply. I've moved this discussion to #27 as you seem to have solved the issue related to unordered-containers.

@LBjerke
Copy link
Author

LBjerke commented Jun 8, 2023

@cdepillabout thank so much that solved the problem

@LBjerke LBjerke closed this as completed Jun 8, 2023
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

3 participants