[Buildbot-devel] windows, ant, and buildbot

Terry.Rankine at csiro.au Terry.Rankine at csiro.au
Thu Mar 27 02:13:16 UTC 2008


hi guys
 
I am having issues with ant (1.6.5 and 1.7.0) and buildbot catching
errors.

Ant on windows will set the errorlevel, and exit with a non-zero
exitcode when it can.

However on windows - cmd /c batfile.bat will always exit cleanly for
some reason unless you force it to exit with an 'exit' command, and set
the appropriate error level.

Here is the buildbot code:
fullMoon.addStep(shell.ShellCommand, command=["ant", "regression-test"],
workdir="build",haltOnFailure=True)

This translates to this (on my box):
argv: ['C:\\WINDOWS\\system32\\cmd.exe', '/c', 'ant', 'regression-test']
 

So buildbot wont detect it failing.

An Ant specific modification is editing the ant.bat as follows

<find this>
rem Set the ERRORLEVEL if we are running NT.
if "%OS%"=="Windows_NT" color 00

goto omega
</find>

<replace with>
rem Set the ERRORLEVEL if we are running NT.
if "%OS%"=="Windows_NT" color 00

exit %ERRORLEVEL%

goto omega
</replace>


If you have a better solution - please let me know.

Terry Rankine




More information about the devel mailing list