fix: MYMETA.yml meta-spec v1.4 format for CPAN.pm dependency resolution#479
Merged
Conversation
The _create_mymeta function in ExtUtils::MakeMaker generated MYMETA.yml using meta-spec v2 with nested prereqs.runtime.requires structure. CPAN.pm prereq_pm() fallback parser (Tier 2: read_yaml) only understands v1 flat top-level requires/build_requires keys. When CPAN::Meta (Tier 1) failed to load, the fallback silently returned zero prerequisites, causing CPAN.pm to install modules without their dependencies. Changes: - Switch MYMETA.yml from meta-spec v2 to v1.4 flat format - Use top-level requires/build_requires/configure_requires keys - Merge TEST_REQUIRES into build_requires (v1.4 has no test phase) - Escape single quotes in abstract field for YAML safety - Use hyphenated dist name (Foo::Bar -> Foo-Bar) - Include version number in generated_by (CPAN.pm filters old EU::MM) - Default configure_requires to ExtUtils::MakeMaker - Add dev/modules/dancer2_support.md investigation plan Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
- Fix single-quote escaping: use YAML's '' (doubled) instead of \'
which is invalid in YAML single-quoted strings. Modules with
apostrophes in their abstract (e.g., "if it's not set") caused
"not a HASH reference" parse errors in CPAN.pm.
- Remove blank lines between YAML sections by chomping interpolated
strings before inserting into heredoc.
- Use {} for empty YAML mapping sections instead of leaving them
as bare keys with no value.
- Update dancer2_support.md with Phase 2 results: 38 modules
installed successfully via notest, Type::Tiny scoping bug
identified as next blocker.
Generated with [Devin](https://cli.devin.ai/docs)
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes two MYMETA.yml bugs in
ExtUtils::MakeMaker::_create_mymetathat prevented CPAN.pm from correctly parsing module dependencies.Bug 1: meta-spec v2 format not understood by CPAN.pm fallback parser
prereqs.runtime.requires) to meta-spec v1.4 with flat top-levelrequires/build_requires/configure_requireskeysprereq_pm()fallback logicBug 2: Invalid YAML single-quote escaping
$abstract =~ s/'/\\'/g(produces\', invalid YAML) tos/'/''/g(doubled single-quote, correct YAML)"if it's not already set"caused warnings from CPAN.pm's YAML parserVerification
Reusing configuration cache.
BUILD SUCCESSFUL in 36s
13 actionable tasks: 7 executed, 6 up-to-date
Configuration cache entry reused. passes all unit tests
Test plan
Reusing configuration cache.
BUILD SUCCESSFUL in 542ms
13 actionable tasks: 1 executed, 12 up-to-date
Configuration cache entry reused. passes all unit tests
Generated with Devin
EOF
)