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

Implied versioning not dropped when merging prereqs #140

Open
bleargh45 opened this issue Jun 25, 2024 · 2 comments · May be fixed by Perl-Toolchain-Gang/CPAN-Meta-Requirements#41
Open

Comments

@bleargh45
Copy link

As part of managing a large dependency tree at work, we have a need to merge multiple cpanfiles together into a single (large) dependency list.

For the most part, this works beautifully, but I have encountered one scenario which provides sub-optimal results...

... when merging 2x dependency lists together where the first has no explicit versioning provided (and so it just cares "do we have it installed at all?"), and the second has an explicit maximum version requirement.

Rather than getting a result similar to < 2.0, we instead get one of >= 0, < 2.0.

While I understand that syntactically this makes sense ("make sure it's installed, and make sure that it has a version number less than 2.0"), it also feels duplicative and wasteful (as the maximum version requirement already implies that the module is installed).

I have attached 2x scripts here to demonstrate this.

cpan-meta-prereqs-cpanfile.pl.txt ... a script which dumps out 2x temporary cpanfile files, and then loads/merges them together, outputting the resulting dependency tree.

cpan-meta-prereqs.pl.txt ... a lower-level script using just CPAN::Meta::Prereqs (instead of Module::CPANfile), which demonstrates same resulting dependency tree

@Leont
Copy link
Member

Leont commented Jun 26, 2024

This is a CPAN::Meta::Requirements issue, but yeah that is suboptimal.

@bleargh45
Copy link
Author

Ah-ha! Thank you!

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 a pull request may close this issue.

2 participants