Strawberry Perl and the nightmare of installing Padre

bart on 2009-10-28T08:56:09

Yesterday evening I felt like it was time for something new, and I decided to install Strawberry Perl and Padre. So I grabbed the MSI installer file from Strawberry Perl's website, and ran it. Soon enough it finished, and I felt simply lost. Was that it?

I glanced in the Start Menu, and I found a few links to docs, 2 to CPAN, and one to the help channel on IRC. I've never used IRC in my life, I don't even have IRC software, so that didn't feel welcoming. No welcome message, no introduction message "What now?", nothing. I'm an experienced Perl user, and as I felt lost, I can't imagine what kind of hell it must feel like to people who are new to Perl.

So I opened a command line window, and I typed "perl -v". Wow! At least that was something: apparently Strawberry Perl had put itself in my PATH, and in front of my default Perl install. (The reason for that is because my default perl is in the user environment variable PATH, and Strawberry put itself in the system environment variable PATH, and the latter comes in front of the former. It doesn't feel right to me, but at least, it's a annoyance caused by Windows.)

But I had, half and half, expected that Padre would have been there. It wasn't. So I went to the win32 Wiki (following the link in the Start Menu and initially ending up in the wrong place), and tried to find a "What now?" page. Still nothing. There's a (very incomplete) page on editors usable for Perl (I can name, off the top of my head, 3 free Windows text editors that aren't listed). I needed an editor, this is a fresh Windows install and there's no editor there yet apart from Notepad.

I decided to grab Padre anyway. So I dropped down to the command line window, and typed "CPAN", followed by "install Padre". That should go swiftly, shouldn't it? It didn't. I got all sorts of weird errors, most of them relating to "missing prerequisite", at least most due to a module that failed to install, due to a "missing file" error message. Say what??

So I decided to figure out which module failed to install, and installed, by hand, the first one that produced such an error: IPC::Run. Hmm, that installed without glitch. But "install Padre" still doesn't work. So, digging down, I decided to try "install Wx" first. Big mistake. After a very long compilation time, Wx appears to exist out of trillions of little C files, it still failed to install successfully. Again, it appears the reason is because of prerequisites that failed to install.

So I dug further down, installing module after module by hand: starting up with the huge ones like PPI, and ending up in really tiny ones, like Class::Accessor. Eventually, they all installed.

So what was the culprit? Nothing. They all installed. But I get the distinct impression CPAN throws away part of the build before it even finishes, and therefore, installing huge dependency trees fails. You have to split it up in smaller chunks and install them one at a time.

Seriously, I can't expect somebody new to perl and CPAN to get this far. From installing Strawberry Perl to finishing installing Padre through CPAN took over 2 hours.

So after everything installed fine, I sighed a sigh of relief, and typed "padre" at the command line. A spinning cursor for 1 second, and the command line prompt was back. That was it. No error, no error message. Nothing.

After a pause of more than an hour, I decided to tackle the problem, and started by the most likely culprit: Wx, which I had more or less forced to install. I dropped back to the CPAN command line and entered "test Wx". Again, some mysterious error message about a missing file (something like "can't copy file ... to ...: file does not exist). "look Wx", in order to unpack the distro, died with the same error. After trying a few times, it finally worked, as it seems CPAN had decided to start afresh. This reinforces the idea that CPAN is the culprit, apparently cleaning up before it even completes building. Eventually, after going through "perl Makefile.PL" and "dmake" manually, "dmake test"... succeeded? So, back in the CPAN shell, I installed it again. I dropped out of CPAN, hopefully typed "padre" and... still nothing.

So I tried one more module: Wx::Demo. (Seriously, guys, the docs of that demo module are seriously lacking. You run the demo through the script it installs: wxperl_demo.pl, but I really had to browse the repository to figure that out.) Anyway: the demos all worked. (One demo looks like shit: "WxComboCtrl", but that's a problem for another day.)

Back to "padre": still nothing. Okay, debugging time. "perl -x -S padre.bat". Huh, I get an editor window?? "padre"... It works??

It no longer fails. It all works.

Okay, the nightmare is over. It took me nearly 3 hours to get this far. This is not something you want to make everybody go through. And the fault is, most likely, in the module CPAN.

p.s. This post was written using Markdown using Showdown and posted after conversion to HTML.


There have indeed been some CPAN problems

Alias on 2009-10-28T12:03:36

So firstly, no guarentees if you have more than one Perl installed... no Perls really live together well.

Secondly, there's known issues in CPAN.pm.

I recommend uninstalling the July strawberry and trying again with the new October release.

http://strawberry-perl.googlecode.com/files/strawberry-perl-5.10.1.0.msi

This has a new (dev) CPAN release that might fix your problem, and some updated Perl modules and C libraries that should (hopefully) make the installation much easier.

Finally, yes, newbies are not REALLY meant to be using Strawberry Perl. The main audience for the current product design is Unix people who are stuck on Windows.

January release should hopefully fix that finally.

Re:There have indeed been some CPAN problems

mw487 on 2009-10-28T13:42:37

I submit that almost anyone installing strawberry already has a perl, and likely more than 1.

When I install strawberry, I have activestate, cygwin, and I tried building my own. And after that, I have an old strawberry in front of the new strawberry.

A prominent set of warnings seems appropriate.

Re:There have indeed been some CPAN problems

bart on 2009-10-29T00:14:36

The way I solved that is as follows:

I removed the Strawberry specific paths from the PATH environment variable. I then added an icon in the start menu to launch a console shell (cmd.exe), after prepending these paths to PATH first.

One easy way to do that, is by making a BAT file with the following contents:

@echo off
path C:\strawberry\c\bin;C:\strawberry\perl\bin;%path%
cmd

But an IMHO nicer alternative is to just create a shortcut with this as the target:

cmd.exe /k PATH=C:\strawberry\c\bin;C:\strawberry\perl\bin;%PATH%

Windows will instantly replace "cmd.exe" with its absolute path.

At least for me, in Windows XP, the name of this shortcut appears and stays in the title bar of the console window, so it's best to give it a meaningful name, like "Strawberry shell".

In the same way, you can provide a shortcut for Padre:

cmd.exe /c PATH=C:\strawberry\c\bin;C:\strawberry\perl\bin;%PATH% && padre

As Padre immediately comes back to the console window after launching, it apparently doesn't even require the console window to remain open, so you can replace "/k" with "/c", so the console window will just pop up and disappear again; and with that shortcut set to run as "Minimized", you won't even see that.

It speaks for itself I've had to edit the shortcut to the CPAN client in a similar way, or it wouldn't be using the right perl.

Re:There have indeed been some CPAN problems

bart on 2009-10-29T00:54:48

I just found there's a padre.exe file in the perl\bin directory, with the same modification time as padre.bat. Apparently they were built together. So that's why it doesn't need a console window...

Re:There have indeed been some CPAN problems

mw487 on 2009-10-29T12:53:14

Thanks much! I think I understand, and I will try that.

In a previous version of strawberry (last one?), when padre tried to update, for me things choked due to failures in the toolchain of padre. Does this likely have to do with the path during the update of padre? (I think that happened before I have the opportunity to intervene...)

It would be lovely for such advice as yours to be obvious to strawberry perl installers who encounter such problems.

Thanks again! I love perl, though it can be trying at times.

Re:There have indeed been some CPAN problems

DiamondInTheRough on 2009-10-30T13:07:34

One of the things that I ran out of time for in October is checking the path for other perl interpreters and putting up warnings if neccessary ... I'm hoping to get it done for January.

As for the PATH thing - we put ourselves in the system path because it is an "all-users" installation. (another thing for January that needs to be discussed is the possibility of making "all-users/current-user" selectable.) We DO try to be polite and put ourselves at the end of the system path (and the proposed "current-user" option will put the entries at the end of the current-user path.)

January will have two separate versions - a "professional" installer that includes Padre, and a "lite" one that does not.

Re:There have indeed been some CPAN problems

mw487 on 2009-10-30T16:58:23

All this information is good. And thanks for your work on SP, I love the idea.

But the most important thing I am saying, is when I install SP, it should make obvious some of these issues, right in the faces of the novice installers (like me). I don't use IRC, but I do lurk on useperl.

Maybe in the last install window, an "open install notes from c:\strawberry\INSTALL_strawberry.txt" checkbox with default checked...

Re:There have indeed been some CPAN problems

ajt on 2009-10-28T21:40:11

It's good to see honest feedback with warts and all and a reasoned response. It's shows good maturity - it would be so easy to fly off the handle with a post like this.

Re:There have indeed been some CPAN problems

dhorne on 2009-10-29T00:06:44

Almost every Windows server I use at work has three Perls installed - Activestate (which we run our code against), Oracle's Perl, and an HP version that comes with its server software.

It appears mostly seemless, but it in the bad old days (probably 7-8 years ago), an upgrade of Oracle meant that it's Perl took preference over Activestate's and our code crashed and burned. I'm not sure if this is still an issue.

Another datum

pjm on 2009-10-29T06:43:11

Just to add a little sweetness and light: I haven't used Windows in anger for almost ten years, but logged on to a Vista virtual instance, downloaded the all-in-one Padre+Strawberry msi installer, and everything was up and running in around 5 minutes, complete with a handy shortcut in the Start menu.

I then typed

use v10.5;
say "hello world";

saved the file, hit F5, and out came the, err "put". Beautiful...

Congrats, from this perspective, to all involved.

Now I have to remember how to coax CPAN on Windows to travel nicely through an authenticating proxy server. Yech...

Paul