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

haskell-language-server: init at 0.1.0.0 #91279

Merged

Conversation

GuillaumeDesforges
Copy link
Contributor

@GuillaumeDesforges GuillaumeDesforges commented Jun 22, 2020

Motivation for this change

Add haskell-language-server to nixpkgs
https://github.com/haskell/haskell-language-server

Things done (after WIP)
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@maralorn
Copy link
Member

Hey @GuillaumeDesforges,

cool that you are working on this.

I am a bit apprehensive about deploying a software for which the developers intentionally decided not to do a release yet. Especially since we might expected additional maintenance overhead. But that‘s not on me to decide. I‘d actually love to test hls, so why not.^^

I will just give you a bit of feedback inline. I hope that‘s okay even if this is still WIP. Feel free to ignore.

@maralorn
Copy link
Member

btw. can you please make haskell PRs against the haskell-updates branch? It will get merged into master once a week, if we are sure that everything works fine.

@GuillaumeDesforges GuillaumeDesforges changed the base branch from master to haskell-updates June 23, 2020 11:47
@GuillaumeDesforges
Copy link
Contributor Author

Thanks for the review @maralorn , it is always appreciated !

As it is a WIP PR I might not apply everything right now (since it's still changing/moving around a lot) but once it stabilizes I will properly do all the above. Let's keep things clean!

@GuillaumeDesforges
Copy link
Contributor Author

GuillaumeDesforges commented Jun 24, 2020

@maralorn Sorry to bother you, but it seems like ./Setup build from buildPhase makes a dist folder... while ./Setup test expects a dist-newstyle folder. Does it ring a bell to you ?

https://gist.github.com/GuillaumeDesforges/7da3253decd1e5b3ac8776cd0f184747

running tests
Running 1 test suites...
Test suite tests: RUNNING...
tests: dist-newstyle: getDirectoryContents:openDirStream: does not exist (No such file or directory)
Test suite tests: FAIL

@maralorn
Copy link
Member

Can‘t say that I have encountered this one before.

I mean the general issue is the difference between cabal v1-build (which uses dist) and cabal v2-build (which uses dist-newstyle). So maybe you can fix this by using ./Setup v2-build or something?

@GuillaumeDesforges
Copy link
Contributor Author

I'm not sure if it is a Nixpkgs issue (for instance related to a cabal version/haskell wrapping voodoo) or an issue from lsp-test itself.
As of now, I'll put dontCheck on this package. Note that it is the lsp-test_0_11_0_2, not lsp-test, so it has a narrow scope of impact.

It seems to work, let's squash and go

@GuillaumeDesforges
Copy link
Contributor Author

Rebased

@GuillaumeDesforges GuillaumeDesforges changed the title [WIP] haskell-language-server: init at 0.1.0.0 haskell-language-server: init at 0.1.0.0 Jun 25, 2020
Copy link
Member

@cdepillabout cdepillabout left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GuillaumeDesforges Thanks for working on this!

I think this is looking pretty good. I left a few comments on things to fix up, but in general this is looking good.

pkgs/development/haskell-modules/hackage-packages.nix Outdated Show resolved Hide resolved
pkgs/development/haskell-modules/configuration-common.nix Outdated Show resolved Hide resolved
pkgs/development/haskell-modules/configuration-common.nix Outdated Show resolved Hide resolved
pkgs/development/haskell-modules/configuration-common.nix Outdated Show resolved Hide resolved
.gitignore Outdated Show resolved Hide resolved
@GuillaumeDesforges
Copy link
Contributor Author

Thanks @cdepillabout for the feedback, will do it right away 👍

@GuillaumeDesforges
Copy link
Contributor Author

Lost a lot of time when trying to automate the update process since cabal2nix was not fetching the same revision of the ghcide fork as the one used by hls, but now this looks pretty good!

@maralorn
Copy link
Member

maralorn commented Jun 29, 2020

@GuillaumeDesforges Thank you for putting so much work into this!

I have compiled and tested this on a project of mine with neovim+coc.nvim. Works like a charm.

We should probably do something like #89450 for haskell-language-server, too.

I have also tried running the ./update.sh script. It reproduced exactly the same to nix expressions. Seems to work.

@GuillaumeDesforges
Copy link
Contributor Author

We should probably do something like #89450 for haskell-language-server, too.

I'm open to suggestions, but I think this can be done in another PR so that this "step" is closed and I can move on in my life ;)

@maralorn
Copy link
Member

We should probably do something like #89450 for haskell-language-server, too.

I'm open to suggestions, but I think this can be done in another PR so that this "step" is closed and I can move on in my life ;)

By all means. Let‘s do that in a later PR.

@maralorn
Copy link
Member

@GrahamcOfBorg build haskellPackages.haskell-language-server

@cdepillabout
Copy link
Member

@GuillaumeDesforges This looks good! Thanks for going back and forth with us so much on this.

@maralorn Thanks for your reviews as well.

@cdepillabout cdepillabout merged commit bc6776a into NixOS:haskell-updates Jun 30, 2020
@GuillaumeDesforges
Copy link
Contributor Author

Thank you very much for your time and comments, I learned a lot doing this PR :)

@GuillaumeDesforges GuillaumeDesforges deleted the haskell-language-server branch June 30, 2020 07:54
@poscat0x04
Copy link
Contributor

this package doesn't build for ghc 8.10.1 btw:

nix-repl> :b nixpkgs.haskell.packages.ghc8101.haskell-language-server
builder for '/nix/store/csy7bipjf6hcqkvzyfa3mksz6gaphq09-data-tree-print-0.1.0.2.drv' failed with exit code 1; last 10 log lines:
    $, called at libraries/Cabal/Cabal/Distribution/Simple/Configure.hs:1024:20 in Cabal-3.2.0.0:Distribution.Simple.Configure
    configureFinalizedPackage, called at libraries/Cabal/Cabal/Distribution/Simple/Configure.hs:477:12 in Cabal-3.2.0.0:Distribution.Simple.Configure
    configure, called at libraries/Cabal/Cabal/Distribution/Simple.hs:625:20 in Cabal-3.2.0.0:Distribution.Simple
    confHook, called at libraries/Cabal/Cabal/Distribution/Simple/UserHooks.hs:65:5 in Cabal-3.2.0.0:Distribution.Simple.UserHooks
    configureAction, called at libraries/Cabal/Cabal/Distribution/Simple.hs:180:19 in Cabal-3.2.0.0:Distribution.Simple
    defaultMainHelper, called at libraries/Cabal/Cabal/Distribution/Simple.hs:116:27 in Cabal-3.2.0.0:Distribution.Simple
    defaultMain, called at Setup.hs:2:8 in main:Main
  Setup: Encountered missing or private dependencies:
  base >=4.8 && <4.14
cannot build derivation '/nix/store/4dc9dn4h0pqqwm854sz56nkfksf5b2d3-brittany-0.12.1.1.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/9x573ymz2j3387gvhbdrkibhxj0cra1j-haskell-language-server-0.1.0.0.drv': 1 dependencies couldn't be built
[1 built (1 failed), 305 copied (2342.7 MiB), 181.3 MiB DL]
error: build of '/nix/store/9x573ymz2j3387gvhbdrkibhxj0cra1j-haskell-language-server-0.1.0.0.drv' failed

@GuillaumeDesforges
Copy link
Contributor Author

this package doesn't build for ghc 8.10.1

It would be needed to make overrides in all the different GHC configurations.

It is true I only tested 8.8.3 (current "main" GHC on nixpkgs)

@maralorn
Copy link
Member

maralorn commented Jul 3, 2020

Well that concrete issue seems likely to be solvable with one simple jailbreak and is an easy upstream issue.

@GuillaumeDesforges
Copy link
Contributor Author

@poscat0x04 If it's an upper bound issue, could you please report to upstream?

@poscat0x04
Copy link
Contributor

@poscat0x04
Copy link
Contributor

this is the corresponding upstream issue: lspitzner/brittany#269

@GuillaumeDesforges
Copy link
Contributor Author

If it is bound to be fixed, we can just wait for upstream to fix.

@414owen
Copy link
Contributor

414owen commented Jul 8, 2020

Seems broken on GHC 8.6.5:

nix-repl> :b (import ../../nixpkgs {}).haskell.packages.ghc865.haskell-language-server
builder for '/nix/store/rfdc1s19l2j4ad0g79kw92dkglfa6a7f-rebase-1.6.1.drv' failed with exit code 1; last 10 log lines:
    die', called at libraries/Cabal/Cabal/Distribution/Simple/Configure.hs:950:20 in Cabal-2.4.0.1:Distribution.Simple.Configure
    configureFinalizedPackage, called at libraries/Cabal/Cabal/Distribution/Simple/Configure.hs:460:12 in Cabal-2.4.0.1:Distribution.Simple.Configure
    configure, called at libraries/Cabal/Cabal/Distribution/Simple.hs:596:20 in Cabal-2.4.0.1:Distribution.Simple
    confHook, called at libraries/Cabal/Cabal/Distribution/Simple/UserHooks.hs:67:5 in Cabal-2.4.0.1:Distribution.Simple.UserHooks
    configureAction, called at libraries/Cabal/Cabal/Distribution/Simple.hs:178:19 in Cabal-2.4.0.1:Distribution.Simple
    defaultMainHelper, called at libraries/Cabal/Cabal/Distribution/Simple.hs:115:27 in Cabal-2.4.0.1:Distribution.Simple
    defaultMain, called at Setup.hs:2:8 in main:Main
  Setup: Encountered missing dependencies:
  time ==1.9.*

@maralorn
Copy link
Member

maralorn commented Jul 8, 2020

@414owen at the time ghc 8.8 came out no one had ever heard of the haskell-language-server project. So I am not sure if it is very reasonable to expect this to work. That being said. Maybe you wanna try with "pkgs.haskell.lib.doJailbreak"?

@414owen
Copy link
Contributor

414owen commented Jul 8, 2020

Cool, I'll give it a shot.
Previously I was using haskell-language-server on 8.6.5 through nix with https://github.com/korayal/hls-nix/blob/master/default.nix
Pretty happy hls is landing in nixpkgs.

@414owen 414owen mentioned this pull request Jul 8, 2020
10 tasks
@GuillaumeDesforges
Copy link
Contributor Author

I definitly have to test on the different available GHCs, for now I only developped the expression for 8.6.5. My apologies for the lack of clarity about that.
If you could work on 8.6.5 @414owen I'd be really glad!

@414owen
Copy link
Contributor

414owen commented Jul 9, 2020

@GuillaumeDesforges sure thing. This line is all it took to get it to build on 8.6.5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants