cabal icon indicating copy to clipboard operation
cabal copied to clipboard

cabal update fails: 01-index.tar: setModificationTime:setFileTimes: does not exist

Open peti opened this issue 7 years ago • 3 comments

After removing the *index* tarballs from the ~/.cabal directory, cabal-install at d7a88c68bce08286c9f7bec5901b7a118ce91a8c fails to recover during update:

$ cabal update
Downloading the latest package list from hackage.haskell.org
/home/simons/.cabal/packages/hackage.haskell.org/01-index.tar: setModificationTime:setFileTimes: does not exist (No such file or directory)

peti avatar Jan 01 '18 10:01 peti

Workaround: run rm *.* in to wipe out all files from ~/.cabal/packages/hackage.haskell.org that contain state.

peti avatar Jan 01 '18 10:01 peti

Btw, even removing only the 01-index.tar while leaving 01-index.tar.gz in place is something that cabal update doesn't recover from; this is why my travis ci script (which removes the redundant .tar before commit to the cache), has to manually restore the unpacked .tar; I never got around to teach cabal to auto-recover in this case.

hvr avatar Jan 01 '18 15:01 hvr

Even deleting all 01-index* files doesn't help cabal recover.

In that case, the error is:

Warning: Could not set modification time of index tarball --
/Users/lucian/.cache/cabal/packages/hackage.haskell.org/01-index.tar:
setModificationTime:setFileTimes: does not exist (No such file or directory)
Package list of hackage.haskell.org is up to date.
The index-state is set to Unknown or invalid timestamp.

Only after I also deleted timestamp.json and snapshot.json, cabal was able to generate a new index.

So that tells me that all these files need to be treated as a whole. If any of them breaks, the index breaks.

LucianU avatar Apr 25 '24 14:04 LucianU