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

Use a per-version cache file for the index state #10848

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mpickering
Copy link
Collaborator

cabal-install will now use a version suffixed cache file for the index state.

If you are regularly changing between cabal-install versions, this will be less annoying as you won't have to regenerate the cache each time you switch project.

There is one tricky part of the implementation. If you update the index with a newer cabal-install, then the old-style cabal-install caches are invalidated by replacing them with an empty file.
This is because in cabal-install (until this commit), the freshness of the cache was now checked by readIndexCache.

If you update with an older cabal-install then the freshness check will see the cache for your new cabal-install is older than the index, and update it.

Fixes #7502

Please read Github PR Conventions and then fill in one of these two templates.

Template B: This PR does not modify behaviour or interface

E.g. the PR only touches documentation or tests, does refactorings, etc.

Include the following checklist in your PR:

  • Patches conform to the coding conventions.
  • Is this a PR that fixes CI? If so, it will need to be backported to older cabal release branches (ask maintainers for directions).

cabal-install will now use a version suffixed cache file for the index
state.

If you are regularly changing between cabal-install versions, this will
be less annoying as you won't have to regenerate the cache each time you
switch project.

There is one tricky part of the implementation. If you update the index
with a newer cabal-install, then the old-style cabal-install caches are
invalidated by replacing them with an empty file.
This is because in cabal-install (until this commit), the freshness of
the cache was now checked by `readIndexCache`.

If you update with an older `cabal-install` then the freshness check
will see the cache for your new cabal-install is older than the index,
and update it.

Fixes #7502
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.

Per-Version Index Cache in ~/.cabal directory
1 participant