-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
master on unix (solaris)
slave on windows
WORKSPACE environment variable should have a windows format on windows platform.
The synthax is <Hudson_Root>\workspace\<project name>\label/windows if (windows is the node alias)
This is for me a major drawback as workspace env variable is important.
To reproduce:
I create a matrix project "test_matrix" executed on 2 nodes (windows & solaris) for each platform define an env ARCH var=sunos/winnt
-------- configure ant task and a build.xml to execute a windows or unix script according platform.
<?xml version='1.0'?>
<project name="MyTest" default="test" basedir=".">
<property environment="env"/>
<taskdef resource="net/sf/antcontrib/antcontrib.properties"/>
<target name="test" description="run test">
<if>
<equals arg1="${env.ARCH}" arg2="winnt" />
<then>
<echo>Launch compilations on winnt: ${env.ARCH}</echo>
<exec executable="runKDBcc.bat" failonerror="true" />
</then>
<else>
<echo>Launch compilations on unix: ${env.ARCH}</echo>
<exec executable="runKDBcc.sh" failonerror="true" />
</else>
</if>
</target>
</project>
------- script for solaris unix
runKDBcc.sh
#! /bin/sh
echo $WORKSPACE
cd $WORKSPACE
------- script for windows
runKDBcc.bat
echo %WORKSPACE%
cd %WORKSPACE%
------- The results on windows with workspace bad name after label.
test:
[echo] Launch compilations on winnt: winnt
[exec]
[exec] The syntax of the command is incorrect.
[exec] C:\slave_hudson\workspace\test_matrix\label\winnt>echo C:\slave_hudson\workspace\test_matrix\label/winnt
[exec] C:\slave_hudson\workspace\test_matrix\label/winnt
[exec]
[exec] C:\slave_hudson\workspace\test_matrix\label\winnt>cd C:\slave_hudson\workspace\test_matrix\label/winnt
[exec]
- is duplicated by
-
JENKINS-6393 WORKSPACE environment variable set incorrectly on a matrix job running on a Windows node
-
- Closed
-
FYI, this also fails if the Master + Slave are both Windows. The master environment seems to be completely irrelivant.
Suggest that the matrix-job code needs to use an OS-aware method for forming the workspace.