NAnt / NAntContrib'VB6'无法启动远程构建

时间:2008-12-17 20:27:32

标签: vb6 continuous-integration nant nantcontrib

背景

我正在将一个Continuous Integration系统放在我本地桌面上运行的两个VM上。 VM#1( Toolbox )正在运行CruiseControl.Net,Subversion,BugTracker.Net和SQL Server Express。 VM#2( BuildMaster )使用NAntContrib运行NAnt,并安装了VB 6.0和1.0 / 1.1 / 2.0 / 3.5 .Net Framework SDK。目的是严格控制BuildMaster上安装的内容,并使Toolbox和开发人员工作站更加宽松。

问题

我在Toolbox上有一个CCNet项目,它在BuildMaster上成功编译了一个测试VB 6.0应用程序,但是上周构建开始失败了。我唯一记得做的就是在Toolbox上安装BugTracker.Net和SQL Server Express。

症状

构建失败并返回异常:

<![CDATA[Starting 'vb6 ( /make "\\buildmaster\Working\TestApp\TestApp.vbp" /outdir "\\buildmaster\Working\TestApp\build" /out "\\buildmaster\Working\TestApp\TestApp.build.err")' in '\\buildmaster\Working\TestApp']]></message><duration>711.02240000000006</duration></task><duration>761.09440000000006</duration></target><failure><builderror><type>NAnt.Core.BuildException</type><message><![CDATA['vb6' failed to start.]]></message><location><filename>\\buildmaster\Working\TestApp\TestApp.build</filename><linenumber>39</linenumber><columnnumber>4</columnnumber></location><stacktrace><![CDATA[   at NAnt.Core.Tasks.ExternalProgramBase.StartProcess() in c:\Nant\src\NAnt.Core\Tasks\ExternalProgramBase.cs:line 501
   at NAnt.Core.Tasks.ExternalProgramBase.ExecuteTask() in c:\Nant\src\NAnt.Core\Tasks\ExternalProgramBase.cs:line 386
   at NAnt.Contrib.Tasks.Vb6Task.ExecuteTask() in c:\Nant\contrib\src\Tasks\Vb6Task.cs:line 220
   at NAnt.Core.Task.Execute() in c:\Nant\src\NAnt.Core\Task.cs:line 186
   at NAnt.Core.Target.Execute() in c:\Nant\src\NAnt.Core\Target.cs:line 247
   at NAnt.Core.Project.Execute(String targetName, Boolean forceDependencies) in c:\Nant\src\NAnt.Core\Project.cs:line 910
   at NAnt.Core.Project.Execute() in c:\Nant\src\NAnt.Core\Project.cs:line 862
   at NAnt.Core.Project.Run() in c:\Nant\src\NAnt.Core\Project.cs:line 947]]></stacktrace><internalerror><type>System.ComponentModel.Win32Exception</type><message><![CDATA[The system cannot find the file specified]]></message><stacktrace><![CDATA[   at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
   at System.Diagnostics.Process.Start()
   at NAnt.Core.Tasks.ExternalProgramBase.StartProcess() in c:\Nant\src\NAnt.Core\Tasks\ExternalProgramBase.cs:line 498]]></stacktrace></internalerror></builderror></failure><duration>1211.7424</duration></buildresults>

显然,例外的是 [CDATA ['vb6'未能启动。]] 。我的问题是,当我直接在BuildMaster上运行Nant构建时,它每次都成功完成构建。

为了完整起见,这是我的NAnt构建脚本:

<?xml version="1.0" ?>
<project name="TestApp" default="build">
    <!-- set build.date property to current date in format yyyy-MM-dd -->
    <tstamp property="build.date" pattern="yyyy-MM-dd" />

    <!-- global project settings -->
    <property name="project.name" value="TestApp" />
    <property name="project.version" value="1.00" unless="${property::exists('project.version')}" />
    <property name="project.release.type" value="release" unless="${property::exists('project.release.type')}" /> <!-- nightly / dev / alpha / beta# / rc# / release -->
    <property name="build.warnaserror" value="false" />

    <!-- default configuration -->
    <property name="project.client" value="" />
    <property name="build.defines" value="" />
    <property name="build.number" value="${math::abs(math::floor(timespan::get-total-days(datetime::now() - datetime::parse('01/01/2000'))))}" />

    <!-- platform specific properties. These are the defaults -->
    <property name="current.build.defines" value="${build.defines}" />

    <!-- Build Tasks -->
    <target name="init" description="Initializes build properties">
        <property name="build.dir" value="${project::get-base-directory()}\build" />
        <echo message="Build Directory is ${build.dir}" />
    </target>

    <target name="clean" depends="init" description="Deletes current build configuration">
        <echo message="Clearing out files before recompiling..." />
        <delete verbose="true">
            <fileset basedir="${build.dir}">
                <include name="TestApp*.exe" />
            </fileset>
        </delete>
    </target>

    <target name="build" depends="clean" description="Perform a build of the base TestApp product">
        <mkdir dir="${build.dir}" unless="${directory::exists(build.dir)}" />

        <!-- Actually compile VB6 project into executable -->
        <vb6 project="TestApp.vbp" outdir="${build.dir}" errorfile="TestApp.build.err" verbose="true" />
    </target>
</project>

非常感谢您的帮助!

1 个答案:

答案 0 :(得分:1)

我可能会误解你的问题所以请光临我。 CCNet的 nant 任务在本地计算机(运行CCNet的计算机)上运行。

如果ToolBox运行CCNet但BuildMaster正在运行所有工具(即VB6等),我很确定无法做出正在尝试的事情。通常,CCNet需要在实际执行构建的机器上运行。 因此,无法找到VB6的事实是因为ToolBox上没有安装VB6。

但是,CCNet确实可以从一个监视/控制多个构建服务器。因此,在您的情况下,您可以配置ToolBox来控制BuildMaster的构建,但 CCNet需要同时安装。有关此类内容的参考,您可以在CCNet的网站上查看Splitting the build