Skip to content

Fix cabal-install fighting over index cache with old versions - #6164

Closed
DanielG wants to merge 1 commit into
haskell:masterfrom
DanielG:cabal-fix-cache
Closed

DanielG wants to merge 1 commit into
haskell:masterfrom
DanielG:cabal-fix-cache

Conversation

@DanielG

@DanielG DanielG commented Jul 27, 2019 •

Copy link
Copy Markdown
Collaborator

Currently 2.4.1.0 and master/3.0 fight over the global index cache. Every time one switches between the versions you get:

Warning: Parsing the index cache failed (Unknown encoding for constructor).
Trying to regenerate the index cache...
[takes 30sec or so]

and it takes just long enough to be really annoying.

Here's my proposed solution: just rename the index cache file.


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.

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

@phadej

phadej commented Jul 27, 2019 via email

Copy link
Copy Markdown
Collaborator

@DanielG

DanielG commented Jul 27, 2019

Copy link
Copy Markdown
Collaborator Author

Does it though? I'd rather do this only when it is necessary and not litter everything with new cache files on each release.

@phadej

phadej commented Jul 29, 2019

Copy link
Copy Markdown
Collaborator

my point is: the versioning should be automatic, if it's manual, one will forget to update it.

If version of cabal-install (and/or Cabal?) is too conservative, then a structure hash of index structure (like in https://hackage.haskell.org/package/binary-tagged) could be used.

(FWIW, binary-tagged for caches in dist-newstyle would make sense too. cabal gets confused when e.g. Extension is added)

@DanielG

DanielG commented Aug 17, 2019

Copy link
Copy Markdown
Collaborator Author

Totally agree this should be automatic. I didn't realise this was fesible though but since there's an existing solution to that problem with Binary instances I'll see if I can spin a PR to integrate this.

@phadej phadej mentioned this pull request Aug 28, 2019
@DanielG

DanielG commented Mar 25, 2020

Copy link
Copy Markdown
Collaborator Author

I think this was fixed for good by #6255

@DanielG DanielG closed this Mar 25, 2020
@amigalemming

Copy link
Copy Markdown
Contributor

cabal-3.2 and cabal-2.4 still fight over the index cache.
What can I do as a cabal-install user?

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