Martin Sebor wrote:
> Martin Sebor wrote:
>> sebor@apache.org wrote:
>>
>>> Author: sebor
>>> Date: Thu Oct 12 17:49:34 2006
>>> New Revision: 463535
>>>
>>> URL: http://svn.apache.org/viewvc?view=rev&rev=463535
>>> Log:
>>> 2006-10-12 Andrew Black <ablack@roguewave.com>
>>>
>>> * makefile.rules (%.o: %(AS_EXT), %.o: %.cpp, %: %.o, %: %.cpp): Add
>>> $(TEEOPTS) to compile/link line so that output is routed to log
>>> files.
>>
>>
>> Andrew, I'm afraid there's a problem with this patch. The exit status
>> of a pipeline is the exit status of the last command so piping stderr
>> of the compiler (or linker) to tee will cause the pipeline to exit with
>> the status of tee rather than that of the compiler or linker. That in
>> turn prevents make from stopping after a compiler or linker error and
>> allows it to continue processing subsequent commands. I'm going to have
>> to revert the makefile changes. Can you please look into how else this
>> could be done?
>
> FYI, we might be able to use the PIPESTATUS bash special variable
> when the shell is bash. With shells that don't provide equivalent
> functionality we will either need to come up with an alternative
> (e.g., our own implementation of a pipe that returns the exit
> status of the first command instead of the last one), or count
> the warnings only in batch builds and skip that part in interactive
> ones. Are there any other options?
>
> Martin
Greetings Martin
I believe the attached patch might be an option that doesn't rely on
bash, though it has a slight inelegant feel to it. In particular, the
part reading '(echo $$cache > /dev/null)' is a hack to keep bash from
losing the cache variable in the pipeline (perhaps 'export cache' should
be used instead?). I have tested this change on Linux, Solaris and
HPUX, and it appears to behave correctly on all three.
--Andrew Black
Log:
* makefile.common (TEEOPTS): Always tee output to $@.log, prevent
setting of LOGFILE from breaking result capturing. (Reimplementation of
rev 463535, reverted in rev 463850 due to loss of return code from
compile/link commands)
* makefile.rules (%.o: %(AS_EXT), %.o: %.cpp, %: %.o, %: %.cpp):
Add $(TEEOPTS) to compile/link line so that output is routed to log
files. (Reverts rev 463850, which reverted rev 463535)
|