-
-
Notifications
You must be signed in to change notification settings - Fork 389
Dynamic (TH-friendly) nix hls derivation #2665
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
Comments
Have you tried using the flake or simply I'm using that at work with a codebase with a lot of TH and we have no issue, on nixos and ubuntu. Otherwise, could you try to describe your working context more precisly (top: a repository that I can checkout and |
Trying to use hls on this repo might help in reproducing any linking errors: https://github.com/codygman/th-pq-segfault/tree/try-nix-libpq From discussion at #1982 (comment). |
I'll try reproducing it on the OSS version of our repo and report back with full reproduction instructions. |
I've tried building from the flake directly, specifically the
EDIT: Seems that building HLS from the flake on the |
Could you try a more recent version than the git diff -r origin/master origin/1.6.1.0-hackage flake.nix | grep -B2 -A2 Static
with pkgs.haskell.lib;
- (enableSharedExecutables (overrideCabal hpkgs.haskell-language-server
+ justStaticExecutables (overrideCabal hpkgs.haskell-language-server
(_: {
postInstall = '' EDIT: the diff between current EDIT2: Just saw your edit ;) It confirms my comment ;) Have fun. |
FWIW nixpkgs supports linking HLS dynamically via the wrapper derivation we provide: pkgs.haskell-language-server.override {
dynamic = true;
supportedGhcVersions = [ "902" ]; # GHC 9.0.2
} It's disabled by default to keep the closure size reasonable, dynamic linking leads to a lot of unnecessary downloads if all GHC versions are enabled (which is the default). |
I think having it on by default and having If you have dynamic linking disabled, one gets terrible error messages and might take hours to figure out what to do. If the closure size is the problem, you know what to do in Nix. Human time > machine time. |
I don't think there is anything left for us to do here? Re-open if you disagree |
Enable dynamic linking for HLS (e.g. for TH) haskell/haskell-language-server#2665
Is your feature request related to a problem? Please describe.
I would like to be able to easily use HLS on NixOS/form a nix expression WITH template haskell support.
Describe the solution you'd like
A sample shell.nix somewhere? A link to a blog post? Anything would be nice, hopefully linked to from https://haskell-language-server.readthedocs.io/en/latest/troubleshooting.html#static-binaries-and-template-haskell-support
Describe alternatives you've considered
Getting this error
What I did is I added this repository as a
niv
source, then:Additional context
n/a
The text was updated successfully, but these errors were encountered: