Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XSLoader meta information incorrect #15493

Closed
p5pRT opened this issue Aug 4, 2016 · 12 comments
Closed

XSLoader meta information incorrect #15493

p5pRT opened this issue Aug 4, 2016 · 12 comments
Labels

Comments

@p5pRT
Copy link

p5pRT commented Aug 4, 2016

Migrated from rt.perl.org#128836 (status was 'resolved')

Searchable as RT128836$

@p5pRT
Copy link
Author

p5pRT commented Aug 4, 2016

From pierre.vigier@gmail.com

Hi,

Module XSLoader META information do not contains the "provides" entry, with the package and the version.
Due to that missing data, carton and cpanm are affected, as reported there​: perl-carton/carton#210 (comment)

For reference, the content of the issue is included herebelow

Pierre


With the following cpanfile​:

requires 'List​::MoreUtils';
if i install that with carton, then delete the cpanfile.snapshot and then run carton install --deployment, i face the following error message​:

[pierre​:~/tmp/xs]> carton install --deployment
Installing modules using /Users/pierre.vigier/tmp/xs/cpanfile (deployment mode)
Found XSLoader which doesn't satisfy 0.22.
Successfully installed Exporter-Tiny-0.042
! Installing the dependencies failed​: Installed version (0.16) of XSLoader is not in range '0.22'
! Bailing out the installation for List-MoreUtils-0.416.
! Installing the dependencies failed​: Module 'List​::MoreUtils' is not installed
! Bailing out the installation for /Users/pierre.vigier/tmp/xs/.
1 distribution installed
Installing modules failed
The corresponding cpanfile.snapshot is generated by carton install

# carton snapshot format​: version 1.0
DISTRIBUTIONS
  Exporter-Tiny-0.042
  pathname​: T/TO/TOBYINK/Exporter-Tiny-0.042.tar.gz
  provides​:
  Exporter​::Shiny 0.042
  Exporter​::Tiny 0.042
  requirements​:
  ExtUtils​::MakeMaker 6.17
  perl 5.006001
  List-MoreUtils-0.416
  pathname​: R/RE/REHSACK/List-MoreUtils-0.416.tar.gz
  provides​:
  List​::MoreUtils 0.416
  List​::MoreUtils​::PP 0.416
  List​::MoreUtils​::XS 0.416
  requirements​:
  Carp 0
  Exporter​::Tiny 0.038
  ExtUtils​::MakeMaker 0
  File​::Basename 0
  File​::Copy 0
  File​::Path 0
  File​::Spec 0
  IPC​::Cmd 0
  XSLoader 0.22
  base 0
  XSLoader-0.22
  pathname​: S/SA/SAPER/XSLoader-0.22.tar.gz
  provides​:
  XSLoader undef
  requirements​:
  ExtUtils​::MakeMaker 0
  Test​::More 0.47
Any ideas why the --deployment does not work there? seems to be related to the XSLoader-0.22 that does not specify the version of XSLoader it is providing

@p5pRT
Copy link
Author

p5pRT commented Aug 4, 2016

From @karenetheridge

On Wed Aug 03 21​:57​:17 2016, pierre.vigier@​gmail.com wrote​:

Hi,

Module XSLoader META information do not contains the "provides" entry,
with the package and the version.

'provides' is not a required key in the CPAN​::Meta specification​: https://metacpan.org/pod/CPAN::Meta::Spec#provides

cpanm fills in provides (sometimes incorrectly) in its own copy of metadata when it installs a distribution. It gets it wrong for XSLoader for some reason (it appears to be getting confused by the layout of .pm, .PL and .xs files).

The XSLoader distribution could possibly have its metadata tweaked to help out cpanm, but there is no bug here.

@p5pRT
Copy link
Author

p5pRT commented Aug 4, 2016

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented Aug 5, 2016

From @karenetheridge

I have prepared a suitable patch.

@p5pRT
Copy link
Author

p5pRT commented Aug 5, 2016

From @karenetheridge

0001-add-provides-metadata-for-XSLoader-RT-138836.patch
From 3ee69687408328b28587c741d98e501437ba066d Mon Sep 17 00:00:00 2001
From: Karen Etheridge <ether@cpan.org>
Date: Fri, 5 Aug 2016 10:16:40 -0700
Subject: [PATCH] add "provides" metadata for XSLoader (RT#138836)

This avoids confusing tools like cpanm and carton which use 'provides'
metadata, and are not able to infer the correct data here because
XSLoader_pm.PL is used to generate XSLoader.pm, but then XSLoader.pm is
deleted before cpanm can see it.

diff --git a/dist/XSLoader/Makefile.PL b/dist/XSLoader/Makefile.PL
index 899cc89..bc35843 100644
--- a/dist/XSLoader/Makefile.PL
+++ b/dist/XSLoader/Makefile.PL
@@ -45,13 +45,26 @@ WriteMakefile(
         'Test::More' => '0.47',
     },
     META_MERGE      => {
-        resources   => {
-            repository  => 'git://perl5.git.perl.org/perl.git',
-            license     => 'http://dev.perl.org/licenses/',
+        'meta-spec'     => { version => 2 },
+        dynamic_config  => 0,
+        resources       => {
+            repository  => {
+                type        => 'git',
+                url         => 'git://perl5.git.perl.org/perl.git',
+            },
             homepage    => 'https://metacpan.org/module/XSLoader',
-            irc         => 'irc://irc.perl.org/#p5p',
-            mailinglist => 'http://lists.perl.org/list/perl5-porters.html',
-            bugtracker  => "https://rt.perl.org/rt3/Search/Results.html?Query=Queue='perl5' AND Content LIKE 'module=XSLoader' AND (Status='open' OR Status='new' OR Status='stalled')",
+            x_IRC       => 'irc://irc.perl.org/#p5p',
+            x_MailingList => 'http://lists.perl.org/list/perl5-porters.html',
+            bugtracker => {
+                mailto      => 'perlbug@perl.org',
+                web         => "https://rt.perl.org/rt3/Search/Results.html?Query=Queue='perl5' AND Content LIKE 'module=XSLoader' AND (Status='open' OR Status='new' OR Status='stalled')",
+            },
+        },
+        provides    => {
+            'XSLoader'  => {
+                file        => 'XSLoader_pm.PL',
+                version     => ${$PACKAGE.'::VERSION'},
+            },
         },
     },
     dist            => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
-- 
2.8.3

@p5pRT
Copy link
Author

p5pRT commented Aug 5, 2016

From @cpansprout

On Fri Aug 05 10​:21​:09 2016, ether wrote​:

I have prepared a suitable patch.

Thank you. I have applied it as 0d9b031.

--

Father Chrysostomos

@p5pRT
Copy link
Author

p5pRT commented Aug 5, 2016

@cpansprout - Status changed from 'open' to 'pending release'

@p5pRT
Copy link
Author

p5pRT commented Aug 8, 2016

From pierre.vigier@gmail.com

Thank you for your help.

On Sat, Aug 6, 2016 at 2​:25 AM Father Chrysostomos via RT <
perlbug-followup@​perl.org> wrote​:

On Fri Aug 05 10​:21​:09 2016, ether wrote​:

I have prepared a suitable patch.

Thank you. I have applied it as 0d9b031.

--

Father Chrysostomos

@p5pRT
Copy link
Author

p5pRT commented Sep 1, 2016

From @maddingue

[ to sum up here what I said in the github ticket of carton
  perl-carton/carton#210 ]

There's a small mistake in the patch, in that ${$PACKAGE.'​::VERSION'} actually is the current version of XSLoader, not the one about to be installed.

The attached patch, corresponding to the version 0.24 just uploaded on the CPAN, makes it more clear by creating two vars​: $CURRENT_VERSION and $NEW_VERSION.

--
Close the world, txEn eht nepO.

@p5pRT
Copy link
Author

p5pRT commented Sep 1, 2016

From @maddingue

XSLoader-0.24.diff

@p5pRT
Copy link
Author

p5pRT commented May 30, 2017

From @khwilliamson

Thank you for filing this report. You have helped make Perl better.

With the release today of Perl 5.26.0, this and 210 other issues have been
resolved.

Perl 5.26.0 may be downloaded via​:
https://metacpan.org/release/XSAWYERX/perl-5.26.0

If you find that the problem persists, feel free to reopen this ticket.

@p5pRT
Copy link
Author

p5pRT commented May 30, 2017

@khwilliamson - Status changed from 'pending release' to 'resolved'

@p5pRT p5pRT closed this as completed May 30, 2017
@p5pRT p5pRT added the Wishlist label Oct 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant