On 08/08/2021 20:34, Diab Jerius wrote:

Here's the problem, illustrated by this CPAN testers failure:


The smoker has versions of Cpanel::JSON::XS and YAML::XS which are older than my required versions.  Since the ::XS versions are prioritized over the ::PP versions, the code uses those and thus fails the tests.   I presume that because the ::XS versions are recommendations rather than requirements, they weren't updated to the versions that the code requires.

Is there some way of triggering an update to the required versions via the metadata, or should I put a runtime version check into the tests and skip if the appropriate versions aren't installed?

You can check what's already installed in your Makefile.PL or equivalent, and prompt the user if you can't figure out what to do automatically. I ASSume that the correct thing to do would be to do as you currently do if none of your deps are installed, but if any are installed you'd want to tell EU::MM's WriteMakefile function that you have a runtime requirement for updated versions.

Use the prompt() function from ExtUtils::MakeMaker as that will pay attention to the PERL_MM_USE_DEFAULT env var. You may also want to pay attention to AUTOMATED_TESTING and NONINTERACTIVE_TESTING. In particular you will find that CPAN-testers generally set all three of those.

Vary as appropriate if you use a different build system.

David Cantrell

Reply via email to