Closed thaljef closed 5 years ago
Aha! I got bitten by this problem this morning, trying to pull 2.37 into our pinto repo at work. I'd be interested to know what's happening here too.
[edit, calmer wording]
This has bitten me too. What's behind this?
This is biting me again and I can no longer fix it by pinning to the older (2.33) version because that has a bug with the number of tests that are skipped when running without a TTY that keeps the tests from passing when being built as part of a Jenkins job.
The Makefile.PL for this package contains this bit:
provides => {
'Term::ReadKey' => {
file => 'META.yml',
version => '2.37',
},
},
which leads to this bit in the META.json
:
"provides" : {
"Term::ReadKey" : {
"file" : "META.yml",
"version" : "2.37"
}
},
The provides section of the CPAN Meta Spec says:
This field is required. It must contain a Unix-style relative file path from the root of the distribution directory to a file that contains or generates the package. It may be given as META.yml or META.json to claim a package for indexing without needing a *.pm.
There is no actual Term/ReadKey.pm
in the source tree to point at, I think that the package is doing the right thing and that thaljef/Pinto#241 should be generalized for the case where the "file" is META.{yaml,json}
to follow the spec.
Alternatively, it seems as if used ReadKey_pm.PL
instead of META.yml
would also fulfill the META spec.
I submitted a PR to pinto that fixes this in Pinto. I'd consider this issue closed as its perfectly valid per the CPAN Meta Spec to declare a provides file of META.yml like this.
I'm not sure what Pinto's release schedule is. It might be nice to mitigate the issue on this side (and perhaps make the metacpan search results less confusing). See #31
Ack. That renaming doesn't work. It fails to match this regex in sub is_simile
here:
$file =~ s|\.pm(?:\.PL)?||;
Renaming the file to ReadKey.pm.PL
and touching up Makefile.PL
and MANIFEST
(and setting SIGN to false) result in a distribution that passes its tests and that Pinto can index as is.
The fix for this has already been merged into Pinto. I'm guessing @thaljef will release a fixed version soon, which makes all of this pointless. What Term::ReadKey is doing is perfectly valid according to the CPAN Meta Spec. This was a Pinto problem, not a Term::ReadKey problem.
There is a file which generates the source code for this module so there's no need to use META.yml, so I'd still consider this a valid issue, without an explanation for why this was done.
I have just pushed 2.38 which includes the above PR
Starting in 2.37, the dist metadata says that
META.yml
is the file that provides theTerm::ReadKey
package. This appears to be deliberately injected by theADD_META
inMakefile.PL
. This throws offModule::Metadata
(used by Metacpan and Pinto) which expect the file to be something that looks like source code (usually either a .pm or .PL file). Can you help @mschout and myself understand why it is being done this way. See also thaljef/Pinto#241