conda / constructor

tool for creating installers from conda packages
https://conda.github.io/constructor/
Other
451 stars 166 forks source link

Output NSIS error messages #798

Open marcoesters opened 1 month ago

marcoesters commented 1 month ago

Checklist

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

jaimergp commented 3 weeks ago

It's there in debug mode:

https://github.com/conda/constructor/blob/b6c42339503102cf228269d4fefd4009ae4dcd47/constructor/winexe.py#L466-L472

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