Perl-Toolchain-Gang / Perl-Toolchain-Gang/Module-Metadata
Inconsistent file paths generated by provides
Nobody has claimed this yet.
- Dominant language
- Perl
- Stars
- 8
- Forks
- 17
- PR merge metrics
- No merged PRs in 30d
Description
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 https://github.com/metacpan/metacpan-web/issues/2306
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read lib/Module/Metadata.pm around package_versions_from_directory and the provides method, focusing on how File::Find and File::Spec paths are combined. Check existing tests for package versions and provides metadata, then verify that generated paths remain Unix-style and relative on Windows as well as other platforms.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- perl
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100