Skip to content

fix: scan root-level .pm files alongside lib/ in MakeMaker#500

Closed
fglock wants to merge 1 commit intomasterfrom
fix/makemaker-root-pm-scan
Closed

fix: scan root-level .pm files alongside lib/ in MakeMaker#500
fglock wants to merge 1 commit intomasterfrom
fix/makemaker-root-pm-scan

Conversation

@fglock
Copy link
Copy Markdown
Owner

@fglock fglock commented Apr 13, 2026

Summary

  • Fix ExtUtils::MakeMaker to scan root-level .pm files alongside lib/, not just as a fallback when lib/ is empty
  • Matches real MakeMaker's PMLIBDIRS behavior where ./*.pm maps to $(INST_LIBDIR)/*.pm
  • Fixes CPAN modules with mixed layouts (main .pm at root, sub-modules in lib/)

Root Cause

PerlOnJava's _install_pure_perl only scanned root-level .pm files when lib/ found nothing (if (!%pm && $name)). Distributions like Math::Base::Convert have Convert.pm at the root and sub-modules under lib/Math/Base/Convert/, so the main module was silently dropped during install.

Test Results

Math::Base::Convert:

  • Before: 0/20 test programs pass (Can't locate Math/Base/Convert.pm)
  • After: 15/20 test programs pass (remaining failures are unrelated runtime issues)

Test plan

  • make passes (build + unit tests)
  • jcpan -t Math::Base::Convert now finds and loads the module

Generated with Devin

PerlOnJava's ExtUtils::MakeMaker only scanned root-level .pm files
as a fallback when lib/ found nothing. Distributions like
Math::Base::Convert that have the main .pm at the root alongside
sub-modules in lib/ would silently drop the main module file.

Now root-level .pm files and BASEEXT directories are always scanned
(with dedup), matching real MakeMaker's PMLIBDIRS behavior.

Before: Math::Base::Convert 0/20 tests pass (Can't locate Convert.pm)
After:  Math::Base::Convert 15/20 tests pass

Generated with [Devin](https://cli.devin.ai/docs)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@fglock fglock closed this Apr 13, 2026
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

Successfully merging this pull request may close these issues.

1 participant