Subject: | Module::Build and version causing issues. |
I am using Module::Build and verion together. It seems that a
problem is arising now between the two modules. Here is some
sample code:
# perl -e 'use Module::Build; print Module::Build->VERSION, "\n";'
0.25
# perl -e 'use version; use Module::Build; print Module::Build->VERSION, "\n";'
0.250.0
It seems that if the module 'version' is loaded, the output from
'Module::Build->VERSION' is different. This causes issues
because of a check to make sure the current working environment
for Module::Build is the same as the previous one.
The error occurs when the newly created 'Build' script is run and
none of the modules in the script use the module 'version'. The
information in the Module::Build environment that was stored when
'perl Build.PL' was run and when the './Build [action]' is run
differents due to the effects of the 'version' module.
If people are using the module 'version', they will need to use
the attached patch to allow Module::Build to continue properly.
This patch checks to see if the 'version' module is loaded when
the build scripts are created and puts the 'use version;' into
the resulting 'Build' script.
--- lib/Module/Build/Base.pm.orig 2004-04-25 15:16:14.000000000 -0700
+++ lib/Module/Build/Base.pm 2004-08-03 11:37:33.000000000 -0700
@@ -787,6 +787,7 @@
my $quoted_INC = join ",\n", map " '$_'", @myINC;
my $shebang = $self->_startperl;
+ my $use_version = exists $INC{'version.pm'} ? "use version;\n" : '';
print $fh <<EOF;
$shebang
@@ -794,7 +795,7 @@
use strict;
use Cwd;
use File::Spec;
-
+$use_version
BEGIN {
\$^W = 1; # Use warnings
my \$curdir = File::Spec->canonpath( Cwd::cwd() );