summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2020-09-08 18:33:42 +0530
committerNirbheek Chauhan <nirbheek.chauhan@gmail.com>2020-09-08 15:27:34 +0000
commiteca4c6fcaf7393a4a042ca2c6d104e83e0de2ffe (patch)
treeeb535349af60fb22563c63ca101ee000effaebd2
parent863492ae1ab7af54f71c0900315d424a66a70b1b (diff)
downloadmeson-eca4c6fcaf7393a4a042ca2c6d104e83e0de2ffe.tar.gz
minstall: Print a big FAILED when a script fails
We don't run any further scripts when this happens, so we need to print a big error. The exit code was already correct. Fixes https://github.com/mesonbuild/meson/issues/7627
-rw-r--r--mesonbuild/minstall.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/mesonbuild/minstall.py b/mesonbuild/minstall.py
index e6e973af1..d4777181d 100644
--- a/mesonbuild/minstall.py
+++ b/mesonbuild/minstall.py
@@ -437,11 +437,13 @@ class Installer:
self.log('Running custom install script {!r}'.format(name))
try:
rc = subprocess.call(script + args, env=child_env)
- if rc != 0:
- sys.exit(rc)
except OSError:
- print('Failed to run install script {!r}'.format(name))
- sys.exit(1)
+ print('FAILED: install script \'{}\' could not be run, stopped'.format(name))
+ # POSIX shells return 127 when a command could not be found
+ sys.exit(127)
+ if rc != 0:
+ print('FAILED: install script \'{}\' exit code {}, stopped'.format(name, rc))
+ sys.exit(rc)
def install_targets(self, d):
for t in d.targets: