Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-5084

WORKSPACE env variable is incorrect for matrix project on windows slaves

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • matrix-project-plugin
    • 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]

            Unassigned Unassigned
            erwan_q erwan_q
            Votes:
            9 Vote for this issue
            Watchers:
            12 Start watching this issue

              Created:
              Updated: