Thursday, August 06, 2009

Recursive Dependency on CPAN

Trouble's a-brewin':
Recursive dependency detected:
Bundle::CPAN
=> Test::Harness
=> A/AN/ANDYA/Test-Harness-3.17.tar.gz
=> File::Spec
=> S/SM/SMUELLER/PathTools-3.30.tar.gz
=> Scalar::Util
=> G/GB/GBARR/Scalar-List-Utils-1.21.tar.gz
=> Test::More
=> M/MS/MSCHWERN/Test-Simple-0.88.tar.gz
=> Test::Harness.

Cannot continue.
This is the output from a CPAN shell. This is a fresh install of perl on Ubuntu Hardy Heron (LTS). The CPAN that comes built-in is obsolete, and an install Bundle::CPAN is in order at the CPAN shell after you've initialized it at the first run.

This problem can be fixed by manually installed the "offending" module, which in this case is Test::Harness. It needs to be installed but needs itself to install itself, which makes no sense (even for perl).

Exit CPAN, and go into your cpan directory:
cd ~/.cpan/Build/
cd Test-Harness[tab]*
perl Makefile.PL
make test
make install
Manually installing the module will break the recursive dependency. So fire up CPAN and breathe normally.

Hopefully this will come in handy to someone.

* CPAN distributes modules with the version number appended after the module name. So the build directory for Test::Harness v3.17 is called Test-Harness-3.17/. Sometimes it appends random strings at the end, so that a more recent download of the same Test::Harness v3.17 doesn't overwrite the old download. So press tab to let your shell take care of the details. Tab completion is your friend.

Labels

About Me

My photo
Singapore
I write essays in my spare time on things that are important to me. The ones that I feel are any good, or make any sense, I put them up here. :)