Reinstalling Perl.

The break in my blogging was to start a new job.  It’s kept me incredibly busy.  I’m now a “Senior Infrastructure Architect” and being paid to write and maintain complex Perl scripts.  It means lots more things in Perl to learn and see, but may limit what I can blog about, as I have to be careful of the NDA.  I’m going to try and get back to this blog, though.

I reinstalled Perl the other day.  It was no trouble; it came with my Linux distribution.

Then I had to reinstall all the missing modules.

That should be easy!  I typed ‘autobundle’ in CPAN before I upgraded, and it wrote out a Bundle file.  All should be well!  I should just have to type “perl -MCPAN -e ‘install Bundle::Snapshot_2009_09_09 and let it go do what it needs to do.

Pity it doesn’t work that well.

I don’t know why it’s done what it’s done.  It seems to have installed every old version of every module I had installed, and then later versions.  Sometimes.  The Catalyst install was particularly screwed up, as it lists Moose 0.90 or greater.  Somehow Moose was at 0.87 or something, and Catalyst’s install noticed this, but then kept going, and said all was good.

All wasn’t good.  The error messages were unfathomable.

Eventually, I tried to reinstall Catalyst and it said that Moose was too low a version, but didn’t fix it.  After fixing it by hand, things were less bad.

This didn’t just happen with Moose either.  I think I have ten versions of DBIx::Class installed, for no visible reason.  I think there as many versions of Catalyst.  Lots of other modules wouldn’t install right, and got CPAN stuck asking for them over and over.  I ran out of space because of extracting them to the build directory.  I finally had to find many of them and install them by hand or force-install them.  The autobundle was not my friend.

CPAN’s version tracking and dependency management failed hard here, and I don’t know why.  It’s taken me weeks of fiddling with this in the evenings to get this sorted out and everything still isn’t normal yet.

Worse, CPAN and/or the module installs keep stopping and asking questions.  Some of them I can see they had to ask, but others… why?  Why are they constantly asking “install the needed modules?”

I need to install Perl 5.10.1 and probably have to do this all over again.  Not looking forward to it.  I may see if I can extract the list of modules from the Bundle file and write a script to install them manually, without the version information.  Maybe I can get away with less redundancy.

What a mess.  I see why people are afraid of the CPAN if it behaves like this.

Tags:

6 Responses to “Reinstalling Perl.”

  1. dagolden says:

    I suspect that the issue is that when a new version of a distribution (say Foo-Bar-1.2) stops including a file, say Foo::Bar::Removed, that was in Foo-Bar-1.1, the old file isn’t deleted from your system (other software you have might still need it!). autobundle will find it, the PAUSE index knows to get it from Foo-Bar-1.1, and depending on the order of things, Foo-Bar-1.1 might get installed first, then Foo-Bar-1.2 or vice versa, which will really screw things up. That’s sort of a PAUSE/autobundle design flaw and needs to be fixed, but it’s not entirely what “correct” behavior is that might not cause other problems.

    As for why things ask to be installed — that’s often (but not always) a sign of things that use some form of AutoInstall. You can set the environment variables PERL_EXTUTILS_AUTOINSTALL=–defaultdeps and PERL_MM_USE_DEFAULT=1 to get default answers to most of those questions. (Someday I hope to enhance CPAN.pm to enable those as a config option.)

    — David

    • Laufeyjarson says:

      I now have to use the same autobundle on a clean 5.10.1 install. I’m likely to parse out the module names and turn it into a shell script which does a “cpan install” on each of them instead of letting Bundle do it. I may try and be extra-sneaky and sort them by name so that the base packages get installed first.

      I thought I had done all the right incantations; they helped, but a bunch of scripts still stopped and asked stuff. I really wish there was a way to say, “You can’t ask questions. If you don’t know, guess. If you can’t guess, fail.”

      Some of the questions were reasonable – DBD::Pg had to ask where pg_config was, because SuSE puts it in a funny place. Same with mod_perl (which I didn’t really want) because SuSE put apxs in a funny place. If those failed or said, “You can’t install this in a batch” and made me do them one at a time, that would have been preferable.

      Many others just asked, “Should I add these to the list?” YES, YES, YES!

  2. wtgee says:

    The whole Snapshot bundle thing is a joke. It has never worked for me properly (probably my fault).

    Start looking into local::lib, it is a good way to be doing these things you want to do, especially on a new, clean system. That way you can separate your system perl from any development perl easily.

  3. Bob Simpson says:

    I got to watch part of this process. Truly unpleasant.

    What is the point of having a procedure to automatically “put things back the way they were” and “bring things up to date” for HUNDREDS of modules if it is going to require constant attention and answers to a bazillion incredibly obvious or incredibly arcane questions?

    “Install required modules?” Yes!
    “Skip unnecessary tests?” Yes!!!
    “Encountered totally ignorable errors. Continue?” YES!!!
    “Path to fleening prong?” Uh… What?

    It is especially galling if the process is going to get it //wrong// and leave the system in an unusable state.

    The whole process was positively surreal.

  4. Hercynium says:

    Indeed there’s no good way to figure out what modules on your system were installed by which distributions. The necessary information just isn’t kept by the installation process… so the whole autobundle thing is just a horrible hack that more often than not doesn’t work.

    The really irritating thing is, I don’t think the changes necessary to CPAN.pm to make this use case work properly should be all that difficult! The information is available, it just need to be kept!

    Perhaps, before I get sucked into an obnoxiously long comment I should re-group and write a fully thought-out post on my blog. ( http://lalaperooza.blogspot.com )

Leave a Reply