cpanm "installdeps" from cpanfile failed in CI
cpanm parsed the cpanfile and tried to install every declared dependency; one of them failed. As with any cpanm failure, the summary points at build.log for the real cause.
What this error means
cpanm --installdeps . ends with "! Installing the dependencies failed: ..." and lists the modules it could not install.
--> Working on .
Configuring App-MyApp ... OK
! Installing the dependencies failed: Module 'XML::LibXML' is not installed
! Bailing out the installation for App-MyApp.Common causes
An XS dependency needs system libraries
A module like XML::LibXML compiles against libxml2; without the -dev package the build fails and installdeps bails out.
A test or version constraint could not be met
A declared minimum version or a failing self-test in a dependency stops the batch install.
How to fix it
Install system libraries then installdeps with --notest
- Install the -dev libraries the XS dependencies need.
- Run cpanm --installdeps with --notest to skip dependency self-tests.
- Run your own tests afterward.
sudo apt-get update
sudo apt-get install -y build-essential libxml2-dev zlib1g-dev
cpanm --notest --installdeps .Include develop dependencies when needed
Add --with-develop so develop-phase modules from the cpanfile are installed too.
cpanm --notest --installdeps --with-develop .How to prevent it
- Install XS -dev system libraries before installdeps.
- Use --notest for dependency installs; run project tests separately.
- Keep cpanfile phases (runtime/test/develop) accurate.