Skip Menu |

This queue is for tickets about the version CPAN distribution.

Report information
The Basics
Id: 49348
Status: resolved
Priority: 0/
Queue: version

People
Owner: Nobody in particular
Requestors: burak [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 0.7701
Fixed in: (no value)



Subject: Inconsisten behaviour between the pure perl and XS versions for three digit numbers
I was getting fails on 5.6.2 from CPAN testers for my Parse::HTTP::UserAgent. See this for example: http://www.nntp.perl.org/group/perl.cpan.testers/2009/08/msg5191895.html First, a little background: Since I got all tests passing under $] >= 5.008 I've assumed that 5.6.2 is the source. However after setting a VM to test 5.6.1 I saw that version fails to compile and installed the pure perl version instead. And got the exact failure. But then realised that ::vpp could be the problem and tried ::vpp under 5.10 and got the same error. The problem seems to reside in version::vpp::_un_vstring(). I've checked the XS code too, but it seemed similar. However, I'm not a experienced C coder. Test case: try to run this with both the XS version and the Pure Perl version: print version->new("420")->numify; version::vpp::_un_vstring() makes it v52.50.48 while the XS version does not. I'm currently using this work around to fix the issue: # if version::vpp is used it'll identify 420 as a v-string # add a floating point to fool it $v .= '.0' if index($v, '.') == -1; my $rv = version->new("$v")->numify; return $rv; however a fix to this issue will be much better. or you can just change the XS version if this is the expected behaviour. The interfaces must be identical IMO. Cheers, Burak
Subject: Re: [rt.cpan.org #49348] Inconsisten behaviour between the pure perl and XS versions for three digit numbers
Date: Tue, 01 Sep 2009 20:27:20 -0400
To: bug-version [...] rt.cpan.org
From: John Peacock <john.peacock [...] havurah-software.org>
On 09/01/2009 07:42 PM, Burak Gursoy via RT wrote Show quoted text
> Test case: try to run this with both the XS version and the Pure Perl > version: > > print version->new("420")->numify; > > version::vpp::_un_vstring() makes it v52.50.48 while the XS version > does not. >
Yeah, there isn't much I can do about it; with 5.6.x through 5.8.0, I have to basically guess whether something is a v-string or not, since there isn't any way to "know" for sure. And you've stumbled across the case where this triggers (three characters, no decimal or underscore). But I see the same behavior with XS and with pure Perl, which is what I would expect to see. Since you know for a fact that the strings you are parsing are in plain versions (and not potential v-strings), you only need to append a '.' iif the string is three characters long and has no decimal already. This will not change the meaning of the version you are parsing, since you are already imposing the $v->numeric notation. Sorry I can't go back in time and make v-strings magical in 5.6.x like I did for 5.8.1... John
01 Eki. 2009 Sal., 20:27:43 tarihinde, john.peacock@havurah- software.org yazdı: Show quoted text
> But I see the same behavior with XS and with pure Perl, which is
what I Show quoted text
> would expect to see.
That's strange. I'm getting different behaviors under ActivePerl 5.10.0 build 1004 & Windows Vista SP2 & latest version of "version": C:\Users\burak\Desktop\version-0.7701>perl -Mblib -wle "use version::vxs; print version::vxs->new(420)->stringify" 420 C:\Users\burak\Desktop\version-0.7701>perl -Ilib -Ivperl -wle "BEGIN {require q{vpp.pm}} print version::vpp->new(420)->stringify" v52.50.48 See the attached file for the full log of the build process. I think that this can be added as a test case to the test suite and I also think that version::vpp must be tested in the build process no matter if it's selected to install or not.
Download version_log
application/octet-stream 4.9k

Message body not shown because it is not plain text.

Fixed in 0.7702 on its way to a CPAN mirror near you... John