Re: 5.10.1-RC1, CPANPLUS, and Module::Build

"Jos I. Boumans" <[email protected]>
Newsgroups gmane.comp.lang.perl.perl5.porters,gmane.comp.version-control.subversion.rapidsvn.devel
Message-ID <[email protected]>
Hi,

On 8 Aug 2009, at 14:44, Elliot Shank wrote:

> Attempting to install Perl::Critic 1.102 via CPANPLUS from 5.10.1- 
> RC1 fails due to what CPANPLUS is doing with the Module::Build  
> mention in configure_requires.  This version of P::C was built with  
> perl 5.10.0 and M::B 0.34_02 (the same one included in 5.10.1).   
> M::B puts its own version into configure_requires.  I've got  
> CPANPLUS pointed at a minicpan, which, obviously, only includes M::B  
> 0.34.

> Despite already having the correct version of M::B already  
> installed, CPANPLUS refuses to install P::C.  Important part of the  
> CPANPLUS output:

> [MSG] Extracted 'Perl::Critic' to '/Users/elliot/opt/perl/perl-5.10/ 
> cpanplus/5.10.1/build/Perl-Critic-1.102'
> [ERROR] This distribution depends on Module::Build, but the latest  
> version of Module::Build on CPAN (0.34) doesn't satisfy the specific  
> version dependency (0.3402). You may have to resolve this dependency  
> manually.

Notice that in your diagnostics, 2 different versions are mentioned.  
Once 0.34_02, once 0.3402.
One has a _, the other does not.

Here's what's going on:

CPANPLUS fishes the version statement out of Module::Build using the  
same regex that EU::MM and similar
tools use. M::B's version statement looks like this:

   $VERSION = '0.34_02';
   $VERSION = eval $VERSION;

Version statements must be on one line to be picked up by these tools  
and this one is not. Here's what
happens:

   $ perl -le'$v="0.34_02";print eval $v'
   0.3402

And now, we've lost our _. Module::Build writes the non-_ version into  
Meta.yml, rather than the version
CPANPLUS and EU::MM will see. P::C's Meta.yml holds:

   configure_requires: Module::Build: 0.3402

And the result is this:

CPAN Terminal> ! print $cb->module_tree('Module::Build')- 
 >installed_version

0.34_02
CPAN Terminal> ! print $cb->module_tree('Module::Build')->is_uptodate

1
CPAN Terminal> ! print $cb->module_tree('Module::Build')- 
 >is_uptodate( version => '0.3402' );

0

In short, by having 2 different versions in Module::Build (one the  
cpan indexer, EU::MM and
CPANPLUS will find, and one that is used when the code is run), is  
causing this issue.

My recommendation would be to either 1) drop the eval or 2) put the  
statements on 1 line or
3) use a different variable to write the 'first' version into  
configure_requires.

Otoh, David probably knows enough about version numbers now to make  
the right call :) And his
other comments regarding the use of a dev module as a dependency etc  
of course still hold true.

Cheers,

--
	Jos Boumans

	'Real programmers use "cat > a.out"'
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.