Bundlefly - Make Your Bundles Fly

Bundlefly is a hack I've written to build a graph of a bundle's distributions and install them in optimal order. It accelerates the installation of entire library suites for new Perl builds and perlbrew instances. As with App::PipeFilter, it may end up on CPAN if there's interest.

Autobundle snapshots are comprehensive by design. They list all installed modules at a particular point in time. We should rarely be asked to confirm "unsatisfied dependencies" while installing them. The dependencies are almost always somewhere in there.

To compound the suck, we're often asked to install the same fundamental dependencies repeatedly. ExtUtils::MakeMaker and Test::More immediately come to mind. We shouldn't be asked once, yet we're asked several times by the end of the day.

One problem is that autobundle snapshots list distributions alphabetically, and CPAN's shell installs them in that order. Test::More, a distribution used to test a large portion of CPAN, is installed relatively late—after it's already been prepended to the install queue as a dependency of several other distributions.

Bundlefly's dependency graph allows it to install dependencies before dependents. The only "unsatisfied dependencies" one should ever see are those introduced since the last CPANDB build and which aren't listed in the autobundle snapshot.

5 Comments

Nice work. Ideally this logic should migrate up into the CPAN clients themselves, of course…

Very cool. This will definitely be useful - I've munged autobundle snapshot files for exactly this effect in the past (and a few other tweaks like stripping out core modules), but never thought to make a module out of it!

Nice...

Just a couple of days ago I was hinting to miyagawa that I would love to see cpanm -j 6 :)

Maybe we could hack Bundlefly to manage multiple parallel CPAN clients instead...

That's awesome and timely. I was just about to write one of those myself. I'll see if your code does what I need instead. :-)

Leave a comment

About Rocco Caputo

user-pic Among other things I write software, a lot of which is in Perl.