Web lists-archives.com

Re: CR-LF handling behavior of SED changed recently - this breaks a lot of MinGW cross build scripts




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