build output/logging buffering?
David Holmes
david.holmes at oracle.com
Sun Jul 1 17:31:29 PDT 2012
On 30/06/2012 12:02 PM, David Holmes wrote:
> On 30/06/2012 10:39 AM, Kelly O'Hair wrote:
>> That logger.sh script is doing some strange buffering to fd 3 somehow.
>> I'd never see that used before.
>>
>> http://hg.openjdk.java.net/build-infra/jdk8/file/ccfffd988af6/common/bin/logger.sh
>>
>
> Don't know about the fd 3 but maybe it is the subshell that introduces
> the buffering ?
I did a simple test using the form:
(exec 3>&1 ; ("$@" 2>&1 1>&3; echo $? > "$RCDIR/rc") | tee -a $LOGFILE
1>&2 ; exec 3>&-) | tee -a $LOGFILE
and couldn't reproduce the problem.
I'll have to see if I can reproduce more easily in the real build system.
Thanks,
David
-----
>
> David
>
>>
>> -kto
>>
>> On Jun 29, 2012, at 2:57 PM, Erik Joelsson wrote:
>>
>>> This problem was new to me. It seems strange that stderr and stdout
>>> would behave differently. Both are piped through a separate instance
>>> of 'tee' to preserver the separation on the console, but to get both
>>> into the logfile.
>>>
>>> /Erik
>>>
>>> On 2012-06-28 20:16, David Holmes wrote:
>>>> I see that a build will create a build.log by default. I also see I
>>>> can set VERBOSE= to get back to the older more verbose style of
>>>> output (eg full compilation commands etc).
>>>>
>>>> But it seems that due to the logging there is some buffering taking
>>>> place that prevents me from seeing the most recent build output
>>>> while it is running. I just had a problem where due to a mistyped
>>>> variable I did a "cd " and then starting trawling my entire home
>>>> directory, but I couldn't see this in the build output, ie no "cd "
>>>> was visible, presumably because the output was being buffered.
>>>>
>>>> What I did see, which gave me the hint were a bunch of warnings that
>>>> presumably went to stderr, not stdout and do did not get buffered.
>>>>
>>>> David
>>>
>>
More information about the build-infra-dev
mailing list