perlancar has asked for the wisdom of the Perl Monks concerning the following question:

So basically, on one system after perl Makefile.PL && make or perl Build.pl && ./Build, we package the blib/ and then later on another system a suitable CPAN client can be instructed to copy the files (modules, scripts, manpages, shared files) in blib/ to the suitable location. Plus it needs to do a couple of other stuffs like appending to perllocal.pod and creating .packlist. But this saves some steps like creating Makefile, building the module and the manpages. It could be useful in slashing down installation time especially if we need to install hundreds of distros on many systems (I'm thinking from 2-4 seconds per distro, with test skipped, to under 1 second).

Yes, this won't work for some distros like ones that use dynamic configs, or contain XS modules, or do extra stuffs during configure. But for a lot of other, typical distros it should.

Some other issues: 1) no testing (but I imagine the scenario of installing lots of distros to setup lots of identical systems, so testing would not catch as much edge cases as it could).

Another idea is to build a prebuilt distro package from an installed system, by locating .packlist and creating a tarball from files listed in that file.

I'm wondering if previous effort of this has been done, or if it is considered worth it at all.

  • Comment on Installing distros from prebuilt files (blib/)?

Replies are listed 'Best First'.
Re: Installing distros from prebuilt files (blib/)?
by Corion (Patriarch) on Jul 05, 2017 at 13:35 UTC
      I see, so for static install cpan client can skip perl Makefile.PL && make and just copies lib/ (and script/) to the final destination. That leaves manpages. I measured manifying 10 .pod files at around 0.6s on my computer. So probably not that much saving.
      BTW, I couldn't find the links above explain the differences between putting scripts in script/ vs bin/.
Re: Installing distros from prebuilt files (blib/)?
by Anonymous Monk on Jul 06, 2017 at 00:02 UTC
Re: Installing distros from prebuilt files (blib/)?
by perlancar (Hermit) on Jul 07, 2017 at 03:02 UTC
    BTW, I notice that cpm has a --prebuilt option to save builds and reuse them. Nice!