How to Set Up a Build Slave for Phoenix
ProjectPhoenix is using the very handy Buildbot tool for a "continuous integration" system. This basically means that every time new or updated code is committed to the wxWidgets or Phoenix source repositories the buildbot will trigger a new build of wxWidgets and Phoenix on all of the attached build slaves using that new code. This helps to ensure that a committed change will not cause a build problem on any of the other platforms that the developer may not have tested yet. We also have build slaves set up to make and publish a binary snapshot of Phoenix for Mac and Windows once per day. The documentation is built daily on another build slave.
Although we now have good basic coverage of the platforms and versions with our current build slaves, it will always be helpful to have others that test new combinations of OS, compiler, Python version, etc. If you have a computer that is generally idle, or one that can run a virtual machine in the background, and that has the necessary prerequisites, then you too can help out with this system. This page describes those prerequisites and what you need to do to set up a new build slave for ProjectPhoenix.
Prerequisites for Windows
- Cygwin with all the basic packages installed, such as bash, bzip2, diffutils, dos2unix, findutils, gzip, sed, tar, unzip, zip, wget, which, etc.
- Microsoft Visual Studio 2008 installed and set up. Be sure that the compiler is accessible from the cygwin shell by running
- Subversion command line tools. I use the DOS (not Cygwin) version of svn, but I'm not sure it's necessary in this case.
- A Windows (not Cygwin) build of Python. Full Cygwin support will come later.
Install the virtualenv and pip Python packages for your Python.
Prerequisites for Other Platforms
- The default compiler for your platform.
- Subversion command line tools.
- Python, including the python-devel packages if they are distributed separately on your platform. For the Mac using the latest 2.7.x from python.org is the best choice currently.
Install the virtualenv and pip Python packages.
- On Windows use a Cygwin Bash Shell for running these commands. On the other platforms use whatever is the normal terminal window.
- Create a new virtualenv that will be used for running the build slave. Run this command in the folder where you would like the build slave to live and do its work. (You can use whatever name you like for the new virtual environment.)
virtualenv --distribute --unzip-setuptools --no-site-packages VE_NAME
- Activate the virtual environment.
source VE_NAME/bin/activate # or "source VE_NAME/Scripts/activate" on Windows
- Install the buildbot_slave and dependent packages.
pip install buildbot_slave
On windows you will also need to download the PyWin32 installer and install it in your virtual environment, something like this:
- Now you'll want to create the build slave itself. The NAME should be something that indicates the platform or wx port being built, followed by a hyphen and the version of Python being used. For example, "win64-py27". We can add more info into the name to indicate different build options if needed.
buildslave create-slave NAME buildbot.wxpython.org NAME PASSWORD
Coordinate with Robin to set up the needed configuration on the build master, and to give you the password to be used. On Windows you should execute buildslave.bat
Edit the files in NAME/info and specify your name and email address in admin and a short description of the buildslave in host.
- At this point it would probably be a good idea to test that your computer and the buildbot environment has all the things it will need to do a build. With the virtual environment still activated running the following commands should tell you a lot:
mkdir testbuild cd testbuild svn co http://svn.wxwidgets.org/svn/wx/wxWidgets/trunk wxWidgets svn co http://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk Phoenix cd Phoenix python build.py dox etg --nodoc sip buildIf that builds successfully then your buildbot slave is ready to be used and you can remove the testbuild folder. If you will be running a slave that will also be used for making binary distributions or the documentation then a little more setup will be needed, coordinate with Robin for what else needs to be done.
- Finally, it is time to start the build slave. You'll also want to execute this command when restarting the build slave after a reboot or whatever. (Be sure to activate the virtual environment first.)
buildslave start NAME # Or buildslave.bat on Windows