rjbs / Dist-Zilla

scary tools for building CPAN distributions
http://dzil.org/
186 stars 152 forks source link

Improve error message for failed 'dzil run' #703

Closed aquanight closed 1 year ago

aquanight commented 2 years ago

This improves the error message provided by 'dzil run' to indicate the resulting exit status of a failed command. An example of where this might help is during exploratory testing using 'dzil run perl'.

In particular I ran into this problem when a module I was doing such testing with crashed with SIGSEGV: with no output from perl itself and only a very basic message from dzil, I had to guess (or discover via strace) what had actually happened.

karenetheridge commented 2 years ago

Can you show a before-and-after of a failed command, since there is no test coverage of this area to show what the changes would look like?

rjbs commented 1 year ago

As far as I can tell:

before:

Can't exec "lss": No such file or directory at /Users/rjbs/.plenv/versions/5.37.2/lib/perl5/site_perl/5.37.2/Dist/Zilla/Dist/Builder.pm line 854.
[DZ] error while running: lss at /Users/rjbs/.plenv/versions/5.37.2/lib/perl5/si
te_perl/5.37.2/Dist/Zilla/Dist/Builder.pm line 854.
[DZ] left failed dist in place at .build/a9IrSHIhsi

after:

[DZ] "lss" failed to start: "No such file or directory" at /Users/rjbs/.plenv/ve
rsions/5.37.2/lib/perl5/site_perl/5.37.2/Dist/Zilla/Dist/Builder.pm line 856.
[DZ] left failed dist in place at .build/tgqXvZr2Xb

Is this better? I don't know, I'm not really seeing the specific way it's better. With no reply to the question already asked, I'm closing this unless there's more to it.