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.6 #1987

Merged
merged 8 commits into from
Nov 20, 2023
Merged

Support building with GHC 9.6 #1987

merged 8 commits into from
Nov 20, 2023

Conversation

RyanGlScott
Copy link
Contributor

Making SAW build with GHC 9.6 is almost entirely a matter of being more precise with mtl-related imports to account for mtl-2.3.1 not re-exporting as many identifiers from Control.Monad, Control.Monad.IO.Class, etc.

I have also bumped the following submodules and source-repository-packages to allow them to build with GHC 9.6:

RyanGlScott and others added 2 commits November 20, 2023 11:54
`sbv-10.*` brings in two changes to the SBV internals that affects SAW:

1. `sbv-10.0` removes the `generateSMTBenchmark` function in favor of two
   separate `generateSMTBenchmarkSat` and `generateSMTBenchmarkProof` functions.
   We use the `generateSMTBenchmarkSat` variant in `SAWScript.Prover.Exporter`.
2. `sbv-10.0` changes the `Maybe [String]` argument to `svUninterpreted` (which
   we use in `saw-core-sbv`'s `Verifier.SAW.Simulator.SBV`) to a `UICodeKind`
   argument, where `UINone` is now what used to be denoted with `Nothing`.

We now use the appropriate CPP to make SAW compile before and after these
changes. See also GaloisInc/cryptol#1513, which was in similar territory.
@RyanGlScott RyanGlScott added PR: ready to merge Magic flag for pull requests to ask Mergify to merge given an approval and a successful CI run and removed PR: ready to merge Magic flag for pull requests to ask Mergify to merge given an approval and a successful CI run labels Nov 20, 2023
@RyanGlScott
Copy link
Contributor Author

After the cryptol submodule bump, the test_constraint_guards test case now fails with (link to CI log):

  test_constraint_guards:             


[19:09:35.133] Loading file "/home/runner/work/saw-script/saw-script/intTests/test_constraint_guards/test.saw"
Warning:  at Test.cry:14:1--14:11:
  Could not prove that the constraint guards used in defining Test::incomplete were exhaustive.
== Anticipated failure message ==
Run-time error: No constraints satisfied in constraint guard
[19:09:35.646] You have encountered a bug in cryptol-saw-core's implementation.
*** Please create an issue at https://github.com/GaloisInc/saw-script/issues

%< --------------------------------------------------- 
  Revision:  d79bfb0230b9fada22052a99ed0a43c1bb8f3ff3
  Branch:    HEAD (uncommited files present)
  Location:  importType TVBound
  Message:   
CallStack (from HasCallStack):
  panic, called at src/Verifier/SAW/Cryptol/Panic.hs:13:9 in cryptol-saw-core-0.1-inplace:Verifier.SAW.Cryptol.Panic
  panic, called at src/Verifier/SAW/Cryptol.hs:264:37 in cryptol-saw-core-0.1-inplace:Verifier.SAW.Cryptol
%< --------------------------------------------------- 


FAIL (1.41s)
    intTests/IntegrationTest.hs:172:
    expected: ExitSuccess
     but got: ExitFailure 2
    Use -p '/test_constraint_guards/' to rerun this test only.

@RyanGlScott
Copy link
Contributor Author

Oops, I think this is my fault. During a rebase, I think I accidentally rolled the cryptol submodule commit back to an earlier point than what is currently in the master branch.

RyanGlScott and others added 6 commits November 20, 2023 14:32
Making SAW build with GHC 9.6 is almost entirely a matter of being more precise
with `mtl`-related imports to account for `mtl-2.3.1` not re-exporting as many
identifiers from `Control.Monad`, `Control.Monad.IO.Class`, etc.

I have also bumped the following submodules and `source-repository-package`s to
allow them to build with GHC 9.6:

* `cryptol`: GaloisInc/cryptol#1572
* `hobbits`: eddywestbrook/hobbits#9
As of GHC 8.6, `TypeInType` is simply an alias for `DataKinds` + `PolyKinds`.
And as of GHC 9.6, `TypeInType` is deprecated. Since we are already using
`DataKinds` + `PolyKinds` in all of the places where we enable `TypeInType` in
`heapster-saw`, let's just remove our use of `TypeInType` to avoid deprecation
warnings.
`parseNamedShapeFromRustDecl` will produce an `-Woverlapping-patterns` warning
with GHC 9.6 (but not in GHCi, see
https://gitlab.haskell.org/ghc/ghc/-/issues/23915), but we can refactor the
code slightly to avoid this issue.
Unfortunately, the upstream `language-rust` repo at
https://github.com/harpocrates/language-rust no longer appears to be actively
maintained, and without a fix for
harpocrates/language-rust#44, it is impossible to
build `language-rust` with GHC 9.6. This patch changes our `language-rust`
submodule to instead use our fork of `language-rust` (at
https://github.com/GaloisInc/language-rust). It is unclear if we will have to
keep doing this in the long term, but this at least unblocks us in the short
term.
@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 Nov 20, 2023
@mergify mergify bot merged commit f7b1966 into master Nov 20, 2023
40 checks passed
@mergify mergify bot deleted the ghc-9.6 branch November 20, 2023 20:42
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