Skip to content

GHC 9.4 support#242

Closed
9999years wants to merge 1 commit intofourmolu:mainfrom
9999years:ghc94
Closed

GHC 9.4 support#242
9999years wants to merge 1 commit intofourmolu:mainfrom
9999years:ghc94

Conversation

@9999years
Copy link
Copy Markdown

@9999years 9999years commented Oct 21, 2022

@github-actions
Copy link
Copy Markdown

👋 @9999years
Thank you for raising your pull request.
Please make sure you have followed our contributing guidelines in DEVELOPER.md. We will review it as soon as possible!

Reviewer: Please verify the following things have been done, if applicable.

  • A file has been added to changelog.d/
  • "Configuration > Available options" section in README.md has been updated
  • "Configuration > Specifying configuration" section in README.md has been updated
  • fourmolu.yaml updated to stay in sync with config in README.md
  • Tests have been added

@parsonsmatt
Copy link
Copy Markdown
Collaborator

Looks like we'll need to drop GHC 8.10 support in order to support 9.4.2 - should be fine to delete that part of CI and raise our own lower bound on base.

import Data.List (intercalate)
import Distribution.Package (packageVersion)
import Distribution.PackageDescription.Parsec (readGenericPackageDescription)
import Distribution.Simple.PackageDescription (readGenericPackageDescription)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

ahhh this will probably fail when built with earlier Cabal - maybe,

#if MIN_VERSION_Cabal(3,8,0)
import Distribution.Simple.PackageDescription (readGenericPackageDescription)
#else
import Distribution.PackageDescription.Parsec (readGenericPackageDescription)
#endif

(not sure if this is built by all GHC or just most recent)

@georgefst
Copy link
Copy Markdown
Collaborator

Thanks for this! We usually wait for Ormolu to merge changes, and periodically merge Ormolu's master branch in to Fourmolu. Often this is when they make a release.

But even if we stick to that process, I'm sure your work here is useful and can be reused.

@brandonchinn178
Copy link
Copy Markdown
Collaborator

Thanks! Like @georgefst said, we usually wait for Ormolu to merge. While git should hopefully merge it correctly, if it doesnt, the conflicts can get ugly. Is there any particular reason to merge this into Fourmolu immediately, or is it ok to wait?

Another reason is that it'd be nice to wait until we can actually test with 9.4 in CI.

@parsonsmatt
Copy link
Copy Markdown
Collaborator

We use upstream PRs at mercury to track changes in our internal code - we're upgrading to GHC 9.4.2 now, and we need fourmolu to work on it.

@9999years
Copy link
Copy Markdown
Author

While git should hopefully merge it correctly, if it doesnt, the conflicts can get ugly.

There were a fair amount of conflicts getting this PR ported to fourmolu's codebase, but it didn't take more than a few hours to resolve them.

@brandonchinn178
Copy link
Copy Markdown
Collaborator

brandonchinn178 commented Oct 21, 2022

@parsonsmatt Does that require a merge, it would it simply need this PR to remain open?

@9999years sure, but then the conflicts merging ormolu's changes into fourmolu's changes that already partially incorporates ormolu's changes would be annoying

@9999years
Copy link
Copy Markdown
Author

The upstream PR has been merged but not released yet. Do we want to wait for a release to be cut before landing this?

@9999years
Copy link
Copy Markdown
Author

We're also integrating these changes into haskell-language-server to enable support for fourmolu there: haskell/haskell-language-server#3317

@brandonchinn178
Copy link
Copy Markdown
Collaborator

For the reasons I mentioned in my last comment, merging this will cause annoying conflicts when merging Ormolu. Hopefully Ormolu makes a release soon and we'll be able to merge it in soon after.

If this happens soon enough, we can just close this PR, as it'll be incorporated in the PR merging Ormolu

@brandonchinn178
Copy link
Copy Markdown
Collaborator

Merged in #259. Trying to get #257 merged before making a new release. Will do my best to make a new release shortly

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.

4 participants