Open gbaz opened 3 years ago
No counterindication, as far as I can see.
That would be an welcome change, specially when developing for cabal, since there are usually multiple cabals involved in the whole compile/run thingy.
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.
Good point about cabal update! Does it do a full rewrite of the index cache file or is it an in-place update?
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...
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.
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.