bug-make
[Top][All Lists]
Advanced

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

Re: Make run in parallel mode with output redirected to a regular file c


From: Frank Heckenbach
Subject: Re: Make run in parallel mode with output redirected to a regular file can randomly drop output lines
Date: Mon, 27 May 2013 00:42:34 +0200

Paul Smith wrote:

> Nevertheless, I do wonder whether forcing stdout/stderr into O_APPEND
> mode would be worthwhile.  It would fix this problem in any event.  I'm
> having a hard time coming up with a reason NOT to do it.

One issue, though it might seem strange that I'm the one to mention
it, is that it might be POSIX specific. How do other systems behave,
can they set O_APPEND via fcntl or otherwise, and if so, does it
guarantee non-conflicting writes? Of course, you could say an
improvement that only works on some systems (as long as doesn't
negatively affect other systems) is better than nothing, but it
might give package maintainers a false sense of safety in keeping a
problematic way of doing things rather than modifying their packages
to do it safely right away (like Stefano just did as I understand
it). Though, if O_APPEND doesn't guarantee non-conflicting writes
*at all* (i.e., even when set on opening, as in "make >> logfile")
on some systems, it's not really safe either.

Of course, you can construct a theoretical case, such as someone
setting up a large empty file, seeking to its beginning and
expecting their make jobs to write there. I can't think of any
practical reason to do this, but as with most of the "-O" and
related discussions, I'm sure someone will tell us about such a
scenario soon. :-)

Neither of may be a very strong argument, but my gut feeling is that
this is slightly outside of the scope of what make should do. But in
any case, I don't have a strong opinion since I'll be using
output-sync from now on anyway.

Stefano Lattarini wrote:

> An now that I think about it, maybe the sanest "fix" would be just
> documenting the issue in the manual?

I tend to agree. Perhaps a sentence or two in "Parallel Output",
mentioning that output-sync will also avoid this problem.



reply via email to

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