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: 82860
Status: open
Priority: 0/
Queue: CPAN-Meta

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

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



Subject: downgrade_optional_features causes illegal internat structures
When the original YAML looks like optional_features: opt_csv: description: Provides parsing of CSV streams requires: Text::CSV_XS: 0.69 recommends: Text::CSV: 1.21 Text::CSV_PP: 1.29 Text::CSV_XS: 0.95 opt_excel: description: Provides parsing of Microsoft Excel files requires: Spreadsheet::ParseExcel: 0.26 Spreadsheet::ParseExcel::FmtDefault: 0 recommends: Spreadsheet::ParseExcel: 0.59 ⋮ The internal structure will look like { opt_csv => { description => 'Provides parsing of CSV streams', x_recommends => { 'Text::CSV' => '1.21', 'Text::CSV_PP' => '1.29', 'Text::CSV_XS' => '0.95' }, x_requires => { 'Text::CSV_XS' => '0.69' } }, opt_excel => { description => 'Provides parsing of Microsoft Excel files', x_recommends => { 'Spreadsheet::ParseExcel' => '0.59' }, x_requires => { 'Spreadsheet::ParseExcel' => '0.26', 'Spreadsheet::ParseExcel::FmtDefault' => 0 } }, ⋮ Passing the complete meta structure through my $yml = CPAN::Meta::Converter->new ($jsn)->convert (version => "1.4"); will now cause several errors like Odd number of elements in anonymous hash at /pro/lib/perl5/ site_perl/5.16.0/CPAN/Meta/Converter.pm line 462. followed by Failed to downconvert metadata to 1.4. Errors: Expected a map structure from string or file. (optional_features -> opt_csv -> build_requires) [Validation: 1.4] Expected a map structure from string or file. (optional_features -> opt_csv -> requires) [Validation: 1.4] Expected a map structure from string or file. (optional_features -> opt_excel -> build_requires) [Validation: 1.4] Expected a map structure from string or file. (optional_features -> opt_excel -> requires) [Validation: 1.4] ⋮ Caused in function _downgrade_optional_features by $features->{$name} = { description => $origin->{$name}{description}, requires => _extract_prereqs($origin->{$name} {prereqs},'runtime','requires'), configure_requires => _extract_prereqs($origin->{$name} {prereqs},'runtime','configure_requires'), build_requires => _extract_prereqs($origin->{$name} {prereqs},'runtime','build_requires'), recommends => _extract_prereqs($origin->{$name} {prereqs},'runtime','recommends'), conflicts => _extract_prereqs($origin->{$name} {prereqs},'runtime','conflicts'), }; resulting in _extract_prereqs () returning empty lists causing illegal initialisation
Subject: Re: [rt.cpan.org #82860] downgrade_optional_features causes illegal internat structures
Date: Mon, 21 Jan 2013 14:48:53 -0500
To: bug-CPAN-Meta [...] rt.cpan.org
From: David Golden <dagolden [...] cpan.org>
As discussed on IRC, the input data structure of optional_features is not proper v2 format, so it's getting munged into "x_" format and then can't round trip. That said, the errors look like bugs and we should address that.