From 6b551ffb2bb27a896751843f94df9290515c7b80 Mon Sep 17 00:00:00 2001 From: jaimergp Date: Fri, 8 Nov 2024 17:59:07 +0100 Subject: [PATCH] Always print NSIS output on errors (#890) --- constructor/winexe.py | 10 +++++++--- news/890-debug-nsis | 19 +++++++++++++++++++ 2 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 news/890-debug-nsis diff --git a/constructor/winexe.py b/constructor/winexe.py index cc9840340..7f8c9968d 100644 --- a/constructor/winexe.py +++ b/constructor/winexe.py @@ -499,9 +499,13 @@ def create(info, verbose=False): args = [MAKENSIS_EXE, verbosity, nsi] logger.info('Calling: %s', args) process = run(args, capture_output=True, text=True) - logger.debug("makensis stdout:\n'%s'", process.stdout) - logger.debug("makensis stderr:\n'%s'", process.stderr) - process.check_returncode() + if process.returncode: + logger.info("makensis stdout:\n'%s'", process.stdout) + logger.error("makensis stderr:\n'%s'", process.stderr) + sys.exit(f"Failed to run {args}. Exit code: {process.returncode}.") + else: + logger.debug("makensis stdout:\n'%s'", process.stdout) + logger.debug("makensis stderr:\n'%s'", process.stderr) if signing_tool: signing_tool.verify_signature(info['_outpath']) diff --git a/news/890-debug-nsis b/news/890-debug-nsis new file mode 100644 index 000000000..2daa2a9d2 --- /dev/null +++ b/news/890-debug-nsis @@ -0,0 +1,19 @@ +### Enhancements + +* + +### Bug fixes + +* Always report NSIS output when an error occurs. (#798 via #890) + +### Deprecations + +* + +### Docs + +* + +### Other + +*