Perl "Makefile.PL ... had compilation errors" / WARNINGS in CI
ExtUtils::MakeMaker ran your Makefile.PL and it either died with compilation errors or reported unmet prerequisites. No Makefile is produced, so the later make step has nothing to run.
What this error means
The configure step fails with "Warning: prerequisite Foo::Bar 0 not found." or "Makefile.PL had compilation errors." and no Makefile appears.
Warning: prerequisite JSON::PP 2.27 not found.
Can't locate Foo/Config.pm in @INC ... at Makefile.PL line 5.
Makefile.PL had compilation errors.Common causes
Makefile.PL imports a module that is not installed
The script uses a helper or the project itself at configure time, and that module is not on @INC yet.
Declared prerequisites are missing
MakeMaker warns that PREREQ_PM entries are absent; if the build then fails, those deps must be installed first.
How to fix it
Install dependencies before configuring
- Install the distribution prerequisites with cpanm --installdeps.
- Then run perl Makefile.PL, make, make test.
- Or let cpanm drive the whole build for you.
cpanm --installdeps .
perl Makefile.PL
make && make testLet cpanm build the distribution
cpanm resolves prerequisites, runs Makefile.PL, make, and test in order, avoiding a manual configure with missing deps.
cpanm --notest --installdeps .
cpanm -v .How to prevent it
- Install prerequisites before running Makefile.PL manually.
- Prefer cpanm --installdeps to resolve configure-time deps.
- Avoid importing not-yet-installed modules at the top of Makefile.PL.