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

Inconsistent file paths generated by provides #36

Open
Grinnz opened this issue Oct 19, 2020 · 1 comment
Open

Inconsistent file paths generated by provides #36

Grinnz opened this issue Oct 19, 2020 · 1 comment

Comments

@Grinnz
Copy link

Grinnz commented Oct 19, 2020

The provides field in the CPAN meta spec specifies that "It must contain a Unix-style relative file path".

However, package_versions_from_directory returns the native file path returned by File::Find canonicalized to the current OS by File::Spec: https://metacpan.org/source/ETHER/Module-Metadata-1.000037/lib/Module/Metadata.pm#L263

This path is then appended to the prefix with a unix-style slash unconditionally by the provides method, but the rest of the path will keep its OS-dependent path separators. Thus on a Windows system you get paths like lib/Foo\Bar.pm.

This method is currently used at least by Minilla in generating the provides metadata. Ref metacpan/metacpan-web#2306

@neilb
Copy link

neilb commented Feb 12, 2021

This (provides including a broken path due to a mix of unix and windows style path separators) caused a slightly confusing situation where a dist was added to the CPAN Index, but then not indexed by MetaCPAN.

Here's the offending line:

"file" : "lib/Data\\QuickMemoPlus\\Reader.pm",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants