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

Don't compare generated cabal files #7

Merged
merged 4 commits into from
Oct 6, 2019

Conversation

snoyberg
Copy link
Collaborator

@snoyberg snoyberg commented Oct 3, 2019

For an example of the bugs involved here, commercialhaskell/stack#5045.

For an example of this bug, see
commercialhaskell/stack#5045.

Problem: pantry was including the hash of generated cabal files in lock
files, and then when newly generated cabal files (based on new hpack
versions) mismatched, it considered it a different package. Solution: do
not store the hash of the generated cabal file, but instead of the
source hpack file.
Turns out that these are no longer necessary at all. We cache the
relevant information within the Pantry database, and just need name and
version for quick checking. This bypasses the entire issue of mismatched
cabal file information and keeps nicer backwards compat with existing
lock files (just generates a warning for the `cabal-file` field).
@snoyberg snoyberg requested a review from psibi October 3, 2019 13:08
snoyberg added a commit to commercialhaskell/stack that referenced this pull request Oct 3, 2019
Fixes #5045. See relevant PR for pantry for more details: commercialhaskell/pantry#7
snoyberg added a commit to commercialhaskell/stack that referenced this pull request Oct 3, 2019
Fixes #5045. See relevant PR for pantry for more details: commercialhaskell/pantry#7
ChangeLog.md Show resolved Hide resolved
Copy link
Member

@psibi psibi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM apart from a minor comment.

snoyberg added a commit to commercialhaskell/stack that referenced this pull request Oct 3, 2019
Fixes #5045. See relevant PR for pantry for more details: commercialhaskell/pantry#7
snoyberg added a commit to commercialhaskell/stack that referenced this pull request Oct 3, 2019
Fixes #5045. See relevant PR for pantry for more details: commercialhaskell/pantry#7
snoyberg added a commit to commercialhaskell/stack that referenced this pull request Oct 3, 2019
Fixes #5045. See relevant PR for pantry for more details: commercialhaskell/pantry#7
Copy link
Contributor

@qrilka qrilka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we OK with just removing "cabal-file"? This will give us warnings when parsing e.g. lock files with dependencies from Github and those could be checked in into a VCS

@snoyberg
Copy link
Collaborator Author

snoyberg commented Oct 4, 2019

That's a good point! It's a better idea to simply ignore the cabal-file field.

Copy link
Contributor

@qrilka qrilka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@snoyberg snoyberg merged commit b5fffb3 into master Oct 6, 2019
@snoyberg snoyberg deleted the dont-compare-generated-cabal-files branch October 6, 2019 06:38
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.

3 participants