X-Recipient: archive-cygwin@delorie.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:subject:to:references:from:message-id:date
	:mime-version:in-reply-to:content-type
	:content-transfer-encoding; q=dns; s=default; b=BvWbhjPQ9kTVfRQK
	IGzgNO08yR+yJzo3+3x2KhkK/WG1dqqr/36axinYAskw64wtxWnIC/tx4yPWTgO4
	qJLzMJCRkOXuwzVY+6XzwXZV58mbXPv+nhgKHf+IhyM8mlBhTotz29OTLyFHmRvS
	UknL15czw7BSFvHE9phgsElD01o=
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:subject:to:references:from:message-id:date
	:mime-version:in-reply-to:content-type
	:content-transfer-encoding; s=default; bh=9ZvrZvxB1zzweODGxwMRma
	kNwZI=; b=jKGYLfl1jVVmpOt7G7vHmGt6S3MBwoeaqyRnwwoOlHyUKW98SROa7s
	TPGA5yykpu7ldqfoeY/i/T4wMA4zQzOJtX62JxbUdYyVT1Yl7nwIPwRZv/rMLJX0
	evXeQRiIrJoObSot6GIjgk+QYCuSRGiHhHo2x5mi+Lier1XheQPuU=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1995
X-HELO: mail-it0-f66.google.com
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;        d=1e100.net; s=20161025;        h=x-gm-message-state:subject:to:references:from:message-id:date         :user-agent:mime-version:in-reply-to:content-language         :content-transfer-encoding;        bh=yjYp++T4FHM7SXIMpz9ukO4rslGE54aIQX7/kD3Qthk=;        b=hP5DcyKqIqwHYGZIkwjBMGmscKsOEtc/bpwFa8GuRSn29eY/hrSODclb1CG6CGOhi7         hWuIV5/UPxog/lQnoDKXpHFyrkFQPYg2KgDzayIAf8bzuTxJyiI1kP7nDbkisSb54gvB         wG/2mbcYU4xS3RFI03HlW9DA2kodcszuh9M5yz9UjVYQnshThfirYTRUxmTP948wzErM         Xr3Egg5iKqHfX2skKnZT92bUNk8N7736ZIX7Cbc0/AbIA2UWpF/BxH4TAfYxilV/e74F         95CEr6aneurIIaUGDFh6dLDtgc56D57C31pO3dpq/6zwUfYNnzMqaUkYFkPqaW0ynQLm         XctA==
X-Gm-Message-State: AODbwcDzRA2Rw5ZQE73vt4juf/TbpV0BHu3bG+InbmzA9m8D5iy7DVdA	iPNT5Ks0f5o7LN8O
X-Received: by 10.36.58.145 with SMTP id m139mr1982051itm.34.1496943242736;        Thu, 08 Jun 2017 10:34:02 -0700 (PDT)
Subject: Re: CR-LF handling behavior of SED changed recently - this breaks a lot of MinGW cross build scripts
To: cygwin@cygwin.com
References: <0F7D3B1B3C4B894D824F5B822E3E5A175B2636E4@IRSMSX103.ger.corp.intel.com> <a53282b6-d00c-aad8-76a6-26b4089a9623@redhat.com> <0F7D3B1B3C4B894D824F5B822E3E5A175B26CE47@IRSMSX102.ger.corp.intel.com> <f8d3d9e4-cd49-aa66-6318-eabdd0e99b4b@redhat.com>
From: cyg Simple <cygsimple@gmail.com>
Message-ID: <8f44901c-a4ef-1abe-3998-e9c61c43dd5f@gmail.com>
Date: Thu, 8 Jun 2017 13:34:04 -0400
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1
MIME-Version: 1.0
In-Reply-To: <f8d3d9e4-cd49-aa66-6318-eabdd0e99b4b@redhat.com>
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-IsSubscribed: yes

On 6/8/2017 11:08 AM, Eric Blake wrote:
> On 06/08/2017 03:50 AM, Soegtrop, Michael wrote:
> 
>> 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.
> 
> At one point in the distant past, we DID have an environment variable
> ($CYGWIN) which included an option to force all pipelines to behave as
> text-mount rather than binary-mount.  I don't remember why it was ripped
> out.  It may be worth a patch to cygwin1.dll to re-add some way to
> enable text-mount pipelines - or maybe even limited-context text-mount
> pipelines (if Cygwin already has an easy way to decide whether the
> sending end of a pipeline is a cygwin or native windows process, then
> the conditional decision would be that input from the pipeline is in
> text mode if the sender is non-cygwin; while output to a pipeline is
> always binary).  But I'm not in a position to write such a pach.
> 

I will add that the original MSYS, I haven't used MSYS2 so I don't know
about it, used binary mode pipes from the start.  There were many
discussions about this but the stance for binary pipes remained.  You
always want the piped data to contain the full set of data to allow for
the peek/seek functions to work properly otherwise the counts from the
read function are just wrong.

There are options to default the MinGW stdio to be in binary mode
instead of the I/O being CR\LF it would just be the standard LF if you
add that option object to the executable build.  The only time you
really need CR\LF is when dealing with dreadful Notepad and a few other
MS specific utilities.

-- 
cyg Simple

--
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

