[PATCH 2.3.1 1/1] Include stdout for build commands using site scons logger


Alireza Assadzadeh <Alireza.Assadzadeh@...>
 

Update OpenMAMA site_scons logger to include stdout for build
commands as well as stderr. Hence, Windows builds details of the
compile/link error (if any) from MSVS CL command-line.

Signed-off-by: Alireza Assadzadeh <Alireza.Assadzadeh@solacesystems.com>
---

The patch is based on 'next' branch.
This was tested and used with scons builds on Windows with MSVS 2010 and
Linux with GCC.

site_scons/logger.py | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/site_scons/logger.py b/site_scons/logger.py
index acb5123..59e857f 100644
--- a/site_scons/logger.py
+++ b/site_scons/logger.py
@@ -36,6 +36,13 @@ class Logger:
if self.opts['verbose'] == True:
sys.stderr.write('WARNING:: %s' % (stderr))
self.fd.write('%s\n' % (stderr))
+ # Include stdout logs if there are any. This is especially
+ # helpful in Windows builds where MSVS CL command-line sends
+ # useful errors/warnings to stdout instead of stderr.
+ if len(stdout) > 0:
+ if self.opts['verbose'] == True:
+ sys.stdout.write('WARNING::stdout: %s' % (stdout))
+ self.fd.write('stdout: %s\n' % (stdout))
return p.returncode

def log_command(self, s, target, src, env):
--
1.9.3

Join Openmama-dev@lists.openmama.org to automatically receive all group messages.