Monday, August 24, 2009

Trying Padre on MacOS

For a while wanted to play with Padre. It's IDE writen in perl programming language and at this point its main target is perl developers. I tried it once on windows, but I don't develop on windows. For development I use perl5.8 from MacPorts on MacOS X.

First of all you find that Padre requires threaded perl and it's reasonable requirement. So I had to switch perl. I've deactivated perl5.8 and installed new one with threads using the following commands:

    port deactivate perl5.8
    port install perl5.8 +threads

Sure such things don't work well: binary incompatibility and path changes. CPAN shell died complaining about missing dzopen in Compress::Zlib. Installed manually from the CPAN. Didn't help. So I deleted all directories that may affect things:

    # get rid of old perl files, the current version is 5.8.9
    find /opt/local/lib/perl5 -name '5.8.8' | xargs sudo rm -fr
    # get rid of everything related to compression
    find /opt/local/lib/perl5 | grep 'Compress' | xargs sudo rm -fr
    # get rid of everything related to old architecture, new one is darwin-threaded-multi-2level
    find /opt/local/lib/perl5 -type d -name darwin-2level | xargs sudo rm -fr

Ok. CPAN started to work as it can use gzip and gunzip commands. Re-installed Compress::Zlib. Then I usually install CPAN::Reporter module. It slows down installation a little bit, but it helps perl community provide you better solutions. Installation is simple:

    sh> cpan
    cpan> install CPAN::Reporter
    cpan> o conf init test_report
    cpan> o conf commit

Then I started installing Padre :)

    cpan> install Padre

It takes some time, so in another console I was looking at breaks in my perl. First of all subversion-perlbings was broken and svk didn't work. So it was easy to fix by reinstalling it using "port -f upgrade subversion-perlbindings" command. Upgraded in the same way all packages matching p5-*.

Installation of Padre failed, but it doesn't mean anything. I deleted lots of files. For example Algorithm::C3 was deleted when Class::MOP is not. It's all easy to fix. Just install modules when some tests die with "module is missing" error.

At the end I had problems with File::HomeDir. It's something that affects loading Padre. Reported a bug report and decided to stop at this point.

Some conclusions. Macports are good, but not that good. For example gentoo has perl-cleaner utility that helps fix things. revdep-rebuild is another gentoo's tool that help a lot during upgrades. At the end switching from perl without threads to version with threads support is a lot of reinstallations. I'm fine with that, but don't think a lot of people are too. I don't think that building everything from scratch for Padre is going to help its acceptance. I see more benefit from helping MacPorts and other distributions solve problems switching from not-threaded perl to threaded and back. File::HomeDir needs more love. Otherwise I had no problems, but the app is not functioning at this moment. Going to try a little some day later.