cpanpm
cpanpm copied to clipboard
Script exit depends on "last line", does not take in consideration recommends
If cpan Foo pulls in a recommend reqiures of Bar which fails to install AND it happens to be the last thing CPAN.pm is processing, the result will be a non-zero exit due to this.
An log of a session exhibiting the problem can be seen in the attachment here.
Many thanks to @xdg for quickly finding this.
At the current level of technology, that's just how it's going to be. I consider this the designed behavior.
Could you explain your reasoning for this behaviour being as designed? I do not see how the failure to install recommended prereqs ought to constitute an overall failure.
https://metacpan.org/pod/CPAN::Meta::Spec#Phases defines 'recommended' prereqs.
cc @dagolden @xdg
The script is really stupid. It simply watches output without understanding what CPAN.pm is doing. If anything in the output looks like it indicates failure, it considers it a failure. It doesn't know what CPAN.pm is doing or why it is doing it. I don't think the documentation in the script promises anything different. It exits with 8 if a module fails to install. That is true for this issue; a module did fail to install.
If you wanted something different, you need a completely different system. This was virtually the entire initial motivation of CPANPLUS.
I'd mark this issue as something like "enhancement" or "help wanted", but it is not a bug.
It's not a bug in the sense of the original intent of the script; it is, however, a bug in the sense of what the CPAN::Meta specification says how cpan clients ought to intepret prerequisite data of a distribution.
I'm content to label this "unlikely to be fixed" -- that is, relief will be felt through the retirement of the client and replacement with another, rather than through an update of this one.