Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

As a developer (primarily JVM-based web apps), I need to use a lot of different tools and services, such as Redis, RabbitMQ, MySQL, git, mercurial, etc. Having worked in a Linux environment where such tools are just an apt-get away, and a Windows world where I just run what I need in a VMWare Workstation VM (aka. also just an apt-get away + vm overhead), I'm a bit lost now that I'm hoping to move away from Windows and into the Mac ecosystem for my computing life.

I've read about MacPorts vs. Fink vs. Homebrew and found it all to be a bit confusing as to which one will suit my needs the best, though I think MacPorts is the most flexible option of the three.

Since I'm used to running what I need in a VM, however, is there anything against doing that when using OS X? What are the tradeoffs between going with MacPorts to install things directly vs. using an Ubuntu VM (via VMWare Fusion) to host the tools / services I need?

In particular, I am concerned with the disk usage, maintainability, and ease of use more than I am concerned with performance. In other words, this is what I care about (in order of preference):

  1. Ease of use - How easy is it to develop on the Mac and use the tools / services
  2. Disk usage - How much disk-space is taken up. The newer macbooks use SSDs and space is at a premium.
  3. Maintainability - What work is involved in keeping packages updated, adding new packages, and removing old ones
  4. Currentness - How up-to-date are the tools / services that are available
  5. Performance - How fast things run, services in particular

My instinct says that installing the actual development tools, like Mercurial, git, etc. directly via the projects' recommended method, and then installing the server-side components like MySQL, Redis, RabbitMQ, etc. into a VM is the best route, but what are the pros-cons of doing this vs. going with something like MacPorts?

Note: I realize that this is a rather programming-centric question, but the central issue is that OS X is different from Windows and *nix when it comes to setting up a development environment and I'm not sure how to navigate in these OS X-specific waters.

share|improve this question
add comment

2 Answers

I've used both approaches in different circumstances. While MacPorts is a good way to get latest versions of various GNU tools (for instance Bash 4.x, when Apple still provides 3.x) it does tend to get bungled with time, I wouldn't rely on it exclusively.

However, most open-source stacks provide easy to use binary installers for Mac. I have good experience with distributions of Git, PostgreSQL and Apache. I have good experience using them for web-based development. Python scripts generally run unmodified - I've developed a web application in Python + PostgreSQL on my Macbook and simply ran it unmodified on the Linux production machine. Same for various scripts at work which wrap ssh credentials management inside Python classes etc. - Ssh is sufficiently uniform.

I do need to run Ubuntu VMs for some purposes. I mostly do that on VMWare servers because my work Macbook Air is poorly suited for large compilations and data transfers. However I've been able to export them from VMWare as OVF and import them to VirtualBox on the Mac. An Ubuntu VM without an X server running on Mac can be very lightweight with less than 10GB disk space and 1GB RAM. My solution for I/O intensive workloads is to create a separate partition on the Mac (completely hassle-free, no reboot required) and assign it to the Ubunbu VM as raw disk, then partition it using Linux fdisk and mount the partitions as necessary.

Some tool recommendations for Mac:

  • SourceTree as a Git GUI.
  • iTerm2 as a terminal emulator
  • Textwrangler as a small and slick text editor that is readily invoked from the command line.
  • Xquarz, the X server for Mac, is no longer bundled with OS/X 10.8, simply install it separately.
share|improve this answer
add comment

Ultimately this is a fairly personal question, that will depend a lot on your workflow and preferences, but I'll add what I can.

My instinct is in line with yours—install the tools you need for writing your code natively, and use a VM for your server-side environment. My reasoning on this is that you (presumably) bought a Mac to use it, and doing most of your development work in a Linux VM seems like a bit of a waste. Use the native tools so that you can use them with whatever other OS X software you may want.

Similarly, while you could probably do a decent job of mimicking your deployment environment in OS X, using a VM is the best way to guarantee exact compatibility (it also makes it easier to manage different versions of your various programs, if you need to work with a production environment and a future server upgrade, etc.).

Ease of Use

I think the OS X tools + testing VM approach wins, as having all your development tools accessible without the need for a VM is the most frictionless, and the testing VM can act independently. OS X is BSD at the core, and as such there's great integration with the command line, particularly in developer-type tools like text editors.

Disk Space

VMs will obviously take up more room than just installing the tools natively, but Ubuntu seems to be able to run in a pretty small footprint (the CLI-only install on my home server runs around 3-4 GB I think, and that could probably be pared down if I tried). So unless you're really cramped for space, I wouldn't worry too much unless you need many different VMs.

Maintainability

I think you'll definitely want to go with a package manager, whether it's MacPorts or one of the other options. I'm not experienced with any of them, but I know MacPorts (and probably Homebrew and the others) have one line update commands, similar to apt.

Currentness

This depends a lot on how you choose to install your software, and what software you're using. Apple tends not to update the CLI tools it bundles very often (often only with major OS releases), so if you rely on a particular version of something that's otherwise built in, you may want to install a newer version (which you should do by installing to a new location, not overwriting the system version). My best advice here is to do some Googling and figure out how current the packages that are important to you are in each package manager.

Performance

VM performance on any recent Mac should be pretty good, but it obviously depends on how intensive the tasks running on the guest OS are. Unless your server side component is pretty heavy (and I don't see why it would be under a development testing load), you should see pretty good performance, particularly if your VM doesn't run a GUI.

Anyway, that's my take, perhaps others can chime in with more specific opinions on Macports vs. other options, or other takes on VM vs. native.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.