Subject: | PREREQ_FATAL not recognized on command line |
I have an automated installer which doesn't perform dependency resolution (it's designed to work with an explicit set of software packages). I've found that some Perl module's tests don't always check that their dependencies are available, so that if one is not, the build and install will succeed, followed by a future failure in a seemingly unrelated module or program.
I'd like to use PREREQ_FATAL to ensure that the installer will notice the error as soon as possible. The documentation indicates that it may be used on the command line, but unfortunately, it seems to only be valid as an argument to WriteMakefile.
Here's my test:
------------------------------------------------------
use ExtUtils::MakeMaker;
WriteMakefile(
NAME => 'Your::Module',
PREREQ_PM => { 'Unavailable::Module' => 0, },
);
------------------------------------------------------
And the result:
------------------------------------------------------
% perl Makefile.PL PREREQ_FATAL=1
Warning: prerequisite Unavailable::Module 0 not found.
Generating a Unix-style Makefile
Writing Makefile for MooX::Cmd
Writing MYMETA.yml and MYMETA.json
Generating a Unix-style Makefile
Writing Makefile for Your::Module
Writing MYMETA.yml and MYMETA.json
------------------------------------------------------
I get the same behavior when setting it via the PERL_MM_OPT environment variable.
This contrasts with the result when I pass it directly as an argument to WriteMakefile (to make sure I'm not doing something totally silly):
------------------------------------------------------
% perl Makefile.PL
MakeMaker FATAL: prerequisites not found.
Unavailable::Module not installed
Please install these modules first and rerun 'perl Makefile.PL'.
------------------------------------------------------
Thanks,
Diab