Wikipedia says,
“BuildBot is a software development continuous integration tool which automates the compile/test cycle required to validate changes to the project code base. It began as a light-weight alternative to the Mozilla project’s Tinderbox, and is now used at Mozilla.”
At work I recently started using buildbot for various projects. My experiences with Python is scarce, let alone with buildbot. I didn’t even know how exactly buildbot works until a week ago and I am figuring out as I go along. So in the interest of keeping notes, I decided to do blog entries on how to use buildbot on Snow Leopard.
If you are still on Leopard, unless you have a special attachment to XCode 3.1.x, it’s time to move on.
FYI, lines that start with “%” sign are meant to be executed in Terminal. You ask what a Terminal is? Well, it is essential that you already have some experiences with Terminal i.e. UNIX shells. If you are not sure what that means, you are reading a wrong article. Sorry, but I can’t please everyone in the world.
—–
Prelude:
Buildbot is a Python application. As such, the choice of Python installation is important. On Snow Leopard, we have a few options:
- Python 2.6.1 installation (default)
- Python 2.5.4 installation
- MacPorts version of 2.6.x (latest preferred)
- Build from source
Choices
- There is also Fink version of Python, should you choose to install one. I omitted it from the list since 1) I had negative experiences with it and 2) well, I haven’t tested it in a year, so I can’t stand behind it.
- Unfortunately, #1 is out of the question, because 2.6.1 has some fundamental deprecated code issues that blocks you from using buildbot. I am sure you can patch it up and hack it up to make it work, but you will risk everything else that depends on Python. At the time of writing, Python 2.6 branch is on 2.6.4. 2.6.1 is over 1.5 yrs old.
- #4 is recommended if you have a vested interest in keeping up with the latest installation of Python for reasons other than buildbot. If all you are doing is buildbot, then this is unnecessary.
- #3 is perhaps the most preferred of all IF you depend on MacPorts in any way.
For reasons I won’t discuss here, I had to use a built-in Python installation on the OS. That pretty much left me with Python 2.5.4, since 2.6.1 won’t work.
We are also lucky to have a fully functional installation of twisted on Snow Leopard and this is a great news. Buildbot relies heavily on twisted, so it’s important that you have a reasonably up to date version.
Installation
- Switch default version of Python to 2.5 (via symlinking technique)
- % cd /usr/bin
- % sudo mv python python_original
- % sudo ln -s python2.5 python
- Install buildbot
- % sudo easy_install-2.5 buildbot
- At the time of writing, we are using Buildbot 0.7.12
- you could also symlink easy_install to point to easy_install-2.5, but this is not as critical in my experiences
- easy_install-2.5 will install buildbot here /Library/Python/2.5/site-packages/
- .egg is a package management solution, much like Package Receipts
Test
Test to make sure buildbot works by following the instructions below
- % buildbot –version
- assertion = buildbot version and twisted versions should appear
- Try and start buildbot master
- % cd ~/; buildbot create-master buildbot-test
- % cd buildbot-test
- % mv master.cfg.sample master.cfg
- % buildbot start
- This should spit out lines of logs. The last line should read: The buildmaster appears to have (re)started correctly.
- If you didn’t see the successful execution, something went wrong. Fortunately, these log outputs are helpful and you should be able to find out why buildbot failed to launch.
- % buildbot stop
That’s it! In my next blog entry (which I will hopefully get to soon), I will introduce buiddbot in a more depth.