Skip to content
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

Unable to use ghc925 with haskell-language-server enabled #1827

Closed
qwbarch opened this issue Jan 6, 2023 · 4 comments
Closed

Unable to use ghc925 with haskell-language-server enabled #1827

qwbarch opened this issue Jan 6, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@qwbarch
Copy link

qwbarch commented Jan 6, 2023

Build system: x86_64-linux
GHC: 9.2.5

Enabling haskell-language-server with ghc925 results in the following error when running nix develop:

error: builder for '/nix/store/xhzz5y2wh93pdlm7cxbz27gyhxgrjk0x-stylish-haskell-lib-stylish-haskell-0.14.3.0.drv' failed with exit code 1;
       last 10 log lines:
       >         defaultDynFlags GHCEx.fakeSettings GHCEx.fakeLlvmConfig
       >       In an equation for baseDynFlags’:
       >           baseDynFlags
       >             = defaultDynFlags GHCEx.fakeSettings GHCEx.fakeLlvmConfig
       >    |
       > 71 | baseDynFlags = defaultDynFlags GHCEx.fakeSettings GHCEx.fakeLlvmConfig

Steps To Reproduce

  1. Run nix flake init --template templates#haskell-nix --impure
  2. Set ghc version to 9.2.5 and enable haskell-language-server.
  3. Disable cross-compilation.
  4. Delete flake.lock
  5. Run nix develop

I also have a repository with the flake already setup: https://github.com/qwbarch/hnix-reproducible

@qwbarch qwbarch added the bug Something isn't working label Jan 6, 2023
@qwbarch
Copy link
Author

qwbarch commented Jan 7, 2023

Just realized that ghc925 isn't listed as one of the supported versions. Is that why?
I assumed it's supported since it's cached:

haskell.nix/ci.nix

Lines 43 to 58 in 1059fc7

# GHC version to cache and whether to run the tests against them.
# This list of GHC versions should include everything for which we
# have a ./materialized/ghcXXX directory containing the materialized
# cabal-install and nix-tools plans. When removing a ghc version
# from here (so that is no longer cached) also remove ./materialized/ghcXXX.
# Update supported-ghc-versions.md to reflect any changes made here.
nixpkgs.lib.optionalAttrs (nixpkgsName == "R2205") {
ghc865 = false;
ghc8107 = false;
} // nixpkgs.lib.optionalAttrs (nixpkgsName == "unstable") {
ghc865 = false;
ghc884 = false; # Native version is used to boot 9.0.1
ghc8107 = true;
ghc902 = false;
ghc924 = false;
ghc925 = true;

@qwbarch
Copy link
Author

qwbarch commented Jan 7, 2023

Not an issue with haskell-nix. The latest hlint version seemed to have a compilation issue, so I turned it off.
Anyone in the future trying to fix the same issue, I followed this: #1816 (comment)

@qwbarch qwbarch closed this as completed Jan 7, 2023
@billksun
Copy link

billksun commented Jan 7, 2023

Maybe related to this issue: haskell/stylish-haskell#437. ghc-lib flag should be used.

The CI code indicates ghc925 is supported and is preferred - its cached and has tests that run against it.

@ftzm
Copy link

ftzm commented Jun 11, 2023

For future readers, I've been able to get stylish-haskell (and thus hls) to build the following:

shell.tools = {
  haskell-language-server = {
     version = "latest";
     modules = [
       { packages.stylish-haskell.flags.ghc-lib = true; }
     ];
   };
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants