-
Notifications
You must be signed in to change notification settings - Fork 122
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.2 #1349
Merged
Merged
Commits on May 4, 2022
-
This contains a variety of changes needed to make Cryptol compile with GHC 9.2: * In GHC 9.2, enabling `UndecidableInstances` no longer implies enabling `FlexibleContexts` (see [here](https://gitlab.haskell.org/ghc/ghc/-/wikis/migration/9.2?version_id=7e2ce63ba042c1934654c4316dc02028d8d3dd31#undecidableinstances-no-longer-implies-flexiblecontexts-in-instance-declarations)). As a result, I had to enable `FlexibleContexts` in `Cryptol.ModuleSystem.Name`. * The `argo` submodule was bumped to bring in the changes from GaloisInc/argo#191, which allows it to build with GHC 9.2. * The upper version bounds on `base`, `bytestring`, `lens`, `base-compat`, and `sbv` were raised to allow building them with GHC 9.2.
Configuration menu - View commit details
-
Copy full SHA for 980e652 - Browse repository at this point
Copy the full SHA 980e652View commit details -
Fix -Woperator-whitespace-ext-conflict warnings
GHC 9.2 now includes `-Woperator-whitespace-ext-conflict` as a part of `-Wall`. Thankfully, these warnings are simple to resolve: just put extra whitespace after the affected uses of `$`.
Configuration menu - View commit details
-
Copy full SHA for 5f01844 - Browse repository at this point
Copy the full SHA 5f01844View commit details -
Fix -Wnoncanonical-{monad,monoid}-instances warnings
GHC 9.2 adds `-Wnoncanonical-monad-instances` and `-Wnoncanonical-monoid-instances` to `-Wall`, which warn whenever one has explicit implementations of `return` or `mappend` that aren't simply `return = pure` or `mappend = (<>)`. This patch makes sure that all `Monad` and `Monoid` instances in Cryptol adhere to these conventions.
Configuration menu - View commit details
-
Copy full SHA for e5ff87f - Browse repository at this point
Copy the full SHA e5ff87fView commit details -
Fix an -Woverlapping-patterns warning uncovered by GHC 9.2
GHC 9.2 has a more aggressive pattern-match coverage checker than in previous versions, which reveals that the `detailedPrompt` case of `mkPrompt` is unreachable. This is technically true, as `detailedPrompt = False`, but it would be nice if we didn't get a warning just for keeping this code around. This simplest solution is to just change `detailedPrompt` to be `id False`, which defeats the coverage checker. An alternative would be to use `GHC.Exts`' newly added `considerAccessible` function (see https://gitlab.haskell.org/ghc/ghc/-/merge_requests/5100), but this would require CPP.
Configuration menu - View commit details
-
Copy full SHA for 634844f - Browse repository at this point
Copy the full SHA 634844fView commit details -
Fix -Wincomplete-uni-patterns warnings
GHC 9.2 now includes `-Wincomplete-uni-patterns` as a part of `-Wall`. As a result, building Cryptol with GHC 9.2 uncovers some previously undetected warnings. Some warnings can be fixed by rewriting the code slightly. For example, changing a use of `Data.List.groupBy` to `Data.List.NonEmpty.groupBy` avoids the need for an incomplete match on `(_ : _)` on the value that `groupBy` returns. (Since `Data.List.NonEmpty` was added to `base` in `4.9`, this also requires bumping the lower version bounds on `base` slightly.) Other warnings were fixed by explicitly adding fall-through `error` cases. The resulting code is no less partial than before, but it avoids warnings and should provide a more specific error in the event that the fall-through cases are reached. Yet another class of warnings are those caused by the use of irrefutable patterns, such as the definition of `ar1 ~[x] = x` in `Cryptol.TypeCheck.TypePat`. It's rather unfortunate that `-Wincomplete-uni-patterns` warns about these (see https://gitlab.haskell.org/ghc/ghc/-/issues/14800), as the only way to avoid the warning would be to rewrite these functions to use refutable patterns, thereby changing their strictness properties. I've decided to simply disable `-Wincomplete-uni-patterns` in each module that uses irrefutable patterns to avoid this issue. I've written also written a Note explaining the reasoning and referenced it in the affected modules.
Configuration menu - View commit details
-
Copy full SHA for 1dd4311 - Browse repository at this point
Copy the full SHA 1dd4311View commit details -
Configuration menu - View commit details
-
Copy full SHA for 86ee1c9 - Browse repository at this point
Copy the full SHA 86ee1c9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 22c61d6 - Browse repository at this point
Copy the full SHA 22c61d6View commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.