From adf09b8316706fe75fd7255125056b077ce05edb Mon Sep 17 00:00:00 2001 From: Akihiko Odaki Date: Sat, 12 Aug 2023 17:57:59 +0900 Subject: [PATCH] Raise if a postconf script fails Raise MesonException if a postconf script fails to let the user know about the failure. --- mesonbuild/backend/backends.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py index 01ec422f4..92cc9fb51 100644 --- a/mesonbuild/backend/backends.py +++ b/mesonbuild/backend/backends.py @@ -1620,7 +1620,9 @@ class Backend: for s in self.build.postconf_scripts: name = ' '.join(s.cmd_args) mlog.log(f'Running postconf script {name!r}') - run_exe(s, env) + rc = run_exe(s, env) + if rc != 0: + raise MesonException(f'Postconf script \'{name}\' failed with exit code {rc}.') def create_install_data(self) -> InstallData: strip_bin = self.environment.lookup_binary_entry(MachineChoice.HOST, 'strip')