(Copied to both the Module-Build list and CPAN Testers Discuss list)

Slavan Rezic flagged a bug in CPAN::Reporter that appears to have
broader implications for Module::Build.

Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=30299 >

In short -- heres the situation:

* Build.PL includes a "requires => {perl => 5.006}" argument
* Module version is being detected by M::B from the .pm file
* .pm file says "our $VERSION = 0.10"

Running "perl Build.PL" on perl 5.005 causes Build.PL to die in
M::B::ModuleInfo:

####
Error evaling version line 'BEGIN { q# Hide from _packages_inside()
#; package Module::Build::ModuleInfo::_version;
no strict;

local $VERSION;
$VERSION=undef;
$vsub = sub {
our $VERSION = "0.01";;
$VERSION
};
}'
[snip]
####

From CPAN::Reporter's perspective, this is a problem because we don't
get a chance to detect the bad perl version with an error string.
Also, if Build.PL doesn't run (and there isn't a META.yml file or
there aren't requirements in the META.yml file), we can't get
prerequisites to see that perl was actually an unsatisfied
prerequisite.

So I have two suggestions:

1) M::B should probably be patched to check for a perl version
requirement before it tries to eval any code from anything in the
distribution (and fail with an appropriate error)

2) CPAN Testers documentation and wiki should encourage module authors
to put "use 5.006" or whatever minimum perl version they need at the
top of their Build.PL, just as with Makefile.PL. This ensures that a
perl version requirement will be respected on any legacy version of
Module::Build and that failure will be detected by CPAN::Reporter as
an "NA" grade.

I welcome thoughts on these suggestions or other suggestions to make
M::B and CPAN::Reporter play nicer with older versions of Perl.

Sincerely,
David Golden

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcpan-testers-discuss @
categoriesperl
postedOct 27, '07 at 7:25p
activeOct 27, '07 at 7:25p
posts1
users1
websitecpan.org

1 user in discussion

David Golden: 1 post

People

Translate

site design / logo © 2021 Grokbase