[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Checksum mismatch error during large commit

From: John Peacock <jpeacock_at_rowman.com>
Date: 2004-03-25 17:02:27 CET

David Haas wrote:

> The question I have to ask is why is this a problem when running under
> Cygwin, but not a problem when you're building natively for windows. I still
> think this has to be some kind of build issue. After all Windows stores all
> the files with CRLF. What does APR do then?

The problem is that Cygwin in textmode changes the file /on the fly/ when it is
read (from the Cygwin user docs):

> Text Mode vs. Binary Mode
>
> Interoperability with other Win32 programs such as text editors was critical to the success of the port of the development tools. Most Red Hat customers upgrading from the older DOS-hosted toolchains expected the new Win32-hosted ones to continue to work with their old development sources.
>
> Unfortunately, UNIX and Win32 use different end-of-line terminators in text files. Consequently, carriage-return newlines have to be translated on the fly by Cygwin into a single newline when reading in text mode.
>
> This solution addresses the compatibility requirement at the expense of violating the POSIX standard that states that text and binary mode will be identical. Consequently, processes that attempt to lseek through text files can no longer rely on the number of bytes read as an accurate indicator of position in the file. For this reason, the CYGWIN environment variable can be set to override this behavior.

The file is stored in the filesystem by Subversion with one line ending (CR/LF)
and the checksum is calculated using that value. Reading the file automatically
translates CR/LF to LF, so the checksum no longer matches. You can try and set
the CYGWIN environment variable to binmode when using Subversion:

        export CYGWIN=$CYGWIN binmode

and this might fix it. Since there is no way currently in APR to force a
binmode read, Greg's suggestion is out.

The issue doesn't arise in native Win32 because the line ending as stored
(CR/LF) is the same as the line ending as read (CR/LF). For Subversion
purposes, Cygwin _is_ Win32, so the files are stored with the native line
endings (CR/LF); I don't know if that could be changed.

HTH

John

-- 
John Peacock
Director of Information Research and Technology
Rowman & Littlefield Publishing Group
4501 Forbes Boulevard
Suite H
Lanham, MD  20706
301-459-3366 x.5010
fax 301-429-5748
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Mar 25 17:02:23 2004

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.