Subject: | M::B can't be upgraded using it's own API |
Currently it is impossible to upgrade Module::Build using it's own API.
Assume you have Module::Build installed and you'd like to upgrade it, with a
script like this:
[kane@coke ~...build/Module-Build-0.2610]$ cat x.pl
use lib '/Users/kane/.cpanplus/5.8.3/build/Module-Build-0.2608/lib';
use Module::Build;
print "Version: $Module::Build::VERSION\n";
$mb = Module::Build->new_from_context;
If you execute this script, you'll get the following errors:
[kane@coke ~...build/Module-Build-0.2610]$ perlc x.pl
Version: 0.2608
/opt/bin/perl -I/Users/kane/.cpanplus/5.8.3/build/Module-Build-0.2608/lib Build.PL
Checking whether your kit is complete...
Looks good
* Optional prerequisite ExtUtils::ParseXS isn't installed
* Optional prerequisite ExtUtils::CBuilder isn't installed
ERRORS/WARNINGS FOUND IN PREREQUISITES. You may wish to install the versions
of the modules indicated above before proceeding with this installation.
Feature 'YAML_support' enabled.
Deleting Build
Removed previous script 'Build'
Creating new 'Build' script for 'Module-Build' version '0.2610'
* ERROR: Configuration was initially created with Module::Build version '0.261',
but we are now using version '0.2608'. Please re-run the Build.PL or Makefile.PL script.
This is due to the fact that the Build file insists on adding the following lines, which
force the loading of the NOT YET INSTALLED module::build when it shells out to run
it's own build procedure:
unless ($is_same_dir) {
die ('This script must be run from /Users/kane/.cpanplus/5.8.3/build/Module-Build-0.2610, not '.$curdir."\n".
"Please re-run the Build.PL script here.\n");
}
unshift @INC,
(
'/Users/kane/.cpanplus/5.8.3/build/Module-Build-0.2610/lib',
'/Users/kane/.cpanplus/5.8.3/build/Module-Build-0.2608/lib'
);
}
And since it's in the 'new_from_context' method, it's impossible to interfere from the calling
code to prevent this from happening.
In praxis this mean no CPANPLUS user can upgrade Module::Bulid.