Skip Menu |
 

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

Maintainer(s)' notes

Attention bug reporters: issues MUST include the version of Module::Metadata that you are running that exhibit the stated symptoms. thank you!

Report information
The Basics
Id: 130939
Status: resolved
Priority: 0/
Queue: Module-Metadata

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

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



Subject: Failed to Module::Metadata->new_from_module with Devel::PatchPerl 1.68
Download (untitled) / with headers
text/plain 1003b
``` ❯ perl -MModule::Metadata\ 99999 Module::Metadata version 99999 required--this is only version 1.000037. BEGIN failed--compilation aborted. ``` ``` ❯ perl -MDevel::PatchPerl\ 9999999 Devel::PatchPerl version 9999999 required--this is only version 1.68. BEGIN failed--compilation aborted. ``` ``` ❯ perl -MModule::Metadata -e 'Module::Metadata->new_from_module("Devel::PatchPerl")' Error evaling version line ' my $dummy = q# Hide from _packages_inside() #; package Module::Metadata::_version::p2; use version; sub { local $VERSION; -our $VERSION = '1.9733';; return $VERSION if defined $VERSION; return $Module::Metadata::_version::p2::VERSION; }; ' in /Users/skaji/env/plenv/versions/5.30.0/lib/perl5/site_perl/5.30.0/Devel/PatchPerl.pm: Can't modify negation (-) in scalar assignment at (eval 6) line 6, at EOF failed to build version sub for /Users/skaji/env/plenv/versions/5.30.0/lib/perl5/site_perl/5.30.0/Devel/PatchPerl.pm at -e line 1. ```
Download (untitled) / with headers
text/plain 724b
Some CPAN clients including cpanm and cpm use Module::Metadata. So we see this error through these CPAN clients: ``` ❯ cpanm -n Devel::PatchPerl Error evaling version line ' my $dummy = q# Hide from _packages_inside() #; package Module::Metadata::_version::p2; use version; sub { local $VERSION; -our $VERSION = '1.9733';; $VERSION }; ' in /Users/skaji/env/plenv/versions/5.30.0/lib/perl5/site_perl/5.30.0/Devel/PatchPerl.pm: Can't modify negation (-) in scalar assignment at (eval 51) line 6, at EOF failed to build version sub for /Users/skaji/env/plenv/versions/5.30.0/lib/perl5/site_perl/5.30.0/Devel/PatchPerl.pm at /Users/skaji/env/plenv/versions/5.30.0/bin/cpanm line 119. ```
Download (untitled) / with headers
text/plain 1.4k
On Thu Nov 07 17:16:04 2019, SKAJI wrote: Show quoted text
> ``` > ❯ perl -MModule::Metadata\ 99999 > Module::Metadata version 99999 required--this is only version > 1.000037. > BEGIN failed--compilation aborted. > ``` > > ``` > ❯ perl -MDevel::PatchPerl\ 9999999 > Devel::PatchPerl version 9999999 required--this is only version 1.68. > BEGIN failed--compilation aborted. > ``` > > ``` > ❯ perl -MModule::Metadata -e 'Module::Metadata-
> >new_from_module("Devel::PatchPerl")'
> Error evaling version line ' my $dummy = q# Hide from > _packages_inside() > #; package Module::Metadata::_version::p2; > use version; > sub { > local $VERSION; > -our $VERSION = '1.9733';; > return $VERSION if defined $VERSION; > return $Module::Metadata::_version::p2::VERSION; > }; > ' in > /Users/skaji/env/plenv/versions/5.30.0/lib/perl5/site_perl/5.30.0/Devel/PatchPerl.pm: > Can't modify negation (-) in scalar assignment at (eval 6) line 6, at > EOF > > failed to build version sub for > /Users/skaji/env/plenv/versions/5.30.0/lib/perl5/site_perl/5.30.0/Devel/PatchPerl.pm > at -e line 1. > ```
This is because the file contains heredocs with patches that Module::Metadata mistakes for both package declarations and version assignments. I consider this a bug in Devel::PatchPerl, since PAUSE is also fooled. The only solution I can think of is to move the patch contents to the __DATA__ section or a non-module file. -Dan
This issue has been resolved in the latest Devel::PatchPerl. BinGOs++ Close this issue.


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.