-
Notifications
You must be signed in to change notification settings - Fork 696
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
Structured binary #6255
Structured binary #6255
Conversation
c9b24e6
to
f83824d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be nice if there was some documentation on what exactly this is trying to do. Your commits don't have any messages, pretty hypocritical to complain when other people do this and then not have any yourself :P
From context and digging literally hundres of lines into the diff I'm guessing this is to fix things such as #6163 and #6164 where types of caches with derrived Binary instances change and reading them back either fails or gives the wrong result.
@@ -39,6 +40,10 @@ instance Binary LicenseExceptionId where | |||
then fail "Too large LicenseExceptionId tag" | |||
else return (toEnum (fromIntegral i)) | |||
|
|||
-- note: remember to bump version each time the definition changes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to defeat the purpose of this patch. Any way this datatype can be included in the structure hash too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Manual Binary
instance => Manual Structured
instance.
Yet, here Binary
instance is generated by templating, so yes, we should generate Structured
instance too. I'll take the license list version and use that.
Good catch.
This is WIP PR, I will rewrite commit messages. |
f83824d
to
1ddced4
Compare
It defines `Structured` type class, which we use to prepend a hash to cached `Binary` blobs. Thus we can catch early, if format is changed, avoiding corrupt cache making cabal behave weirdly. Plenty types got Typeable instances, as it's a superclass of Structured This commit also introduces new compat modules: - Distribution.Compat.Typeable with typeRep - Distribution.Client.Compat.Orphans, to collect at least some orphans into central place.
1ddced4
to
ae33fcf
Compare
Please include the following checklist in your PR:
[ci skip]
is used to avoid triggering the build bots.Please also shortly describe how you tested your change. Bonus points for added tests!