Subject: | Major bug in Module::Build::Version 0.77 |
There is a very nasty bug in Module::Build::Version 0.77.
The _VERSION hook (implementing a UNIVERSAL::VERSION wrapper?) seems to
implement a run-time class autoloader.
What's worse, this autoloader is completely unsafe about checking the
result of the require call.
If for some reason an eval is done in a parent scope of the ->VERSION
method, putting a value into $@, then this value seems to be checked and
matches the check for Module::Build::Version's own require eval response.
The result is that, if an require eval fails, every single ->VERSION
call from that scope downwards return undef.
version::vpp::_VERSION((eval
273)[C:\strawberry\perl\lib/Module/Build/Version.pm
:31]:516):
516: eval "require $class" unless %{"$class\::"}; # already existing
DB<8> s
version::vpp::_VERSION((eval
273)[C:\strawberry\perl\lib/Module/Build/Version.pm
:31]:517):
517: return undef if $@ =~ /Can't locate/ and not defined $req;
DB<8> x $@
0 "Can't locate Class/Autouse.pm in \@INC (\@INC contains:
C:\\strawberry\\cpan
\\build\\Padre-0.40-hYgCQP\\blib\\arch
C:\\strawberry\\cpan\\build\\Padre-0.40-h
YgCQP\\blib\\lib C:/strawberry/perl/lib C:/strawberry/perl/site/lib .)
at (eval
71)[t\\11-badcode.t:25] line 1.\cJ at (eval 71)[t\\11-badcode.t:25] line
1\cJ\cI
main::BEGIN() called at Class/Autouse.pm line 1\cJ\cIeval {...} called
at Class/
Autouse.pm line 1\cJ\cIeval 'use Class::Autouse \\':devel\\';' called at
t\\11-b
adcode.t line 25\cJBEGIN failed--compilation aborted at (eval
71)[t\\11-badcode.
t:25] line 1.\cJ at (eval 71)[t\\11-badcode.t:25] line 1\cJ\cIeval 'use
Class::A
utouse \\':devel\\';' called at t\\11-badcode.t line 25\cJ"
DB<9> x version->VERSION
0 undef
DB<10> x $version::VERSION
0 0.77
DB<11>