Skip to content

Enable stylish-haskell for ghc-9.10 and ghc-9.12 #4559

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged

Conversation

GuillaumedeVolpiano
Copy link
Collaborator

With the release of stylish-haskell-0.15.0.0, it now builds with ghc-lib-parser-9.10, so we can enable the plugin for ghc-9.10.
Note that a ghc-lib-parser-9.12 version should be released soon.

@GuillaumedeVolpiano
Copy link
Collaborator Author

@fendor : I guess the tests will need to be rerun later, cabal is failing to find stylish-haskell-0.15.0.0, which was added to hackage yesterday…

@fendor
Copy link
Collaborator

fendor commented Apr 14, 2025

@GuillaumedeVolpiano You have to update the index-state in the cabal.project file. You can find your own index-state by running cabal update. You can just set that.
The CI will never find the newer version until you update the index-state in cabal.project, since we are intentionally freezing our dependencies to avoid build failures.

@GuillaumedeVolpiano GuillaumedeVolpiano force-pushed the stylish-haskell branch 2 times, most recently from 011e927 to d1d9db9 Compare April 14, 2025 10:18
@GuillaumedeVolpiano
Copy link
Collaborator Author

GuillaumedeVolpiano commented Apr 14, 2025

@jhrcek : stylish-haskell now needs Cabal-3.14, but this conflicts with a lot of things here. I can get stylish-haskell to compile nicely with Cabal-3.12 with the following changes to lib/Language/Haskell/Stylish/Config/Cabal.hs
`#if MIN_VERSION_Cabal(3,14,0)

  let projectRoot = Just $ Cabal.makeSymbolicPath p

  potentialCabalFile <- Cabal.findPackageDesc projectRoot

  case potentialCabalFile of

    Right cabalFile -> pure $ Just $

      Cabal.interpretSymbolicPath projectRoot cabalFile

    _ -> go (p : searched) ps

#else

 let projectRoot = p

 potentialCabalFile <- Cabal.findPackageDesc projectRoot

 case potentialCabalFile of

   Right cabalFile -> pure $ Just cabalFile

   _ -> go (p : searched) ps

#endif`

But I guess this kindof defeats your purpose. If not, I'll submit a PR there, hopefully we get a 0.15.0.1 version and everything will be simple then.

@fendor : I guess we need a Draft label here for now.

@fendor fendor marked this pull request as draft April 14, 2025 10:50
@jhrcek
Copy link
Collaborator

jhrcek commented Apr 14, 2025

Oh, that's not good. I guess that Jasper proactively bumped to the latest version of cabal syntax in haskell/stylish-haskell#489 before merging my 9.10 support PR.

I wonder if we could broaden the accepted version range of stylish-haskell's Cabal dependency (not really sure how Cabal stuff is used in stylish-haskell)?

@GuillaumedeVolpiano GuillaumedeVolpiano force-pushed the stylish-haskell branch 3 times, most recently from dce2c11 to 1d324d6 Compare April 19, 2025 15:32
@GuillaumedeVolpiano GuillaumedeVolpiano marked this pull request as ready for review April 19, 2025 15:33
@GuillaumedeVolpiano GuillaumedeVolpiano changed the title Enable stylish-haskell for ghc-9.10 Enable stylish-haskell for ghc-9.10 and ghc-9.12 Apr 19, 2025
@GuillaumedeVolpiano
Copy link
Collaborator Author

@fendor @michaelpj @jhrcek : this is now ready for review

Copy link
Collaborator

@fendor fendor left a comment

Choose a reason for hiding this comment

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

Lgtm! When can we drop support for stylish-haskell 0.14? Like, which ghc version is only compatible with the older stylish-haskell version?

@GuillaumedeVolpiano
Copy link
Collaborator Author

9.4

@GuillaumedeVolpiano GuillaumedeVolpiano enabled auto-merge (squash) April 19, 2025 16:44
Copy link
Collaborator

@jhrcek jhrcek left a comment

Choose a reason for hiding this comment

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

Great work, including pushing the work on upstream dependencies 👍

@GuillaumedeVolpiano GuillaumedeVolpiano merged commit 4747d37 into haskell:master Apr 19, 2025
41 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants