Skip Menu |

This queue is for tickets about the version CPAN distribution.

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

People
Owner: jpeacock [...] cpan.org
Requestors: kane [...] cpan.org
Cc:
AdminCc:

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



Subject: version::vpp dies on Does::Not::Exist->VERSION, as opposed to version::vxs/normal perl
Greetings, I've found the following fatal issue with version.pm 0.69 in pure perl form: When requesting the Some::Module->VERSION method, if the module is not able to be loaded, version::vpp throws a fatal error. Normal perl, and version::vxs do not do this. Here's an example: # using normal perl: $ perl -le'print Doest::Not::Exist->VERSION' $ # using version::vxs $ perl -I/tmp/vxs/darwin-2level/ -Mversion::vxs -le'print Doest::Not::Exist->VERSION' $ # using version::vpp $ perl-Mversion::vpp -le'print Doest::Not::Exist->VERSION' Doest::Not::Exist defines neither package nor VERSION--version check failed at /opt/lib/perl5/site_perl/5.8.8/version/vpp.pm line 418. $ This behaviour breaks ExtUtils::MakeMaker, including the one in the latest stable perl (5.8.8) , which checks for the version of any prereq as follows: my $file = "$prereq.pm"; $file =~ s{::}{/}g; eval { require $file }; my $pr_version = $prereq->VERSION || 0; If version::vxs or no version at all are loaded, this works just fine, but if version::vpp is loaded, this aborts the EU::MM code with a fatal error, preventing a Makefile from being written. For your reference, it uses this code (version::vpp:418): *UNIVERSAL::VERSION = sub { my ($obj, $req) = @_; my $class = ref($obj) || $obj; no strict 'refs'; eval "require $class" unless %{"$class\::"}; # already existing die "$class defines neither package nor VERSION--version check failed" if $@ or not %{"$class\::"}; Further down, more 'die' statements are encountered, which may not be used in standard perl or version::vxs either. I consider this is a critical bug in version::vpp to be used in CPANPLUS or EU::MM/Module::Build. Can you see a way to fix while keeping to the accepted semantics? Thanks, Jos
This is incredibly tricky because the core UNIVERSAL::VERSION in Perl 5.8.x emits a different error than 5.6.x. I apparently have it right in the XS code, but not in the PP code. I'm part way there, but it seems that running under the debugger is altering the behavior in subtle ways (like I'm not always getting the "Can't locate..." error in $@. Arggghhhh... John
I've stepped through version::vpp and completely replicated the error messages that different Perl releases emit in response to different situations and replicated those (as much as possible). This ticket will be resolved by the next dev release later tonight or possibly tomorrow. I need to make sure that all tests pass that should pass and don't fail when they shouldn't, then fix up the XS module to have the same behavior as the pure Perl release. Thanks John
On Tue Jan 30 20:50:26 2007, JPEACOCK wrote: Show quoted text
> I've stepped through version::vpp and completely replicated the error > messages that different Perl releases emit in response to different > situations and replicated those (as much as possible). This ticket will > be resolved by the next dev release later tonight or possibly tomorrow.
If that release is 0.069_02 (released 30 jan 2007), the issue remains. The following diff shows that there have been changes to the relevant code, but it does not resolve the issue: http://search.cpan.org/diff?from=version-0.69_01&to=version-0.69_02 The code *still* croaks on a ->VERSION call of a module that is not loaded. This is still a critical error. This is not a 5.6 vs 5.8 issue, as shown in the above samples. The die/croak code simply must be removed... -- Jos
I'm not seeing that failure mode any longer, due to this line: + return undef if $@ =~ /Can't locate/ and not defined $req; Are you sure that you aren't accidentally running some other iteration of version::vpp? I'm about to release 0.69_03 to CPAN, with code to prevent any modules from being installed under bleadperl, but to just run the tests with the core code for good measure (so I don't get failures from testers.cpan.org). John
On Mon Feb 05 16:09:18 2007, JPEACOCK wrote: Show quoted text
> I'm not seeing that failure mode any longer, due to this line: > > + return undef if $@ =~ /Can't locate/ and not defined $req; > > Are you sure that you aren't accidentally running some other iteration > of version::vpp?
My bad, you are completely correct: $ perl -I /Users/kane/.cpanplus/5.8.8/build/version-0.69_02/blib/lib -le'print Does::Not::Exist->VERSION' $ Thanks for pointing my nose at the obvious :) -- Jos