This queue is for tickets about the CPAN CPAN distribution.

Report information
The Basics
Id:
123505
Status:
resolved
Priority:
Low/Low
Queue:

People
Owner:
Nobody in particular
Requestors:
'spro^^*%*^6ut# [...] &$%*c
Cc:
AdminCc:

BugTracker
Severity:
(no value)
Broken in:
2.18-TRIAL
Fixed in:
2.19-TRIAL



Subject: Fails to handle required *and* optional dependency
Some modules have recently started recommended a specific version of a hard dependency that has no required version. Class::Load, for example, has ‘requires: Data::OptList: '0'’ and ‘recommends: Data::OptList: '0,110'’. CPAN.pm does not handle this very well. The sequence that it goes through is set out at <https://rt.cpan.org/Ticket/Display.html?id=123447>. I see a similar problem with Module::Pluggable. The META.yml contains this: optional_features: module_runtime: description: 'Optionally use Module::Runtime for requiring plugins rather than homegrown system' requires: Module::Runtime: '0.012' recommends: Module::Runtime: '0.012' I must admit I’ve never heard of optional_features. But in any case, the CPAN shell really gets muddled up:
Show quoted text
nolock_cpan> test IO::Async::SSL
... processes a bunch of dependencies, eventually getting to Module::Pluggable ... Configuring S/SI/SIMONW/Module-Pluggable-5.2.tar.gz with Makefile.PL Checking if your kit is complete... Looks good Generating a Unix-style Makefile Writing Makefile for Module::Pluggable Writing MYMETA.yml and MYMETA.json SIMONW/Module-Pluggable-5.2.tar.gz /usr/local/bin/perl5.26.0 Makefile.PL -- OK Running make for S/SI/SIMONW/Module-Pluggable-5.2.tar.gz
Show quoted text
---- Unsatisfied dependencies detected during ---- ---- SIMONW/Module-Pluggable-5.2.tar.gz ---- Module::Runtime [requires,optional] See the ‘requires,optional’ thing, which I also observe with Class::Load. It builds and tests: cp lib/Devel/InnerPackage.pm blib/lib/Devel/InnerPackage.pm cp lib/Module/Pluggable.pm blib/lib/Module/Pluggable.pm cp lib/Module/Pluggable/Object.pm blib/lib/Module/Pluggable/Object.pm Manifying 3 pod documents SIMONW/Module-Pluggable-5.2.tar.gz /usr/bin/make -- OK Running make test ... etc etc etc ... All tests successful. Files=43, Tests=180, 5 wallclock secs ( 0.17 usr 0.09 sys + 3.55 cusr 0.87 csys = 4.68 CPU) Result: PASS SIMONW/Module-Pluggable-5.2.tar.gz Tests succeeded but one dependency not OK (Module::Runtime) Then it goes ahead and tests Module::Runtime, but still remembers that Module::Pluggable is ‘not ok’, so it is not included in PERL5LIB for subsequent tests, and so everything else fails in the end. Regardless of how this is handled, it should not be saying ‘but one dependency not OK’ before even trying to test that dependency!
This has been fixed in the repo, as far as I can tell. I just tried 'test IO::Async::SSL' with a perl that did not have either of Module::Runtime Module::Pluggable or IO::Async::SSL installed and it passed all tests. Will make a new trial release ASAP.
On Sat Nov 04 04:46:55 2017, ANDK wrote:
Show quoted text
> This has been fixed in the repo, as far as I can tell. I just tried > 'test IO::Async::SSL' with a perl that did not have either of > Module::Runtime Module::Pluggable or IO::Async::SSL installed and it > passed all tests. > > Will make a new trial release ASAP.
I have a question, though: Sometimes these times of failures seem to come and go. Is the order that dependencies are processed dependent on the order they come out of a hash?
Subject: Re: [rt.cpan.org #123505] Fails to handle required *and* optional dependency
Date: Sat, 04 Nov 2017 22:38:03 +0100
To: "Father Chrysostomos via RT" <bug-CPAN@rt.cpan.org>
From: Andreas Koenig <andreas.koenig.7os6VVqR@franz.ak.mind.de>
Show quoted text
> I have a question, though: Sometimes these times of failures seem to > come and go. Is the order that dependencies are processed dependent on > the order they come out of a hash?
I wouldn't bet on it, there may still be places in the code that allow some randomness. So I tried with current code another couple of times with different perls, and all succeeded. I also found the commit: : commit 5c86d0711aa0ab2685ed0210b2304fc1dbd01cf3 : Author: Andreas Koenig <andk@cpan.org> : Date: Sat Jun 24 09:38:50 2017 +0200 : : Bugfix RT 121914: cpan client fails to install Class::Load : : - we considered something optional when recommended/suggested : - this is wrong when it is both recommended AND required : - exposed by Class-Load-0.24 which required Data::OptList 0 and recommends : Data::OptList 0.11 : - now fixed by checking against available version number in is_locally_optional -- andreas
On Sat Nov 04 17:38:28 2017, andreas.koenig.7os6VVqR@franz.ak.mind.de wrote:
Show quoted text
> > I have a question, though: Sometimes these times of failures seem to > > come and go. Is the order that dependencies are processed dependent > > on > > the order they come out of a hash?
> > I wouldn't bet on it, there may still be places in the code that allow > some randomness. So I tried with current code another couple of times > with different perls, and all succeeded. I also found the commit: > > : commit 5c86d0711aa0ab2685ed0210b2304fc1dbd01cf3 > : Author: Andreas Koenig <andk@cpan.org> > : Date: Sat Jun 24 09:38:50 2017 +0200 > : > : Bugfix RT 121914: cpan client fails to install Class::Load > : > : - we considered something optional when recommended/suggested > : - this is wrong when it is both recommended AND required > : - exposed by Class-Load-0.24 which required Data::OptList 0 and > recommends > : Data::OptList 0.11 > : - now fixed by checking against available version number in > is_locally_optional
Ah. Thank you.
2.19-TRIAL with this fix is uploaded. Thanks again for the report!


This service runs on Request Tracker, is sponsored by The Perl Foundation, and maintained by Best Practical Solutions.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.