Perl-Toolchain-Gang / CPAN-Meta-Requirements

a set of version requirements for a CPAN dist
5 stars 15 forks source link

Does 0.8.0 really not fulfil ">=0.6" ? #29

Closed mschilli closed 8 years ago

mschilli commented 8 years ago

I know that comparing versions can be tricky, but is it really reasonable to reject version 0.8.0 when someone requires 0.6 and above?

use CPAN::Meta::Requirements; my $build_requires = CPAN::Meta::Requirements->new; $build_requires->add_minimum('Thrift' => '0.6'); if( $build_requires->accepts_module( 'Thrift' => '0.8.0' ) ) { print "yes!\n"; } else { print "nooo ...\n"; }

miyagawa commented 8 years ago

Yes, because 0.8.0 is equal to 0.008000 in numeric.

On Mon, Aug 3, 2015, 9:57 PM Mike Schilli notifications@github.com wrote:

I know that comparing versions can be tricky, but is it really reasonable to reject version 0.8.0 when someone requires 0.6 and above?

use CPAN::Meta::Requirements; my $build_requires = CPAN::Meta::Requirements->new; $build_requires->add_minimum('Thrift' => '0.6'); if( $build_requires->accepts_module( 'Thrift' => '0.8.0' ) ) { print "yes!\n"; } else { print "nooo ...\n"; }

— Reply to this email directly or view it on GitHub https://github.com/Perl-Toolchain-Gang/CPAN-Meta-Requirements/issues/29.

mschilli commented 8 years ago

If 0.8.0 is 0.008000, why isn't 0.6 equal to 0.006 in "numeric"?

miyagawa commented 8 years ago

0.6.0 is. But 0.6 isn't.

On Mon, Aug 3, 2015, 10:25 PM Mike Schilli notifications@github.com wrote:

If 0.8.0 is 0.008000, why isn't 0.6 equal to 0.006 in "numeric"?

— Reply to this email directly or view it on GitHub https://github.com/Perl-Toolchain-Gang/CPAN-Meta-Requirements/issues/29#issuecomment-127482658 .

mschilli commented 8 years ago

So if a module author releases 0.6.1 after 0.6, this will break every module on CPAN requiring 0.5 and above?

miyagawa commented 8 years ago

Correct. A CPAN dist shouldn't switch version number scheme, at least not in the middle of minor releases.

Read more at http://www.dagolden.com/index.php/369/version-numbers-should-be-boring/

On Mon, Aug 3, 2015, 10:32 PM Mike Schilli notifications@github.com wrote:

So if a module author releases 0.6.1 after 0.6, this will break every module on CPAN requiring 0.5 and above?

— Reply to this email directly or view it on GitHub https://github.com/Perl-Toolchain-Gang/CPAN-Meta-Requirements/issues/29#issuecomment-127483878 .

mschilli commented 8 years ago

Okay, I'll fix my dependency on Thrift 0.6 to 0.6.1 and hope that the author won't revert to a two-number scheme. Thanks!

karenetheridge commented 8 years ago

Well, Thrift is still indexed to 0.8.0 rather than the new 0.9.0 release, because its package statement was altered:

https://metacpan.org/source/GSLIN/Thrift-0.9.0//lib/Thrift.pm

Thrift                         0.008000  G/GS/GSLIN/Thrift-0.8.0.tar.gz
Thrift::BinaryProtocol         0.009000  G/GS/GSLIN/Thrift-0.9.0.tar.gz
Thrift::BinaryProtocolFactory  0.009000  G/GS/GSLIN/Thrift-0.9.0.tar.gz
Thrift::BufferedTransport      0.009000  G/GS/GSLIN/Thrift-0.9.0.tar.gz
Thrift::BufferedTransportFactory 0.009000  G/GS/GSLIN/Thrift-0.9.0.tar.gz
Thrift::ForkingServer          0.009000  G/GS/GSLIN/Thrift-0.9.0.tar.gz
Thrift::FramedTransport        0.009000  G/GS/GSLIN/Thrift-0.9.0.tar.gz
Thrift::HttpClient             0.009000  G/GS/GSLIN/Thrift-0.9.0.tar.gz

On Mon, Aug 3, 2015 at 10:50 PM, Mike Schilli notifications@github.com wrote:

Okay, I'll fix my dependency on Thrift 0.6 to 0.6.1 and hope that the author won't revert to a two-number scheme. Thanks!

— Reply to this email directly or view it on GitHub https://github.com/Perl-Toolchain-Gang/CPAN-Meta-Requirements/issues/29#issuecomment-127486525 .

dagolden commented 8 years ago

Side note: this is why I recommend that people always use a leading v when doing anything involving version tuples. It's much less confusing when someone drops the last part (as long as they keep the leading v): v0.6.0 == v0.6 == 0.006.