Subject: | Fails if $VERSION is invalid, even when no specific version required |
Date: | Wed, 21 Jul 2010 18:42:03 +0900 |
To: | bug-Module-Build [...] rt.cpan.org |
From: | Ansgar Burchardt <ansgar [...] 43-1.org> |
Hi,
Module::Build seems to make the assumption that $VERSION assignments
follow the conventions used on CPAN, but some module do not follow
these. For example the following Build.PL fails:
use Module::Build;
my $build = Module::Build->new(
module_name => "Foo",
requires => {
"SVN::Core" => 0,
},
);
with this message:
Version '..' from /usr/lib/perl5/SVN/Core.pm does not appear to be valid:
BEGIN { q# Hide from _packages_inside()
#; package Module::Build::ModuleInfo::_version::p1;
use Module::Build::Version;
no strict;
local $SVN::Core::VERSION;
$SVN::Core::VERSION=undef;
$vsub = sub {
$SVN::Core::VERSION = "$SVN::Core::VER_MAJOR.$SVN::Core::VER_MINOR.$SVN::Core::VER_MICRO";;
$SVN::Core::VERSION
};
}
The fatal error was: Invalid version format (fractional part required)
at [...]/Module/Build/ModuleInfo.pm line 348, <GEN0> line 7.
I am using Module::Build 0.3607, the same error (with a less verbose
error message) also happens with 0.340201 (as included in perl 5.10.1).
A workaround is to check the SVN::Core dependency by hand (SVN::Web does
this). But I think at least for a dependency that does not specify any
version, Module::Build should not fail if $VERSION seems to be invalid.
Of course it would also be good if SVN::Core follows the conventions as
well.
Regards,
Ansgar