Perl "Attempt to reload X aborted" in CI
A module failed to compile the first time it was required. Perl records the failed load in %INC, so any subsequent require/use of the same file reports "Attempt to reload ... aborted" instead of retrying. The real error is the first compilation failure.
What this error means
Later requires die with "Attempt to reload Foo/Bar.pm aborted. Compilation failed in require at ... line N", while the first failure (a syntax error or missing dependency) appeared earlier.
Attempt to reload Foo/Bar.pm aborted.
Compilation failed in require at t/load.t line 8.Common causes
The module failed its first compilation
A syntax error, a missing dependency, or a die at load time caused the initial require to fail; %INC then blocks reloading it.
A missing transitive dependency inside the module
The module uses something not installed in CI, so it never compiles, and every requiring file sees the reload-aborted message.
How to fix it
Find and fix the first compilation failure
- Scroll up to the first error before the reload-aborted line.
- Fix the syntax error or install the missing dependency it names.
- Verify the module compiles on its own with perl -c.
perl -Ilib -c lib/Foo/Bar.pmInstall the missing dependency the module needs
If the first failure was a missing module, install it so the initial require compiles cleanly.
cpanm --notest --installdeps .How to prevent it
- Compile-check modules with
perl -cbefore running the suite. - Install all runtime and test dependencies before requiring modules.
- Read the first error, not the cascade of reload-aborted messages.