HelloSam
HelloSam

Reputation: 2345

Bundling perl prereq module in source form for deployment?

My webapp depends on quite a few modules. When I deploy on a remote server, I have to cpanm to re-install all the modules, which has the following issues:

So I want to redistribute them when I deploy. I could almost use PAR, but I can't because I don't want want to do that in binary form - as the Perl version, architecture might be different.

Module::Install::Bundle is the closet I have found. Upon specifying the prereq, it can auto fetch the modules and all its dependencies (up to core module) from CPAN. Module does build and test, but "make install" does nothing - it doesn't install those prereq at all.

Is there something I have missed?

I am using Strawberry Perl on Windows.

Upvotes: 2

Views: 138

Answers (3)

nponeccop
nponeccop

Reputation: 13677

cpanm in principle can do what you want:

  • cpanm --notest is fast (of course you don't always want to skip the tests but tests are by large the biggest source of slowdown. Other than that you can try to write a parallel downloader yourself)
  • cpanm FOO/Bar-1.234.tar.gz will install an exact version and it's possible to upload your forks of packages under your PAUSE account (so it works for private, but still open-source libs)
  • cpanm . installs the distribution in the current directory, so it may be the way for your private libs
  • cpanm foo.tar.gz works too

The only problem with cpanm is to automate the list of dependencies.

Note also that it doesn't make sense to pin library versions without pinning the perl version as well. In that case you can use PAR. Also with PAR you don't need to use the packer to get a monolithic file - you can install modules using PAR::Repository which is better for debugging than monolithic packages.

Upvotes: 1

Schwern
Schwern

Reputation: 164759

Pinto provides you with a sort of private, super CPAN mirror which only upgrades when you want it to, and only the modules you want to be upgraded. It can also accept tarballs with private patches. Here's a video on the subject.

Upvotes: 1

jira
jira

Reputation: 3944

You might have a look at Carton. With that you can give your application self contained set of dependencies.

Upvotes: 0

Related Questions