kowainik / stan

🕵️ Haskell STatic ANalyser
https://kowainik.github.io/projects/stan
Mozilla Public License 2.0
562 stars 48 forks source link

Support GHC 9.8 #525

Closed tomjaguarpaw closed 8 months ago

tomjaguarpaw commented 8 months ago

Blocked on

0rphee commented 8 months ago

Hi again @tomjaguarpaw ! I guess I'll try to add support for 9.8..

Any recommendations/advise from what you did to support 8.8 - 9.6?

Currently I only been trying to fix dependency issues with trial, trial-tomland, &tomland. But the final blocker seems to be relude, as it hasn't updated for base-4.19 yet. (I forked the other ones, bumping dependency bounds, seemingly without building issues)

tomjaguarpaw commented 8 months ago

Thanks for offering to look at this!

I recommend ignoring dependencies for now, and just building with cabal build --allow-newer/cabal test --allow-newer. I'm working on sorting out the dependencies in the background, and have offered @vrom911 to be co-maintainer of the packages that are not up to date.

The kind of changes you'll have to make are demonstrated in 02dfc3acc0fe22bf90c86a2f9f7e1eb1b35604b7. Specifically, you'll either have to extend the following modules to 9.8, or, if the GHC API has changed the things we use, add new ones:

When you've done that, and stan builds, you may get test errors due to names changing between 9.6 and 9.8. That's why the change from GHC.Tuple to GHC.Tuple.Prim was needed in the linked commit.

But, if you do get test errors, it's probably best to report back, because debugging is really fiddly and I'll have to explain how to dig in further.

tomjaguarpaw commented 8 months ago

To get into something specific to start with, if I do

cabal test --allow-newer --with-ghc ghc-9.8

then I see

src/Stan/Hie/Debug902.hs:43:25: error: [GHC-61689]
    Module ‘GHC.Types.Avail’ does not export ‘GreName(..)’.
   |
43 | import GHC.Types.Avail (GreName (..))
   |                         ^^^^^^^^^^^^

That means that src/Stan/Hie/Debug902.hs will have to be copied over to src/Stan/Hie/Debug908.hs and edited to make it work with the latest GHC 9.8 API by finding what the new name for GreName is by comparing

(then src/Stan/Hie/Debug.hs will have to be edited to import the 9.8 module appropriately).


Give that a go, and feel free to ask any questions here at any point!

0rphee commented 8 months ago

Thanks for the comprehensive overview! I'll se what I can do and report back

tomjaguarpaw commented 8 months ago

Resolved by