delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2017/06/08/09:32:00

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:from:content-type:content-transfer-encoding
:mime-version:subject:date:references:to:in-reply-to:message-id;
q=dns; s=default; b=wVx+TRtZxcYv10EtqyfUUzFAZU9J5w2z3hVzlgCWtXh
/LutOePvL95qDQI9enIm16fESB4p6DZx2XzU7sJmhHXrLoipfo3ZfBoS88sbWGRh
0QW2uDiwZbk0/J2MLRJEkzgOkNogMbt2nsEwc/+ZRH0mtrjtuY4HHANOFq7gswC0
=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:from:content-type:content-transfer-encoding
:mime-version:subject:date:references:to:in-reply-to:message-id;
s=default; bh=VwvjX0NhZGs40Rj4p/wK6u+4eeM=; b=BVe8vMtIZ6U+MnhhZ
Lm9nZ+EhtTcWYJwoxkJ9hAhri1l2ZSU8CyAvxmWofLbP5gXMZru1Qkv8aY+PGcHe
R1Zdda3wtP5NANmog+UXNAJrerOdFcsLXpEMkMZPUC1HpLLv10shCyutanqrgrot
wf73Pl++Q01k94s/sgV+rBemZI=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.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
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=mounts, H*RU:67.222.38.55, HX-HELO:sk:gproxy5, Hx-spam-relays-external:sk:gproxy5
X-HELO: gproxy5.mail.unifiedlayer.com
X-Authority-Analysis: v=2.2 cv=QdwWhoTv c=1 sm=1 tr=0 a=x/h8IXy5FZdipniTS+KQtQ==:117 a=x/h8IXy5FZdipniTS+KQtQ==:17 a=IkcTkHD0fZMA:10 a=LWSFodeU3zMA:10 a=mDV3o1hIAAAA:8 a=w_pzkKWiAAAA:8 a=lkQp6GEPDECzkSKWiuQA:9 a=Ipt91RR8u86QaDHF:21 a=OwRh6rOYKW7v8MED:21 a=QEXdDO2ut3YA:10 a=7Qpikb98htYA:10 a=DjXQK3J06HAA:10 a=x-Zbrhhhr-gA:10 a=_FVE-zBwftR9WsbkzFJk:22 a=sRI3_1zDfAgwuvI8zelB:22
From: Vince Rice <vrice AT solidrocksystems DOT com>
Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\))
Subject: Re: CR-LF handling behavior of SED changed recently - this breaks a lot of MinGW cross build scripts
Date: Thu, 8 Jun 2017 08:31:07 -0500
References: <0F7D3B1B3C4B894D824F5B822E3E5A175B2636E4 AT IRSMSX103 DOT ger DOT corp DOT intel DOT com> <a53282b6-d00c-aad8-76a6-26b4089a9623 AT redhat DOT com> <0F7D3B1B3C4B894D824F5B822E3E5A175B26CE47 AT IRSMSX102 DOT ger DOT corp DOT intel DOT com>
To: "cygwin AT cygwin DOT com" <cygwin AT cygwin DOT com>
In-Reply-To: <0F7D3B1B3C4B894D824F5B822E3E5A175B26CE47@IRSMSX102.ger.corp.intel.com>
Message-Id: <9B5AD0AF-F256-4C45-B2BA-14DCDA2EF61E@solidrocksystems.com>
X-BWhitelist: no
X-Exim-ID: 1dIxWm-0005wj-JT
X-Source-Sender: 99-106-192-34.lightspeed.ftwotx.sbcglobal.net ([192.168.1.86]) [99.106.192.34]:55259
X-Source-Auth: vrice AT solidrocksystems DOT com
X-Email-Count: 1
X-Source-Cap: c29saWRycjI7c29saWRycjI7Ym94ODY3LmJsdWVob3N0LmNvbQ==
X-IsSubscribed: yes
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id v58DVwxL020637

> On Jun 8, 2017, at 3:50 AM, Soegtrop, Michael wrote:
> 
> Dear Eric,
> 
>> No, the documented behavior is that CR-LF is converted to LF only for text-
>> mounted files; but pipelines are default binary-mounted.  If you want to strip
>> CR from a pipeline, then make it explicit.
>> 
>>> var=$( prog | sed .)
>> 
>> Rewrite that to var=$( prog | tr -d '\r' | sed .)
> 
> I have two problems with this:
> 
> 1.) I build many (~ 50) unix libs and tools MinGW cross on cygwin from sources and this breaks many of the configure and other scripts. Feeding back the fixes to the individual lib/tool maintainers will take quite some time and also results in lengthy discussion why they should care about crappy DOS artefacts at all. A compatibility option via environment variable would have been nice.
> 
> 2.) It is very hard to interpret the documentation in this way. I am citing from https://www.gnu.org/software/sed/manual/sed.html:
> 
> -b --binary  
> This option is available on every platform, but is only effective where the operating system makes a distinction between text files and binary files. When such a distinction is made—as is the case for MS-DOS, Windows, Cygwin—text files are composed of lines separated by a carriage return and a line feed character, and sed does not see the ending CR. When this option is specified, sed will open input files in binary mode, thus not requesting this special processing and considering lines to end at a line feed.
> 
> This doesn't say what is treated as a text file and what is treated as a binary file and one can reasonably assume that a text tool like sed opens everything not explicitly declared as binary as text, if a documented option like -b exists.
> 
> This cygwin sed behavior is documented in https://cygwin.com/cygwin-ug-net/using-textbinary.html but I wouldn't expect people using sed on cygwin will find this.
> 
> In summary I would say that the behavior of sed in cygwin is documented in the cygwin documentation, but it is contradicting the documentation of sed itself, and possibly the intended function of sed as a text processing tool.
> 
> I must admit that building Linux stuff for MinGW cross on cygwin works substantially better than doing this on MSys/MSys2. The number of patches I need is small, so the decisions the cygwin team took seem to be the right ones. But this change adds at least one order of magnitude in my "number of patches required" statistics. 

Use binary mounts. The root of the problem is using text mounts in the first place.
--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


- Raw text -


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