Skip Menu |

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

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

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

Bug Information
Severity: Critical
Broken in: 0.2808
Fixed in: (no value)



Subject: Module::Build dies on dists using version.pm and development versions
When using version.pm and a version number containing a development version, ./Build dies: ~/MB-Bug$ ./Build Global symbol "$VAR1" requires explicit package name at (eval 23) line 18, <GEN6> line 1. ...propagated at /usr/lib/perl5/site_perl/5.8.8/Module/Build/Base.pm line 1015, <GEN6> line 1. This seems to be caused by a back-reference in _build/build_params: 'alpha' => ${\$VAR1->[2]{'dist_version'}{'qv'}}, I've attached a tarball containing a dist illustrating the bug. It uses: use version;our $VERSION = qv('0.01_1'); I've also attached a patch that fixes that issue by adding no strict 'vars' around the part where build_params is read back in (Module::Build::Base::read_config) Maybe it would be better to ensure that the output of Data::Dumper is parsable without this workaround. I tried Data::Dumper::Purity and Data::Dumper::Deepcopy, but neither seemed to work... Hope this helps, and thanks for Module::Build!
Subject: version_patch.module_build_0.2808
Download version_patch.module_build_0.2808
application/octet-stream 610b

Message body not shown because it is not plain text.

Subject: test-dist.tgz
Download test-dist.tgz
application/x-gzip 2.8k

Message body not shown because it is not plain text.

Subject: Re: [rt.cpan.org #30004] Module::Build dies on dists using version.pm and development versions
Date: Mon, 15 Oct 2007 10:37:39 -0700
To: bug-Module-Build [...] rt.cpan.org
From: Eric Wilhelm <scratchcomputing [...] gmail.com>
# from Thomas Klausner via RT # on Monday 15 October 2007 00:39: Show quoted text
>When using version.pm and a version number containing a development >version, ./Build dies: > >  ~/MB-Bug$ ./Build >  Global symbol "$VAR1" requires explicit package name at (eval 23) >  line 18, <GEN6> line 1. ...propagated at >  /usr/lib/perl5/site_perl/5.8.8/Module/Build/Base.pm line 1015, > <GEN6> line 1.
I can replicate that here with either 0.2808 or svn. But NOTE -- version.pm must be the compiled vxs.pm. perl -le 'use version; print $INC{"version/vxs.pm"}' With the pure-perl vpp.pm, it doesn't happen: perl -le 'use version; print $INC{"version/vpp.pm"}' --Eric
I've committed some more Data::Dumper fixes that should fix this, want to try again? Thanks. -Ken
From: DOMM [...] cpan.org
On Tue Oct 23 15:13:21 2007, KWILLIAMS wrote: Show quoted text
> I've committed some more Data::Dumper fixes that should fix this, want > to try again?
I installed Module::Build from svn (0.2808_01), but it still does not work. I now get a slightly different error message, though: Global symbol "$x" requires explicit package name at (eval 28) line 18, <GEN6> line 1. ...propagated at /usr/lib/perl5/site_perl/5.8.8/Module/Build/Base.pm line 1026, <GEN6> line 1. This is still caused by this line in _build/build_params of my test dist: 'alpha' => ${\$x->[2]{'dist_version'}{'qv'}}, Hm, when I remove my version.pm (and thus use the one bundled with Module::Build::Version), the problematic line in build_params looks like this: 'alpha' => 1, And everything works... But when I do this: perl -Mversion -MData::Dumper -le 'my $v=qv("0.1_1");print Dumper $v' , the Dump looks ok: 'alpha' => 1, After an hour of digging through Module::Build, I think I found the problem in Module::Build::ModuleInfo around line 317. Here you call Module::Build::Version->new($result), but if $result is already a version.pm object, this seems to cause the strange reference try this: perl -MData::Dumper -Mversion -le 'my $v=qv("0.1_1");print Dumper $v;my $v2=version->new($v);print Dumper $v2' Maybe this is a bug in version.pm, but the attached patch provides a workaround (all tests continue to work..)
Index: lib/Module/Build/ModuleInfo.pm =================================================================== --- lib/Module/Build/ModuleInfo.pm (revision 10110) +++ lib/Module/Build/ModuleInfo.pm (working copy) @@ -313,7 +313,11 @@ die "failed to build version sub for $self->{filename}"; my $result = $vsub->(); - # Bless it into our own version class + # Bless it into our own version class unless we already have a version + # object + if (ref($result) eq 'version') { + return $result; + } $result = Module::Build::Version->new($result); return $result;
Subject: Re: [rt.cpan.org #30004] Module::Build dies on dists using version.pm and development versions
Date: Wed, 24 Oct 2007 10:35:21 +0200
To: Ken_Williams via RT <bug-Module-Build [...] rt.cpan.org>
From: Thomas Klausner <domm [...] cpan.org>
Hi! On Tue, Oct 23, 2007 at 03:13:39PM -0400, Ken_Williams via RT wrote: Show quoted text
> > <URL: http://rt.cpan.org/Ticket/Display.html?id=30004 > > > I've committed some more Data::Dumper fixes that should fix this, want to try again?
I installed Module::Build from svn (0.2808_01), but it still does not work. I now get a slightly different error message, though: Global symbol "$x" requires explicit package name at (eval 28) line 18, <GEN6> line 1. ...propagated at /usr/lib/perl5/site_perl/5.8.8/Module/Build/Base.pm line 1026, <GEN6> line 1. This is still caused by this line in _build/build_params of my test dist: 'alpha' => ${\$x->[2]{'dist_version'}{'qv'}}, Hm, when I remove my version.pm (and thus use the one bundled with Module::Build::Version), the problematic line in build_params looks like this: 'alpha' => 1, And everything works... But when I do this: perl -Mversion -MData::Dumper -le 'my $v=qv("0.1_1");print Dumper $v' , the Dump looks ok: 'alpha' => 1, After an hour of digging through Module::Build, I think I found the problem in Module::Build::ModuleInfo around line 317. Here you call Module::Build::Version->new($result), but if $result is already a version.pm object, this seems to cause the strange reference try this: perl -MData::Dumper -Mversion -le 'my $v=qv("0.1_1");print Dumper $v;my $v2=version->new($v);print Dumper $v2' Maybe this is a bug in version.pm, but the attached patch provides a workaround (all tests continue to work..) -- #!/usr/bin/perl http://domm.plix.at for(ref bless{},just'another'perl'hacker){s-:+-$"-g&&print$_.$/}

Message body is not shown because sender requested not to inline it.

From: JPEACOCK [...] cpan.org
On Wed Oct 24 04:41:42 2007, DOMM wrote: Show quoted text
> try this: > perl -MData::Dumper -Mversion -le 'my $v=qv("0.1_1");print Dumper > $v;my $v2=version->new($v);print Dumper $v2' > > Maybe this is a bug in version.pm, but the attached patch provides a > workaround
This was a bug in the XS form of version.pm (so using the pure Perl version.pm built into M::B would work fine). I just released 0.74 to CPAN with the following fix: Log: Data::Dumper is sometimes too clever for its (and our) own good. When copying an existing version object, directly set newSViv for qv and/or alpha, instead of using &PL_sv_yes, since the latter has a PV slot which looks shared to D::D's jaundiced eye.
Fixed in svn r10121. We now require version.pm 0.74 or else we use our embedded vpp.pm code.