domenkozar / hie-nix

Nix packages for Haskell IDE Engine
115 stars 18 forks source link

Errors when running update.sh #13

Closed freeman42x closed 6 years ago

freeman42x commented 6 years ago

I changed the commit SHA to a4e21f43c94dfc253d07614e781347d657c86b9b and then run update.sh

Ensuring git version is >= 2 ...
Ensuring cabal version is >= 2 ...
stack2nix: haskell.compiler.ghc843 failed to build via nix
CallStack (from HasCallStack):
  error, called at src/Stack2nix/Util.hs:79:22 in stack2nix-0.1.3.1-7PUL0jmN2ShDWzAz8T0G4X:Stack2nix.Util

Ensuring git version is >= 2 ...
Ensuring cabal version is >= 2 ...
stack2nix: /tmp/s2n-12446/stack-8.0.2.yaml does not exist. Use 'stack init' to create it.
CallStack (from HasCallStack):
  error, called at src/Stack2nix.hs:77:30 in stack2nix-0.1.3.1-7PUL0jmN2ShDWzAz8T0G4X:Stack2nix
noughtmare commented 6 years ago

This is due to ghc 8.4 support being added to hie. You can fix this by adding --stack-yaml=8.2.2.yaml to the first of the two lines starting with $STACK2NIX and removing the second line (because 8.0 support has been dropped by hie).

freeman42x commented 6 years ago

@noughtmare Is this correct?

#!/bin/sh
STACK2NIX=$(nix-build -A stack2nix)/bin/stack2nix

COMMIT=a4e21f43c94dfc253d07614e781347d657c86b9b
URL=https://github.com/haskell/haskell-ide-engine.git

$STACK2NIX --git-recursive --revision $COMMIT $URL > ghc-8.4.nix
$STACK2NIX --git-recursive --revision $COMMIT $URL --stack-yaml=stack-8.2.2.yaml > ghc-8.2.nix
freeman42x commented 6 years ago

It created ghc-8.2.nix correctly but failed on ghc-8.4.nix

freeman42x commented 6 years ago

It also fails for:

 $STACK2NIX --git-recursive --revision $COMMIT $URL --stack-yaml=stack-8.4.2.yaml > ghc-8.4.nix

I think it might be a stack2nix issue.

noughtmare commented 6 years ago

Yeah, I'm not sure what causes the issue with 8.4, I thought it might be that the version of nixpkgs used by hie-nix doesn't support ghc 8.4.3 yet.

domenkozar commented 6 years ago

I'll look into this as soon as I'm done fixing most immediate issues on https://github.com/cachix/cachix

noughtmare commented 6 years ago

I think the issue is that stack opens a pure nix shell (https://stack.readthedocs.io/en/stable/nix_integration/#the-nix-shell). That causes stack to use the system nixpkgs. I have been able to build a 8.4.3 project using stack build --nix-path="nixpkgs=https://github.com/nixos/nixpkgs/archive/master.tar.gz". Maybe this could be fixed by allowing the user to supply a custom nix path to stack2nix, just like stack does?

noughtmare commented 6 years ago

Actually, running NIX_PATH=nixpkgs=https://github.com/nixos/nixpkgs/archive/master.tar.gz ./update.sh works.

noughtmare commented 6 years ago

Now I get this when trying to install hie84:

$ nix-env -iA hie84 -f .
error: anonymous function at /home/jaro/hie-nix/ghc-8.4.nix:13086:10 called without required argument 'ghc-syb-utils', at /nix/store/gsccads7hyv2s5bksvpwgv0000qalzsk-3b1e15140c574c01ae25835b934fe71be3376877.tar.gz-unpacked/pkgs/development/haskell-modules/make-package-set.nix:88:27
domenkozar commented 6 years ago

Update: https://github.com/domenkozar/hie-nix/pull/16

domenkozar commented 6 years ago

GHC 8.4 support done in #18, waiting on stack2nix PR merges and release.