-
Notifications
You must be signed in to change notification settings - Fork 207
Nix / Nixos support #357
Comments
Here are two logs with
Behaviour observedIn both cases, the following behaviour occurs:
My environmentI am using NixOS (latest stable, 17.09). I generated a #!/bin/sh
real-hie -d -l /tmp/hie.log --vomit $@ | tee /tmp/hie-wire.log The logsThe first one is from a
The second one is a new Stack project with
|
Please show the contents of |
So the problem in the Stack project turned out to be the old The Nix project, on the other hand, seemed to be an incompatibility in GHC versions. (The output about I compiled
|
I have but a bounty on this issue. https://www.bountysource.com/issues/51713360-nix-nixos-support would love to see this resolved ASAP. |
@Fresheyeball @imalsogreg do you want to have IDE support for projects using nix-shell/nix-build or is stack+nix enough? |
@domenkozar Preferably nix-shell aware; most of my work is on projects with dependencies managed by nix. |
@domenkozar I don't use |
NixOS/nixpkgs#32947 fixes this I think. |
Does anything need to change in https://github.com/haskell/haskell-ide-engine#installation-with-nix because of this? |
@alanz Those instructions are still reasonable for building and installing a local checkout with stack + nix, but end-users will probably want to install from nixpkgs which they can do with my PR. If it would be welcome, I'd be happy to also add nix expressions to make it possible to do a self-contained (not via stack) nix build from a nix checkout. |
Note that there may be some confusion on my part if this addresses the issue here. The idea with that PR is that your nix environment (nix-shell, nix-buffer, whatever) would build haskell-ide-engine with the same haskell package set as your package is using, and that would fix the version mismatch here. But @Fresheyeball is testing to see if that's enough. |
@shlevy would you mind reaching out on slack? |
@Fresheyeball Which slack? |
Idk, I am on fpchat. |
@imalsogreg @Fresheyeball The nixpkgs PR is now merged, testing appreciated 😄 |
I have prepared hie executables for GHC 8.0.2 and GHC 8.2.2 with Nix in reproducible mannner: https://github.com/domenkozar/hie-nix - let me know what you think |
@domenkozar This seems very hard to integrate in with nixpkgs haskell package sets |
@domenkozar, so if I @shlevy is this what you mean, that it won’t? |
@shlevy why would you need that? |
@domenkozar Because we're defining package environments for our projects based on nixpkgs (plus our own overlays), and we want (well, need) to have the same dependencies (not just the same GHC version!) to use hie with our projects. |
So I want to make an env that contains "the hie appropriate for this project" and launch that hie per-project. |
^ Exactly. What’s the point otherwise? |
Afaik HIE does this at runtime using ghc-mod, so you'd have to run it with nix-shell of your environment. |
It does; working v. well. =) Thank you, @domenkozar!
Also, if you can specify path to a HIE wrapper in your editor, you can use a wrapper like https://github.com/michalrus/kornel/blob/8e0d466e4f23a8479a268eaff5940537a335e08d/hie.sh to not have to run the whole editor inside an impure (This |
@Fresheyeball @imalsogreg could you provide a Nix project you'd like to see HIE working with? I think with hie-nix it should be trivial, but I want to make sure we agree that's the acceptance criteria for this to pass :) |
Here's a skeleton Nix project: The frontend package can be compiled using ghcjs, although for editor integration purposes one could compile it using ghc. It even targets android and iOS. Should be a good candidate to test HIE support? |
Once this thing settles down to best practice, can someone make a PR on the README, for future NIX users? |
@alanz https://github.com/haskell/haskell-ide-engine#installation-with-nix @srid @ElvishJerricco made it work, but not sure he posted the steps (although they are as in README with usual caveats). Is this considered then done? :) |
Well, the link is good, but the instructions at https://github.com/domenkozar/hie-nix/blob/master/README.md don't work. We now seem to have
Rather than hie-nix.nix |
It did work (I've tested locally), but I see your point, it was confusing. What about this: https://github.com/domenkozar/hie-nix#install |
Yep, that works. And a pretty neat way of doing it. Thanks. |
@domenkozar I presume at some stage this will end up on a binary cache somewhere? My install (admittedly for a fresh nixpkgs install) is building the world. |
Yes, that's the plan :) |
Writing here to thank @michalrus again. Coming back to this months later, and your strategy has worked for me. |
See NixOS/nixpkgs#31697
The text was updated successfully, but these errors were encountered: