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

Per-Version Index Cache in ~/.cabal directory #7502

Open
gbaz opened this issue Aug 2, 2021 · 6 comments
Open

Per-Version Index Cache in ~/.cabal directory #7502

gbaz opened this issue Aug 2, 2021 · 6 comments

Comments

@gbaz
Copy link
Collaborator

gbaz commented Aug 2, 2021

Switching between cabal install versions can occur either when developing cabal, or when using nix-shells that bring different versions into scope, among other reasons.

Each time you switch versions, you get Warning: Parsing the index cache failed and it needs to regenerate the index cache.

This can be tedious and time consuming.

I suggest that cabal store its index cache per-cabal-version rather than always in the same spot, thus helping to more frequently avoid this issue.

@Mikolaj
Copy link
Member

Mikolaj commented Aug 2, 2021

No counterindication, as far as I can see.

@ptkato
Copy link
Collaborator

ptkato commented Aug 2, 2021

That would be an welcome change, specially when developing for cabal, since there are usually multiple cabals involved in the whole compile/run thingy.

@phadej
Copy link
Collaborator

phadej commented Aug 3, 2021

This was discussed and it is not trivial. The cabal update command wouldn't update the cache files of other cabal-install versions. That is probably not a problem for Hackage index as it's append only (so the old index cache will just not see new stuff), but e.g. with head.hackage index (which is competely overwritten) very weird things will happen.

Please outline how you would prevent cache corruption.

@gbaz
Copy link
Collaborator Author

gbaz commented Aug 3, 2021

Good point about cabal update! Does it do a full rewrite of the index cache file or is it an in-place update?

@gbaz
Copy link
Collaborator Author

gbaz commented Aug 3, 2021

The obvious thing to do is to just have update remove all versions of the index cache, and let them be generated as necessary on demand. I think this would be pretty seamless...

@andreasabel
Copy link
Member

I think this issue is important to fix, because having several versions of cabal-install around is the advice when one still relies on sandboxes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants