Eyes Above The Waves

Robert O'Callahan. Christian. Repatriate Kiwi. Hacker.

Sunday 14 January 2007

Babes In Toyland

I have a new Macbook Pro courtesy of the Mozilla Corporation. Somehow I've never grown out of the thrill of unpacking a shiny new machine, celebrating it as "the best yet!" (mostly thanks to Moore's Law), and then setting it up "just right".

Last time I bought a Mac, one of the first things I saw after turning it on was an Apple nag dialog asking me to pay $60 or so to upgrade to Quicktime Pro. Having just shelled out thousands of dollars for the "superior Apple experience", that dialog was most aggrieving. Fortunately that hasn't happened this time. Has Apple figured out what a turn-off that was?

I requested a Macbook mainly because via virtualization I will be able to run Mac, Windows and Linux all in the same machine. That will be very very useful. For too long I'm stumbled along doing all my work in Linux (and before that, all in Windows) and having to beg for help whenever I encounter bugs on other platforms. That was lame, and it's over.

In fact, I've already installed OpenSUSE 10.2 under Parallels. Parallels doesn't have good Linux guest integration so I'm stuck with crappy manual transfer of mouse control from Linux to MacOS. And there's something slightly weird going on with networking; almost everything works, except openssh can't resolve any DNS addresses properly. I wonder what openssh does differently from apps like Firefox. But otherwise it seems to work well, and fast, so I think this is going to be a winner.

One problem with virtualization is communication between the VMs. It's going to be annoying to copy patches or trees around between them. However I've managed to set up file sharing (CIFS shares actually) so that Linux can mount my Mac homedir directly. It would be interesting to try keeping all my trees in the Mac file system and building from them directly in Linux, putting the results in an objdir in the Linux file system. I suspect that the bazillion stat() calls performed by 'make' will be dog-slow over CIFS, making this untenable, but it'd be cool if it wasn't too bad. Then I could edit all my files in native Mac apps and just use Linux and Windows to build and test. And I also wouldn't have to juggle as many trees. I'll give it a go.

Update I "fixed" my openssh address resolution problem by setting "AddressFamily inet" in my ssh_config. I guess the problem was related to IPv6.


What about "publishing" the build tree in a file that contains a filesystem, and then "mounting" it as a (read-only?) hard-disk in Parallels (if parallels can do that)?
Robert B
Have you looked at Apple's developer tools CD? I'm just curious as to what you thought of them.
William Swanson
Isn't the keyboard a problem? I still can't get used to the position of the Ctrl/Alt/Command keys when I run other OS's on my MacBook Pro.
Smokey Ardisson
That QuickTime Pro nag dialogue annoys everyone, and it's a shame Apple hasn't given up on it. I imagine you'll encounter it when you first launch QuickTime Player :(
One thing to keep in mind: if you're going to have a local mirror of the Mozilla cvs repository on your Mac (like bz does), the default filesystem is case-insensitive (but case preserving), and this was problematic when checking out from the local repo. "HFSX" (HFS Extended Case-Sensitive) is a supported filesystem, but you either have to reformat the disk or a partition, or use a disk image (which seemed to cause some sleep problems for bz).
I had a problem with OpenSSH on Linux not too long where it segfaulted when trying to do a DNS lookup. It turned out that it was using the wrong OpenSSL library version. More details that you probably don't find too interesting are in this thread:
Robert O'Callahan
Diego: I'm not sure what you mean but the idea is to edit files on the Mac and have them show up immediately in Windows and Linux, so that probably won't work.
Robert: I haven't really used the XCode environment.
William: I'll probably be able to adjust :-)
Smokey: That's good to know. I could keep the mirror in Linux, or I might just put it on a Linux machine in the office.
Dave Miller
Your update reminds me... you can get huge performance improvements in Mac OS X by completely disabling IPv6 in the Network panel if you don't actually have IPv6 connectivity. Seems Mac OS X gives IPv6 higher priority, and will always try that first before falling back on IPv4 if it's available, so if you don't have IPv6, there's a 4 to 6 second delay on every DNS lookup while it tries IPv6 first. Click the "Configure IPv6..." button, then change the popup menu to Off.
Actually, the sleep issue was just a hardware problem. After replacing the sleep switch and magnet it's all good.
The command I used to create the repository disk image is:
hdiutil create -size 4g -fs "Case-sensitive HFS+" -stretch 4g -volname "Mozilla CVS Repository" -type UDIF ~/cvs-mirror.dmg
and then dragged that disk image into my startup items list in system config and symlinked /cvsroot to /Volumes/Mozilla CVS Repository
Looking at the hdiutil manpage now, however, it looks like they changed the options around; you may want -fs HSFX.
Oh, one more thing. Linking's been pretty painful here (with 2GB of RAM). A lot slower than the P4-3.6 desktop I use as my main devel machine... Apple's ld may need some love. :(
Just forget about QuickTime (which doesn't even have fullscreen in the free version), and use NicePlayer ( http://niceplayer.sourceforge.net/ ) instead. Uses the QuickTime API (or Xine via a plugin), and is really nice to use.
Robert Loomans
You might want to try NFS rather than CIFS....
Robert O'Callahan
But will NFS work as well as CIFS for the Windows VM?
Robert Loomans
Nothing is stopping you running both for the given directories... then you can use whatever performs better for Linux (NFS, I expect) and CIFS for Windows.
I switched from a ThinkPad (which I actually liked better hardware-wise) to a MacBook Pro in August for the same reason.
I actually live in my 1GB RAM/40GB HD Linux VM, switching over to my Windows VM and Mac host only when I want to compile and test certain changes (or for the occasional platform-specific app).
I keep separate trees in each OS at the moment. I guess I could use a shared folder between Mac and Windows, but it seems like more trouble than it's worth. Hmm, but I just saw your followup post on the performance cost of building in Linux from files served over CIFS from the Mac. Maybe I'll try that.