aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2015-11-22 14:39:21 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2015-11-22 14:39:21 +0200
commit78e2cf064131fc155b9529e383c95ca6a225a6a7 (patch)
tree0ee54627ce8ab7521a7517257e8cdfcba9388a43
parent134468d4a50c43b9adf615e7af2dbb417e63618f (diff)
downloadmeson-78e2cf064131fc155b9529e383c95ca6a225a6a7.zip
meson-78e2cf064131fc155b9529e383c95ca6a225a6a7.tar.gz
meson-78e2cf064131fc155b9529e383c95ca6a225a6a7.tar.bz2
More logging for compiler sanity testing.
-rw-r--r--compilers.py25
1 files changed, 22 insertions, 3 deletions
diff --git a/compilers.py b/compilers.py
index 7ca602f..f211760 100644
--- a/compilers.py
+++ b/compilers.py
@@ -294,8 +294,17 @@ class CCompiler(Compiler):
extra_flags = ['-c']
else:
extra_flags = []
- pc = subprocess.Popen(self.exelist + extra_flags + [source_name, '-o', binary_name])
- pc.wait()
+ cmdlist = self.exelist + extra_flags + [source_name, '-o', binary_name]
+ pc = subprocess.Popen(cmdlist, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ (stdo, stde) = pc.communicate()
+ stdo = stdo.decode()
+ stde = stde.decode()
+ mlog.debug('Sanity check compiler command line:', ' '.join(cmdlist))
+ mlog.debug('Sanity check compile stdout:')
+ mlog.debug(stdo)
+ mlog.debug('-----\nSanity check compile stderr:')
+ mlog.debug(stde)
+ mlog.debug('-----')
if pc.returncode != 0:
raise EnvironmentException('Compiler %s can not compile programs.' % self.name_string())
if self.is_cross:
@@ -544,7 +553,17 @@ class CPPCompiler(CCompiler):
ofile = open(source_name, 'w')
ofile.write('class breakCCompiler;int main(int argc, char **argv) { return 0; }\n')
ofile.close()
- pc = subprocess.Popen(self.exelist + [source_name, '-o', binary_name])
+ cmdlist = self.exelist + [source_name, '-o', binary_name]
+ pc = subprocess.Popen(cmdlist, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ (stdo, stde) = pc.communicate()
+ stdo = stdo.decode()
+ stde = stde.decode()
+ mlog.debug('Sanity check compiler command line:', ' '.join(cmdlist))
+ mlog.debug('Sanity check compile stdout:')
+ mlog.debug(stdo)
+ mlog.debug('-----\nSanity check compile stderr:')
+ mlog.debug(stde)
+ mlog.debug('-----')
pc.wait()
if pc.returncode != 0:
raise EnvironmentException('Compiler %s can not compile programs.' % self.name_string())