This is the mail archive of the cygwin-apps mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Setup patch to keep test version if test version installed

On 02/06/2015 02:24 AM, Corinna Vinschen wrote:
> On Feb  5 22:57, Achim Gratz wrote:
>> Oh, and while you are so deep in the bowels of setup.exe, would it be
>> possible to somehow fake a pty to shell scripts and a console to cmd so
>> that the scripts run by setup.exe produce their output in line-buffered
>> instead of fully buffered mode?
> Er... uh... *cough*... PTC?
> For Cygwin processes this would require to duplicate lots of the pty
> code from Cygwin to Setup.  For native commands it might be enough to
> play with the process creation flags in the call to CreateProcess, but
> that might lead to a flickering taskbar entry for a hidden console.

For native commands (.bat, .cmd postinstalls), I have no idea.  But for
cygwin processes (.sh postinstalls), it would be neat if we could get
coreutils' stdbuf utility working on cygwin, then we just invoke 'sh -c
"stdbuf"' instead of 'sh -c ""'.

> The other problem is that the stdio handles are redirected to a file
> and thus, even if you have a console or pty, the output from the command
> will use fully buffered mode.
> The only way around that, afaics, is some sort of global setting (env
> var?) for the buffering mode which is honored by native processes and
> which may be read by the Cygwin DLL as well to enforce line buffering.
> But I'm not aware such a setting exists.

stdbuf uses LD_PRELOAD to tell a process in main() that it should use
line or no buffering, regardless of whether the output file is a file.
And cygwin supports LD_PRELOAD.  But to date, no one has helped figure
out how to port it to cygwin (I assume it should work, but have not had
time to try it - the difficulties lie more in getting the coreutils
Makefile to target the difference in cygwin naming with .dll instead of
.so and with .exe suffixes to worry about).

Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library

Attachment: signature.asc
Description: OpenPGP digital signature

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]