Closed poscat0x04 closed 4 years ago
Unfortunately stack2nix which I'm using for all-hies isn't maintained anymore, see https://github.com/input-output-hk/stack2nix/issues/140#issuecomment-521921120
And now this is causing problems, because newer stack versions are required now because of https://www.stackage.org/blog/2020/02/discontinuing-legacy-snapshots
So this is probably the time to do https://github.com/Infinisil/all-hies/issues/19, will take a bit of work and figuring out though. I'll try to get to this soon.
Hmmm, maybe we can use cabal2nix? Are there any dependencies that are not covered by nixpkgs?
That might work, but probably only with a lot of manual effort, because I'd have to potentially fix a lot of dependency builds (which I don't need to with stack), and that for all 7 GHC versions.
Or we can just use stack to build a static binary (this is what archlinux is doing).
With Nix it's not possible to just use stack directly, because it does very impure things.
Looking forward to this too! Get issues with cabal-3.0.0.0 and ghc865 in hie 1.1. Read posts it might have something to do with Cabal Helper
@gurgl Do you have any specific issue in mind? Because version 1.2 has only two bug-fixes, iirc.
Tried to use haskell.nix for building all versions of HIE 1.2, but it seems like only about 8.6.4, 8.6.5 and 8.8.1 are supported by it, but HIE supports more versions than that. The branch is [here]https://github.com/Infinisil/all-hies/tree/haskell.nix), but I won't continue trying with this.
I'll look into using nixpkgs Haskell infra instead next.
@fendor I was hoping this tweak of cabal-helper would resolve my issues. I might be wrong about that but still hope. https://github.com/haskell/haskell-ide-engine/commit/16a8c087fdd5da3ffd583ac7f1af178bcd680dda
Or are the stack files not applicable for nix builds?
That patch is mainly development and build-related. IIRC, it does not fix any issues that happen at run-time. So, unless you say what your issues are and open an issue at the hie repo, I doubt that a random update will fix it :)
If we are going to use nixpkgs infra then we might as well just merge this package into the nixpkgs tree.
If all GHC versions should continue to be supported, then that's not a possibility, as a single nixpkgs version only has a subset of them
Tried to use haskell.nix for building all versions of HIE 1.2, but it seems like only about 8.6.4, 8.6.5 and 8.8.1 are supported by it, but HIE supports more versions than that. The branch is here, but I won't continue trying with this.
@Infinisil May I ask how you got this to work? Specifically I can't seem to be able to nix-build update.nix
, I run into:
these derivations will be built:
/nix/store/hpfz51kjnjwzrg75fps0y8a0crhl6i93-nix-shell.drv
building '/nix/store/hpfz51kjnjwzrg75fps0y8a0crhl6i93-nix-shell.drv'...
nobuildPhase
This derivation is not meant to be built, aborting
builder for '/nix/store/hpfz51kjnjwzrg75fps0y8a0crhl6i93-nix-shell.drv' failed with exit code 1
and manually running the commands in the update script to attempt to generate the 882 variant, even from inside a nix-shell update.nix
, runs into this error:
[nix-shell:~/code/all-hies]$ /nix/store/q2b95yl8hwpdyx9hl30nh4pxmxk1ck9i-nix-tools-0.1.0.0-exe-stack-to-nix/bin/stack-to-nix -o generated-new/ghc882 --stack-yaml /nix/store/zwc2kkrwzgcrsm3van3dgwyadb5qslf1-source/stack-8.8.2.yaml --cache /dev/null
[0.1 MiB DL]
stack-to-nix: nix-prefetch-git: createProcess: runInteractiveProcess: exec: does not exist (No such file or directory)
caveat: I did try to run this against HIE 1.3
@dansanduleac In that branch I have a new.nix
file you can use to build HIE with e.g. nix-build new.nix -A ghc865
. No guarantees about it though
Ao ok, I didn't know where to start :) Thanks for the clarification!
FWIW I hacked up stack2nix
to work with stack 2.1 and save for the known issue with the base libraries it can produce working expressions for HIE 1.3 for at least a subset of GHC's.
The expressions are here at https://github.com/pbogdan/nix-hie and there's a nix-hie
cachix binary cache for those as well.
It's only for my own personal use though so neither my stack2nix patches or the hie repo are very polished and may or may not be maintained going forward.
I'm posting updates for haskell.nix builds in https://github.com/Infinisil/all-hies/issues/19. GHC 8.6.5 and 8.8.3 builds are working now at least
With #64 merged HIE was updated to a recent unstable version (after 1.4)
https://github.com/haskell/haskell-ide-engine/releases/tag/1.2