delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2008/12/19/04:43:33

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00
X-Spam-Check-By: sourceware.org
From: "Gary R. Van Sickle" <g DOT r DOT vansickle AT att DOT net>
To: <cygwin AT cygwin DOT com>
References: <877i5wlwc3 DOT fsf AT mcbain DOT luannocracy DOT com> <20081219090531 DOT GV14886 AT trikaliotis DOT net>
Subject: RE: Rationale for line-ending recommendation?
Date: Fri, 19 Dec 2008 03:42:34 -0600
Message-ID: <EF7F2E5833CC4B5C8D8003C4A8F5DD7A@DFW5RB41>
MIME-Version: 1.0
In-Reply-To: <20081219090531.GV14886@trikaliotis.net>
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Note-from-DJ: This may be spam

> From: Spiro Trikaliotis
> 
> Hello David,
> 
> * On Thu, Dec 18, 2008 at 05:42:20PM -0900 David Abrahams wrote:
> > 
> > Can anyone explain why the installer began recommending using *nix 
> > line ending conventions?  DOS-compatible endings have 
> always "just worked"
> > for me and I've heard of lots of problems doing it the 
> now-recommended 
> > way.
> 
> Personally, I also install it with CR/LF line endings.
> 

Me too, and like you and the OP report, it "just works" 99.44% of the time.
Of course, since it's not the 21st century yet, many Unixoid programs are
still unable to handle text files properly, hence the remaining 0.66%.

> However, I noticed one problem this way: xfonts. If you 
> install xfonts on cygwin with CR/LF line endings, the fonts 
> end up corrupt, and you cannot start X. I was bitten by this 
> problems many times, whenever I installed a fresh Cygwin.
> 
> To fix this,
     ^^^^^^^^

You mean "work around this broken software".  Presumably this will be
"fixed" sometime in the 21st century, whenever that starts.

> I use the following way: I mount /var/cache 
> (which also has
> /var/cache/fonts/) in binmode, and reinstall xfonts.
> 
> This is a long-running problem.
> 

Indeed, but hardly surprising, since all indications are that handling text
files is an NP-Hard problem.

> Another problem I once had, but which might have been fixed 
> in the meantime, was the gcc compiler for the Lego 
> mindstorms: It did not accept sources files with DOS line 
> endings. Note, however, that this was 2000 or 2001, so it 
> might have changed in the meantime.
> 

Gcc was broken for a while, but that did in fact get properly fixed quite a
while ago.

> Oh, and Subversion is problematic, too. Because the SVN 
> developers decided to handle line endings on their own using 
> libapr, opening files in binary mode and reading and writing 
> CR, LF or CR/LF on their own,

This is the right way to do things...

> on Cygwin, SVN is hard-coded to 
> *nix line endings. This is not nice. Note that this approach 
> will also fail badly if you mount parts of your system in 
> textmode, and parts in binmode.
> 
> Because of this, I am using an SVN version which I compiled 
> myself with a patched libapr.
> 

...I'm not following this.  Are you talking about the SVN repository, or the
clients, or...?  What's the issue?  I know CVS had some problems with the
dreaded \n/\r\n issue back in the day, but I wasn't aware of similar
Subversion issues.

> 
> Other than that, I never had any problems with the CR/LF line endings.

Bash has some known problems in this area, but there's a Cygwin-specific fix
(that unfortunately is off by default) which hopefully will get accepted
upstream sometime in the next century.

> However, the rationale might be that most problems are 
> testing better with LF line endings, as they come from the 
> *nix world. Remember, on *nix systems, the difference between 
> opening a file in text- or in binmode is practically 
> non-existant. Thus, many programmers do not care about the 
> "right" mode.
> 

Well, better stated, they assume they can treat all files - text,
executables, jpegs, whatever - as if they were Unix-formatted text files.
Of course, they're not, hence problems ensue.

> Best regards,
>    Spiro.

-- 
Gary R. Van Sickle
 


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019