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

Potentially conflicting ghc in stack.yaml and shell.nix #269

Closed
alexvorobiev opened this issue Sep 27, 2016 · 3 comments
Closed

Potentially conflicting ghc in stack.yaml and shell.nix #269

alexvorobiev opened this issue Sep 27, 2016 · 3 comments

Comments

@alexvorobiev
Copy link

stack.yaml requests resolver: lts-6.12 which assumes ghc-7.10.3 but shell.nix has inherit ghc; which can resolve to any version of ghc potentially. Should it be set to haskell.packages.ghc7103.ghc instead?

@mboes
Copy link
Member

mboes commented Sep 28, 2016

I believe this is as intended: inherit ghc; means Stack gets to choose which GHC version to use when using the --nix flag (just as it does when not using the --nix flag). By default, it'll select the GHC version for LTS 6.12. But if you override the resolver say by passing --resolver nightly on the command-line, then Stack will tell Nix to provision some other version of GHC.

@alexvorobiev
Copy link
Author

alexvorobiev commented Sep 29, 2016

The main reason I asked was I was getting an error when I tried to run stack build --nix about missing ghc attribute so I had to edit shell.nix. After I commented the inherit ghc; line and added

ghc = haskell.packages.ghc7103.ghc;

the build worked. So it looks like the default behavior you described (which is what I expected as well) doesn't work. It looks like this is related to a bug (commercialhaskell/stack#2243) which is supposed to be fixed in Stack 1.2.0 so I am waiting for it to become available in Nix (pending this NixOS/nixpkgs#18942).

@mboes
Copy link
Member

mboes commented Sep 29, 2016

Ok yes, that's an upstream issue. Stack >= 1.2 highly recommended if you're going to use --nix.

@mboes mboes closed this as completed Sep 29, 2016
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

2 participants