Perl Dependency Hell – CPAN module should not be required.
December 4th, 2011 § Leave a Comment
I have some free time lately so I decided to try out MongoDB on some virtual machines here at the house. Before some layoffs at my past job, I was personally looking into a distributed database system for use in a multi-site authoritative DNS solution.
“MongoDB is cool”, I was told. Ok, let’s try it out.
I downloaded MongoDB, for x86_64, from their site. Installation and setup was a breeze. After the compressed tar-ball was extracted, change into the ./bin directory of the archive, and execute, “./mongod”. Wait? That’s it? – Yep. I ran through their tutorial and got the general, “feel”, for the basics. Ok, time to try the Perl interface and get to coding!
Ok, they recommend,
$ cpan MongoDB
I generally don’t like the cpan module doing all the work of downloading all the needed modules for me. I want to know what it is involved, just in case something fails mid-install, or I run into a problem later. It also requires a network connection and responsive CPAN mirrors. (how would I install this on a private network?) Not to mention, it also relies on you trusting it to not to interfere with other modules already installed.
For manual install they said I needed,
Any::Moose, Class::Method::Modifiers, Data::Types, DateTime, File::Slurp, Test::Exception, Try::Tiny, boolean, and Module::Install. (Additionally, Tie::IxHash is required for testing.)
On my generic CentOS install, I didn’t expect this to be too time consuming. Just download the modules from search.cpan.org, fulfill a couple of dependency requirements, and install.
What I experienced from then on could only be described as, “Perl Dependency Hell”. After the 37th dependency was installed, and I had only made it through to, “DateTime”, I had to stop.
I can imagine coders are putting together Perl modules to fit certain needs in the community. Take a command-line argument parser, for example. Not everyone needs one but, when one is needed, they are usually lightweight (to performance and load times) and very useful. But when does module granularity exceed usefulness? Most of the modules I downloaded were written by the same author and most had only one small “.pm”, perl module included. Could these not be combined into CPAN… packages? or subsets?
Beyond commercial software licensing, I believe dependencies are the bain of this Perl geek’s (or in many cases UNIX lover’s), existence. After so many years of existence, I would have thought things like this would have been addressed.
Well, I guess I have to depend on the cpan module to install my libraries.. this time!
Here are my notes from the pain of a couple of hours of crap…
yum install perl-ExtUtils-MakeMaker
yum install make
yum install gccInstalled Test-Simple-0.98 (req by Mouse)
Installed Sub-Uplevel-0.22 (req by Mouse)
Installed Mouse-0.97 (req by Any-Moose)
Installed Any-Moose-0.18Installed Try-Tiny-0.11 (req by Test-Fatal)
Installed Test-Fatal-0.008 (req by Class-Method-Modifiers)
Installed Class-Method-Modifiers-1.08Installed CPAN-Meta-YAML-0.004 (req by CPAN-Meta)
Installed JSON-PP (req by CPAN-Meta)
Installed Parse-CPAN-Meta-1.4401 (req by CPAN-Meta)
Installed Version-Requirements-0.101020 (req by CPAN-Meta)
Installed version-0.95 (req by CPAN-Meta)
Installed CPAN-Meta-2.112621 (req by Module-Build)Installed Locale-Maketext-Simple-0.21 (req by IPC::Cmd)
Installed Module-CoreList-2.58 (req by Module-Load-Conditional)
Installed Module-Load-0.22 (req by Module-Load-Conditional)
Installed Params-Check-0.32 (req by Module-Load-Conditional)
Installed Module-Load-Conditional-0.46 (req by IPC-Cmd)
Installed Params-Check-0.32 (req by IPC-Cmd)
Installed IPC-Cmd-0.72 (req by ExtUtils::CBuilder)
Installed ExtUtils-CBuilder-0.280202 (req by Module-Build)Installed Compress-Raw-Bzip2-2.045 (req by IO-Compress)
Installed Compress-Raw-Zlib (req by IO-Compress)
Installed IO-Compress-2.045 (req by Archive-Tar)Installed Algorithm-Diff-1.15 (req by Text-Diff… not 1.15)
(CPAN defaulted to 1.15, d/l’ed 1.19 as I found out, IT was req by Text::Diff)
Installed Algorithm-Diff-1.1902 (req by Text-Diff)
Installed Text-Diff-1.41 (req by Archive-Tar)Installed IO-Zlib-1.10 (req by Archive-Tar)
Installed Package-Constants-0.02 (req by Archive-Tar)
Installed Archive-Tar-1.82 (req by … umm.. Module-Build)Installed Perl-OSType-1.002 (req by Module-Build)
Installed Module-Metadata-1.000007 (req by Module-Build)
Installed Module-Build-0.3800 (req by Data-Types)
Installed Data-Types-0.09(About this time I was starting to yell obscenities at the screen…)
Installed List-MoreUtils-0.33 (req by DateTime-Locale)
Installed Params-Validate-1.00 (req by DateTime-Locale)
Installed DateTime-Locale-0.45 (req by DateTime)DateTime-0.7 needs DateTime-TimeZone, which needs Class-Load, which needs
Data::OptList, Module::Runtime, and Package::Stash…. and what do those
need???
Edit: It’s installed via,
[root@testbox3 ~]# cpan MongoDB
.. but, will it blend? More to come.
Edit: What I go through to be careful… still plugging away at coding and MongoDB… If ADD doesn’t catch up to be first… oh, look! a piece of candy!