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.
perl
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.
Terminal
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.
Terminal
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.
Related guides
Perl "Can't locate ExtUtils/MakeMaker.pm" in CIFix "Can't locate ExtUtils/MakeMaker.pm in @INC" in CI - Makefile.PL needs ExtUtils::MakeMaker to configure,…
Perl "Can't locate Module/Build.pm" (Build.PL) in CIFix Build.PL failures in CI - "Can't locate Module/Build.pm in @INC" or "./Build: not found" - the Module::Bu…
cpanm "installdeps" from cpanfile failed in CIFix "cpanm --installdeps ." failures in CI - cpanm read the cpanfile and one of the declared dependencies fai…