Search code examples
perl-modulecpanperl

bootstrap cpan without make


I want to use the cpan tool get a library from CPAN (HTTP::Tiny::Multipart). (Or should I be using something else??) It is written in pure Perl so I hope I don't need make for this. Can this be done?

At first I couldn't get things to download at all, but eventually I found out the issue was proxies, and now with the right environment variables set I can successfully reach CPAN. But now I get error messages about a missing make.


Solution

  • There are three common installers for Perl module distributions. To use these installers, one follows one of the following two sequences of steps:

    perl Makefile.PL   # ExtUtils::MakeMaker or compatible
    make
    make test
    make install
    

    or

    perl Build.PL      # Module::Build or compatible
    ./Build
    ./Build test
    ./Build install
    

    cpan handles downloading the distributions and installing prerequisites, but it doesn't replace the distribution's installer. When it comes time to install a download distribution, it uses one of the above sequence (depending on whether the distribution includes a file named Build.PL or not).

    HTTP-Tiny-Multipart (the distribution that provides HTTP::Tiny::Multipart) uses ExtUtils::MakeMaker as its installer, so installing it requires make.


    The underlying issue is that you are using a gutted environment. It's not the purpose of git to provide perl to you.

    If you want the full unix emulation environment for which git and its perl were built[1], install Cygwin. Alternatively, you could also just as easily install a native Perl such as ActivePerl or Strawberry Perl.


    1. Technically, git and its perl are built for MSYS, which is a subset of Cygwin.