WinXP machine as slave

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

WinXP machine as slave

Petr Blaha
Hi all,

we would like to use WinXP machine as slave. We successfully installed
cygwin and we can start slave.jar from web console on master. Since the
issue #280: Slave agent can't execute programm on Win is already fixed
we built own Hudson and used this.

However, we still encounter the error:

started
Building remotely on winXP
[TestBinary] $ cmd.exe /C ant.bat && exit %%ERRORLEVEL%%
'ant.bat' is not recognized as an internal or external command,
operable program or batch file.
finished: FAILURE

This is strange for me since I'm pretty sure that ant is in PATH:

pblaha@pblaha-ntb:~/servers/apache-tomcat-6.0.2/bin$ ssh
Administrator@129.157.74.84 cmd.exe /C ant.bat
Unable to locate tools.jar. Expected to find it in
E:\java\jre1.6.0\lib\tools.jar
Buildfile: build.xml does not exist!
Build failed

It confirms that Administrator has ant on PATH. Why the slave can't run
ant? Is it a bug in Hudson or do we need to setup some special
properties in cygwin?

Thanks,

Petr

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: WinXP machine as slave

Kohsuke Kawaguchi-2

Hudson launchs a remote process like this "cmd.exe /C ant.bat ..." from
the slave agent process, so PATH is inherited from there.

One possibility is that you are setting PATH in the interactive login
profile (like .bashrc), which won't kick in when you launch slave-agent.jar.

If you click the slave name from the web UI, you can see the diagnostic
information page from the slave, which lists all the environment
variables and system properties that your slave agent sees. Check the
PATH there, to see if it includes Ant or not. I suspect it doesn't
contain your Ant.

Aside from setting up PATH correctly, you can also fix this problem by
using the system configuration to tell Hudson exactly where Ant is. The
problem is that this requires Ant to be installed on the same location
in all systems, which is impossible if some are Unix and some are Windows.

I believe there's a separate RFE to allow slaves to override where
things (like Ant/JDK/Maven, etc) are.

Petr Blaha wrote:

> Hi all,
>
> we would like to use WinXP machine as slave. We successfully installed
> cygwin and we can start slave.jar from web console on master. Since the
> issue #280: Slave agent can't execute programm on Win is already fixed
> we built own Hudson and used this.
>
> However, we still encounter the error:
>
> started
> Building remotely on winXP
> [TestBinary] $ cmd.exe /C ant.bat && exit %%ERRORLEVEL%%
> 'ant.bat' is not recognized as an internal or external command,
> operable program or batch file.
> finished: FAILURE
>
> This is strange for me since I'm pretty sure that ant is in PATH:
>
> pblaha@pblaha-ntb:~/servers/apache-tomcat-6.0.2/bin$ ssh
> Administrator@129.157.74.84 cmd.exe /C ant.bat
> Unable to locate tools.jar. Expected to find it in
> E:\java\jre1.6.0\lib\tools.jar
> Buildfile: build.xml does not exist!
> Build failed
>
> It confirms that Administrator has ant on PATH. Why the slave can't run
> ant? Is it a bug in Hudson or do we need to setup some special
> properties in cygwin?
>
> Thanks,
>
> Petr
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

--
Kohsuke Kawaguchi
Sun Microsystems                   [hidden email]

smime.p7s (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: WinXP machine as slave

Wolfram Kroll-2
In reply to this post by Petr Blaha
Am 09.02.2007 um 16:46 schrieb Petr Blaha:

> Hi all,

Hi Petr,

>
> we would like to use WinXP machine as slave. We successfully installed
> cygwin and we can start slave.jar from web console on master. Since
> the issue #280: Slave agent can't execute programm on Win is already
> fixed we built own Hudson and used this.
>
> However, we still encounter the error:
>
> started
> Building remotely on winXP
> [TestBinary] $ cmd.exe /C ant.bat && exit %%ERRORLEVEL%%

I didn't know that cmd.exe understands "&&", I changed ant.bat instead
to make it return a useful value.  Thanks for this hint!

I think you have to set the ANT_HOME environment variable on windows to
make ant work. BTW I am using a special batch file for starting the
slave where I set this and other environment variables. I don't have
access to that machine right now, so I cannot tell you what we did
exactly, but I will tell you on monday.

Wolfram

> 'ant.bat' is not recognized as an internal or external command,
> operable program or batch file.
> finished: FAILURE
>
> This is strange for me since I'm pretty sure that ant is in PATH:
>
> pblaha@pblaha-ntb:~/servers/apache-tomcat-6.0.2/bin$ ssh
> Administrator@129.157.74.84 cmd.exe /C ant.bat
> Unable to locate tools.jar. Expected to find it in
> E:\java\jre1.6.0\lib\tools.jar
> Buildfile: build.xml does not exist!
> Build failed
>
> It confirms that Administrator has ant on PATH. Why the slave can't
> run ant? Is it a bug in Hudson or do we need to setup some special
> properties in cygwin?
>
> Thanks,
>
> Petr
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: WinXP machine as slave

Kohsuke Kawaguchi-2
Wolfram Kroll wrote:
>> Building remotely on winXP
>> [TestBinary] $ cmd.exe /C ant.bat && exit %%ERRORLEVEL%%
>
> I didn't know that cmd.exe understands "&&", I changed ant.bat instead
> to make it return a useful value.  Thanks for this hint!

Hudson does this automatically, when you tell it to launch Ant on
Windows, BTW.

> I think you have to set the ANT_HOME environment variable on windows to
> make ant work. BTW I am using a special batch file for starting the
> slave where I set this and other environment variables. I don't have
> access to that machine right now, so I cannot tell you what we did
> exactly, but I will tell you on monday.

--
Kohsuke Kawaguchi
Sun Microsystems                   [hidden email]

smime.p7s (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: WinXP machine as slave

Wolfram Kroll-2

Am 09.02.2007 um 20:22 schrieb Kohsuke Kawaguchi:

> Wolfram Kroll wrote:
>>> Building remotely on winXP
>>> [TestBinary] $ cmd.exe /C ant.bat && exit %%ERRORLEVEL%%
>> I didn't know that cmd.exe understands "&&", I changed ant.bat
>> instead to make it return a useful value.  Thanks for this hint!
>
> Hudson does this automatically, when you tell it to launch Ant on
> Windows, BTW.

fine.

Wolfram

>
>> I think you have to set the ANT_HOME environment variable on windows
>> to make ant work. BTW I am using a special batch file for starting
>> the slave where I set this and other environment variables. I don't
>> have access to that machine right now, so I cannot tell you what we
>> did exactly, but I will tell you on monday.
>
> --
> Kohsuke Kawaguchi
> Sun Microsystems                   [hidden email]

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]