Nightly Builds.
This page discusses how to manage cruise control that controls the nightly builds.
This page is a work in progress and is more a set of tips rather than an in depth discussion of the build.
Overview of the Build System
There is always a nightly build for trunk and sometimes a nightly build for one of the branches. For example the 1.0.x branch may have a nightly build running as well.
The working directories for the nightly build are:
- /home/autorun/cvs/udig-cruise/checkout/scripts (for the trunk nightly build.)
- /home/autorun/cvs/udig-cruise/checkout/scripts-1.0.x (for the 1.0.x nightly build.)
The scripts directory has the scripts that will perform the build. The scripts/build directory is where the building takes place and contains the files from the svn checkout as well as the generated custom scripts for performing the build.
The artifacts directory (scripts/artifacts) contains the build files. The files are also copied to /home/www/udig/htdocs/nightly/uDig/(timestamp)/
Note: The run.xml file is the entry point for the build. ant run.xml will manually start the build. However since autorun's JRE is java 1.4 the build will fail so you will have to configure the class path correctly. It is better to use cruise control to run the build. The file:
/home/autorun/cvs/udig-cruise/config-trunk.xml contains the build intervals.
Tips for Debugging the Build
- If the log has compile errors then most likely a developer has committed bad code. Give him/her hell and make them fix it.
- Could also be that a jar was added to the net.refractions.udig.libs plugin. The download script does not always work so log in to www.refractions.net as root and delete the net.refractions.udig.libs directory in the /home/autorun/cvs/checkout/scripts/build/plugins directory.
- If the log has no compile errors there are a few different possible causes:
- Some one changed one or more of the features and they are illegal. For example a plugin was added to a feature but not to the repository. The build will fail and there will not be a useful error message.
- Some times something inexplicable will happen and for no apparent reason the build will fail. See restarting the build for instructions.
- You can watch the output of the build as it is building by using the command: tail -f /var/log/cruise/udig.log
Kicking the Build
You can force a new build to start by deleting the /home/autorun/cvs/udig-cruise/uDig.ser file and restarting cruise-control. (See Restarting Cruise Control).
Cleaning the Build
- Log in as root
- su - autorun
- Delete the build directory (see Overview of the Build System) for location of the build directory.
- Change to the scripts directory.
- From the scripts directory run ant -f run.xml -Dnoclean=true. Keep re-running until it runs with no errors.
- Restart Cruise Control.
Restarting Cruise Control
You must be root to control cruise-control.
The commands to control cruise-control are:
/etc/rc.d/init.d/cruise-udig (start|stop|restart) this command controls the cruise-control that manages the trunk nightly builds.
There may be a /etc/rc.d/init.d/cruise-udig-1.0.x (start|stop|restart) to start the 1.0.x branch nightly build. The version numbers will change depending on the branches that the nightly build will use.
Sometimes stop/restart can't stop the build. If this occurs, one must use the kill command to kill the cruise-control processes. You can run ps aux | grep cruise to get the list of cruise-control processes.
The -configfile flag can be used to distinguish between the cruise-control instances. If there is no -configfile flag then it probably isn't a udig nightly build. The -configfile flag should look like -configfile config-trunk.xml or -configfile config-1.0.x.xml or something similar.
Manually Running the Build
Software Requirements
| uDig Development Environment |
| Apache Ant 1.6.5 |
| Perl (ActivePerl for Windows) |
Distribution Packages
Some additional packages are required for building runnable distributions.
| Eclipse RCP Runtime | Windows | Linux(GTK) |
| Java Runtime Environment | Windows | Linux |
Subversion Ant (SVNAnt) Extensions
SVNAnt contains ant task definitions used to perform svn operations from an ant script. It must be build from the subclipse repository.
- Check out the svnant source tree from http://subclipse.tigris.org/svn/subclipse/trunk/svnant/ (username/password = "guest")
- Execute an ant build from the root of the source tree
- Copy the following files into your ant lib directory.
- build/lib/svnant.jar
- lib/svnClientAdapter.jar
- lib/svnjavahl.jar
- lib/javasvn.jar
Checking Out the Scripts
The build scripts are located in the subversion repository at http://svn.geotools.org/udig/trunk/scripts/. Check them out to a directory of your choice.
Editing the Properties File
Before running the build you need to edit some of the property files and tailor them to your system.
| Windows Paths Make sure you dont not encode the path seperator as '\'. Use either ' |
build.properties
| baseLocation | Full path to your eclipse installation. It should be the same eclipse installation used to develop with udig |
dist.properties
| rcp.linux.archive | Full path to linux rcp |
| rcp.win32.archive | Full path to win32 rcp |
| jre.linux.archive | Full path to linux jre |
| jre.win32.archive | Full path to win32 jre |
| udig.exeIcon | Full path to the udig exe icon |
| udig.artifact.dir | Full path to directory in which build artifacts will be stored |
Running the Build
Alright you are ready to run the build, time to pray to the deity of your choice.
Running the build the first time
The command to run the build the first time is:
ant -f run.xml -Dnoclean=true
On subsequent builds use:
ant -f run.xml
The first command instructs the build not to clean an generated files as they do not exist yet.
Troubleshooting
This isn't your run of the mill ant build. There are many levels of ant calls going on which then fall back on the pde. So suffice it to say there is enough going on to lead to strange errors.
As a rule of thumb, never consider something a "build error" until you get it twice in a row. If your build fails for some reason, run it again and if you get the exact same error, then it is indeed a failure. (Yeah I know its silly but thats life).
Here is a list of some errors have come across.
| Unable to find plugin foo.bar_XXX... | This is usually a problem with the version number of the plugin. Either on the plugin itself, or the feature that refernces it. |