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

Flake ghc 92 #2621

Merged
merged 4 commits into from
Jan 24, 2022
Merged

Flake ghc 92 #2621

merged 4 commits into from
Jan 24, 2022

Conversation

guibou
Copy link
Collaborator

@guibou guibou commented Jan 21, 2022

This is (partial) flake support for GHC 9.2.

This is in a limited state, especially:

  • I have not repaired the support for a few plugins.
  • nix develop .#....-dev target is not working, it pulls a few dependencies which are not overiden. I'll give another pass soon.

But the cool thing is that it allows to build haskell-language-server from flake in another project. I've just updated my work project to GHC 9.2 and I'm enjoying HLS thank to this flake.

Tell me if you prefer to merge "partial" support or if I need to work on the currently broken tasks. I cannot guarantee that I'll allocate time to this soon.

However, users can find this MR and point their flake to this commit and immediately get HLS in their project.

This will be easier to update, and pass them as one dictionary.
I've naively copied most of the special cases for `GHC 9.0.1`.

- `nix develop .\#haskell-language-server-921` gives me a shell in
  which I'm able to `cabal build`
- `nix build .#haskell-language-server-921` builds HLS binary. I was
  able to use it in a proprietary codebase (by importing the flake) and
  it works fine.
- some plugins are disabled, `brittany`, `stylishhaskell`, `hlint`,
  `haddockComments`, `alternateNumberFormat`. I didn't fight too much to
  fix this because I'm not using them. I'll do an effort in the future
  to fix them.
- `nix develop .\#haskell-language-server-921-dev` does not starts, I
  need to investigate.
@guibou
Copy link
Collaborator Author

guibou commented Jan 21, 2022

For reference, here is the command I used in my project to upgrade HLS, where hls is the name of my flake input:

nix flake lock --override-input hls github:guibou/haskell-language-server/flake_ghc_92

And obviously:

        hls = inputs.hls.packages.${system}."haskell-language-server-921";

somwhere.

@guibou
Copy link
Collaborator Author

guibou commented Jan 21, 2022

/cc @teto

@jneira jneira requested review from berberman and michaelpj January 21, 2022 21:36
Copy link
Collaborator

@michaelpj michaelpj left a comment

Choose a reason for hiding this comment

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

Are you interested in maintaining these going forwards?

@michaelpj michaelpj added the merge me Label to trigger pull request merge label Jan 23, 2022
@teto
Copy link
Contributor

teto commented Jan 23, 2022

that may be the problem you are referring to, but putting it there just in case, since it's an area that is under active development in nix: With nix 2.6.0pre20211217_6e6e998

nix develop .#haskell-language-server-921-dev          
AWS error 'RequestTimeTooSkewed' (The difference between the request time and the current time is too large.), will retry in 0 ms
error: cannot fetch input 'path:./flake_hackage?narHash=sha256-gVzFEW0y%2fuPHJaGJ6w7VZc3QDhH6latvmYHJuzaXDa0=' because it uses a relative path
(use '--show-trace' to show detailed location information)

Cool work o/

@michaelpj michaelpj removed the merge me Label to trigger pull request merge label Jan 23, 2022
@michaelpj
Copy link
Collaborator

Ah, that's a good point. Do flakes at relative paths work reliably? I remember there being issues with that.

@guibou
Copy link
Collaborator Author

guibou commented Jan 23, 2022

Ah, that's a good point. Do flakes at relative paths work reliably? I remember there being issues with that.

Initially I moved everything to a relative path flake because I wanted to have a flake only for the hackage dependencies and remove boilerplate, I tried that;

image

Unfortunately, it does not work, because flake does not "evaluate" nix language in the input section.

So actually, we can move everything back in the main flake.nix file. Let me do that tomorrow.

Are you interested in maintaining these going forwards?

Yes sure.

@jneira jneira added the merge me Label to trigger pull request merge label Jan 24, 2022
@jneira jneira mentioned this pull request Jan 24, 2022
32 tasks
@mergify mergify bot merged commit 6123268 into haskell:master Jan 24, 2022
@michaelpj
Copy link
Collaborator

I added you to the CODEOWNERS in #2619.

@guibou guibou deleted the flake_ghc_92 branch January 24, 2022 15:09
@smunix
Copy link
Contributor

smunix commented Jan 26, 2022

@guibou - I'm seeing this issue with the flake use at a relative path; is it possibly related to this fix?

/e/nixos (main ± u+4) ∫ sudo nixos-rebuild test --cores 10 --max-jobs 5                                             [21:08:41] 
building the system configuration...
warning: Git tree '/etc/nixos' is dirty
error: cannot fetch input 'path:./flake_hackage?narHash=sha256-%2fF3itZJSZDnaxRGpkTffHDkxC7PloYqxVTW%2f%2fbP3i20=' because it uses a relative path
(use '--show-trace' to show detailed location information)

I use flake with home-manager and that used to work before, but it no longer does.

@guibou
Copy link
Collaborator Author

guibou commented Jan 29, 2022

@smunix yes, that's unfortunately an issue. I'm working on a fix right now. Sorry for the inconvenience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge me Label to trigger pull request merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants