You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The cabal-dev test suite ran into an issue where the following sequence of events happened quickly creswick/cabal-dev#74 (comment)
Create an empty index (creates 00-index.tar)
install a package that does not exist (creates 00-index.cache)
add-source a package (updates 00-index.tar, but not 00-index.cache)
install a package that now exists (reads invalid 00-index.cache and fails)
The reason this fails is because file modification times have a granularity of seconds, and on a modern machine that's simply not precise enough to reliably order events. I haven't dug in to cabal's code very much, but it seems to make the incorrect assumption that just updating the tar file will reliably invalidate the cache.
An easy way to more reliably invalidate the cache would be to just delete the cache file whenever the tar is updated. This would not require any change of the file formats and should be minimally invasive.
The text was updated successfully, but these errors were encountered:
add-source a package (updates 00-index.tar, but not 00-index.cache)
Looking at cabal-dev's source, I see that it manipulates the index file directly using Codec.Archive.Tar. IMO, this makes it a cabal-dev bug - addSources should be deleting the cache after having successfully executed writeIndex.
The cabal-dev test suite ran into an issue where the following sequence of events happened quickly creswick/cabal-dev#74 (comment)
The reason this fails is because file modification times have a granularity of seconds, and on a modern machine that's simply not precise enough to reliably order events. I haven't dug in to cabal's code very much, but it seems to make the incorrect assumption that just updating the tar file will reliably invalidate the cache.
An easy way to more reliably invalidate the cache would be to just delete the cache file whenever the tar is updated. This would not require any change of the file formats and should be minimally invasive.
The text was updated successfully, but these errors were encountered: