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
Unbreak ghcide and bump haskell-lsp version #75449
Conversation
da9ccdc
to
7461625
Compare
- haskell-lsp ==0.15.0.0 | ||
- haskell-lsp-types ==0.15.0.0 | ||
- haskell-lsp ==0.17.0.0 | ||
- haskell-lsp-types ==0.17.0.0 |
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.
In general, the Haskell stuff in nixpkgs tracks the latest LTS release. We don't override these package versions with our own updated versions (since this could break a lot of stuff).
If you look at the top of this list here, you can see that these packages are locked to versions from the latest LTS. (peti updates these weekly, you can watch live if you're interested: https://www.twitch.tv/peti343)
It appears that the latest version of ghcide requires haskell-lsp ==0.17.*, haskell-lsp-types ==0.17.*
, which is later than the version from LTS-14.
However, hackage2nix generates the latest versions of packages in the LTS as well, so haskellPackages.haskell-lsp_0_18_0_0
and haskellPackages.haskell-lsp-types_0_18_0_0
should be available.
I suggest trying to override ghcide to use these two package versions and then jailbreaking the cabal file.
Here's an example of hnix
overriding package versions as well as using doJailbreak
:
nixpkgs/pkgs/development/haskell-modules/configuration-common.nix
Lines 230 to 233 in 63f6681
hnix = | |
generateOptparseApplicativeCompletion "hnix" ( | |
dontCheck (doJailbreak (super.hnix.override { these = self.these_0_7_6; })) | |
); |
Could you update this PR to remove the above lines from configuration-hackage2nix.yaml
, and instead adding an entry for ghcide
to configuration-common.nix
?
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 suggest trying to override ghcide to use these two package versions and then jailbreaking the cabal file.
Oh, and let me know if this doesn't work. There is a way to force hackage2nix
to generate arbitrary package versions (so we could make it generate haskellPackages.haskell-lsp_0_17_0_0
for ghcide
).
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.
Thanks for your explanations! Do I have to run hackage2nix
locally to test my changes?
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.
@turion No, peti runs hackage2nix
locally, so you don't have to do it in this PR.
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.
Unfortunately ghcide
does not build with haskell-lsp-0.18
. We probably need to make a haskellPackages.haskell-lsp_0_17_0_0
, but I don't know how. In parallel, I'll start and (send a PR to) upgrade ghcide
to build with a newer haskell-lsp
.
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 see. I'm working towards 1. then first :)
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.
ghcide
with haskell-lsp-0.18
is released. I don't really understand how this change gets here. Do I just wait and rebase?
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 really understand how this change gets here.
I think there is an automatic script that updates the haskell-updates
branch with recent package versions from Hackage. (Or maybe it is semi-automatic and peti has to run it by hand)
You can see the current state of haskell-updates
here (including a bunch of commits with the message hackage-packages.nix: automatic Haskell package set update
):
At some point (maybe today or tomorrow?) one of these Haskell package set updates should contain the new version of ghcide
. At that point you should be able to rebase this PR on haskell-updates
and use the new version of haskell-lsp
.
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.
Ok. Thanks for all your explanations!
Is this whole workflow documented somewhere? Just in case peti goes on a 2 month vacation and someone needs to pick up the reign ;)
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.
It is somewhat documented in the hackage2nix
Readme:
https://github.com/NixOS/cabal2nix/tree/master/hackage2nix
There is also a youtube video showing the steps:
https://www.youtube.com/watch?v=qX0mgtSm360
Also, peti streams live these updates, so if you watch him doing it once or twice, you should get a good idea of how to do it:
https://discourse.nixos.org/t/please-join-the-new-weekly-haskell-updates-video-livestream/4420
14b0fb3
to
9c01e12
Compare
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.
Can you please re-base this PR on top of a current version of haskell-updates
to resolve the merge conflicts?
This update was generated by hackage2nix v2.15.0-9-g650d530 from Hackage revision commercialhaskell/all-cabal-hashes@dc5b0e7.
3814616
to
8bee1b9
Compare
@peti Yes, since the conflicts are only internal to |
Another dependency, |
Seems nontrivial to fix. I'll add |
7461625
to
6417091
Compare
Fixing |
I'm a bit out of ideas. The upstream version for |
@turion You are discovering why people use |
@turion What you can do is send a PR adding a line to this list: nixpkgs/pkgs/development/haskell-modules/configuration-hackage2nix.yaml Lines 2475 to 2536 in c8c7398
like - haskell-lsp == 0.18.0.0 # for ghcide-0.4 (or whatever is the correct ghcide version) Once this gets merge into You should be able to use this package in an override to |
Hehe, yes ;) but I haven't given up on |
@cdepillabout I guess I could, but this is quite a manual and tiresome cycle. I'll just wait until upstream has released a new version. https://github.com/digital-asset/ghcide/issues/277 This whole workflow feels like it's going to break every time e.g. |
@turion Sorry this is somewhat of a manual/annoying process.
For the most part, yes.
There are some cases where the situation would stabilize:
Unfortunately, the Haskell stuff in nixpkgs doesn't work too well for new packages that aren't in Stackage and have frequent releases to Hackage. As suggested by mpickering, creating an overlay with known package versions (or using a tool like Creating a |
@cdepillabout Thank again you for your detailed explanations! It certainly helps me to understand the process and to more effectively contribute.
Ah, good point! So LTS in Haskell on |
I have attempted to fix the |
6484351
to
1f79abf
Compare
This is why I maintain https://github.com/hercules-ci/ghcide-nix |
1f7024e
to
7d2cc64
Compare
@turion, do you still intend to update this PR? Or can it be closed? |
d3a751a
to
aa46cdd
Compare
aa46cdd
to
fdd64fb
Compare
Motivation for this change
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nix-review --run "nix-review wip"
./result/bin/
)nix path-info -S
before and after)Notify maintainers
cc @