aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2018-06-24 13:21:54 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2018-06-24 21:19:49 +0300
commit1a6765e6318f23ab5c48859907649335c2c05ab0 (patch)
tree550e6420523834d6f23d5287a91848f1265a2314
parent2aa77c545bf4190596ea0ec6f55ae4941e7e5598 (diff)
downloadmeson-1a6765e6318f23ab5c48859907649335c2c05ab0.zip
meson-1a6765e6318f23ab5c48859907649335c2c05ab0.tar.gz
meson-1a6765e6318f23ab5c48859907649335c2c05ab0.tar.bz2
Return a better warning if compiled executable is invalid.
-rw-r--r--mesonbuild/compilers/c.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/mesonbuild/compilers/c.py b/mesonbuild/compilers/c.py
index b63dce4..da28b5d 100644
--- a/mesonbuild/compilers/c.py
+++ b/mesonbuild/compilers/c.py
@@ -282,7 +282,10 @@ class CCompiler(Compiler):
else:
cmdlist = [binary_name]
mlog.debug('Running test binary command: ' + ' '.join(cmdlist))
- pe = subprocess.Popen(cmdlist)
+ try:
+ pe = subprocess.Popen(cmdlist)
+ except Exception as e:
+ raise EnvironmentException('Could not invoke sanity test executable: %s.' % str(e))
pe.wait()
if pe.returncode != 0:
raise EnvironmentException('Executables created by {0} compiler {1} are not runnable.'.format(self.language, self.name_string()))