8207001: *.obj.log files get truncated causing unreliable incremental builds on Windows
authorerikj
Thu, 12 Jul 2018 16:30:47 +0200
changeset 51069 d5d5f6658b12
parent 51068 2e675859332a
child 51070 2f4c3cac8556
8207001: *.obj.log files get truncated causing unreliable incremental builds on Windows Reviewed-by: erikj, tbell Contributed-by: ralf.schmelter@sap.com
make/common/MakeBase.gmk
--- a/make/common/MakeBase.gmk	Thu Jul 12 07:14:30 2018 -0700
+++ b/make/common/MakeBase.gmk	Thu Jul 12 16:30:47 2018 +0200
@@ -1015,7 +1015,7 @@
   $(call LogCmdlines, Exececuting: [$(strip $2)]) \
   $(call MakeDir, $(dir $(strip $1))) \
   $(call WriteFile, $2, $(strip $1).cmdline) \
-  ( $(strip $2) > >($(TEE) $(strip $1).log) 2> >($(TEE) $(strip $1).log >&2) || \
+  ( $(RM) $(strip $1).log && $(strip $2) > >($(TEE) -a $(strip $1).log) 2> >($(TEE) -a $(strip $1).log >&2) || \
       ( exitcode=$(DOLLAR)? && \
       $(CP) $(strip $1).log $(MAKESUPPORT_OUTPUTDIR)/failure-logs/$(subst /,_,$(patsubst $(OUTPUTDIR)/%,%,$(strip $1))).log && \
       $(CP) $(strip $1).cmdline $(MAKESUPPORT_OUTPUTDIR)/failure-logs/$(subst /,_,$(patsubst $(OUTPUTDIR)/%,%,$(strip $1))).cmdline && \