Skip to content
Latchkey

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

  1. Install the distribution prerequisites with cpanm --installdeps.
  2. Then run perl Makefile.PL, make, make test.
  3. Or let cpanm drive the whole build for you.
Terminal
cpanm --installdeps .
perl Makefile.PL
make && make test

Let 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

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →