Perl and Apache Upgrades for Intel Mac (Pain)

| | Comments (2)

I have been using a MacBook Pro for several months, and I finally got around to upgrading Perl on it. I figured 5.10's release, and Christmas vacation, was a decent opportunity.

I ran into a lot of problems.

  • First, note that my existing Perl/Apache installs were PPC. And this is an Intel Mac. And because some systems are not very careful about what they use to do things, I had to make sure I basically hid all the PPC things in my path. For example, a PPC perl in my path was used for part of the mod_perl build process, even though I used an Intel perl for the Makefile.PL, which caused some symbols to go missing.

  • Similarly, the Apache config kept picking up a random library I had in /usr/local/lib, and throwing errors. So I finally figured I should just move all of /usr/local/bin and /usr/local/lib out of the way until I got everything built. I selectively brought things back later.

  • But this was not my only problem with Apache. Oh, no. Apparently mod_perl 1.30 and perl 5.10 simply do not get along. I kept getting errors about bad file descriptors every time I tried to start Apache. I finally found discussion from p5p about it, from a few weeks ago, and used Andreas Koenig's patch for mod_perl, taken from Steve Hay's fix slated for mod_perl 1.31. This fixed the problem, apparently.

  • However, apparently this patch only works for fixing non-threaded perl. So I then had to rebuild perl to be non-threaded. I had wanted to keep my perl config as close to the default Mac OS X build as possible, for binary compatiblity reasons, but it's not that important, I suppose, since 5.8 and 5.10 are not binary compatible anyway, and Mac OS X 10.6 (the first likely to use 5.10.x) won't be out for a long time. So, I don't need threads, and therefore, non-threaded it is.

  • And then there was libapreq. I don't know how to properly solve this problem, but I kept getting errors about my_perl being undeclared in two functions, hooks for uploading files. As I don't use that functionality, I simply commented out the body of the functions. It was getting late.

  • Most of the other modules were pretty smooth though. DBD::mysql kept looking for the mysql libraries in /usr/local/mysql/lib/mysql instead of /usr/local/mysql/lib. I couldn't see an obvious reason why, so I just added a symlink. Shrug.

  • Also, Mac::Carbon had some errors in the tests. Those should be fixed, but I have a lot of other fixes to make before uploading a new version. More on that some other time. The broken test was for Mac::AppleEvents, and I even have a comment in there about how the tests were very likely to be broken. I was right!

  • Mac::Glue posed a problem: the glue files are not byte-order independent. Maybe they should be, but that won't help me now. So I needed to rebuild all my glue files, which isn't a big deal.

  • Also not byte-order independent: the "friends" field in the Slash database. Like the glue files, it uses Storable. I know there are ways to make it work, but I did not use those ways previously, so now I am stuck. For Slash, I just wrapped the thaw() call in an eval for now, but I'll pull that later, after I call the rebuild task.

  • Speaking of modules, what got all this started was that I was trying to build XML::LibXML for my MacBook Pro so I could use XML::Atom to make posts from BBEdit to <pudge/*>. But building a PPC binary for an Intel machine ON an Intel machine turned out to be just too much for me. So I figured it was time to just start over.

  • The CPAN autobundle worked pretty well, although after installing Bundle::CPAN and Bundle::Slash, I then took my autobundle and wrote a quick script around it to basically call perl -M$module -e1 and note any errors, and that way I could skip most of the bundle, since I am still using the pure perl version of many modules, that I already had installed, and I don't necessarily want to install every upgrade to every module, since some of them can break (cf. XML::RSS). Then I scanned the uninstalled/broken module results and installed any I wanted by hand.

  • I make note here that Data::JavaScript::Anon is "still broken." Version 0.9 is broken, version 1.00 works, but CPAN still gives me version 0.9 unless I ask for 1.00 specifically, and so when I installed Bundle::Slash, I got the wrong one. But that has nothing to do with this, it's just Something Else.

Bottom line is that now I have Slash running on my Intel Mac with native Apache 1.39, mod_perl 1.30 (with patch), and perl 5.10 (without threads), and the only brokenness -- that I know of -- that remains is missing functionality in Apache::Request that I don't use, and lack of thread-capable perl for mod_perl.

It was a long day making all that work, too. Dang it was long. Lots of futzing around. But I also now apparently have almost no more PPC apps running on a regular basis on my Mac: just Eudora. Which sucks. But not as much as every other mail app. I dunno, maybe I should give Thunderbird another go. I hate that it is not a native Mac UI, but it's not like Eudora has a great UI either. Maybe I'll try again.


lottadot Author Profile Page said:

Funny, I was doing similar but not w/5.10. Now you are tempting me to try it :) (I got a new 17" MBP from work).

When I first went to an Intel Mac, I ran into a lot of the same things, coming from the PPC. I ended up doing a bare install and wiping the thing's Perl w/ stock. Basically, just starting over.

If you kept any notes/scripts/configration-files from building all this, please post 'em. (ie did it take anything special to build Apache and mod_perl together on Darwin? I think in times past I restorted to a custom config file in order to keep everything in /usr/local/apache).

I didn't know about the byteorder problem in Slash::Zoo. That never crossed my mind. The Data::JavaScript::Anon's been a pain for a while now.

And this auto bundle's got my curiosity. I've never heard of it. Can you post that script? This sounds useful, time to read the docs I suppose.

What do do you think of MT? It caught my eye that you're not using Slash::Journal, or Slash, at all, for this part of your site. Any particular reason why? I've had MT downloaded for quite some time now, but hadn't ever got around to setting it up to mess around with it.

So will all the journal-postings on use.perl etc be comment-disabled such that the only place we'll be posting comments to your articles is on the new glob?

Jason A. Crome said:

What options do you use for building Perl in order to come closest to how it ships with OS X? I'm not sure it will matter for what I'm doing, but when in Rome....


Leave a comment

<pudge/*> (pronounced "PudgeGlob") is thousands of posts over many years by Pudge.

"It is the common fate of the indolent to see their rights become a prey to the active. The condition upon which God hath given liberty to man is eternal vigilance; which condition if he break, servitude is at once the consequence of his crime and the punishment of his guilt."

About this Entry

This page contains a single entry by pudge published on December 29, 2007 10:31 PM.

Today is The Day ... Until The Next Day was the previous entry in this site.

LCE039 New Year / Schrammie is the next entry in this site.

Find recent content on the main index or look in the archives to find all content.