-
Notifications
You must be signed in to change notification settings - Fork 12
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
Add another branch with Haskell IDE Engine #8
Comments
I've been thinking about the same thing. I was thining about making it optional ( I feel like cachix support would be tricky since it requires the user to be either a trusted Nix user or change the system configuration. Also, I guess we have to wait until infinisil/all-hies#55 is fixed. |
Making hie vs ghcid a choice in the cookiecutter template is better than having a separate branch. It looks like building hie with nix for 8.8.3 is not going to happen for awhile given Infinisil is trying to find a general fix for I think we may have to create our own build (like this gist) and post the build on cachix ourselves so users don't have to build it themselves. We would only have to support the version of ghc that we pick for this repo or only the ones supported by Ideally we won't have to have different nixpkgs versions for the hie setup. In other words we try to pick a checkout of nixpkgs that works for development with and without hie. Steps needed to get hie added to this template:
Note: I agree cachix setup can be non-trivial and it would be much better to get hie on cache.nixos.org, but I'm not sure what else we can do in the meantime. We could setup our own cache with herculies-ci since I have heard hydra requires arcane knowledge. Its just more time consuming to setup and maintain. At the same time it would be nice to eventually automate some of what we are doing. |
I already have CI setup (via buildkite) for this project, should be easy to introduce cachix there. I'll spend some time within this week on it. |
I did some playing around with ghcide (hie is slow) and I have to say its a much better experience. The main downside is ghcide does not support Multi-Cradle correctly see issue #113. What this actually means is ghcide can only handle one set of dependencies for your entire project. This is because ghcide is essentially a wrapper around ghci (like ghcid) and can only load one target from your cabal file. For example, if you set your target to be your library then your Either way, I'll create a ghcide branch to show you would it would look like. |
I created the ghcide branch with the extra There is a real annoyance I've run into, adding dependencies does not work like you would want to. I might be able to setup something with sos in a separate terminal. I'll look into this tomorrow. |
I spent some time trying out a few alternatives:
In general any solution with Regardless, I think the least painful setup is to have all of |
Well, I found one workaround, but it requires you to have a script in the repository (call it with
You have your editor run this script instead of running I tried adding this script to |
That is a cool trick! I wonder if it'd work if wrote a shell script wrapper to ghcide and added it to our nix-shell. So when "ghcid" is invoked inside our nix-shell, it'll run |
Here is what I tried to set that up (though I called it
(There might be a mkScript equivalent in nixpkgs, but I didn't find one) Then add this to your
(This will add However, I kept getting |
Doesn't direnv integration in editors solve this? For instance emacs-direnv would essentially make |
I just fixed the CI, made it public, and configured it so that it uploads to https://hs-nix-template.cachix.org/. |
@codygman, you are right! Though it seems the vim direnv could use a bit of polish. I think we can have the script as a backup for users without direnv editor integrations. However, the development process is much nicer with editor direnv integration. If you use |
@utdemir Thanks for setting that up! |
Got another way we could setup ghcide to auto reload after lorri finishes a new build, see issue 371 |
At this point, I'd suggest adding haskell-language-server to the default packages |
That makes sense to me, I just did that on Two points:
|
I had occasion to test this today, and haskell-language-server is immediately available, thanks! I'm using direnv with emacs, in case it helps any. |
I'm going to close this issue since |
I've been getting hie working locally to see how it works in practice. There are a few downsides to getting it setup: You need to either compile it yourself (2 hours plus) or set your nixpkgs to the same checkout as one of the pre-built ones that you can get on cachix (see this repo). I've been running into issues if I use a different checkout of nixpkgs even if I use the correct version of ghc and cabal. There is also a hack I need to write to get hie to find the hoogle database. Either way I would want to put the setup with hie in another branch so users can choose to just use ghcid (which always works).
Note: Setting up cachix is more difficult than I thought since we cannot just upload the
shell
derivation since it will be different for each user. Instead we would need to build the parts individually.The text was updated successfully, but these errors were encountered: