views:

818

answers:

2

Background

I'm putting together a Continuous Integration system at work on two VMs running on my local desktop. VM #1 (Toolbox) is running CruiseControl.Net, Subversion, BugTracker.Net and SQL Server Express. VM #2 (BuildMaster) is running NAnt with NAntContrib and has VB 6.0 and the 1.0/1.1/2.0/3.5 .Net Framework SDKs installed. The intent is to tightly control what's installed on BuildMaster and be much looser on Toolbox and developer workstations.

Issue

I had a CCNet project on Toolbox that successfully compiled a test VB 6.0 application on BuildMaster, but the build started failing last week. The only thing I remember doing was install BugTracker.Net and SQL Server Express on Toolbox.

Symptoms

The build fails and returns an exception:

<![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>

Obviously, the meat of the exception is [CDATA['vb6' failed to start.]]. My problem is that when I run the Nant build directly on BuildMaster it completes the build successfully every time.

For the sake of completeness, here's my NAnt build script:

<?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>

Your help is greatly appreciated!

+1  A: 

I might be misinterpreting your question so please bare with me. CCNet's nant task operatates on the local machine (the machine running CCNet).

If ToolBox is running CCNet but BuildMaster is running all tools (i.e. VB6, etc), I'm fairly sure there no way to do what's being attempted. Generally, CCNet needs to be running on the machine actually performing the builds. Therefore, the fact that VB6 cannot be found is because VB6 is not installed on ToolBox.

However, CCNet does have a way to monitor/control multiple build servers from one. So in your case you could configure ToolBox to control BuildMaster's builds, but CCNet would need to be installed on both. For a reference on something like this you can check out Splitting the build on CCNet's site.

Scott Saad
That makes sense, but... (there's always a but...) It *was* working and then I did something to make it stop working.I added an <echo> in the NAnt build script to identify which computer NAnt was being invoked on and,true to your answer, it was being run on TOOLBOX not on BUILDMASTER.
CrazyOnYou
I installed CruiseControl.Net on BUILDMASTER as a remote server and am able to run all of the builds from the Web page hosted on TOOLBOX.Thanks for your help!
CrazyOnYou
I am working on a similar project and have a quick question: In order for the system to be able to compile VB6 code, does it need to have Visual Studio 6.0 installed, as if it were a developer machine, or is there a list of files that need to be present/registered on the server that will allow it to build VB6 work?
Brett Rigby
According to the documentation for the VB6 task, it uses vb6.exe. You'll probably need the minimum version of the environment installed, but I'm not sure what specific files are required for vb6.exe to operate properly.
Scott Saad
A: 

Hi,

we have same kind of scenarios , can anyone suggest how to proceed.

Chandan