Tuesday, June 22, 2010

How to set up a flexible, efficient dev environment for any platform

If you're like me, you've probably tried to figure out the best possible way to use a mac (or PC) for editing your code, and then run the code on a platform on linux (most likely LAMP).

The default solution is to have an SVN checkout on your mac/windows machine. In order to test your code, you would have to commit it to svn, go over to the linux setup, do an svn up, and then finally be able to refresh the page to see the changes.

I found that this mechanism takes way too long. The code/test cycle can be very painfully slow

Here's a solution I figured out. Perhaps it might help you out:

1. get VirtualBox. It is free and easy to use.
2. load it up with your favorite flavor of linux ( I prefer Debian or Ubuntu) to run your platform on.
3. hint: make an image out of it and share the image amongst your other devs.
4. run the linux image as a guest machine on top of virtualbox
5. make sure your mac/pc can connect to the guest machine
6. Install samba on your guest machine and expose your code's root directory via samba. on windows, be careful with this. on windows, you have to use the exact same username/password on linux/samba as your windows user and as your linux user.
7. create a samba mount from your mac/windows that points directly to your linux guest machine
8. now you can edit files from the samba mount using your favorite IDE, save, and then refresh the page to test.

I found this to be a hugely efficient system once it's set up. there are a few snags you might run into while setting it up. But once done, it's well worth it.

If you run a large dev team, it might be worth it to run a vm server that knows how to link up everybody's VMs and ensure that they have the same configs/etc

ZendStudio 7.2 + Other Java Software on Mac OSX - Crashes on start

For a little while I didn't upgrade from ZendStudio 5.5 to 7.2 because of a silly mac bug that caused 7.2 to throw an exception whenever you start it.

I headbanged for a little while until I finally figured out that the issue is a simple problem with mac osx's symbolic linking system for managing java versions.

Here is the problem. Below is a list of file in the java framework directory - at /System/Library/Frameworks/JavaVM.framework/

drwxr-xr-x 15 root wheel 510 Jun 22 20:21 Versions
lrwxr-xr-x 1 root wheel 26 Jun 22 10:11 Resources -> Versions/Current/Resources
lrwxr-xr-x 1 root wheel 29 Jun 22 10:11 Libraries -> Versions/CurrentJDK/Libraries
lrwxr-xr-x 1 root wheel 23 Jun 22 10:11 JavaVM -> Versions/Current/JavaVM
lrwxr-xr-x 1 root wheel 24 Jun 22 10:11 Home -> Versions/CurrentJDK/Home
lrwxr-xr-x 1 root wheel 24 Jun 22 10:11 Headers -> Versions/Current/Headers
lrwxr-xr-x 1 root wheel 27 Jun 22 10:11 Frameworks -> Versions/Current/Frameworks
lrwxr-xr-x 1 root wheel 28 Jun 22 10:11 Commands -> Versions/CurrentJDK/Commands
lrwxr-xr-x 1 root wheel 24 Jun 22 10:11 CodeResources -> Versions/A/CodeResources
lrwxr-xr-x 1 root wheel 27 Jun 22 10:11 Classes -> Versions/CurrentJDK/Classes


problem is, macosx doesn't end up creating a sym link for Versions/CurrentJDK.

To fix the problem, all you have to do is symlink Versions/CurrentJDK to Versions/A .

Your problem might not be exactly this. It might be a variation of it. Feel free to leave a comment if this helps or if you find another variation of this problem