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.0 #1559

Merged
merged 4 commits into from
Jan 31, 2022
Merged

Support building with GHC 9.0 #1559

merged 4 commits into from
Jan 31, 2022

Conversation

RyanGlScott
Copy link
Contributor

This contains a variety of fixes needed to make the packages in the
saw-script repo compile with GHC 9.0:

  • GHC 9.0 implements simplified subsumption (see here). This requires manually eta expanding some function applications to accommodate (see, for instance, the expansions of getAllLLVM in SAWScript.Crucible.LLVM.MethodSpecIR.
  • GHC's constraint solver now solves constraints in each top-level group sooner (see here). This affects heapster-saw, as it uses declaration splices extensively. I did some fairly involved rearranging of data type declarations and TH-generated instances to make everything typecheck. It's not exactly pretty, but it gets the job done.
  • GHC 9.0 now enables -Wstar-is-type in -Wall, so this patch replaces some uses of * with Data.Kind.Type in saw-core-what4 and crux-mir-comp. Data.Kind requires the use of GHC 8.0 or later, so this patch also updates the lower bounds on base to >= 4.9 in the appropriate .cabal files. (I'm fairly certain that this requirement was already present implicity, but better to be explicit about it.)
  • The upper version bounds on base in saw-remote-api were raised to allow it to build with base-4.15.*, which is bundled with GHC 9.0.
  • The cryptol submodule was bumped to incorporate the changes from GHC 9.* cryptol#1233, which allow it to build with GHC 9.0.

Copy link
Contributor

@robdockins robdockins left a comment

Choose a reason for hiding this comment

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

I don't have any real context for the heapster changes, but everything else looks OK to me.

@RyanGlScott
Copy link
Contributor Author

The diff in heapster-saw is large, but there's largely nothing that interesting about it—it's just moving definitions around to satisfy the whims of Template Haskell in GHC 9.0, which is pickier about the ordering of top-level groups that are separated by TH splices.

Speaking of which, I should probably give @eddywestbrook a heads-up on this just in case this touches on any in-flight Heapster work.

This contains a variety of fixes needed to make the packages in the
`saw-script` repo compile with GHC 9.0:

* GHC 9.0 implements simplified subsumption (see
  [here](https://gitlab.haskell.org/ghc/ghc/-/wikis/migration/9.0?version_id=5fcd0a50e0872efb3c38a32db140506da8310d87#simplified-subsumption)).
  This requires manually eta expanding some function applications to
  accommodate (see, for instance, the expansions of `getAllLLVM` in
  `SAWScript.Crucible.LLVM.MethodSpecIR`.
* GHC's constraint solver now solves constraints in each top-level group
  sooner (see
  [here](https://gitlab.haskell.org/ghc/ghc/-/wikis/migration/9.0?version_id=5fcd0a50e0872efb3c38a32db140506da8310d87#the-order-of-th-splices-is-more-important)).
  This affects `heapster-saw`, as it uses declaration splices extensively. I
  did some fairly involved rearranging of data type declarations and
  TH-generated instances to make everything typecheck. It's not exactly pretty,
  but it gets the job done.
* GHC 9.0 now enables `-Wstar-is-type` in `-Wall`, so this patch replaces some
  uses of `*` with `Data.Kind.Type` in `saw-core-what4` and `crux-mir-comp`.
  `Data.Kind` requires the use of GHC 8.0 or later, so this patch also updates
  the lower bounds on `base` to `>= 4.9` in the appropriate `.cabal` files.
  (I'm fairly certain that this requirement was already present implicity, but
  better to be explicit about it.)
* The upper version bounds on `base` in `saw-remote-api` were raised to allow
  it to build with `base-4.15.*`, which is bundled with GHC 9.0.
* The `cryptol` submodule was bumped to incorporate the changes from
  GaloisInc/cryptol#1233, which allow it to build with GHC 9.0.
@RyanGlScott RyanGlScott added the PR: ready to merge Magic flag for pull requests to ask Mergify to merge given an approval and a successful CI run label Jan 31, 2022
@mergify mergify bot merged commit db538d3 into master Jan 31, 2022
@mergify mergify bot deleted the ghc-9.0 branch January 31, 2022 19:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: ready to merge Magic flag for pull requests to ask Mergify to merge given an approval and a successful CI run
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants