When an install goes wrong#

Symptoms first, since that is what you have when you arrive here.

“Can’t locate Foo/Bar.pm” after a successful install#

The install said it worked, and the module is not there. pperl searches lib/perl5 under $PPERL_HOME, or under ~/.pperl when that is unset, so the usual cause is that the install and the run see different trees: PPERL_HOME was set for one and not the other, or the install went into a tree pperl does not search unasked. Compare the “installed into” line of the install with pperl’s search path:

pperl -e 'print "$_\n" for @INC'

A tree that is missing there can be added with PPERL5LIB.

A distribution that declares XS installs its modules into the tree’s architecture directory, lib/perl5/x86_64-linux/ on this platform, even when they are pure Perl. That is not a cause: as perl does, pperl searches the architecture directory of every tree on PPERL5LIB, PERL5LIB and -I, and of ~/.pperl/lib/perl5.

The installer wants to build a module pperl already has#

Confirm what pperl thinks it provides, and at which version:

pperl -MConfig -MExtUtils::MakeMaker -e \
  'my $f = Config::lib_file("Storable.pm"); print "$f ", MM->parse_version($f), "\n"'
# ./pperl-native/Storable.pm 3.41

If the path starts with ./pperl-native/ the module is built in. If the installer still wants it, compare the versions: the dependency may genuinely be newer than the version pperl carries, in which case no arrangement will satisfy it.

An installer that is not pperl’s own, run under pperl, looks for modules with file tests and does not see the built-in ones. Use pperl --cpan.

“Can’t locate loadable object for module Foo::Bar in @INC”#

XS: the module wants its compiled part, and pperl does not build one. Read the no-XS rule to work out which shape the distribution is, because shapes 2 and 3 there have a way forward and shapes 4 and 5 do not.

A module that has a Perl implementation of its own catches this message and uses that implementation, so you do not see it. When you do, the module either has no Perl implementation, or has one that is switched on another way, such as by an environment variable its documentation names.

“Need to fall back to http”#

Missing or unusable modules 'Net::SSLeay', 'IO::Socket::SSL', and found neither curl nor wget installed.
Need to fall back to http.

This pperl has no TLS support of its own, and the host has neither curl nor wget, so the CPAN client downloads over plain http. Install curl or wget; the next pperl --cpan run finds it and downloads over https. The XS substitutes are not fetched at all in this state, and that warning (below) ends in neither curl nor wget is configured.

“XS substitutes not refreshed from …”#

pperl: --cpan: XS substitutes not refreshed from https://perl.petamem.com/downloads/cppan: ...

The run could not fetch pperl’s substitutes for XS distributions, for the reason named at the end: no network, or a server error. The install carries on with the substitutes fetched last, so only one published since then is missing. On a machine that is never online, set PPERL_CPPAN_URL to an empty string to stop the attempt.

pperl: --cpan: cannot unpack .../cppan.tar.gz; the XS substitutes stay as they were

The download arrived but is not an archive pperl can unpack. The install carries on with the substitutes fetched before it, and the next run downloads the file afresh.

The install hangs waiting for input#

It should not - under --cpan, PERL_MM_USE_DEFAULT and NONINTERACTIVE_TESTING are both set, so distributions take their own defaults. If you are driving an installer yourself, set both.

Tests fail but the module is fine#

-T goes straight through to the CPAN client and skips the tests:

pperl --cpan -T Some::Module

Worth doing once to find out whether the module or its test suite is the problem. A test suite that itself depends on XS will fail against a perfectly good pure-Perl module.

Starting over#

The tree is disposable. Nothing else refers to it:

rm -rf ~/.pperl
pperl --cpan Your::Module

Reporting#

If a pure-Perl distribution fails to install, or installs and then cannot be loaded, that is a pperl bug and worth filing:

petamem/pperl-bugtracker#issues

Include the distribution name and version, the full --cpan output, and pperl -e 'print "$_\n" for @INC'.