[JIRA] Issue Comment Edited: (JENKINS-7442) Ant build steps with properties including variables are broken

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[JIRA] Issue Comment Edited: (JENKINS-7442) Ant build steps with properties including variables are broken

JIRA noreply@jenkins-ci.org

    [ http://issues.jenkins-ci.org/browse/JENKINS-7442?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=146481#comment-146481 ]

skorsky edited comment on JENKINS-7442 at 3/8/11 12:13 PM:
-----------------------------------------------------------

Reopening this. Still not fixed.
Using a job name with a blank does not work because variable expansion is broken.

Job name is 'Test Jenkins7442'.

Console output is:
[workspace] $ cmd.exe /C '"D:\Tools\apache-ant-1.8.2\bin\ant.bat -DvNN="" -DvBID=2011-03-04_18-27-43 -DvNLAB=master "-D""vJURL=http://localhost:8080/jenkins/job/Test%20Jenkins7442/""" "-D""vBTAG=jenkins-Test Jenkins7442-6""" -DvHH=D:\HudsonHome -DvJAVH=D:\Tools\jdk1.6.0_24 "-D""vBURL=http://localhost:8080/jenkins/job/Test%20Jenkins7442/6/""" -DvBNUM=6 -DvHURL=http://localhost:8080/jenkins/ "-D""vJN=Test Jenkins7442""" -DvJH=D:\HudsonHome "-D""vWS=D:\HudsonHome\jobs\Test Jenkins7442\workspace""" -DvEXEC=1 && exit %%ERRORLEVEL%%"'
Buildfile: D:\HudsonHome\jobs\Test Jenkins7442\workspace\build.xml

BUILD FAILED
Target "Jenkins7442-6"" does not exist in the project "foo".

Total time: 0 seconds
Finished: FAILURE


build.xml is:
<project name="foo" default="foo">
  <target name="foo">
    <echoproperties prefix="v"/>
  </target>
</project>



Advanced build step properties are:
vBNUM=$BUILD_NUMBER
vBID=$BUILD_ID
"vBTAG=$BUILD_TAG"
"vBURL=$BUILD_URL"
vEXEC=$EXECUTOR_NUMBER
vHH=$HUDSON_HOME
vHURL=$HUDSON_URL
vJH=$JENKINS_HOME
"vJN=$JOB_NAME"
"vJURL=$JOB_URL"
vNN=$NODE_NAME
vNLAB=$NODE_LABELS
vJAVH=$JAVA_HOME
"vWS=$WORKSPACE"

I guess that $BUILD_TAG is broken and the second part of this is misused as an Ant target.

This is tested with Jenkins 1.399. Escaping the quotes has change, but is still not OK.
The expected command line on windows is for the example above:
"D:\Tools\apache-ant-1.8.2\bin\ant.bat -DvNN= -DvBID=2011-03-04_18-27-43 -DvNLAB=master "-DvJURL=http://localhost:8080/jenkins/job/Test%20Jenkins7442/" "-DvBTAG=jenkins-Test Jenkins7442-6" -DvHH=D:\HudsonHome -DvJAVH=D:\Tools\jdk1.6.0_24 "-DvBURL=http://localhost:8080/jenkins/job/Test%20Jenkins7442/6/" -DvBNUM=6 -DvHURL=http://localhost:8080/jenkins/ "-DvJN=Test Jenkins7442" -DvJH=D:\HudsonHome "-DvWS=D:\HudsonHome\jobs\Test Jenkins7442\workspace" -DvEXEC=1 && exit %%ERRORLEVEL%%"


      was (Author: skorsky):
    Reopening this. Still not fixed.
Using a job name with a blank does not work because variable expansion is broken.

Job name is 'Test Jenkins7442'.

Console output is:
[workspace] $ cmd.exe /C '"D:\Tools\apache-ant-1.8.2\bin\ant.bat -DvNN="" -DvBID=2011-03-04_18-27-43 -DvNLAB=master "-D""vJURL=http://localhost:8080/jenkins/job/Test%20Jenkins7442/""" "-D""vBTAG=jenkins-Test Jenkins7442-6""" -DvHH=D:\HudsonHome -DvJAVH=D:\Tools\jdk1.6.0_24 "-D""vBURL=http://localhost:8080/jenkins/job/Test%20Jenkins7442/6/""" -DvBNUM=6 -DvHURL=http://localhost:8080/jenkins/ "-D""vJN=Test Jenkins7442""" -DvJH=D:\HudsonHome "-D""vWS=D:\HudsonHome\jobs\Test Jenkins7442\workspace""" -DvEXEC=1 && exit %%ERRORLEVEL%%"'
Buildfile: D:\HudsonHome\jobs\Test Jenkins7442\workspace\build.xml

BUILD FAILED
Target "Jenkins7442-6"" does not exist in the project "foo".

Total time: 0 seconds
Finished: FAILURE


build.xml is:
<project name="foo" default="foo">
  <target name="foo">
    <echoproperties prefix="v"/>
  </target>
</project>



Advanced build step properties are:
vBNUM=$BUILD_NUMBER
vBID=$BUILD_ID
"vBTAG=$BUILD_TAG"
"vBURL=$BUILD_URL"
vEXEC=$EXECUTOR_NUMBER
vHH=$HUDSON_HOME
vHURL=$HUDSON_URL
vJH=$JENKINS_HOME
"vJN=$JOB_NAME"
"vJURL=$JOB_URL"
vNN=$NODE_NAME
vNLAB=$NODE_LABELS
vJAVH=$JAVA_HOME
"vWS=$WORKSPACE"

I guess that $BUILD_TAG is broken and the second part of this is misused as an Ant target.

This is tested with Jenkins 1.399. Escaping the quotes has change, but is still not OK.

 

> Ant build steps with properties including variables are broken
> --------------------------------------------------------------
>
>                 Key: JENKINS-7442
>                 URL: http://issues.jenkins-ci.org/browse/JENKINS-7442
>             Project: Jenkins
>          Issue Type: Bug
>          Components: ant
>    Affects Versions: current
>         Environment: Hudson 1.376 on Windows 2003 Server with Tomcat 6.
>            Reporter: skorsky
>            Assignee: Alan Harder
>            Priority: Blocker
>
> If Ant build steps take properties with an %, the next char is enclosed in quotes in a 'fancy' way:
> $ cmd.exe /C '"C:\ant\apache-ant-1.7.1\bin\ant.bat "-Dhudsonhome=%"H"UDSON_HOME%" && exit %%ERRORLEVEL%%"'
> The property should be "-Dhudsonhome=%HUDSON_HOME%"
> This worked with Hudson 1.365

--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira