Perl-Toolchain-Gang / CPAN-Meta

Specifications for CPAN distribution META files
36 stars 40 forks source link

EUMM 6.57_05 MYMETA.yml loses prereqs #118

Closed cpansprout closed 8 years ago

cpansprout commented 8 years ago

Styoooooopid GitHub won’t let me attach the files. So this is going to be very long....

This is the MYMETA.yml file:


---
abstract: 'The World-Wide Web library for Perl'
author:
  - 'Gisle Aas <gisle@activestate.com>'
build_requires:
  FindBin: 0
  Test: 0
  Test::More: 0
configure_requires:
  ExtUtils::MakeMaker: 0
  File::Copy: 0
  Getopt::Long: 0
distribution_type: module
dynamic_config: 0
generated_by: 'ExtUtils::MakeMaker version 6.57_05'
license: perl_5
meta-spec:
  url: http://module-build.sourceforge.net/META-spec-v1.4.html
  version: 2
name: libwww-perl
no_index:
  directory:
    - t
    - inc
prereqs:
  runtime:
    suggests:
      Authen::NTLM: 1.02
      HTTP::GHTTP: 0
      IO::Socket::INET: 0
      LWP::Protocol::https: 6.02
requires:
  Digest::MD5: 0
  Encode: 2.12
  Encode::Locale: 0
  File::Listing: 6
  HTML::Entities: 0
  HTML::HeadParser: 0
  HTTP::Cookies: 6
  HTTP::Daemon: 6
  HTTP::Date: 6
  HTTP::Negotiate: 6
  HTTP::Request: 6
  HTTP::Request::Common: 6
  HTTP::Response: 6
  HTTP::Status: 6
  IO::Select: 0
  IO::Socket: 0
  LWP::MediaTypes: 6
  MIME::Base64: 2.1
  Net::FTP: 2.58
  Net::HTTP: 6.07
  URI: 1.10
  URI::Escape: 0
  WWW::RobotRules: 6
  perl: 5.008001
resources:
  bugtracker:
    mailto: bug-libwww-perl@rt.cpan.org
    web: https://rt.cpan.org/Public/Dist/Display.html?Name=libwww-perl
  repository:
    type: git
    url: https://github.com/libwww-perl/libwww-perl.git
    web: https://github.com/libwww-perl/libwww-perl
  x_IRC: irc://irc.perl.org/#lwp
  x_MailingList: mailto:libwww@perl.org
version: 6.15
x_authority: cpan:LWWWP

With these modules:

$ perl5.24.0 -S pmvers Parse::CPAN::Meta
1.4417
$ perl5.24.0 -S pmvers CPAN::Meta
2.150005

I get the following output from CPAN::Meta:

$ perl5.24.0 -MCPAN::Meta -le 'use Data::Dumper; warn Dumper +CPAN::Meta->load_file("MYMETA.yml");'
$VAR1 = bless( {
                 'release_status' => 'stable',
                 'prereqs' => {
                                'runtime' => {
                                               'suggests' => {
                                                               'Authen::NTLM' => '1.02',
                                                               'HTTP::GHTTP' => '0',
                                                               'LWP::Protocol::https' => '6.02',
                                                               'IO::Socket::INET' => '0'
                                                             }
                                             }
                              },
                 'no_index' => {
                                 'directory' => [
                                                  't',
                                                  'inc'
                                                ]
                               },
                 'generated_by' => 'ExtUtils::MakeMaker version 6.57_05, CPAN::Meta::Converter version 2.150005',
                 'resources' => {
                                  'x_MailingList' => 'mailto:libwww@perl.org',
                                  'x_IRC' => 'irc://irc.perl.org/#lwp',
                                  'bugtracker' => {
                                                    'web' => 'https://rt.cpan.org/Public/Dist/Display.html?Name=libwww-perl',
                                                    'mailto' => 'bug-libwww-perl@rt.cpan.org'
                                                  },
                                  'repository' => {
                                                    'type' => 'git',
                                                    'url' => 'https://github.com/libwww-perl/libwww-perl.git',
                                                    'web' => 'https://github.com/libwww-perl/libwww-perl'
                                                  }
                                },
                 'abstract' => 'The World-Wide Web library for Perl',
                 'name' => 'libwww-perl',
                 'license' => [
                                'perl_5'
                              ],
                 'dynamic_config' => '0',
                 'author' => [
                               'Gisle Aas <gisle@activestate.com>'
                             ],
                 'meta-spec' => {
                                  'url' => 'http://search.cpan.org/perldoc?CPAN::Meta::Spec',
                                  'version' => 2
                                },
                 'version' => '6.15',
                 'x_authority' => 'cpan:LWWWP'
               }, 'CPAN::Meta' );

Notice how the ‘requires’ prereqs have been dropped. Parse::CPAN::Meta seems to be working:

$ perl5.24.0 -MParse::CPAN::Meta -le 'use Data::Dumper; warn Dumper +Parse::CPAN::Meta->load_file("MYMETA.yml");'
$VAR1 = {
          'no_index' => {
                        'directory' => [
                                       't',
                                       'inc'
                                     ]
                      },
          'dynamic_config' => '0',
          'meta-spec' => {
                         'version' => '2',
                         'url' => 'http://module-build.sourceforge.net/META-spec-v1.4.html'
                       },
          'prereqs' => {
                       'runtime' => {
                                    'suggests' => {
                                                  'LWP::Protocol::https' => '6.02',
                                                  'HTTP::GHTTP' => '0',
                                                  'IO::Socket::INET' => '0',
                                                  'Authen::NTLM' => '1.02'
                                                }
                                  }
                     },
          'author' => [
                      'Gisle Aas <gisle@activestate.com>'
                    ],
          'version' => '6.15',
          'distribution_type' => 'module',
          'configure_requires' => {
                                  'File::Copy' => '0',
                                  'ExtUtils::MakeMaker' => '0',
                                  'Getopt::Long' => '0'
                                },
          'license' => 'perl_5',
          'requires' => {
                        'LWP::MediaTypes' => '6',
                        'HTTP::Negotiate' => '6',
                        'Digest::MD5' => '0',
                        'HTTP::Daemon' => '6',
                        'IO::Socket' => '0',
                        'Net::HTTP' => '6.07',
                        'perl' => '5.008001',
                        'Encode' => '2.12',
                        'IO::Select' => '0',
                        'Net::FTP' => '2.58',
                        'HTTP::Response' => '6',
                        'URI::Escape' => '0',
                        'WWW::RobotRules' => '6',
                        'Encode::Locale' => '0',
                        'HTTP::Date' => '6',
                        'URI' => '1.10',
                        'HTTP::Request::Common' => '6',
                        'HTML::HeadParser' => '0',
                        'HTML::Entities' => '0',
                        'HTTP::Request' => '6',
                        'HTTP::Status' => '6',
                        'MIME::Base64' => '2.1',
                        'HTTP::Cookies' => '6',
                        'File::Listing' => '6'
                      },
          'generated_by' => 'ExtUtils::MakeMaker version 6.57_05',
          'name' => 'libwww-perl',
          'x_authority' => 'cpan:LWWWP',
          'build_requires' => {
                              'FindBin' => '0',
                              'Test' => '0',
                              'Test::More' => '0'
                            },
          'abstract' => 'The World-Wide Web library for Perl',
          'resources' => {
                         'bugtracker' => {
                                         'mailto' => 'bug-libwww-perl@rt.cpan.org',
                                         'web' => 'https://rt.cpan.org/Public/Dist/Display.html?Name=libwww-perl'
                                       },
                         'x_MailingList' => 'mailto:libwww@perl.org',
                         'repository' => {
                                         'web' => 'https://github.com/libwww-perl/libwww-perl',
                                         'url' => 'https://github.com/libwww-perl/libwww-perl.git',
                                         'type' => 'git'
                                       },
                         'x_IRC' => 'irc://irc.perl.org/#lwp'
                       }
        };
karenetheridge commented 8 years ago

This is interesting... I don't see any 'prereqs' field mentioned in the meta spec for 1.4: https://github.com/Perl-Toolchain-Gang/CPAN-Meta/blob/master/history/MYMETA-spec-1_4.pod. However, Makefile.PL does appear to be correct to my eye (but I'm biased, I wrote the latest incarnation) -- https://metacpan.org/source/ETHER/libwww-perl-6.15/Makefile.PL, correctly declaring meta-spec version 2 and META_MERGE for the suggested prereqs.

(this comment edited after the original emailed version, for accuracy)

cpansprout commented 8 years ago

FYI, in case this makes a difference, the MYMETA.yml was generated by perl 5.14.4. I don’t think it does make a difference. It’s usually the version of ExtUtils::MakeMaker (6.57_05) that matters.

haarg commented 8 years ago

CPAN::Meta seems to be behaving appropriately here. EUMM is producing an invalid meta file, but that is expected given the old version you are using.

cpansprout commented 8 years ago

I think what is happening is that LWP’s Makefile.PL provides ‘prereqs’ in META_MERGE, but EUMM doesn’t presume to understand the contents of META_MERGE and merges it with whatever it happens to be outputting. So this is an LWP problem. It should check the EUMM version to see whether it supports the later spec format before adding things in that format that would override necessary fields.

haarg commented 8 years ago

MYMETA is partly broken in EUMM 6.57_02 through 6.57_06. Moo's Makefile.PL has an example of a workaround for this.

https://github.com/moose/Moo/blob/master/Makefile.PL#L120-L121 https://github.com/moose/Moo/blob/master/Makefile.PL#L129-L130

cpansprout commented 8 years ago

Oh, thank you. Based on that, I have submitted this patch: https://rt.cpan.org/Ticket/Display.html?id=116256. This issue can be closed.