[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: running parallel make jobs and avoiding jumbled/garbled output?

From: Per Jessen
Subject: Re: running parallel make jobs and avoiding jumbled/garbled output?
Date: Fri, 22 Feb 2008 18:39:27 +0100
User-agent: KNode/0.10.4

Paul Smith wrote:

> However, it sounds to me like the OP is seeing this issue even with
> output to stdout, which is already line-buffered (or is supposed to
> be). So, I think the issue might be more complex than that.

No, if I run the same 'make -j4' job in a terminal, there's no problem. 
No garbling and no truncation of output. 

> The thing is, it's not a problem with make at all.  Make just runs
> programs and waits for them to finish.  The programs (compilers, etc.)
> that make invokes are printing directly to stdout/stderr, themselves;
> make is not reading that output and emitting it again.
> I'm pretty sure that line buffering settings are user-space features,
> not process features, and as such they are not inherited by
> sub-processes but rather determined anew for every process that
> starts, based on its terminal settings, etc.

Hmm, when a new process is forked, I'm pretty certain the default is for 
it to continue using whatever stdin/out/err settings the parent process
was using.

> That means the problem is not make, but rather the programs you're
> running are not setting stdout to be line-buffered explicitly.  I'm
> not sure there's much make can do about it, other than try to set up a
> pty or something and redirect all process output to that... ouch.
> Maybe you can run your cron job inside of screen or some other program
> that mimics a terminal, so the programs you invoke are set to use line
> buffering?

I'll look into that. 

Per Jessen, Z├╝rich

reply via email to

[Prev in Thread] Current Thread [Next in Thread]