Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output NSIS error messages #798

Open
2 tasks done
marcoesters opened this issue May 15, 2024 · 1 comment
Open
2 tasks done

Output NSIS error messages #798

marcoesters opened this issue May 15, 2024 · 1 comment
Labels
type::feature request for a new feature or capability

Comments

@marcoesters
Copy link
Contributor

Checklist

  • I added a descriptive title
  • I searched open requests and couldn't find a duplicate

What is the idea?

Catch and forward the error message output by makensis.exe to facilitate debugging.

Why is this needed?

When makensis.exe fails, the error message is along the lines of

subprocess.CalledProcessError: Command '['C:\\Users\\runneradmin\\miniconda3\\NSIS\\makensis.exe', '/V2', 'C:\\Users\\RUNNER~1\\AppData\\Local\\Temp\\tmpe83oee6u\\main.nsi']' returned non-zero exit status 1.

This does not help developers understand why their build failed. Running makensis.exe directly, however, will yield an error message.

However, running makensis.exe directly is not always convenient to do (on a CI, for example), and should not be necessary to do in the first place. Outputting the error message via constructor will facilitate debugging.

What should happen?

constructor should forward the error message provided by makensis.exe.

Additional Context

No response

@marcoesters marcoesters added the type::feature request for a new feature or capability label May 15, 2024
@jaimergp
Copy link
Contributor

It's there in debug mode:

verbosity = f"{'/' if sys.platform == 'win32' else '-'}V{4 if verbose else 2}"
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()

But yea, we could change the debug level if the returncode != 0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type::feature request for a new feature or capability
Projects
Status: 🆕 New
Development

No branches or pull requests

2 participants