Here we explain how to run a buildbot on Win32and Cygwin. Note that this was done several years ago (2008), and may no longer be current.
The buildbot code is written in Python, so we need a Python implementation. Ideally, we would use aPython implementation for the buildbot, and a Cygwin one for the Cygwin buildbot.
There is a Cygwin Python. It has some trouble during installation, but it does work for the buildbot.
There is no
cmd.exe to run shell commands; we want it to use bash.
Fortunately, there is a workaround for this (see below); we can use
the Cygwin Python buildbot to run bash scripts.
We assume the tools required to build monotone onare installed; see .
Download the Cygwin installer from http://cygwin.com/, and run it
C:/, not the default
C:/Cygwin. The Cygwin installer says this is not a good idea; ignore that.
The reason we do this is to make Windows file syntax match Cygwin syntax on the C drive. Installing to
C:/means Cygwin mounts
/, so Cygwin paths on the C drive are
It may be possible to make the buildbot work with Cygwin installed at
C:/Cygwin; I have not tried it.
Note thatis not installed at
C:/; that would collide with Cygwin. This means bash scripts run by must use file syntax:
Include the following packages:
cvs and inetutils are required by autoconf, but are not included in the Cygwin installer dependency lists.
We need a working monotone to pull the monotone source from the server. You can use either the Cygwin monotone, or the releasedmonotone. In either case, the buildbot master needs to know where the working monotone is. It can be in PATH for the user that runs the buildbot.
/Apps as the source area; use another path if it suites you.
Download zope.interface-3.3.0.tar.gz from http://zope.org/Products/ZopeInterface/
Download Twisted 2.5 source (not the Win32 installer) from http://twistedmatrix.com/trac/. The file name is Twisted-2.5.0.tar.bz2
cd /Apps tar zxf /Downloads/monotone/zope.interface-3.3.0.tar.gz cd zope.interface-3.3.0/ python ./setup.py install
This tries to compile some C code, but the link fails with the error:
/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../i686-pc-cygwin/bin/ld: cannot find -lpython2.5
Execute the link manually, changing
python ./setup.py install
It has similar link problems, and 'runner' fails entirely, because it needs 'pmap_set', which should be in libc.a, but isn't on Cygwin. Fortunately, we don't need 'runner'.
cd /Apps tar jxf /Downloads/monotone/Twisted-2.5.0.tar.bz2
Edit setup.py, comment out 'runner' from sumoSubprojects
cd /Apps/Twisted-2.5.0/ python ./setup.py install
This encounters similar link problems as above
cd <span class="createlink"><a href="http://wiki.monotone.ca/cgi-bin/ikiwiki.cgi?page=twistedcore&from=BuildBot%2FWindows&do=create" rel="nofollow">?</a>TwistedCore</span>-2.5.0 <link manually> cd .. python ./setup.py install
cd /Apps mkdir buildbot tar zxf /Downloads/monotone/buildbot_0.7.5-1.1+RL20070709-2testing.tar.gz --strip-components=1 cd buildbot python ./setup.py install
If desired for security, create a user account to run the buildbot. The buildbot runs code downloaded from the monotone buildbot server; there is a chance that will be hacked, or that the code is broken, and might do something harmful.
It may also be helpful to have separate user for the buildbot, in order to set PATH properly.
We create local scripts to run the monotone build commands in an Msys shell, because that's the only way to get a PATH that has onlyin it.
Set PATH for the user running buildbot to include Cygwin, but not MinGW. It may include the MinGW monotone, but that's not required.
Ask on the monotone mail list http://lists.nongnu.org/mailman/listinfo/monotone-devel for a bot name and password. In the message, include the path for running the working monotone. If it is in PATH, just say
mtn. Also be sure to say you are running a MinGW buildbot; it needs the buildbot master that uses local scripts to run commands. Richard Levitte handles the buildbot master setup.
Create a directory that will contain the buildbot scripts and the monotone source and build directory. It must be writeable by the user running the buildbot. Here we'll call this
Setup the buildbot:
buildbot create-slave /Gnu/monotone-buildbot-mingw monotone.ca:9001 <NAME> <PASSWORD>
The name and password are provided by Richard Levitte; they are stored in /Gnu/monotone-buildbot-mingw/buildbot.tac
One step in the monotone configure script wants to run the
cccompiler. If that doesn't exist, we get a dialog box reporting an error in python, and the buildbot grinds to a halt. So we copy gcc.exe to cc.exe:
cp /Apps/MinGW/bin/gcc.exe /Apps/MinGW/bin/cc.exe
Create local shell scripts to run MinGW commands from Cygwin Python buildbot. Adjust the paths to match your setup. Note the MinGW syntax in some of the paths.
/MinGW/bin/sh.exe --login -c /c/Gnu/monotone-buildbot-mingw/autoreconf.sh
cd /c/Gnu/monotone-buildbot-mingw/full-i386-win32-mingw/build autoreconf -i
/MinGW/bin/sh.exe --login -c /c/Gnu/monotone-buildbot-mingw/configure.sh
cd /c/Gnu/monotone-buildbot-mingw/full-i386-win32-mingw/build ./configure
/MinGW/bin/sh.exe --login -c /c/Gnu/monotone-buildbot-mingw/make-all.sh
cd /c/Gnu/monotone-buildbot-mingw/full-i386-win32-mingw/build make all
/MinGW/bin/sh.exe --login -c /c/Gnu/monotone-buildbot-mingw/make-check.sh
cd /c/Gnu/monotone-buildbot-mingw/full-i386-win32-mingw/build make check
/Gnu/monotone-buildbot-mingw/info/admin. Put in your name and email address.
/Gnu/monotone-buildbot-mingw/info/host. Put in a description of your machine; for example "Monotone Mingw32".
If you have a firewall, allow outgoing ports 9000, 9001, 9010. 9000 is the buildbot master, 9001 is the buildbot master web page, 9010 is the buildbot master testing web page.
Run the buildbot:
buildbot start /Gnu/monotone-buildbot-mingw/
The first time it runs, it does some more setup. It logs everything to /Gnu/monotone-buildbot-mingw/twistd.log
A Cygwin buildbot uses the same Twisted installation as a MinGW buildbot.
Because Cygwin is very similar to Unix, we can use the standard buildbot master scripts; no need for local scripts.
There is one installation step required: Cygwin puts the boost library headers in
/usr/include/boost-<version>/boost , and monotone configure doesn't find them there. So we fix that:
Add a symbolic link to the boost library headers:
ln --symbolic /usr/include/boost-1_33_1/boost /usr/include/boost
There are several ways to run a buildslave. If the Windows box is a dedicated buildbot machine, the simplest is to just run it from a Cygwin bash shell each time you reboot the box:
buildbot start /Gnu/monotone-buildbot-mingw/
/Gnu/monotone-buildbot-mingw/twistd.logto see it starting up and check for errors.
However, this buildbot will not automatically restart if the machine is rebooted due to a power failure or other problem. Running the buildbot as a service would accomplish that. However, the Cygwin cygrunsrv doesn't quite work for this; there are permission problems.