Skip to content

Structured binary - #6255

Merged
phadej merged 2 commits into
masterfrom
structured-binary
Dec 11, 2019
Merged

phadej merged 2 commits into
masterfrom
structured-binary

Conversation

@phadej

@phadej phadej commented Sep 24, 2019 •

Copy link
Copy Markdown
Collaborator

Please include the following checklist in your PR:

  • Patches conform to the coding conventions.
  • Any changes that could be relevant to users have been recorded in the changelog.
  • The documentation has been updated, if necessary.
  • If the change is docs-only, [ci skip] is used to avoid triggering the build bots.

Please also shortly describe how you tested your change. Bonus points for added tests!

Comment thread cabal.project Resolved

@DanielG DanielG left a comment

Copy link
Copy Markdown
Collaborator

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.

then fail "Too large LicenseExceptionId tag"
else return (toEnum (fromIntegral i))

-- note: remember to bump version each time the definition changes

Copy link
Copy Markdown
Collaborator

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?

Copy link
Copy Markdown
Collaborator Author

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.

@phadej

phadej commented Oct 6, 2019

Copy link
Copy Markdown
Collaborator Author

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

This is WIP PR, I will rewrite commit messages.

@phadej phadej changed the title Structured binary WIP: Structured binary Oct 6, 2019
@phadej phadej added this to the 3.2 milestone Dec 10, 2019
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.
@phadej phadej changed the title WIP: Structured binary Structured binary Dec 11, 2019
@phadej
phadej merged commit 8c3af19 into master Dec 11, 2019
@phadej
phadej deleted the structured-binary branch December 11, 2019 12:44
@phadej phadej mentioned this pull request Dec 11, 2019
@Kleidukos Kleidukos mentioned this pull request Jan 8, 2022
3 tasks done
@philderbeast philderbeast mentioned this pull request Mar 19, 2026
2 of 6 tasks
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.

2 participants