-
-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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: nuked references to GHC causes hlint plugin to fail #107098
Comments
Huh, interesting. The hlint plugin works for me despite of the nuked references. But not sure if I've tried the other package you mentioned. The problem is, that haskell-language-server per default pulls in 4 hls packages and therefore would pull in 4 ghc dependencies. So nothing would break explicitely, but I expect people would be annoyed. Finding a fix for this issue would be great! |
The manual describes in section https://haskell4nix.readthedocs.io/nixpkgs-users-guide.html#how-to-install-a-compiler-with-libraries how to set the environment variables |
Sorry for the late reply. I have found that with import <nixpkgs> {};
mkShell {
buildInputs = [
ghc
cabal-install
haskell-language-server
];
shellHook = ''
export NIX_GHC="${ghc}/bin/ghc"
export NIX_GHCPKG="${ghc}/bin/ghc-pkg"
export NIX_GHC_DOCDIR="${ghc}/share/doc/ghc/html"
export NIX_GHC_LIBDIR="${ghc}/lib/ghc-$($NIX_GHC --numeric-version)"
'';
} However, I am now quite confused why these environment variables are not needed to be set up for the language server under |
I'm wondering about the state of this issue. Can we close this? Or is there any particular action left that we have to do? |
@peti The question here is this, and I think you are the most qualified to answer it, would not nuking those references fix the noticed issue under some circumstances or is the claimed relation in this issue just wrong? |
I think we can close this. The culprit was that I didn't know about the Also, the upstream issue seems to be fixed: haskell/haskell-language-server#1225. |
Describe the bug
The builder for haskell-language-server removes references to GHC in HLS binary. This causes plugins like hlint to fail: haskell/haskell-language-server#591.
To Reproduce
Steps to reproduce the behavior:
nix-shell -p haskell-language-server
(on unstable channel)Expected behavior
Applying hlint suggestion via HLS should not fail.
Additional context
This seems to only affect
haskell-language-server
(and nothaskellPackages.haskell-language-server
). Applying hlint suggestions withhaskellPackages.haskell-language-server
works.Here is the actual root cause: alanz/ghc-exactprint#96.
Maybe it would be possible to fix this in nixpkgs while we wait for the fix upstream? I think the references to GHC are removed here https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/tools/haskell/haskell-language-server/withWrapper.nix#L19. I am not actually sure why it's necessary to remove these references. Is it because of using
haskell.lib.justStaticExecutables
? Would something else break if references were not removed?Notify maintainers
@maralorn
Maintainer information:
The text was updated successfully, but these errors were encountered: