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

How to deal with missing ghc version on Nix? #166

Open
wizzup opened this issue May 6, 2019 · 3 comments
Open

How to deal with missing ghc version on Nix? #166

wizzup opened this issue May 6, 2019 · 3 comments

Comments

@wizzup
Copy link

wizzup commented May 6, 2019

Try to convert gloss project to nix expression and got following error

$ stack2nix --version
stack2nix 0.2.2

$ stack2nix --stack-yaml stack-8.6.yaml . --verbose

Ensuring git version is >= 2 ...
Ensuring cabal version is >= 2 ...
stack2nix (isLocalRepo): True
stack2nix (projRoot): "."
stack2nix (argUri): "."
handleStackConfig (cwd): /data/learn/haskell/gloss
handleStackConfig (localDir): .
handleStackConfig (remoteUri): Nothing
handleStackConfig (alreadyExists): True
stack2nix: haskell.compiler.ghc861 failed to build via nix
CallStack (from HasCallStack):
  error, called at src/Stack2nix/Util.hs:79:22 in stack2nix-0.2.2-EjYkwZMOavSKQ5oHK3VyZt:Stack2nix.Util

I am on NixOS but my channel no longer have ghc861 for a very long time after many updates

$ nix-env -qaPA nixos.haskell.compiler
nixos.haskell.compiler.ghc822                  ghc-8.2.2
nixos.haskell.compiler.integer-simple.ghc822   ghc-8.2.2
nixos.haskell.compiler.ghc822Binary            ghc-8.2.2-binary
nixos.haskell.compiler.ghc844                  ghc-8.4.4
nixos.haskell.compiler.ghc863Binary            ghc-8.6.3-binary
nixos.haskell.compiler.ghc864                  ghc-8.6.4
nixos.haskell.compiler.integer-simple.ghc864   ghc-8.6.4
nixos.haskell.compiler.ghc865                  ghc-8.6.4.20190406
nixos.haskell.compiler.integer-simple.ghc865   ghc-8.6.4.20190406
nixos.haskell.compiler.ghcHEAD                 ghc-8.7.20190115
nixos.haskell.compiler.integer-simple.ghcHEAD  ghc-8.7.20190115
nixos.haskell.compiler.ghcjs84                 ghcjs-8.4.0.1
nixos.haskell.compiler.ghcjs                   ghcjs-8.6.0.1
@purefn
Copy link

purefn commented May 10, 2019

@wizzup I worked around this by specifying a NIX_PATH that I know has the right ghc in it. In my case, I needed something with ghc 8.6.3 but in the nixpkgs for my user it has been dropped and replaced with 8.6.4. So I had to backtrack and find a revision with 8.6.3 in it and use that.

NIX_PATH=nixpkgs=https://github.com/NixOS/nixpkgs/archive/68be6bbc31351a4cf5b6431d746dc390ed29c16c.tar.gz stack2nix .

HTH

@wizzup
Copy link
Author

wizzup commented May 13, 2019

@purefn Thanks, That's one way to do it. I end-up edit the stack.yaml to use the one that matched my current version (lts-13.21).

https://www.stackage.org/

@wizzup wizzup closed this as completed May 13, 2019
@domenkozar domenkozar reopened this May 13, 2019
@domenkozar
Copy link
Contributor

I think if stack2nix can't build deps it should have a better error message.

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