Re: version.pm Build.PL

[email protected] (John Peacock)
Newsgroups perl.module.build
Message-ID <[email protected]>
Eric Wilhelm wrote:
> Is this related?
> 
> with version-0.7501 --
> 
>   $ perl Build.PL
>   ...
>   Can't determine distribution version, must supply
>   either 'dist_version', 'dist_version_from', or 'module_name' parameter
>   at /usr/local/code/perl_lib/active/Module/Build/Base.pm line 978.

Ignore my previous response.  I installed Module::Build trunk and I see now that 
you were saying that it is currently impossible to build version.pm itself with 
Module::Build.

It has to do with the fact that I am changing the module_name parameter 
depending on whether we are building the XS or pure Perl code.  This is required 
or the XS code doesn't build right, but the guts of new_from_file() seem to have 
changed so that it tries to find the module_name's instead of the dist_name's 
$VERSION (and hence fails).

If I do this:

=== Build.PL
==================================================================
--- Build.PL    (revision 443)
+++ Build.PL    (local)
@@ -48,6 +48,7 @@
  }
  if ( $perl_only or not $t->have_c_compiler() ) {
      $build_arguments{module_name} = 'version::vpp';
+    $build_arguments{dist_version_from} = './vperl/vpp.pm',
      $build_arguments{pm_files} = {
         './lib/version.pm' => './lib/version.pm',
         './vperl/vpp.pm' => './lib/version/vpp.pm',
@@ -56,6 +57,7 @@
  else {
      $build_arguments{c_source} = './vutil';
      $build_arguments{module_name} = 'version::vxs';
+    $build_arguments{dist_version_from} = './vutil/lib/version/vxs.pm',
      $build_arguments{pm_files} = {
         './lib/version.pm' => './lib/version.pm',
         './vutil/lib/version/vxs.pm' => './lib/version/vxs.pm'

then it works.

But, I think this is a serious regression, since the documentation for 
dist_version_from() clearly states that:

> The version is extracted from the specified file according to
> the same rules as ExtUtils::MakeMaker and "CPAN.pm".  It
> involves finding the first line that matches the regular
> expression
> 
>     /([\$*])(([\w\:\']*)\bVERSION)\b.*\=/

and doesn't say anything about the module_name being involved.

John
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.