[ic] Easier way to install CPAN module dependencies

Josh Lavin jlavin at endpoint.com
Wed Jul 6 22:48:14 UTC 2016


I've been running through the Interchange install process and I think we
can make this a bit easier for new users.

One is how to get all the CPAN modules installed. Typically this is done
with Bundle::Interchange. `make install` will even attempt this
installtion for you, but it is pretty cumbersome, in today's world of
great tools like "cpanm".

A more modern way to get this done would be to use cpanfile or Carton,
or even Makefile.PL and then instruct users to simply run 
    `cpanm --installdeps .`
(and of course, let them know they should install cpanm first, which is
the popular choice for CPAN installs today).

These methods would allow us to maintain our dependency lists in our
source code, without requiring maintenance of an external module.

I tried setting Makefile.PL's PREREQ_PM and making a tardist to test it.
However, when I ran `cpanm --installdeps .` it wanted to "configure
interchange-v5.10.0" and failed:

    $ cpanm --installdeps .
    --> Working on .
    Configuring interchange-v5.10.0 ... FAIL
    ! Timed out (> 60s). Use --verbose to retry.
    [1]    19456 terminated  cpanm --installdeps .

It went on to install the dependencies, but the failure would be pretty
alarming to a new user.

However, using a cpanfile is as simple as listing the dependencies:

    requires 'Bundle::LWP';
    requires 'Crypt::Random';
    requires 'DBI';
    requires 'Digest::Bcrypt';
    requires 'Digest::MD5';
    requires 'Digest::SHA';
    requires 'HTML::Entities';
    requires 'HTML::Tagset';
    requires 'Image::Size';
    requires 'IO::Scalar';
    requires 'JSON';
    requires 'MIME::Base64';
    requires 'MIME::Lite';
    requires 'Net::IP::Match::Regexp';
    requires 'OLE::Storage_Lite';
    requires 'Parse::RecDescent';
    requires 'Safe::Hole';
    requires 'Set::Crontab';
    requires 'Spreadsheet::ParseExcel';
    requires 'Spreadsheet::WriteExcel';
    requires 'Storable';
    requires 'Term::ReadKey';
    requires 'Term::ReadLine::Perl';
    requires 'Text::Query';
    requires 'Tie::ShadowHash';
    requires 'URI::URL';

and installing with `cpanm --installdeps .` does fine (although I still
have trouble getting Digest::Bcrypt's Math::Pari to pass all the tests
for some reason).

I couldn't find that we require minimum versions of any of the modules
above, but please set me straight if that's not right.

I've already committed a cpanfile and updated the README to refer to it:
https://github.com/interchange/interchange/commit/3dce5d3e2695bc0a12f81e48a69ed86ed5d9c9c3

although I left the instructions for Bundle::Interchange.

-- 
Josh Lavin
End Point Corporation



More information about the interchange-users mailing list