Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

(OT) Fixing OSX's biggest weakness as a dev platform

by dragonchild (Archbishop)
on Apr 09, 2008 at 19:49 UTC ( [id://679342]=perlmeditation: print w/replies, xml ) Need Help??

OSX is great. I get the best GUI readily available on top of BSD. With a few issues (I'm looking at you, mod_fastcgi!), everything compiles just fine. And, the coolest part is that I can do webapp demos right on my MacBook cause Firefox, Apache, and MySQL all run just fine. And, judging from what people are using at YAPC, a lot of Perlers seem to agree with me.

But, there's one major issue that plagues the *nix developer - the stupid case-insensitive filesystem. Oh, it displays everything correctly; it is case-preserving. But, Foo.txt and foo.txt just won't co-exist. There is hope, though. Starting in 10.3 (Jaguar), OSX did release a case-sensitive version of HFS+. It's not enabled by default, and for good reason - lots of OSX applications will keel over or do "Bad Things"(tm) in a case-sensitive environment. Whether or not you win the moral victory cause the developers were stupid, the app still doesn't work.

So, the solution would appear to partition the hard-drive into a bootable case-insensitive partition and have a case-sensitive one for development work. Which is what I did today and I'm here to say that it works pretty good. I use SuperDuper to make a bootable backup on an external HD and booted off of it. That allowed me to partition my main disk. I then restored the backup, booted from the main disk, and put SVK and my personal build of Perl over there. A dev@->/Volumes/Dev in my homedir and we're ready to go.


My criteria for good software:
  1. Does it work?
  2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?
  • Comment on (OT) Fixing OSX's biggest weakness as a dev platform

Replies are listed 'Best First'.
Re: (OT) Fixing OSX's biggest weakness as a dev platform
by sundialsvc4 (Abbot) on Apr 09, 2008 at 21:00 UTC

    If it were me, I would simply choose a different name.

    OS/X after-all is not the only well-known operating system out there with a case-preserving but case-insensitive file system! So, if you find yourself in any situation that could be adversely affected by name-clashes of this sort, in the long run you're going to have to resolve that problem ... not by “redefining the file system” (especially not when that will undoubtedly break everything-else in that world), but by changing the nature of your application.

    Perl obviously doesn't require a case-sensitive filesystem. It operates quite happily in either situation and contains a plethora of good CPAN modules for dealing with such OS-dependent issues.

    Apps simply cannot waltz in and sing, “change your world for me-e-e-e...” Nor can a developer claim sufficiency just because “it works on my box.” The app needs to use CPAN-modules (and built-in File modules) that know how to “behave appropriately.” By delegating the action to an external package that, for all you know (but do not care) might well be environment-dependent, the application becomes environment-independent.

Re: (OT) Fixing OSX's biggest weakness as a dev platform
by jasonk (Parson) on Apr 11, 2008 at 00:40 UTC

    The way I do it is to create a disk image that contains a case-sensitive, journaled, HFS+ filesystem. Then I mount that as /usr/local, and install all my development stuff in /usr/local (which is where it will get deployed when it goes into production).

    This also lets me switch between versions of the development platform or event between projects, by just mounting a different disk image on /usr/local.


    We're not surrounded, we're in a target-rich environment!
      Huh. I didn't think about disk images. That's a pretty neat solution and probably better than mine.

      This does beg the question - why doesn't OSX put all the bootable requirements on disk and put everything else inside a dmg?


      My criteria for good software:
      1. Does it work?
      2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?

        Disk images are great, but there are two reasons OSX doesn't "put everything else inside a DMG":

        1. Performance: you're adding a layer of indirection, since the dmg is a file on the "real" filesystem, reading or writing a file to it requires altering a file on another file system. This is not very fast; and while it may be "fast enough" for some things, it won't be for others.
        2. Reliability: if a disk gets a bad sector, the worst case scenario is that the data on that sector is lost. If a DMG file gets corrupted, that whole "disk" is damaged, often beyond repair.

        In short, using disk images for development tasks is smart (you're keeping stuff in source control, and backups of that anyhow, right? Right?! :D), there's a lot of things it wouldn't be smart for.

        <radiant.matrix>
        Ramblings and references
        The Code that can be seen is not the true Code
        I haven't found a problem yet that can't be solved by a well-placed trebuchet
Re: (OT) Fixing OSX's biggest weakness as a dev platform
by Anonymous Monk on Apr 10, 2008 at 02:46 UTC
    Win32 developers can live with such, why not you?

      Because OS X is of Unix kin, and should behave like all Unixen do. Windows on the other hand, is from CP/M kin and may well behave in all sort of ways without anybody even noticing, as long as 8.3 uppercase works :) From Dilbert:

      Unix Bearded guy: Kid, here's 50 cents, go get yourself a PC.

        The objection, nonetheless, can be sustained. Not every Unix filesystem is case-insensitive; Perl certainly doesn't care. If, when faced with an established system that “does not do as you prefer,” you fundamentally redefine that such a system in such a way that will break thousands of core applications for that system ... that's just a little too much hubris.

        The OS X is not just a Unix kin. It's also a Macintosh ... or at least it was meant to be a Macintosh from the outside with BSD under the hood. And Macs used to be case insensitive as far as I remember. And I bet you'd surprise the heck out of the Mac oldtimers if you suddenly switched to a case sensitive filesystem.

Re: (OT) Fixing OSX's biggest weakness as a dev platform
by rudder (Scribe) on Apr 13, 2008 at 20:37 UTC

    I disagree that the case-preserving fs is OS X's biggest weakness as a dev platform. I think its biggest weakness is that its library system is so convoluted and different from every other *nix platform. OS X has dylibs, Mach-O bundles, "frameworks" (doesn't mean what you think it means), along with the usual .a files and also a slightly different naming convention for libs. The whole thing is an ugly mess and is difficult to understand.

Re: (OT) Fixing OSX's biggest weakness as a dev platform
by Anonymous Monk on Apr 12, 2008 at 18:28 UTC

    Are you sure case-sensitivity would actually break anything?

    I use the case-sensitive variant of HFS+ for everything on my mac, and haven't found any problems.

    (Of course, I'm sure there are lots of apps I've never tried.)

Re: (OT) Fixing OSX's biggest weakness as a dev platform
by sundialsvc4 (Abbot) on Apr 14, 2008 at 19:46 UTC

    I am simply of the opinion that you cannot change the leopard's spots. If the fundamental nature of a particular system is (say...) that “it uses a case-insensitive filesystem,” you cannot buck this tide. You can align yourself against it for a time, say with some sort of mountable-file-system nonsense, but you can never change it ... and you can never launch “a successful application” if you try. If your application has any such of a core-requirement... you must change the application. Nothing else will do. “Resistance is futile...”

Re: (OT) Fixing OSX's biggest weakness as a dev platform
by aufflick (Deacon) on Apr 16, 2008 at 01:29 UTC
    You're all mad - choose the case-sensitive version of HFS+ when you install. Backup and re-install if you didn't do that.

    You will occasionally hit problems with commercial apps not liking the case-sensitive file system, most notable Photoshop, but you can usually work around that (for instance there is a script that correctly renames all the files in Photoshop.app to work on a case-sensitive file system).

    OSX is a very good unix - better than some with eg. its two-level name space for dynamically loaded libraries. If you want to use it as a unix environment I think it's a must to use the case-sensitive fs.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlmeditation [id://679342]
Approved by kyle
Front-paged by Erez
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (3)
As of 2025-03-26 07:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When you first encountered Perl, which feature amazed you the most?










    Results (67 votes). Check out past polls.

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.