Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Upgrade Fourmolu to 0.13.1.0 #3762

Closed
wants to merge 2 commits into from
Closed

Upgrade Fourmolu to 0.13.1.0 #3762

wants to merge 2 commits into from

Conversation

ad-si
Copy link

@ad-si ad-si commented Aug 16, 2023

As requested in fourmolu/fourmolu#357.

Must the nix files also be updated in this PR?

@brandonchinn178
Copy link
Contributor

@joyfulmantis should fourmolu be pinned in stack.yaml? Maybe the HLS build should just always get the latest version of fourmolu available?

@michaelpj
Copy link
Collaborator

I think this comment is wrong: fourmolu/fourmolu#357 (comment)

The stack build configuration is not used for anything other than testing. We use cabal to build the binaries. So for some reason cabal is picking an older version of fourmolu in that build. Hard to know why without looking at the build plan. If you want to force a newer version then you should change the bounds in the plugin cabal file to force it!

@michaelpj
Copy link
Collaborator

TBH this bound looks far too permissive to me: https://github.com/haskell/haskell-language-server/blob/master/plugins/hls-fourmolu-plugin/hls-fourmolu-plugin.cabal#L35

I'm not sure we gain anything from telling cabal we allow all these versions, in fact we probably want to use the newest major version whenever possible. So I'd probably just change that to ^>= 0.13.

@joyfulmantis
Copy link
Collaborator

TBH this bound looks far too permissive to me: https://github.com/haskell/haskell-language-server/blob/master/plugins/hls-fourmolu-plugin/hls-fourmolu-plugin.cabal#L35

I'm not sure we gain anything from telling cabal we allow all these versions, in fact we probably want to use the newest major version whenever possible. So I'd probably just change that to ^>= 0.13.

Yes, as long as the latest version works with all of our ghc versions, there is no reason to support older versions. This to be honest should probably also be done with stylish-haskell and the ormolu plugin, as they both have the same OR dependency on their main library.

@brandonchinn178
Copy link
Contributor

Ok, I can change it to just 0.13. @ad-si feel free to close

@michaelpj
Copy link
Collaborator

I guess having wider version bounds lets people who are manually building HLS pick an older version of fourmolu or something, but that's somewhat niche.

@brandonchinn178
Copy link
Contributor

@michaelpj oh HLS builds binaries for multiple versions of GHC, right? So we do need to support multiple versions of fourmolu for each version of GHC fourmolu supports. e.g. I see there's a configuration-ghc-90.nix file, and fourmolu 0.13 won't build for GHC 9.0

@michaelpj
Copy link
Collaborator

Right, so we need to keep at least enough of a range to support all the GHC versions we support.

Generally this is a bit awkward: it's not clear that there's an obvious way to ensure that we are generally building with "the latest version of tools that are compatible with our GHC version" or something. I guess we could do

if impl(ghc <9.2)
   build-depends: fourmolu ^>= 0.12
else
   build-depends: fourmolu ^>= 0.13

or something, but that's also a bit ugly.

@July541
Copy link
Collaborator

July541 commented Aug 17, 2023

For current, ghc8.10 using fourmolu-0.3.0.0, ghc9.0 and ghc9.2 using fourmolu-0.10.1.0, ghc9.4 and ghc9.6 using fourmolu-0.13.0.0. These depend on which ghc-lib-parser the corresponding ghc is using.

@brandonchinn178
Copy link
Contributor

@July541 Thanks. In the original issue, they were using HLS 2.1.0.0 with GHC 9.4.5, but they still got fourmolu 0.12. Any idea how that happened?

@July541
Copy link
Collaborator

July541 commented Aug 17, 2023

Not sure about the details, but we dont' have fourmolu-0.13.0.0 until #3744, maybe it's the HLS compiled before #3744?

And #3744 also added a debug level log about fourmolu version and ormolu version.

@brandonchinn178
Copy link
Contributor

New PR: #3764

@brandonchinn178
Copy link
Contributor

Oh ok so I added 0.13 support in June: July541@c126332

But @joyfulmantis removed it, probably a bad rebase: July541@a918c02#diff-657e190925739b6d16d46aa6956dda0e9de823cbe251a3672c5c6e412945ce5c

@joyfulmantis
Copy link
Collaborator

Oh ok so I added 0.13 support in June: July541@c126332

But @joyfulmantis removed it, probably a bad rebase: July541@a918c02#diff-657e190925739b6d16d46aa6956dda0e9de823cbe251a3672c5c6e412945ce5c

Yeah, that must have been a bad rebase. Sorry about that!

- fourmolu-0.12.0.0
- fourmolu-0.13.1.0
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this is necessary anymore. I removed this line in #3764, and the stack snapshot should just be using whatever version of fourmolu is in the snapshot.

And this snapshot is only used for build; cabal is used to build the release artifacts. I think the PR can just be closed

@michaelpj
Copy link
Collaborator

Yep, this is obsolete now

@michaelpj michaelpj closed this Sep 7, 2023
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.

5 participants