fix: add .stderr dumfile to log *after* make engine has exited. wip
authorraptorbot <raptorbot@systemstesthead.symbian.intra>
Mon, 18 Jan 2010 16:39:52 +0000
branchwip
changeset 130 4f2ae0d78608
parent 128 d7a63891e2e6
child 131 e8506cb18305
fix: add .stderr dumfile to log *after* make engine has exited.
sbsv2/raptor/python/raptor_make.py
--- a/sbsv2/raptor/python/raptor_make.py	Mon Jan 18 00:22:30 2010 +0000
+++ b/sbsv2/raptor/python/raptor_make.py	Mon Jan 18 16:39:52 2010 +0000
@@ -458,7 +458,8 @@
 				command += " " + " ".join(addTargets)
 
 			# Send stderr to a file so that it can't mess up the log (e.g.
-			# clock skew messages from some build engines.
+			# clock skew messages from some build engines scatter their
+			# output across our xml.
 			stderrfilename = makefile+'.stderr'
 			command += " 2>'%s' " % stderrfilename
 
@@ -504,13 +505,6 @@
 					line = stream.readline()
 					self.raptor.out.write(line)
 
-				try:
-					e = open(stderrfilename,"r")
-					for line in e:
-						self.raptor.out.write(escape(line))
-					e.close()
-				except Exception,e:
-					self.raptor.Error("Couldn't complete stderr output for %s - '%s'", str(e), command)
 
 				# should be done now
 				returncode = p.wait()
@@ -519,6 +513,17 @@
 				self.raptor.InfoEndTime(object_type = "makefile",
 						task = "build", key = str(makefile))
 
+				# Take all the stderr output that went into the .stderr file
+				# and put it back into the log, but safely so it can't mess up
+				# xml parsers.
+				try:
+					e = open(stderrfilename,"r")
+					for line in e:
+						self.raptor.out.write(escape(line))
+					e.close()
+				except Exception,e:
+					self.raptor.Error("Couldn't complete stderr output for %s - '%s'", command, str(e))
+
 				if returncode != 0  and not self.raptor.keepGoing:
 					self.Tidy()
 					return False