haskell / haskell-language-server

Official haskell ide support via language server (LSP). Successor of ghcide & haskell-ide-engine.
Apache License 2.0
2.65k stars 355 forks source link

Support for ghc-9.2.* #2179

Closed jneira closed 2 years ago

jneira commented 3 years ago

State of support

Has ghc-9.2.1 support

Formatters

Build system and CI

Dependencies which needs updates and hackage release

fendor commented 3 years ago

The MR #2128 adds compat module hierarchy and functions compatible with the GHC API 9.2 in a backward compatible manner. With I think roughly 3 exceptions (which require some small changes), bringing basic support for ghc-9.2 is a matter of adding the appropriate imports, once retrie supports ghc-9.2.

Dessix commented 2 years ago

Looks like the next portion of this is dependent on support for 9.2 in retrie, which has a WIP that needs carried over the finish-line.

jneira commented 2 years ago

as noted by @Ailrun here https://github.com/haskell/haskell-language-server/issues/297#issuecomment-954904749 ghc-9.2.1 has been released

mouse07410 commented 2 years ago

How near are we to releasing 1.5.0, and would it include GHC-9.2.1 support?

jneira commented 2 years ago

Hi, 1.5.0 will be released soon but i am afraid it will not include ghc-9.2.1 for sure, there is still lot of work to be done here

mouse07410 commented 2 years ago

I am afraid it will not include ghc-9.2.1 for sure, there is still lot of work to be done here

Maybe at least include partial support??? (Assuming it can be done and makes sense)

jneira commented 2 years ago

I am afraid it will not include ghc-9.2.1 for sure, there is still lot of work to be done here

Maybe at least include partial support??? (Assuming it can be done and makes sense)

I am afraid that this is blocked on a ghcide change and ghcide is the core of hls so we cant release it even partially.

Ailrun commented 2 years ago

Related PR: nikita-volkov/ptr-poker#7 (which is a dependency of jsonify, which is in turn of opentelemetry-extra)

Dessix commented 2 years ago

ghc-exactprint-1.3.0 has been released - that was the portion that was blocking retrie itself; the next step is to update retrie to use it, and then it can be used for HLS 9.2.

There's a work-in-progress branch at https://github.com/alanz/retrie/tree/ghc-9.2 - it appears they're stuck on something related to fixity processing.

Ailrun commented 2 years ago

@Dessix The branch is actually merged now. It's now the problem of release (However, even after that, we still have opentelemetry-extra issue)

Dessix commented 2 years ago

Looks like the retrie release went through.

ptr-poker #7 is also released. What can we do to move this forward into jsonify and subsequently opentelemetry-extra?

Ailrun commented 2 years ago

Unfortunately, there wese mistakes in the PR and in a fix committed afterwards. This PR fixes those mistakes: https://github.com/nikita-volkov/ptr-poker/pull/8

pepeiborra commented 2 years ago

We don't really depend on opentelemetry-extra, only on opentelemetry. Does that help?

Ailrun commented 2 years ago

Huh? then Why do I get issues from a transitive dependency of opentelemetry-extra? That's weird... let me check..

Oh, that was actually of our flake setting! Weird... is there any reason to use opentelemetry-extra?

pepeiborra commented 2 years ago

opentelemetry-extra provides tools to analyse eventlogs in Tracy, Chrome and other open telemetry viewers. The flake builds it because I use it.

Ailrun commented 2 years ago

@pepeiborra: Thank you for the answer. I think, as both opentelemetry and opentelemetry-extra are managed in the same directory and as their CI fails under GHC 9.2, the situation remains the same, unfortunately. I listed some issues I experienced while I tried to build GHCIDE with GHC 9.2:

GHC 9.2 support of GHCIDE (probably not yet exhaustive):

Main library

pepeiborra commented 2 years ago

opentelemetry installs without issues for me:

cabal install opentelemetry --overwrite-policy=always -w ghc-9.2 
Resolving dependencies...
Build profile: -w ghc-9.2.1 -O1
In order, the following will be built (use -v for more details):
 - ghc-trace-events-0.1.2.4 (lib) (requires build)
 - opentelemetry-0.7.0 (lib) (requires build)
Starting     ghc-trace-events-0.1.2.4 (lib)
Building     ghc-trace-events-0.1.2.4 (lib)
Installing   ghc-trace-events-0.1.2.4 (lib)
Completed    ghc-trace-events-0.1.2.4 (lib)
Starting     opentelemetry-0.7.0 (lib)
Building     opentelemetry-0.7.0 (lib)
Installing   opentelemetry-0.7.0 (lib)
Completed    opentelemetry-0.7.0 (lib)
pepeiborra commented 2 years ago

WIP branch here: https://github.com/haskell/haskell-language-server/compare/ghc-9.2?expand=1

Ailrun commented 2 years ago

Awesome, let's wait how GHC 9.2 support goes in other repositories...

wz1000 commented 2 years ago

We can use head.hackage to obtain a build plan. It already has patches for th-extras, constraints-extras and primitive-unlifted

Edit: Oh I see that is what Pepe's branch does.

pepeiborra commented 2 years ago

We can use head.hackage to obtain a build plan. It already has patches for th-extras, constraints-extras and primitive-unlifted

It has a patch for primitive-unlifted-0.1.3.0 but it looks like we need a newer version:

cabal: Could not resolve dependencies:
[__0] trying: ghcide-1.5.0.1 (user goal)
[__1] trying: stm-containers-1.2 (dependency of ghcide)
[__2] trying: stm-hamt-1.2.0.7 (dependency of stm-containers)
[__3] trying: primitive-extras-0.10.1.2 (dependency of stm-hamt)
[__4] next goal: primitive-unlifted (dependency of primitive-extras)
[__4] rejecting: primitive-unlifted-1.0.0.0, primitive-unlifted-0.1.3.1
(constraint from project config
/Users/pepeiborra/scratch/ide/cabal-ghc921.project requires ==0.1.3.0)
[__4] rejecting: primitive-unlifted-0.1.3.0 (conflict: primitive-extras =>
primitive-unlifted>=1.0 && <1.1)
Bodigrim commented 2 years ago

Because of https://github.com/haskell-primitive/primitive-unlifted/issues/28 you need the following incantation:

allow-newer:
  primitive-unlifted:base,
allow-older:
  primitive-extras:primitive-unlifted
constraints:
  primitive-unlifted < 1

If the issue with GHC 9.2 support in primitive-unlifted gets stalled, Hackage trustees can make revisions to avoid allow-newer / allow-older.

Bodigrim commented 2 years ago

I believe primitive-{extras,unlifted} tweaks are no longer needed now.

Dessix commented 2 years ago

2503 has been merged, as have primitive-unlifted and Aeson support for 9.2.1; What's the next blocker, or are we just waiting for the next release?

pepeiborra commented 2 years ago

HEAD already has experimental support for GHC 9.2 - just waiting for a release now.

jneira commented 2 years ago

I've updated the issue description with a detailed check list tracking ghc-9.2.1 support

lilnasy commented 2 years ago

If there are beginner friendly tasks for 9.2 support, I'd love to help out.

jneira commented 2 years ago

If there are beginner friendly tasks for 9.2 support, I'd love to help out.

@lilnasy Many thanks for the offer. Well there are some plugins without 9.2.1 support. Some of thems need updates in the underlying library so they are blocked. Afaik the plugins which could be adapted would be:

Not sure about retrie plugin neither, which needs support for retrie library (//cc @pepeiborra)

mouse07410 commented 2 years ago

Somewhat out of topic: what about 9.0.2? Stackage moved nightly to 9.0.2, but HLS is still 9.0.1-only.

jneira commented 2 years ago

Somewhat out of topic: what about 9.0.2? Stackage moved nightly to 9.0.2, but HLS is still 9.0.1-only.

Support was tracked with https://github.com/haskell/haskell-language-server/issues/2541 and added with https://github.com/haskell/haskell-language-server/pull/2567 so the next release will include it

TeofilC commented 2 years ago

hlint-3.4 has just been released with support for ghc-9.2 https://hackage.haskell.org/package/hlint-3.4/changelog

konn commented 2 years ago

GHC 9.2.3 has just been released, so it might be the time to tackle it.

Dessix commented 2 years ago

2732 (OverloadedRecordDot support) may be worth adding to the checklist, as the IDE gets somewhat confused with 9.2's new record syntax otherwise.

mouse07410 commented 2 years ago

Any word on GHC-9.2.3 support yet? It shouldn't be too different from 9.2.2 from the HLS point of view, I'd imagine?

maerten commented 2 years ago

There's a PR for 9.2.3: https://github.com/haskell/haskell-language-server/pull/2936

jneira commented 2 years ago

Sorry this issue is outdated and i dont have time to keep up to date, please open a new one if you want to track support for newer versions of ghc-9.2