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
haskell-language-server: Init wrapper for multiple ghc versions at 0.5.0 #99519
Conversation
I have reduced the closure size to a reasonable ~330 MB. One hls binary is about 95 MB. I am eager for feedback. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't use haskell-language-server, but this looks pretty good to me.
If I could make one suggestion, it would be to have some documentation in development/tools/haskell/haskell-language-server/withWrapper.nix
that gave a short explanation of how this is supposed to be used.
For instance, if I was new to nixpkgs, my first thoughts would be:
- How do I use haskell-language-server from nixpkgs?
- Is it sufficient to do
nix-shell -p cabal -p ghc -p haskell-language-server
and just start using it? Or is there some other sort of setup I need? - It appears that haskell-language-server installs different versions, so will it basically just automatically work with different ghc versions? Or do I have to do something so this works? If I want haskell-language-server for a different ghc version, do I have to override the
haskellPackages
argument todevelopment/tools/haskell/haskell-language-server/withWrapper.nix
?
I guess it would be nice to have this in the official documentation as well, but personally I'd be fine with just documenting it here in the code.
Yeah, there is definitely documentation missing. I actually would go all in and add a section to nixpkgs manual. First I need to learn how to do that. |
be2e4fb
to
1436509
Compare
4a4d0cb
to
c26ce5e
Compare
I have added a documentation section. Would love some feedback if it's all clearly understandable. |
I could have add 9.0.1 but I want to do that in a subsequent PR, because right know tons of packages are broken on 9.0.1. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Easy to understand! Looks good!
Motivation for this change
haskell-language-server needs a binary which is compiled with the ghc the user uses for their project. That's why hls normally get's distributed (e.g. via ghcup) with the haskell-language-server-wrapper that picks the right binary based on the current project and a binary for every supported ghc version.
I want hls support in nixpkgs to be as good as that, so we also need to provide all those binaries.
I am introducing
pkgs.haskell-language-server
here which has a overridablesupportedGhcVersions
list.I have fixed the closure size with reference-to. A glance at the binary made a reasonable impression that those references aren‘t needed. A quick test of the binary seems to do just fine.
\cc @peti @GuillaumeDesforges @cdepillabout
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)