Use a per-version cache file for the index state #10848
Open
+85
−18
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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: