Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the CPAN-Meta CPAN distribution.

Report information
The Basics
Id: 67295
Status: resolved
Priority: 0/
Queue: CPAN-Meta

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

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



Subject: Causes Makefile.PL to die on ANDK/CPAN-Testers-ParseReport-0.1.18.tar.bz2
I have introduced an eval trap yesterday to see which version is responsible and it was 2.110930 as can be seen here: http://www.cpantesters.org/cpan/report/860c8274-6011-11e0-9e3c-b33042987c1d It's ironic that the fail report comes from my own box, I didn't know that I could produce the fail myself :)
Subject: Re: [rt.cpan.org #67295] Causes Makefile.PL to die on ANDK/CPAN-Testers-ParseReport-0.1.18.tar.bz2
Date: Thu, 7 Apr 2011 09:32:27 -0400
To: bug-CPAN-Meta [...] rt.cpan.org
From: David Golden <dagolden [...] cpan.org>
On Thu, Apr 7, 2011 at 2:50 AM, Andreas Koenig via RT <bug-CPAN-Meta@rt.cpan.org> wrote: Show quoted text
> I have introduced an eval trap yesterday to see which version is > responsible and it was 2.110930 as can be seen here: > > http://www.cpantesters.org/cpan/report/860c8274-6011-11e0-9e3c-b33042987c1d > > It's ironic that the fail report comes from my own box, I didn't know > that I could produce the fail myself :) >
Looks like a bug in EU::MM -- it's putting a version object into the CPAN::Meta data structure. I should probably put some protection against that during serialization of META. -- David
The issue there is not a version object in "version" but in "provides". I'd like CPAN::Meta to handle version objects (and any overloaded object) rather than having to prefilter the input. Maybe special case version objects or just always stringify anywhere a string-like thing is needed. Here's what gets fed to CPAN::Meta->create... CPAN::Meta::create(/Users/schwern/perl5/perlbrew/perls/perl-v5.12.2/lib/site_perl/5.12.2/CPAN/Meta.pm:145): 145: my $version = __PACKAGE__->VERSION || 2; DB<6> x $struct 0 HASH(0x100b1ecf0) 'abstract' => 'parse reports to www.cpantesters.org from various sources' 'author' => ARRAY(0x100eac748) empty array 'build_requires' => HASH(0x100eac838) 'ExtUtils::MakeMaker' => 0 'configure_requires' => HASH(0x100eac760) 'ExtUtils::MakeMaker' => 0 'distribution_type' => 'module' 'dynamic_config' => 1 'generated_by' => 'ExtUtils::MakeMaker version 6.571' 'license' => 'perl' 'meta-spec' => HASH(0x100eac850) 'url' => 'http://module-build.sourceforge.net/META-spec-v1.4.html' 'version' => 1.4 'name' => 'CPAN-Testers-ParseReport' 'no_index' => HASH(0x100e79f48) 'directory' => ARRAY(0x100eac6a0) 0 't' 1 'inc' 'provides' => HASH(0x100d605a0) 'CPAN::Testers::ParseReport' => HASH(0x100d606a8) 'file' => 'lib/CPAN/Testers/ParseReport.pm' 'version' => version=HASH(0x100bf01a8) 'original' => '0.1.18' 'qv' => 1 'version' => ARRAY(0x100c41e20) 0 0 1 1 2 18 'repository' => 'git://repo.or.cz/cpan-testers-parsereport.git' 'requires' => HASH(0x100b23278) 'CPAN::Meta::Converter' => 2.110580 'CPAN::Meta::YAML' => 0.003 'Class::ISA' => 0 'Config::Perl::V' => 0 'DateTime' => 0 'DateTime::Format::Strptime' => 0 'File::Path' => 1.08 'File::Spec' => 3.33 'Getopt::Long' => 0 'HTML::Entities' => 0 'Hash::Util' => 0 'IO::Prompt' => 0 'JSON::PP' => 2.27105 'LWP::UserAgent' => 0 'List::Util' => 0 'MIME::QuotedPrint' => 3.07 'Parse::CPAN::Meta' => 1.4401 'Pod::Usage' => 1.33 'Statistics::Regression' => 0 'Test::More' => 0 'Test::Pod' => 0 'Time::Local' => 1.11 'XML::LibXML' => 0 'XML::LibXML::XPathContext' => 0 'YAML::Syck' => 0 'version' => 0.88 'version' => 'v0.1.18'
Fixed in https://github.com/dagolden/cpan-meta/pull/4 It was because the dclone() work around uses JSON::PP which does not have a way of universally converting objects. So I hacked in a local UNIVERSAL::TO_JSON. This is what JSON.pm does.
On Sat Apr 09 05:42:26 2011, MSCHWERN wrote: Show quoted text
> Fixed in https://github.com/dagolden/cpan-meta/pull/4 > > It was because the dclone() work around uses JSON::PP which does not > have a way of universally converting objects. So I hacked in a local > UNIVERSAL::TO_JSON. This is what JSON.pm does.
Thanks, I'll check it out. But I don't want to see version objects (or any objects) in CPAN::Meta. I'll add some validation to ensure all inputs are non-blessed and I'll add a converter to stringify anything it does find. So lazy_validation will normalize things correctly, but the default will be strict. EU::MM can use lazy_validation if it can't be bothered to ensure proper inputs. -- David
On Sat Apr 09 08:00:03 2011, DAGOLDEN wrote: Show quoted text
> EU::MM can use lazy_validation if it can't be bothered to ensure
proper inputs. MakeMaker is using lazy_validation. This particular ticket is about a bug in CPAN::Meta's dclone implementation which rejects objects because it happens to use a JSON parser to do the cloning. It's orthogonal to validation. Show quoted text
> But I don't want to see version objects (or any objects) in CPAN::Meta. > > I'll add some validation to ensure all inputs are non-blessed and I'll > add a converter to stringify anything it does find. So lazy_validation > will normalize things correctly, but the default will be strict.
If I'm reading this correctly, the default will be to *not* honor object stringification? This means any use of well behaved version objects or file objects will have to be manually stringified before handing over to CPAN::Meta? That's an encapsulation violation and a pain in the ass for the user. Since there's nothing wrong with using version or file objects for things like version and provides, they're even built into the spec, that would make lazy_validation effectively mandatory. Or everybody using strict has to write a pre-filter... which means nobody will use strict mode. While I understand you want to prevent someone from passing an object in where it doesn't belong, erroring on every object makes strict mode effectively useless. In short, when is strict mode useful?
Strict mode, of a sort, is useful to prevent the bugs allowed by Perl's annoying default object stringification behavior. I'd be in favor of stringifying objects that provide stringification behavior and barfing on others -- by default. David, what do you think about this? -- rjbs
Subject: Re: [rt.cpan.org #67295] Causes Makefile.PL to die on ANDK/CPAN-Testers-ParseReport-0.1.18.tar.bz2
Date: Thu, 19 May 2011 23:12:05 -0400
To: bug-CPAN-Meta [...] rt.cpan.org
From: David Golden <dagolden [...] cpan.org>
On Thu, May 19, 2011 at 10:42 PM, Ricardo Signes via RT <bug-CPAN-Meta@rt.cpan.org> wrote: Show quoted text
> I'd be in favor of stringifying objects that provide stringification > behavior and barfing on others -- by default.
That's acceptable to me. -- David
I'm traveling this weekend, but I'll see if I can have a swing at this, at least for the version-specific use case. Schwern, can you provide a failing test case? I can devise one, but you might already have an idea of exactly what you're expecting to work in an easy-to-testify way? -- rjbs
Subject: Re: [rt.cpan.org #67295] Causes Makefile.PL to die on ANDK/CPAN-Testers-ParseReport-0.1.18.tar.bz2
Date: Thu, 19 May 2011 23:24:01 -0400
To: bug-CPAN-Meta [...] rt.cpan.org
From: David Golden <dagolden [...] cpan.org>
On Thu, May 19, 2011 at 11:15 PM, Ricardo Signes via RT <bug-CPAN-Meta@rt.cpan.org> wrote: Show quoted text
> I'm traveling this weekend, but I'll see if I can have a swing at this, > at least for the version-specific use case.
Thanks. Show quoted text
> Schwern, can you provide a failing test case?  I can devise one, but you > might already have an idea of exactly what you're expecting to work in > an easy-to-testify way?
E.g. Using a Path::Class::File object as a filename for a 'provides' field. Objects that provide stringification should be able to be used transparently as strings. Default object stringification is one of those things that makes some things easy and other things really annoying. Makes me want a "no object::stringification" pragma. -- David
On Thu May 19 23:15:11 2011, RJBS wrote: Show quoted text
> Schwern, can you provide a failing test case? I can devise one, but you > might already have an idea of exactly what you're expecting to work in > an easy-to-testify way?
There's a patch with a test languishing here which covers the version object case: https://github.com/dagolden/cpan-meta/pull/4 Other types of stringified objects are important, but I haven't run into problems with them in the wild. We've hit a bunch of distributions that use version objects. dagolden@cpan.org wrote: Show quoted text
> Makes me want a "no object::stringification" pragma.
http://search.cpan.org/perldoc?stringification though it currently doesn't deny objects the author is considering it. I tried some tricks to locally define a UNIVERSAL stringification which would die, but it seems overloaded methods are attached to an object at the time of their creation.
Patched in the repo
CPAN::Meta 2.112150 released to CPAN