cpanpm icon indicating copy to clipboard operation
cpanpm copied to clipboard

Script exit depends on "last line", does not take in consideration recommends

Open ribasushi opened this issue 9 years ago • 5 comments
trafficstars

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.

ribasushi avatar Apr 11 '16 21:04 ribasushi

At the current level of technology, that's just how it's going to be. I consider this the designed behavior.

briandfoy avatar Oct 26 '16 03:10 briandfoy

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.

karenetheridge avatar Oct 26 '16 04:10 karenetheridge

cc @dagolden @xdg

karenetheridge avatar Oct 26 '16 04:10 karenetheridge

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.

briandfoy avatar Oct 26 '16 14:10 briandfoy

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.

karenetheridge avatar Oct 30 '16 02:10 karenetheridge