andk / cpanpm

CPAN.pm
87 stars 79 forks source link

Prerequisites are not rechecked when retrying to install a module #89

Open steve-m-hay opened 9 years ago

steve-m-hay commented 9 years ago

If I run "install MIME::Entity" on a clean perl-5.20.2 with CPAN.pm upgraded to v2.10 then on my system it fails because somewhere in the prerequisites is Test::Deep, which depends on Test::NoWarnings, which fails tests because it uses fork(), which my system doesn't have. [I logged that problem in CPAN RT#77352, but have received no response.]

I thought the fix would be simple: just "force install Test::NoWarnings" and then re-run "install MIME::Entity" and this time all should be well.

Unfortunately, it doesn't work because the second attempt at running "install MIME::Entity" doesn't seem to recheck prerequisites: It just says that the package has "already been unwrapped" and dives straight into running the tests, which fails because Test::Deep is still missing.

I have a complete log of the output if that helps anyone to figure out where it goes wrong.

If I exit the cpan shell and immediately re-enter it and then type "install MIME::Entity" again then it works correctly, installing Test::Deep first and sorting out any other still-missing prerequisites before trying MIME::Entity again.

I would like it to do that without me having to exit and re-enter the cpan shell.

andk commented 9 years ago

On Wed, 29 Apr 2015 06:05:20 -0700, Steve Hay notifications@github.com said:

I would like it to do that without me having to exit and re-enter the cpan shell.

I think the solution would have been 'fforce test MIME::Entity' (alternatively 'force get MIME::Entity') followed by 'install MIME::Entity'.

andreas

steve-m-hay commented 9 years ago

Thanks. Yes, both of those solutions do indeed work.

To my mind it would still be nicer if cpan was somehow aware that a previously missing prerequisite has now been installed so that a simple "install MIME::Entity" does the trick, but I realize that that could be difficult to implement so please feel free to close this issue if you wish.