Perl-Toolchain-Gang / Perl-Toolchain-Gang/Module-Metadata

Module::Metadata is confused by Fatpack archives

Open
#18 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Perl
Stars
8
Forks
17
PR merge metrics
No merged PRs in 30d

Description

Module::Metadata 's package_versions_from_directory() is confused by the existence of a fatscript.pm file in the directory being searched. The function pushes modules into the results that are inside the fatscript.pm: POD examples, etc. The fatscript.pm in question comes from from my cpanminus install and was made by App::FatPacker.

/home/myuser/perl5/lib/perl5/App/cpanminus/fatscript.pm

You can see this if you grab the file explicitly with new_from_file()

  % cd ~/perl5
  % perl -MData::Dumper -MModule::Metadata -E '
      $pm_info = Module::Metadata->new_from_file("App/cpanminus/fatscript.pm" ); 
      print Dumper \$pm_info ;'

It was suggested that the fatscript code was confusing Module::Metadata by the use of HERE style documents: the output shows "A" "My" "YourModule" etc. which all come from POD examples. Perhaps embedded fatpacked modules should ibe excluded by Module::Metadata somehow on a default run (via the call to wanted in the find() from package_versions_from_directory) and flagged as fatpacked with embedded modules and then either special cased (package_versions_from_fatpack) or the output only available when a constructor option is passed. In any case the incorrectly included POD example modules in the fatpacked file should be handled more correctly.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the report with Module::Metadata->new_from_file("App/cpanminus/fatscript.pm") and inspect package_versions_from_directory(), including its find() and wanted handling. Trace how the fatpacked file and its POD examples enter the results, using the App::FatPacker-generated fatscript.pm as the case to understand. Done means fatpacked embedded modules and POD example names are handled according to a clearly defined default or opt-in behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
perl
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.