CloudStack development environment has gone through quite a bit of changes lately.  For people who are developing on CloudStack, these changes have caused quite a bit of confusion.  I'm documenting these problems here and the solutions to each.

Dealing with Windows and Cygwin

  • Don't use spaces in Windows.  Windows and cygwin just don't play well with paths with spaces in them.  I even create a top directory called bin and put all of my java, eclipse, cygwin, maven, mysql and other directories in it.  Just so I don't have to deal with the spaces issue.  You have to be diligent because JDK and other installations want to install in Program Files or Program Files (x86), just change the path to bin.
  • Make use of the mklink feature in Windows.  Windows comes with a little known utility to make symbolic links.  Here are the type of things I do with this utility.
    • Create a current link to all the software that have version updates and have environment variables.  For example, for JAVA_HOME, my environment variable is JAVA_HOME=c:\bin\Java\current and current is a symbolic link to the JDK version I installed.  This way, I don't have to change the environment variable each time I update JDK.  I just change the symbolic link.  You can also leave the old version there in case of problems and revert easily.
    • I create a link to genisoimage.exe called mkisofs in the cygwin bin directory.  Now you don't have to download the mkisofs file.
    • I create a link to python2.7 called python in the cygwin bin directory.  Now you don't have to download a separate version of python.
  • Add the following to your /etc/fstab: "/cyg cygdrive binary,noacl,posix=0,user 0 0".  This line does two things.  Instead of /cygdrive/c to change to a different drive, you type /cyg/c which is much shorter.  It also removes the posix acl semantics which causes problems with the build because the build tries to manipulate file permissions and causes big problems with the Windows file system.
  • Download systeminternals tools from Microsoft.  It comes with a little handy utility called handle which tells you which process owns a handle to your file.  With Java and Cygwin, it's sometimes difficult to know who still owns a handle to a file.  Unlike Unix, Windows doesn't let you delete a file when a handle is still open on it.  With this utility, you can figure out the process and kill the process.
  • No labels