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 #1860

Merged
merged 7 commits into from
May 26, 2023
Merged

Support building with GHC 9.4 #1860

merged 7 commits into from
May 26, 2023

Conversation

RyanGlScott
Copy link
Contributor

@RyanGlScott RyanGlScott commented Apr 19, 2023

This contains a variety of tweaks needed to build SAW with GHC 9.4:

Fixes #1852.

@RyanGlScott
Copy link
Contributor Author

Surprisingly, the awslc tests fail with this change:

[12:31:38.396] Finding symbol for "sha512_block_data_order"
[12:31:38.450] Found symbol at address 0x7066c0, building CFG
[12:31:39.551] Simulating function "sha512_block_data_order" (at address 0x7066c0)
[12:31:39.551] Examining specification to determine preconditions
[12:31:41.620] Simulating function
[12:31:42.038] Examining specification to determine postconditions
[12:31:42.395] Simulation finished, running solver on 1 goals
[12:43:35.351] Parse exception: Failed reading: empty
2023/04/19 12:43:36 Failed to run saw script %s.verify-SHA512-384-quickcheck.sawexit status 2
exit status 1
1
make: *** [Makefile:25: awslc] Error 1
Error: Process completed with exit code 2.

I certainly didn't intend for any user-visible behavior to change with this patch, but perhaps this is a consequence of bumping one of the submodules, such as what4. I will try reverting particular submodule commits to see if that makes a difference.

@RyanGlScott RyanGlScott marked this pull request as draft April 19, 2023 13:01
@RyanGlScott
Copy link
Contributor Author

I've identified GaloisInc/what4#232 as the change which introduced the awslc tests regression, as reverting that change makes the tests pass once more. I haven't yet produced a more minimal example of the regression, however. @andreistefanescu, do you have a sense for why that change would affect things?

RyanGlScott and others added 7 commits May 26, 2023 06:50
This contains a variety of tweaks needed to build SAW with GHC 9.4:

* GHC 9.4 is more conservative about inferring superclass constraints that arise
  from functional dependencies (see [this
  section](https://gitlab.haskell.org/ghc/ghc/-/wikis/migration/9.4?version_id=b60e52482a666d25638d59cd7e86851ddf971dc1#constraints-derived-from-superclasses)
  of the GHC 9.4 Migration Guide), so we must add explicit `m ~ Identity`
  constraints to certain parts of `heapster-saw` to make it compile with GHC
  9.4.
* I raised the upper version bounds on `aeson` and `vector` to allow building
  them with GHC 9.4.
* The following submodule changes were brought in to support building with
  GHC 9.4:
  * `argo`: #193
  * `crucible`: GaloisInc/crucible#1073

    (This also requires bumping the `llvm-pretty`, `llvm-pretty-bc-parser`,
    and `what4` submodules as a side effect)
  * `language-sally`: GaloisInc/language-sally#13
  * `macaw`: GaloisInc/macaw#330
  * `parameterized-utils`: GaloisInc/parameterized-utils#146

Fixes #1852.
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.
This produces a `-Wgadt-mono-local-binds` warning with GHC 9.4, which has added
the warning to `-Wall`. To avoid the warning, I have removed a use of
`NoMonoLocalBinds` in `SAWScript.Crucible.JVM.BuiltinsJVM`. This required
adding an explicit type signature to `failure` as a result.
@RyanGlScott RyanGlScott marked this pull request as ready for review May 26, 2023 20:30
@RyanGlScott
Copy link
Contributor Author

With @andreistefanescu's help, the CI passes with the changes from GaloisInc/what4#232. Let's land this.

@RyanGlScott RyanGlScott merged commit 48731f1 into master May 26, 2023
@RyanGlScott RyanGlScott deleted the ghc-9.4 branch May 26, 2023 21:08
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.

SAWScript doesn't build with GHC 9.4.4
2 participants