(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

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

local $VERSION;
$vsub = sub {
our $VERSION = "0.01";;

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

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.

David Golden

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcpan-testers-discuss @
postedOct 27, '07 at 7:25p
activeOct 27, '07 at 7:25p

1 user in discussion

David Golden: 1 post



site design / logo © 2021 Grokbase