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

Support building with GHC 9.4 #230

Merged
merged 3 commits into from
Jan 23, 2023
Merged

Support building with GHC 9.4 #230

merged 3 commits into from
Jan 23, 2023

Conversation

RyanGlScott
Copy link
Contributor

@RyanGlScott RyanGlScott commented Jan 18, 2023

This contains a varity of changes needed to make the libraries in the what4 repo compile with GHC 9.4:

  • GHC 9.4 is pickier about undecidable instance checking. See this section of the GHC 9.4 Migration Guide. As a result, I had to explicitly enable UndecidableInstances in What4.Utils.AbstractDomains to make it compile.
  • ST no longer has a MonadFail instance. See this section of the GHC 9.4 Migration Guide. To adapt to this change, I removed the MonadFail instance for VarRecorder, which was built on top of ST's MonadFail instance. Accordingly, all uses of fail at type VarRecorder have now been replaced with error.
  • I bumped the aig submodule to bring in the changes from Allow building with base-4.17.* (GHC 9.4.*) aig#13, which are required to make aig build with GHC 9.4.
  • I bumped the upper version bounds of various dependencies to allow them to build with GHC 9.4.

Fixes #224.

@RyanGlScott RyanGlScott requested a review from kquick January 18, 2023 15:30
Copy link
Member

@kquick kquick left a comment

Choose a reason for hiding this comment

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

As a minor suggestion, if you wanted to use 9.4.3 instead of 9.4.4, then the nixpkgs/22.11 could be used instead of nixpkgs-unstable (with the advantage that the former is... more stable), but we can also address this via the upcoming 23.05 release as well, so it's your call.

@RyanGlScott
Copy link
Contributor Author

I don't have a strong opinion on which minor 9.4 release to use, so I've changed it to GHC 9.4.3 / nixpkgs/22.05.

@kquick
Copy link
Member

kquick commented Jan 18, 2023

Ah, my mistake. I was getting the results of a searchlist when I looked to see what GHC version 22.11 had and a more recent set of packages was also available on the searchlist path. You do need to use nixos-unstable at present to get 9.4.4... sorry about that!

@RyanGlScott RyanGlScott force-pushed the ghc-9.4 branch 2 times, most recently from dd65bbc to 0edd1ad Compare January 18, 2023 18:50
This contains a varity of changes needed to make the libraries in the `what4`
repo compile with GHC 9.4:

* GHC 9.4 is pickier about undecidable instance checking. See
  [this section](https://gitlab.haskell.org/ghc/ghc/-/wikis/migration/9.4?version_id=24540b698481cf2b0bd11029b58eaddc0fbfbb31#stricter-undecidableinstances-checking)
  of the GHC 9.4 Migration Guide. As a result, I had to explicitly enable
  `UndecidableInstances` in `What4.Utils.AbstractDomains` to make it compile.
* `ST` no longer has a `MonadFail` instance. See
  [this section](https://gitlab.haskell.org/ghc/ghc/-/wikis/migration/9.4?version_id=b60e52482a666d25638d59cd7e86851ddf971dc1#st-is-no-longer-an-instance-of-monadfail)
  of the GHC 9.4 Migration Guide. To adapt to this change, I removed the
  `MonadFail` instance for `VarRecorder`, which was built on top of `ST`'s
  `MonadFail` instance. Accordingly, all uses of `fail` at type `VarRecorder`
  have now been replaced with `error`.
* I bumped the `aig` submodule to bring in the changes from
  GaloisInc/aig#13, which are required to make `aig`
  build with GHC 9.4.
* I bumped the upper version bounds of various dependencies to allow them to
  build with GHC 9.4.

Fixes #224.
GHC 9.4 adds `-Wtype-equality-requires-operators` to `-Wall`, which warns about
certain uses of type equalities that are not forward-compatible with planned
changes in GHC. See [this
section](https://gitlab.haskell.org/ghc/ghc/-/wikis/migration/9.4?version_id=b60e52482a666d25638d59cd7e86851ddf971dc1#-is-now-a-type-operator)
of the GHC 9.4 Migration Guide. These warnings are easily fixed by enabling the
`TypeOperators` extension.
@RyanGlScott RyanGlScott marked this pull request as ready for review January 23, 2023 18:28
@RyanGlScott RyanGlScott merged commit 9e9a1c3 into master Jan 23, 2023
@RyanGlScott RyanGlScott deleted the ghc-9.4 branch January 23, 2023 19:10
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.

Make it build with ghc 9.4.3
2 participants