Skip Menu |
 

This queue is for tickets about the Module-Build CPAN distribution.

Report information
The Basics
Id: 56071
Status: resolved
Priority: 0/
Queue: Module-Build

People
Owner: Nobody in particular
Requestors: SREZIC [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: 0.3603



Subject: Version checks too strict?
Download (untitled) / with headers
text/plain 1.2k
The following Build.PL works with older Module::Build, but not with the MB bundled with perl 5.12.0: #!perl use Module::Build; my $builder = Module::Build->new( name => 'TEST', module_name => 'TEST', dist_version => '1.0', requires => { HTML::Table => '1.0' }, ); $builder->create_build_script; __END__ With perl 5.8.9 and MB 0.35 I get: $ perl Build.PL Checking prerequisites... Looks good Creating new 'Build' script for 'TEST' version '1.0' With perl 5.12.0-RC0 I get: $ /usr/perl-5.12.0-RC0/bin/perl Build.PL Version '2.08a' from /usr/perl-5.12.0-RC0/lib/site_perl/5.12.0/HTML/Table.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 $VERSION; $VERSION=undef; $vsub = sub { $VERSION = '2.08a';; $VERSION }; } The fatal error was: Invalid version format (non-numeric data) at /usr/perl-5.12.0-RC0/lib/5.12.0/Module/Build/ModuleInfo.pm line 348, <GEN6> line 6. I see that there was a version.pm change with lax vs. strict version numbers. Maybe something around this change is causing that problem? BTW the real-world module where I encountered the problem was JQuery-1.06 Regards, Slaven
Download (untitled) / with headers
text/plain 339b
Perl 5.12 has stricter requirements for version numbers. "2.08a" is not a valid version number, even under "lax" rules. This is documented in perldelta: http://search.cpan.org/~jesse/perl-5.12.0-RC0/pod/perl5120delta.pod#Version_number_formats We should provide a better error message, but it should still be a fatal error. -- David
Download (untitled) / with headers
text/plain 1.6k
On Mon Mar 29 15:08:33 2010, DAGOLDEN wrote: Show quoted text
> Perl 5.12 has stricter requirements for version numbers. "2.08a" is > not > a valid version number, even under "lax" rules. > > This is documented in perldelta: > > http://search.cpan.org/~jesse/perl-5.12.0- > RC0/pod/perl5120delta.pod#Version_number_formats > > We should provide a better error message, but it should still be a > fatal error.
It being a fatal error for the distribution version is one thing, that's under the control of the author. But it being a fatal error for a prerequisite version is another. That's not under the author's control. By making a non-conforming version number in a prereq a fatal error, that effectively makes impossible to depend on that prereq. Here's the scenario: HTML::Table 2.08 is the current version. Distribution Foo depends on HTML::Table 2.08. HTML::Table upload 2.08a. A user installs HTML::Table, getting version 2.08a. User tries to install Foo but gets an error about HTML::Table having an invalid version number. At worst HTML::Table committed a minor clerical error. The version still compares fine as a number, its still usable. But because of this clerical error, the user cannot install Foo, the authors of Foo likely get the error report and have to push HTML::Table for a new release. A clerical error in one module becomes an install failure for a user installing a different module. I'd recommend having a non-conforming dist_version be an error, the author gets it and they can deal with it, and just dealing with prereq versions as best you can. If it doesn't parse as a version object, just force it to be a number by adding 0. Maybe throw a warning about it, but get the module installed.
[...] ++ for schwern. Regards, Slaven
Download (untitled) / with headers
text/plain 397b
Note that this would die on Perl 5.12. $ perl -e 'use HTML::Table 2.08' In Perl 5.12, using alphabeticals in $VERSION is not a "minor clerical error" anymore. UNIVERSAL::VERSION requires both its argument and the associated $VERSION to pass the "lax" version number format test. Nevertheless, since we're parsing versions out of a file, I've patched the repo to strip trailing alphabeticals.
Download (untitled) / with headers
text/plain 103b
Now that there has been a stable Module::Build release, I'm marking this "patched" issue as "resolved".


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.