-
Notifications
You must be signed in to change notification settings - Fork 841
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
Upgrade to Cabal 2.0 #3288
Upgrade to Cabal 2.0 #3288
Conversation
src/Stack/Types/PackageDump.hs
Outdated
@@ -31,4 +31,6 @@ data InstalledCacheEntry = InstalledCacheEntry | |||
instance Store InstalledCacheEntry | |||
|
|||
installedCacheVC :: VersionConfig InstalledCacheInner | |||
installedCacheVC = storeVersionConfig "installed-v1" "GGyaE6qY9FOqeWtozuadKqS7_QM=" | |||
-- FIXME would be really nice to avoid changing this hash... | |||
--installedCacheVC = storeVersionConfig "installed-v1" "GGyaE6qY9FOqeWtozuadKqS7_QM=" |
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.
@mgsloan Do you have any insight into a way to avoid having to change this hash? Unless I'm mistaken, changing it will correct the precompiled package cache.
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.
The version tag should be bumped if the serialization has changed. I haven't looked over this change very thoroughly, but can we be sure that the serialization is the same as before? If so, then you can just change the hash and keep the version tag the same, and things should just work.
What's the motivation for switching over to Cabal types? To me it'd make sense to minimize dependencies on Cabal api.
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.
That's unfortunate, I was hoping there was some way to add backwards-compatibility support using the old serialization format.
I understand the goal of being less dependent on the Cabal API, but I don't think it's too relevant here: we're already wrapping up these data types internally, and can easily wrap them differently in the future. The advantage is that Cabal's new representations are more space efficient (using unpinned memory and UTF-8 encoding, or in the case of Version
encoding to a single Word64
). But if we're going to lose caching, I'd rather just back out this change.
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.
That's unfortunate, I was hoping there was some way to add backwards-compatibility support using the old serialization format.
That is possible, but of course the datatypes will need to be duplicated. Some logic would need to be implemented to handle recognizing the old tag and doing the datatype migration.
dc9a6b1
to
8d62eb6
Compare
See the comment added in this commit, further investigation is likely needed.
Looks like I totally outsmarted myself here working on the Cabal 2.0 migration. Please see the newly added comment in this commit.
Sorry if it's not related: I tried to build this branch with GHC 8.2.1, but got the following errors:
|
@felixonmars Thanks for the feedback, but we're not going to be upgrading to GHC 8.2 quite yet. That will be undertaken later. |
Note: Documentation fixes for https://docs.haskellstack.org/en/stable/ should target the "stable" branch, not master.
Please include the following checklist in your PR:
Please also shortly describe how you tested your change. Bonus points for added tests!