Skip to content

[WIP] Better HLS support for GHC 9.2#21

Draft
arjunkathuria wants to merge 3 commits intomainfrom
bump-nixpkgs-for-newer-hls
Draft

[WIP] Better HLS support for GHC 9.2#21
arjunkathuria wants to merge 3 commits intomainfrom
bump-nixpkgs-for-newer-hls

Conversation

@arjunkathuria
Copy link
Contributor

@arjunkathuria arjunkathuria commented Jan 7, 2024

What does this PR do

This PR introduces improved HLS support for Haskell-Language-Server (HLS) for all repos using the common GHC 9.2 nixpkgs provided by this repo.

Key changes here include:-

  • Bumps nixpkgs input to newer to get the newer version of HLS
  • Update base package-set from ghc927 to ghc928.

GHC 9.2.8 has the best support amongst all GHC 9.2.x versions with newer upstream HLS releases and almost all tier-1 and tier-2 plugins are expected to work. This puts us in a near best-case scenario HLS experience for our projects, while still being on GHC 9.2

Motivation

There've been reports of haskell-language-server (HLS) not working well-enough for around ~half the files in the main NY repo.

• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/0c7ffbc66e6d78c50c38e717ec91a2a14e0622fb' (2023-10-02)
  → 'github:nixos/nixpkgs/63143ac2c9186be6d9da6035fa22620018c85932' (2024-01-02)

This nixpkgs update affords us to use a newer version of HLS available with nix.

This takes us from:-

haskell-language-server 2.1.0.0 (current) -> haskell-language-server 2.4.0.0 (new)

HLS is being updated all the time and newer versions often have cool fixes, perf improvements and improved platform support. Newer versions also tend to increasingly work in more scenarios.

This should help with the dev experience.

Task checklist

The following list of tasks are planned / completed and are required for this to be able to get merged in:-

  • Bump nixpkgs to latest/ newer commit.
  • Upgrade to GHC 9.2.8 by using the ghc928 package set.
  • Check if latest commit at the time in shared-kernel repo main branch builds with these changes.
    ( commit built 233fe272c918256a5a10751de7fc1a436dad6442 ) ✅
    and then again ( commit built dba9d4b41af9ad50de11d30f74d9797037cb366f ) ✅
  • Check if latest commit at the time in beckn-gateway repo main branch builds with these changes.
    ( commit built:- 247cf21fb59dda40faa0be3c9264bda68237a8b5) ✅
    and then again ( commit built 50136fa3695e484296d2f06ca59464e6ee0f767d ) ✅
  • Check if latest commit at the time in main nammayatri repo main branch builds with this.
    ( commit built:- 355fce96b0d3a931c70f55522161fab7eb4af847 ) ✅
  • Check if latest commit at the time in namma-dsl repo main branch builds with this new package-set.
    ( commit built:- 99ea894ee5879bfef574f850dc64f99c2a953d99 ) ✅
    and then again ( commit built 8aaf1c30acb48b9798d7c7ef381146ff28fab3bf ) ✅
  • Check builds on macos M1
  • Test a local ride-flow
  • TBD ???

cc: @0utkarsh

@srid
Copy link
Member

srid commented Jan 7, 2024

Is this ready to be merged, and has been tested in nammayatri build?

@arjunkathuria
Copy link
Contributor Author

arjunkathuria commented Jan 8, 2024

I'd let it hang around for a day or two, should anyone have any feedback/concerns/suggestions.

It was tested with a build of shared-kernel ( less deps to build locally ), it built alright. The HLS experience was quite pleasant with the newer version, worked instantly and nicely.

If no further concerns emerge (any blockers for this update to go in etc.), we'd do a full main NY repo build and probably a local ride-flow test before merging this in.

@arjunkathuria
Copy link
Contributor Author

Drafting for now.

Making some changes. BRB.

@arjunkathuria arjunkathuria marked this pull request as draft January 9, 2024 07:37
@arjunkathuria arjunkathuria changed the title Update nixpkgs for newer HLS version [WIP] Better HLS support for GHC 9.2 Jan 14, 2024
Bumps nixpkgs input to newer to get the newer version of HLS

• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/0c7ffbc66e6d78c50c38e717ec91a2a14e0622fb' (2023-10-02)
  → 'github:nixos/nixpkgs/63143ac2c9186be6d9da6035fa22620018c85932' (2024-01-02)
Moves to using GHC 9.2.8 as the base package-set,
updating from the earlier GHC 9.2.7 package set.

GHC 9.2.8 is the compiler version that's best supported
by HLS in the 9.2 series, looking at it's support table.

This would bring the best-case scenario for HLS for us,
as much as we can hope on 9.2 series.
Pins "persistent" package to version "2.14.5.2".

The version "2.14.6.0" in the nixpkgs has issues
building with the main nammayatri repo.
@arjunkathuria arjunkathuria force-pushed the bump-nixpkgs-for-newer-hls branch from 6412aaf to 6785ebd Compare January 29, 2024 10:48
@arjunkathuria
Copy link
Contributor Author

arjunkathuria commented Jan 29, 2024

* Forced push after new rebase *

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants