From 1a6765e6318f23ab5c48859907649335c2c05ab0 Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Sun, 24 Jun 2018 13:21:54 +0300 Subject: Return a better warning if compiled executable is invalid. --- mesonbuild/compilers/c.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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())) -- cgit v1.1