-
Notifications
You must be signed in to change notification settings - Fork 152
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
Enable building Clash against GHC 9.10 (copy #2758) #2790
base: 1.8
Are you sure you want to change the base?
Conversation
Cherry-pick of e702e9a has failed:
Cherry-pick of 1f8e765 has failed:
To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally |
(cherry picked from commit e702e9a)
This also introduces a new functions, fromGhcUnique, which converts from GHC's Unique to Clash's Unique. This function is used wherever we interact with Uniques we get from GHC. (cherry picked from commit 1f8e765)
(cherry picked from commit b32dec8)
(cherry picked from commit c7ec4dc)
Used to implement dataToTag# in GHC 9.10 (cherry picked from commit 5fe9aea)
Type-level addition got moved from GHC.TypeNats to GHC.TypeNats.Internal in GHC 9.10, so name-based identifcation started failing. (cherry picked from commit 3bded90)
As of GHC 9.10 it lives in GHC.Internal.Stack.Types (cherry picked from commit dd0aeee)
As of GHC 9.10 the Tuple constructors now live in GHC.Tuple (cherry picked from commit 5c2d9d6)
As of GHC 9.10, constraint tuples are no longer called (%,%), but CTuple2 (cherry picked from commit 2a320e3)
(cherry picked from commit 4a538c0)
In base-4.20 the type families were moved to GHC.TypeNats.Internal, which the old code didn't match on. Matching against uniques is far more stable. (cherry picked from commit fcf6a33)
(cherry picked from commit 7691de5)
(cherry picked from commit a63eeaa)
(cherry picked from commit c3d7765)
(cherry picked from commit eb9748c)
(cherry picked from commit 1f6fca4)
(cherry picked from commit d52447b)
This way we can just refer to "'patError" regardless of whether it lives in: - Control.Exceptions.Base, or - GHC.Internal.Control.Exception.Base (cherry picked from commit e565d26)
807fb97
to
315e29c
Compare
The changes of 098380f may be a quick fix for the currently encountered error. I don't completely understand tough, why we didn't run into that one earlier already. I can't test everything on CI without opening another PR, so just feel free to cherry pick it the changes for this one if you like them. |
Add support for GHC 9.10
Currently, when building the Clash compiler against GHC 9.10 it will only work reliably on 64-bit platforms, and not so on 32-bit platforms. That's because we still use
Int
for our uniques, while GHC will useWord64
, and we usefromIntegral
to convert theWord64
toInt
. Users on 32-bit platforms should use GHC 9.8 or older to compile the Clash compiler for now.Once this is merged, open an issue to rethink our
Unique
story so that it works with GHC's changeover fromInt
toWord64
so that they have sufficient uniques on 32-bit platforms.Still TODO:
This is an automatic copy of pull request #2758 done by [Mergify](https://mergify.com).