Personal tools

SubversionNightlyBuilds

From OpenLaszlo

Contents

Examining nightly builds

If you want to see a recent nightly build, download a source or binary distro as packaged, from http://download.openlaszlo.org/nightly/ or test the most recent live build on labs, at http://labs.openlaszlo.org/legals-nightly/ for legals, and http://labs.openlaszlo.org/trunk-nightly/ Or you can browse the svn tag from which this build was created at http://svn.openlaszlo.org/openlaszlo/builds/

Running a nightly build

Builds are "kicked off" automatically by a cron task on linux-builder. The cron task is owned by the user svnbuild. The very best way to run a build is to do nothing; the build will be kicked off by cron at around 2 or 3 am, and about an hour later, the build products will appear on http://download.openlaszlo.org/nightly/ and mail will go to the laszlo-builds mailing list.

If you want to kick off a build for right now, and have it exactly match the conditions under which the nightly builds are run, log on to linux-builder as user svnbuild, and edit the crontab (the list of cron tasks) so that the crontab entry which invokes the build you want to build includes an invocation in the near future. cron is a bit difficult to explain; suffice it to say that... the first two entries in each line are minutes after the hour and </em>hour in 24-hour time</em> at which that command should be invoked.

List the current crontab

  [svnbuild@linux-builder ~]$ crontab -l 
  0 3 * * * /home/svnbuild/src/svn/tools/trunk/build-tools/nightly/nightly-go.sh
  37 2,13 * * * /home/svnbuild/src/svn/tools/trunk/build-tools/nightly/nightly-go.sh branches/legals

The interesting thing here is that a build of legals is scheduled to occur at 1:37 PM. I put the ",13" entry on the "hours" column when, at 1:30 PM, someone asked me to kick off a build.

To edit the crontab, do crontab -e

What's really happening

The nightly build script, $LZ_TOOLS_ROOT/tools/trunk/build-tools/nightly/nightly-go.sh, does many things. See the source for the details, but roughly, here's what happens:

  1. It determines what branch and revision number to use, based on passed-in parameters. If no command line arguments are specified, it uses the latest revision of trunk.
  2. It sends mail saying it's starting.
  3. It invokes build.xml in the nightly/ directory, with a bunch of targets set to control which parts of the build happen.
  4. It sends mail saying that the build completed, either success or failure.

The interesting part of this, of course, is what happens inside the build.xml file.

nightly/build.xml

For a normal nightly build, we execute the "nightly" target


    <target name="nightly" depends="init">
        <ant target="svn-make-tag" />
        <ant target="svn-update-to-tag" />
        <ant target="push-to-children" /> 
        <ant target="make-download-dest-dir" />        
        <ant target="build" />        
        <ant target="lztest" />
        <ant target="push-to-download"/> 
    </target>

Reading the list of targets in order describes what the build actually does:

  1. svn-make-tag creates a tag of the specified branch at the specified revision number
  2. svn-update-to-tag checks out the just created tag to a brand new clean directory on ~svnbuild/builds/
  3. push-to-children rsync's that clean tree to windows-builder and tiger-builder
  4. make-download-destdir creates a directory on download.openlaszlo.org with the name of the build, ready to hold the build products.
  5. build calls "ant dist-one" in the tree we just checked out
    1. It also calls kick-off-windows and kick-off-mac, which starts the build on each of those machines.
    2. See tiger-builder-go.sh and windows-builder-go.sh for exactly what these do.
  6. lztest only applies to legals builds; it runs the "ant lztest" task, and fails the build if the tests fail.
  7. push-to-download pushes the linux-builder products to download.openlaszlo.org.

Finding information about builds

On linux-builder, information about builds lives in two places: ~/builds: actual svn working copies of a particular tagged build ~/logs: the log that matches each of the tagged builds. Every build should have a directory in ~/builds/buildname and a corresponding log in ~/logs/buildname.log.

tiger-builder and linux-builder have the same directory structure, but the ~/builds directory does not contain an svn working copy! ~/builds ~/logs

The logs on linux-builder will give you the most information about the build.

See Setting Up Tiger Builder for instructions on how to set up a new build machine.