[darcs-users] zlib and patch crc errors: an update

Ganesh Sittampalam ganesh at earth.li
Thu May 7 21:35:42 UTC 2009


Hi,

I've been working on implementing some of the pieces we need to continue 
the migration to the Haskell zlib [1] in the face of the repos out there 
with corrupted CRCs [2].

So far I've updated zlib to report errors in a way that also returns the 
data produced so far and allows the caller to decide whether to use it, 
and updated the file reading code to make use of this interface and 
produce a warning. You can look at the code for this work here [3]. I 
designed the zlib changes together with Duncan and have now submitted them 
to him.

The next issue is how to actually repair the broken files. Once the 
relevant files have been appropriately identified, the mechanics are 
straightforward, but I'd like to be sure that all possible cases are 
covered. Looking back through history, I think the corrupted files could 
have been written out by all versions of darcs >=1.0.4 and <2.2.0.

One question I have is whether it's possible for corrupted files to exist 
in places other than _darcs/patches. For example what about the global 
patch cache, and the hashed pristine? The answers to this question will 
determine how widely the repair command needs to operate.

My current plan is for the repair command to be a special option to darcs 
repair, --patchcrcs, which will *only* repair bad CRCs and nothing else. 
It will do so on all files it finds in _darcs/patches (and elsewhere if 
appropriate), rather than just the ones mentioned in the current 
inventory, because (a) that's actually easier and (b) I think it's a 
better idea.

Cheers,

Ganesh

[1] 
http://lists.osuosl.org/pipermail/darcs-users/2008-November/016276.html
[2] 
http://lists.osuosl.org/pipermail/darcs-users/2008-November/016271.html
[3]
http://code.haskell.org/darcs/sprint-2009-04/{crcs-zlib,crcs-darcs}


More information about the darcs-users mailing list